[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00a301daa1be$34d98620$9e8c9260$@trustnetic.com>
Date: Thu, 9 May 2024 11:08:46 +0800
From: Jiawen Wu <jiawenwu@...stnetic.com>
To: "'Simon Horman'" <horms@...nel.org>
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
> > 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" ?
There are 4 cases where wx_set_rx_mode() is called, CTAG_RX and CTAG_FILTER
combined with wx_mac_sp and wx_mac_em. But only one special case that
changing CTAG_RX requires wx_mac_sp device to do reset, and wx_set_rx_mode()
also will be called during the reset process. So I think "if else" is more appropriate
here.
Powered by blists - more mailing lists