All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Alexander Lobakin <alexandr.lobakin@intel.com>
Cc: tirtha@gmail.com, intel-wired-lan@lists.osuosl.org,
	magnus.karlsson@intel.com,
	Tirthendu Sarkar <tirthendu.sarkar@intel.com>,
	netdev@vger.kernel.org
Subject: Re: [Intel-wired-lan] [PATCH intel-next v4] i40e: allow toggling loopback mode via ndo_set_features callback
Date: Wed, 23 Nov 2022 09:00:38 +0200	[thread overview]
Message-ID: <Y33FFtXqcAiDXxLA@unreal> (raw)
In-Reply-To: <20221122155759.426568-1-alexandr.lobakin@intel.com>

On Tue, Nov 22, 2022 at 04:57:59PM +0100, Alexander Lobakin wrote:
> From: Leon Romanovsky <leon@kernel.org>
> Date: Tue, 22 Nov 2022 13:07:28 +0200
> 
> > On Fri, Nov 18, 2022 at 02:33:06PM +0530, Tirthendu Sarkar wrote:
> > > Add support for NETIF_F_LOOPBACK. This feature can be set via:
> > > $ ethtool -K eth0 loopback <on|off>
> > > 
> > > This sets the MAC Tx->Rx loopback.
> > > 
> > > This feature is used for the xsk selftests, and might have other uses
> > > too.
> 
> [...]
> 
> > > @@ -12960,6 +12983,9 @@ static int i40e_set_features(struct net_device *netdev,
> > >  	if (need_reset)
> > >  		i40e_do_reset(pf, I40E_PF_RESET_FLAG, true);
> > >  
> > > +	if ((features ^ netdev->features) & NETIF_F_LOOPBACK)
> > > +		return i40e_set_loopback(vsi, !!(features & NETIF_F_LOOPBACK));
> > 
> > Don't you need to disable loopback if NETIF_F_LOOPBACK was cleared?
> 
> 0 ^ 1 == 1 -> call i40e_set_loopback()
> !!(0) == 0 -> disable
> 

Nice, thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

WARNING: multiple messages have this Message-ID (diff)
From: Leon Romanovsky <leon@kernel.org>
To: Alexander Lobakin <alexandr.lobakin@intel.com>
Cc: Tirthendu Sarkar <tirthendu.sarkar@intel.com>,
	tirtha@gmail.com, netdev@vger.kernel.org,
	intel-wired-lan@lists.osuosl.org, magnus.karlsson@intel.com
Subject: Re: [PATCH intel-next v4] i40e: allow toggling loopback mode via ndo_set_features callback
Date: Wed, 23 Nov 2022 09:00:38 +0200	[thread overview]
Message-ID: <Y33FFtXqcAiDXxLA@unreal> (raw)
In-Reply-To: <20221122155759.426568-1-alexandr.lobakin@intel.com>

On Tue, Nov 22, 2022 at 04:57:59PM +0100, Alexander Lobakin wrote:
> From: Leon Romanovsky <leon@kernel.org>
> Date: Tue, 22 Nov 2022 13:07:28 +0200
> 
> > On Fri, Nov 18, 2022 at 02:33:06PM +0530, Tirthendu Sarkar wrote:
> > > Add support for NETIF_F_LOOPBACK. This feature can be set via:
> > > $ ethtool -K eth0 loopback <on|off>
> > > 
> > > This sets the MAC Tx->Rx loopback.
> > > 
> > > This feature is used for the xsk selftests, and might have other uses
> > > too.
> 
> [...]
> 
> > > @@ -12960,6 +12983,9 @@ static int i40e_set_features(struct net_device *netdev,
> > >  	if (need_reset)
> > >  		i40e_do_reset(pf, I40E_PF_RESET_FLAG, true);
> > >  
> > > +	if ((features ^ netdev->features) & NETIF_F_LOOPBACK)
> > > +		return i40e_set_loopback(vsi, !!(features & NETIF_F_LOOPBACK));
> > 
> > Don't you need to disable loopback if NETIF_F_LOOPBACK was cleared?
> 
> 0 ^ 1 == 1 -> call i40e_set_loopback()
> !!(0) == 0 -> disable
> 

Nice, thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

  reply	other threads:[~2022-11-23  7:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  9:03 [Intel-wired-lan] [PATCH intel-next v4] i40e: allow toggling loopback mode via ndo_set_features callback Tirthendu Sarkar
2022-11-18  9:03 ` Tirthendu Sarkar
2022-11-22 11:07 ` [Intel-wired-lan] " Leon Romanovsky
2022-11-22 11:07   ` Leon Romanovsky
2022-11-22 15:57   ` [Intel-wired-lan] " Alexander Lobakin
2022-11-22 15:57     ` Alexander Lobakin
2022-11-23  7:00     ` Leon Romanovsky [this message]
2022-11-23  7:00       ` Leon Romanovsky
2022-12-07 14:56     ` [Intel-wired-lan] " Rout, ChandanX
2022-12-07 15:37       ` Magnus Karlsson
2022-12-09  9:09         ` Magnus Karlsson
2022-12-09  9:09           ` Magnus Karlsson
2022-12-09 17:57           ` Tony Nguyen
2022-12-09 17:57             ` Tony Nguyen

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=Y33FFtXqcAiDXxLA@unreal \
    --to=leon@kernel.org \
    --cc=alexandr.lobakin@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=tirtha@gmail.com \
    --cc=tirthendu.sarkar@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.