From: Joe Damato <jdamato@fastly.com>
To: florian@bezdeka.de
Cc: netdev@vger.kernel.org, vitaly.lifshits@intel.com,
avigailx.dahan@intel.com, anthony.l.nguyen@intel.com,
stable@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH iwl-net] igc: Fix XSK queue NAPI ID mapping
Date: Thu, 6 Mar 2025 08:45:40 -0800 [thread overview]
Message-ID: <Z8nRNJ7QmevZrKYZ@LQ3V64L9R2> (raw)
In-Reply-To: <796726995fe2c0e895188862321a0de8@bezdeka.de>
On Thu, Mar 06, 2025 at 05:27:38PM +0100, florian@bezdeka.de wrote:
> Hi Joe,
>
> On 2025-03-05 19:09, Joe Damato wrote:
> > In commit b65969856d4f ("igc: Link queues to NAPI instances"), the XSK
> > queues were incorrectly unmapped from their NAPI instances. After
> > discussion on the mailing list and the introduction of a test to codify
> > the expected behavior, we can see that the unmapping causes the
> > check_xsk test to fail:
> >
> > NETIF=enp86s0 ./tools/testing/selftests/drivers/net/queues.py
> >
> > [...]
> > # Check| ksft_eq(q.get('xsk', None), {},
> > # Check failed None != {} xsk attr on queue we configured
> > not ok 4 queues.check_xsk
> >
> > After this commit, the test passes:
> >
> > ok 4 queues.check_xsk
> >
> > Note that the test itself is only in net-next, so I tested this change
> > by applying it to my local net-next tree, booting, and running the test.
> >
> > Cc: stable@vger.kernel.org
> > Fixes: b65969856d4f ("igc: Link queues to NAPI instances")
> > Signed-off-by: Joe Damato <jdamato@fastly.com>
> > ---
> > drivers/net/ethernet/intel/igc/igc_xdp.c | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/igc/igc_xdp.c
> > b/drivers/net/ethernet/intel/igc/igc_xdp.c
> > index 13bbd3346e01..869815f48ac1 100644
> > --- a/drivers/net/ethernet/intel/igc/igc_xdp.c
> > +++ b/drivers/net/ethernet/intel/igc/igc_xdp.c
> > @@ -86,7 +86,6 @@ static int igc_xdp_enable_pool(struct igc_adapter
> > *adapter,
> > napi_disable(napi);
> > }
> >
> > - igc_set_queue_napi(adapter, queue_id, NULL);
> > set_bit(IGC_RING_FLAG_AF_XDP_ZC, &rx_ring->flags);
> > set_bit(IGC_RING_FLAG_AF_XDP_ZC, &tx_ring->flags);
> >
> > @@ -136,7 +135,6 @@ static int igc_xdp_disable_pool(struct igc_adapter
> > *adapter, u16 queue_id)
> > xsk_pool_dma_unmap(pool, IGC_RX_DMA_ATTR);
> > clear_bit(IGC_RING_FLAG_AF_XDP_ZC, &rx_ring->flags);
> > clear_bit(IGC_RING_FLAG_AF_XDP_ZC, &tx_ring->flags);
> > - igc_set_queue_napi(adapter, queue_id, napi);
> >
> > if (needs_reset) {
> > napi_enable(napi);
>
> That doesn't look correct to me. You removed both invocations of
> igc_set_queue_napi() from igc_xdp.c. Where is the napi mapping now
> done (in case XDP is enabled)?
igc_set_queue_napi is called when the queues are created (igc_up,
__igc_open). When the queues are created they'll be linked. Whether
or not XDP is enabled does not affect the queues being linked.
The test added for this (which I mentioned in the commit message)
confirms that this is the correct behavior, as does the
documentation in Documentation/netlink/specs/netdev.yaml.
See commit df524c8f5771 ("netdev-genl: Add an XSK attribute to
queues").
> To me it seems flipped. igc_xdp_enable_pool() should do the mapping
> (previously did the unmapping) and igc_xdp_disable_pool() should do
> the unmapping (previously did the mapping). No?
In igc, all queues get their NAPIs mapped in igc_up or __igc_open. I
had mistakenly added code to remove the mapping for XDP because I
was under the impression that NAPIs should not be mapped for XDP
queues. See the commit under fixes.
This was incorrect, so this commit removes the unmapping and
corrects the behavior.
With this change, all queues have their NAPIs mapped (whether or not
they are used for AF_XDP) and is the agreed upon behavior based on
prior conversations on the list and the documentation I mentioned
above.
> Btw: I got this patch via stable. It doesn't make sense to send it
> to stable where this patch does not apply.
Maybe I made a mistake, but as far as I can tell the commit under
fixes is in 6.14-rc*:
$ git tag --contains b65969856d4f
v6.14-rc1
v6.14-rc2
v6.14-rc3
v6.14-rc4
So, I think this change is:
- Correct
- Definitely a "fixes" and should go to iwl-net
- But maybe does not need to CC stable ?
If the Intel folks would like me to resend with some change please
let me know.
next prev parent reply other threads:[~2025-03-06 16:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-05 18:09 [PATCH iwl-net] igc: Fix XSK queue NAPI ID mapping Joe Damato
2025-03-05 19:15 ` Gerhard Engleder
2025-03-06 16:27 ` florian
2025-03-06 16:45 ` Joe Damato [this message]
2025-03-06 18:31 ` Tony Nguyen
2025-03-07 21:37 ` Tony Nguyen
2025-03-25 16:23 ` [Intel-wired-lan] " Mor Bar-Gabay
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=Z8nRNJ7QmevZrKYZ@LQ3V64L9R2 \
--to=jdamato@fastly.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=ast@kernel.org \
--cc=avigailx.dahan@intel.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian@bezdeka.de \
--cc=hawk@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=stable@vger.kernel.org \
--cc=vitaly.lifshits@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