diff mbox series

[net,v2,2/4] net: wangxun: fix to change Rx features

Message ID 20240429102519.25096-3-jiawenwu@trustnetic.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series Wangxun fixes | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 926 this patch: 926
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 937 this patch: 937
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 937 this patch: 937
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 14 this patch: 14
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-04-29--15-00 (tests: 994)

Commit Message

Jiawen Wu April 29, 2024, 10:25 a.m. UTC
Fix the issue where some Rx features cannot be changed.

When using ethtool -K to turn off rx offload, it returns error and
displays "Could not change any device features". And netdev->features
is not assigned a new value to actually configure the hardware.

Fixes: 6dbedcffcf54 ("net: libwx: Implement xx_set_features ops")
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
 drivers/net/ethernet/wangxun/libwx/wx_lib.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Simon Horman May 2, 2024, 8:36 a.m. UTC | #1
On Mon, Apr 29, 2024 at 06:25:17PM +0800, Jiawen Wu wrote:
> Fix the issue where some Rx features cannot be changed.
> 
> When using ethtool -K to turn off rx offload, it returns error and
> displays "Could not change any device features". And netdev->features
> is not assigned a new value to actually configure the hardware.
> 
> Fixes: 6dbedcffcf54 ("net: libwx: Implement xx_set_features ops")
> Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>

Reviewed-by: Simon Horman <horms@kernel.org>

> ---
>  drivers/net/ethernet/wangxun/libwx/wx_lib.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> index 6fae161cbcb8..667a5675998c 100644
> --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> @@ -2690,12 +2690,14 @@ int wx_set_features(struct net_device *netdev, netdev_features_t features)
>  		wx->rss_enabled = false;
>  	}
>  
> +	netdev->features = features;
> +

nit: I think it would be slightly nicer to place this
     at the end of the function, just before return.
     But it would make no difference to the logic,
     so I don't feel strongly about this.

>  	if (changed &
>  	    (NETIF_F_HW_VLAN_CTAG_RX |
>  	     NETIF_F_HW_VLAN_STAG_RX))
>  		wx_set_rx_mode(netdev);
>  
> -	return 1;
> +	return 0;
>  }
>  EXPORT_SYMBOL(wx_set_features);
>  
> -- 
> 2.27.0
> 
>
Jiawen Wu May 10, 2024, 1:57 a.m. UTC | #2
> > diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> > index 6fae161cbcb8..667a5675998c 100644
> > --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> > +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> > @@ -2690,12 +2690,14 @@ int wx_set_features(struct net_device *netdev, netdev_features_t features)
> >  		wx->rss_enabled = false;
> >  	}
> >
> > +	netdev->features = features;
> > +
> 
> nit: I think it would be slightly nicer to place this
>      at the end of the function, just before return.
>      But it would make no difference to the logic,
>      so I don't feel strongly about this.

Thanks for your notice, but it does have to be written here.
Since 'netdev->features' will be checked in wx_set_rx_mode().

> 
> >  	if (changed &
> >  	    (NETIF_F_HW_VLAN_CTAG_RX |
> >  	     NETIF_F_HW_VLAN_STAG_RX))
> >  		wx_set_rx_mode(netdev);
> >
> > -	return 1;
> > +	return 0;
> >  }
> >  EXPORT_SYMBOL(wx_set_features);
> >
> > --
> > 2.27.0
> >
> >
>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
index 6fae161cbcb8..667a5675998c 100644
--- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
+++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
@@ -2690,12 +2690,14 @@  int wx_set_features(struct net_device *netdev, netdev_features_t features)
 		wx->rss_enabled = false;
 	}
 
+	netdev->features = features;
+
 	if (changed &
 	    (NETIF_F_HW_VLAN_CTAG_RX |
 	     NETIF_F_HW_VLAN_STAG_RX))
 		wx_set_rx_mode(netdev);
 
-	return 1;
+	return 0;
 }
 EXPORT_SYMBOL(wx_set_features);