lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240502092526.GD2821784@kernel.org>
Date: Thu, 2 May 2024 10:25:26 +0100
From: Simon Horman <horms@...nel.org>
To: Jiawen Wu <jiawenwu@...stnetic.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, rmk+kernel@...linux.org.uk, andrew@...n.ch,
	netdev@...r.kernel.org, mengyuanlou@...-swift.com,
	duanqiangwen@...-swift.com
Subject: Re: [PATCH net v2 4/4] net: txgbe: fix to control VLAN strip

On Mon, Apr 29, 2024 at 06:25:19PM +0800, Jiawen Wu wrote:
> When VLAN tag strip is changed to enable or disable, the hardware requires
> the Rx ring to be in a disabled state, otherwise the feature cannot be
> changed.
> 
> Fixes: f3b03c655f67 ("net: wangxun: Implement vlan add and kill functions")
> Signed-off-by: Jiawen Wu <jiawenwu@...stnetic.com>
> ---
>  drivers/net/ethernet/wangxun/libwx/wx_hw.c    |  2 ++
>  drivers/net/ethernet/wangxun/libwx/wx_lib.c   |  6 ++--
>  drivers/net/ethernet/wangxun/libwx/wx_type.h  | 22 ++++++++++++++
>  .../net/ethernet/wangxun/ngbe/ngbe_ethtool.c  | 18 +++++++----
>  .../ethernet/wangxun/txgbe/txgbe_ethtool.c    | 18 +++++++----
>  .../net/ethernet/wangxun/txgbe/txgbe_main.c   | 30 +++++++++++++++++++
>  .../net/ethernet/wangxun/txgbe/txgbe_type.h   |  1 +
>  7 files changed, 84 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/ethernet/wangxun/libwx/wx_hw.c b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
> index 945c13d1a982..c09a6f744575 100644
> --- a/drivers/net/ethernet/wangxun/libwx/wx_hw.c
> +++ b/drivers/net/ethernet/wangxun/libwx/wx_hw.c
> @@ -1958,6 +1958,8 @@ int wx_sw_init(struct wx *wx)
>  		return -ENOMEM;
>  	}
>  
> +	bitmap_zero(wx->state, WX_STATE_NBITS);
> +
>  	return 0;
>  }
>  EXPORT_SYMBOL(wx_sw_init);
> diff --git a/drivers/net/ethernet/wangxun/libwx/wx_lib.c b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> index aefd78455468..ed6a168ff136 100644
> --- a/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> +++ b/drivers/net/ethernet/wangxun/libwx/wx_lib.c
> @@ -2692,9 +2692,9 @@ int wx_set_features(struct net_device *netdev, netdev_features_t features)
>  
>  	netdev->features = features;
>  
> -	if (changed &
> -	    (NETIF_F_HW_VLAN_CTAG_RX |
> -	     NETIF_F_HW_VLAN_STAG_RX))
> +	if (wx->mac.type == wx_mac_sp && changed & NETIF_F_HW_VLAN_CTAG_RX)
> +		wx->do_reset(netdev);
> +	else if (changed & (NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER))
>  		wx_set_rx_mode(netdev);
>  
>  	return 0;

Hi Jiawen Wu,

NETIF_F_HW_VLAN_CTAG_RX appears in both the "if" and "if else" condition.
Should "if else" be changed to "if" ?

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ