netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Jiawen Wu <jiawenwu@trustnetic.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, rmk+kernel@armlinux.org.uk, andrew@lunn.ch,
	netdev@vger.kernel.org, mengyuanlou@net-swift.com,
	duanqiangwen@net-swift.com
Subject: Re: [PATCH net v2 4/4] net: txgbe: fix to control VLAN strip
Date: Thu, 9 May 2024 14:38:02 +0100	[thread overview]
Message-ID: <20240509133802.GY1736038@kernel.org> (raw)
In-Reply-To: <00a301daa1be$34d98620$9e8c9260$@trustnetic.com>

On Thu, May 09, 2024 at 11:08:46AM +0800, Jiawen Wu wrote:
> > > 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.

Hi Jiawen Wu,

Thanks for your response.

Looking over this again it seems that I misread the code the first time
around. And i think that the current if ... else if ...  construction is
fine. Sorry for the noise.

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


      reply	other threads:[~2024-05-09 13:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 10:25 [PATCH net v2 0/4] Wangxun fixes Jiawen Wu
2024-04-29 10:25 ` [PATCH net v2 1/4] net: wangxun: fix the incorrect display of queue number in statistics Jiawen Wu
2024-05-01  1:59   ` Jakub Kicinski
2024-05-09  2:39     ` Jiawen Wu
2024-05-09 15:19       ` Jakub Kicinski
2024-04-29 10:25 ` [PATCH net v2 2/4] net: wangxun: fix to change Rx features Jiawen Wu
2024-05-02  8:36   ` Simon Horman
2024-05-10  1:57     ` Jiawen Wu
2024-04-29 10:25 ` [PATCH net v2 3/4] net: wangxun: match VLAN CTAG and STAG features Jiawen Wu
2024-04-29 16:07   ` Sai Krishna Gajula
2024-05-02  8:29   ` Simon Horman
2024-04-29 10:25 ` [PATCH net v2 4/4] net: txgbe: fix to control VLAN strip Jiawen Wu
2024-05-02  9:25   ` Simon Horman
2024-05-09  3:08     ` Jiawen Wu
2024-05-09 13:38       ` Simon Horman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240509133802.GY1736038@kernel.org \
    --to=horms@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=duanqiangwen@net-swift.com \
    --cc=edumazet@google.com \
    --cc=jiawenwu@trustnetic.com \
    --cc=kuba@kernel.org \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).