netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Karlsson <magnus.karlsson@gmail.com>
To: "Rout, ChandanX" <chandanx.rout@intel.com>,
	intel-wired-lan <intel-wired-lan@lists.osuosl.org>,
	"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>
Cc: "Lobakin, Alexandr" <alexandr.lobakin@intel.com>,
	Leon Romanovsky <leon@kernel.org>,
	"Fijalkowski, Maciej" <maciej.fijalkowski@intel.com>,
	"Sarkar, Tirthendu" <tirthendu.sarkar@intel.com>,
	"tirtha@gmail.com" <tirtha@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Karlsson, Magnus" <magnus.karlsson@intel.com>,
	"Kuruvinakunnel, George" <george.kuruvinakunnel@intel.com>,
	"Nagaraju, Shwetha" <shwetha.nagaraju@intel.com>,
	"Nagraj, Shravan" <shravan.nagraj@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH intel-next v4] i40e: allow toggling loopback mode via ndo_set_features callback
Date: Fri, 9 Dec 2022 10:09:00 +0100	[thread overview]
Message-ID: <CAJ8uoz2_s_hyYZaPt15a9c274UXC-8Ejc2nPAmqMN9437fcciQ@mail.gmail.com> (raw)
In-Reply-To: <CAJ8uoz1RjaGv=HEwmaZw1hKH_GpHA9u-sBvz-Cxb0W_wdYjDZg@mail.gmail.com>

On Wed, Dec 7, 2022 at 4:37 PM Magnus Karlsson
<magnus.karlsson@gmail.com> wrote:
>
> On Wed, Dec 7, 2022 at 4:01 PM Rout, ChandanX <chandanx.rout@intel.com> wrote:
> >
> > Hi Team,
> > We observed some different result on i40e driver which are as follows
> >
> > Issue Summary: Unable to find loopback test in "ethtool -t <interface> using i40e driver using latest next-queue.
> > Observations:
> > ===========
> > 1. we are able to enable loopback mode on i40e driver.
> > 2. We are unable to find loopback test in "ethtool -t <interface>" command while using i40e driver.
>
> That is correct, there is no loopback test in i40e. We chose not to
> add one since it was broken in ice (until Maciej fixed it), so we
> thought nobody actually used it. Instead, we have a much more thorough
> test shipped in tools/testing/selftests/bpf/xsk* that tests the
> loopback support in more ways than just sending a single message. I
> have run this test using Tirtha's patch and it passes. So can I sign
> off with a Tested-by? Would save you a lot of time, which is good.
> There is no point for you to run the same test as I did again. Just a
> waste of valuable testing time.

Adding intel-wired and Tony who was not on the reply for some reason.

I have now tested the patch and it passes all the tests executed by
tools/testing/selftests/bpf/test_xsk.sh. The script launches over 100
tests that send 1000s of different packets through the loopback
interface and verifies that the packet content is the same as what was
sent and that they are received in order.

Tested-by: Magnus Karlsson <magnus.karlsson@intel.com>

Tony, please pick this up for your next i40e pull request / release.

Thank you: Magnus

> > 3. However, in ice driver we are able to enable loopback mode also we are able to see the loopback test using "ethtool -t <interface>".
> >
> > Note: Detail Observation is attached in excel format.
> >
> > On I40e
> > =======
> > [root@localhost admin]# ethtool -k ens802f3 | grep loopback
> > loopback: off
> > [root@localhost admin]# ethtool -K ens802f3 loopback on
> > [root@localhost admin]# ethtool -k ens802f3 | grep loopback
> > loopback: on
> > [root@localhost admin]# ethtool -t ens802f3 online
> > The test result is PASS
> > The test extra info:
> > Register test  (offline)         0
> > Eeprom test    (offline)         0
> > Interrupt test (offline)         0
> > Link test   (on/offline)         0
> > [root@localhost admin]# ethtool -t ens802f3 offline
> > The test result is PASS
> > The test extra info:
> > Register test  (offline)         0
> > Eeprom test    (offline)         0
> > Interrupt test (offline)         0
> > Link test   (on/offline)         0
> >
> > On ice
> > =====
> > [root@localhost admin]# ethtool -k ens801f0np0 | grep loopback
> > loopback: off
> > [root@localhost admin]# ethtool -K ens801f0np0 loopback on
> > [root@localhost admin]# ethtool -k ens801f0np0 | grep loopback
> > loopback: on
> > [root@localhost admin]# ethtool -t ens801f0np0 online
> > The test result is PASS
> > The test extra info:
> > Register test  (offline)         0
> > EEPROM test    (offline)         0
> > Interrupt test (offline)         0
> > Loopback test  (offline)         0
> > Link test   (on/offline)         0
> > [root@localhost admin]# ethtool -t ens801f0np0 offline
> > The test result is PASS
> > The test extra info:
> > Register test  (offline)         0
> > EEPROM test    (offline)         0
> > Interrupt test (offline)         0
> > Loopback test  (offline)         0
> > Link test   (on/offline)         0
> >
> >
> > Thanks & Regards
> > Chandan Kumar Rout
> >
> > -----Original Message-----
> > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Lobakin, Alexandr
> > Sent: 22 November 2022 21:28
> > To: Leon Romanovsky <leon@kernel.org>
> > Cc: Sarkar, Tirthendu <tirthendu.sarkar@intel.com>; tirtha@gmail.com; intel-wired-lan@lists.osuosl.org; netdev@vger.kernel.org; Karlsson, Magnus <magnus.karlsson@intel.com>
> > Subject: Re: [Intel-wired-lan] [PATCH intel-next v4] i40e: allow toggling loopback mode via ndo_set_features callback
> >
> > 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
> >
> > >
> > > > +
> > > >     return 0;
> > > >  }
> > > >
> > > > @@ -13722,7 +13748,7 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
> > > >     if (!(pf->flags & I40E_FLAG_MFP_ENABLED))
> > > >             hw_features |= NETIF_F_NTUPLE | NETIF_F_HW_TC;
> > > >
> > > > -   netdev->hw_features |= hw_features;
> > > > +   netdev->hw_features |= hw_features | NETIF_F_LOOPBACK;
> > > >
> >
> > Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
> >
> > Thanks,
> > Olek
> > _______________________________________________
> > Intel-wired-lan mailing list
> > Intel-wired-lan@osuosl.org
> > https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

  reply	other threads:[~2022-12-09  9:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-18  9:03 [PATCH intel-next v4] i40e: allow toggling loopback mode via ndo_set_features callback Tirthendu Sarkar
2022-11-22 11:07 ` Leon Romanovsky
2022-11-22 15:57   ` Alexander Lobakin
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 [this message]
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=CAJ8uoz2_s_hyYZaPt15a9c274UXC-8Ejc2nPAmqMN9437fcciQ@mail.gmail.com \
    --to=magnus.karlsson@gmail.com \
    --cc=alexandr.lobakin@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=chandanx.rout@intel.com \
    --cc=george.kuruvinakunnel@intel.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=leon@kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=shravan.nagraj@intel.com \
    --cc=shwetha.nagaraju@intel.com \
    --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 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).