From: Joe Damato <jdamato@fastly.com>
To: netdev@vger.kernel.org
Cc: kuba@kernel.org, Joe Damato <jdamato@fastly.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net-next v2 1/4] netdevsim: Mark NAPI ID on skb in nsim_rcv
Date: Thu, 17 Apr 2025 01:32:39 +0000 [thread overview]
Message-ID: <20250417013301.39228-2-jdamato@fastly.com> (raw)
In-Reply-To: <20250417013301.39228-1-jdamato@fastly.com>
Previously, nsim_rcv was not marking the NAPI ID on the skb, leading to
applications seeing a napi ID of 0 when using SO_INCOMING_NAPI_ID.
To add to the userland confusion, netlink appears to correctly report
the NAPI IDs for netdevsim queues but the resulting file descriptor from
a call to accept() was reporting a NAPI ID of 0.
Signed-off-by: Joe Damato <jdamato@fastly.com>
---
drivers/net/netdevsim/netdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index 0e0321a7ddd7..2aa999345fe1 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -29,6 +29,7 @@
#include <net/pkt_cls.h>
#include <net/rtnetlink.h>
#include <net/udp_tunnel.h>
+#include <net/busy_poll.h>
#include "netdevsim.h"
@@ -357,6 +358,7 @@ static int nsim_rcv(struct nsim_rq *rq, int budget)
break;
skb = skb_dequeue(&rq->skb_queue);
+ skb_mark_napi_id(skb, &rq->napi);
netif_receive_skb(skb);
}
--
2.43.0
next prev parent reply other threads:[~2025-04-17 1:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 1:32 [PATCH net-next v2 0/4] Fix netdevim to correctly mark NAPI IDs Joe Damato
2025-04-17 1:32 ` Joe Damato [this message]
2025-04-17 1:32 ` [PATCH net-next v2 2/4] selftests: drv-net: Factor out ksft C helpers Joe Damato
2025-04-17 1:32 ` [PATCH net-next v2 3/4] selftests: net: Allow custom net ns paths Joe Damato
2025-04-17 1:32 ` [PATCH net-next v2 4/4] selftests: drv-net: Test that NAPI ID is non-zero Joe Damato
2025-04-17 7:26 ` Paolo Abeni
2025-04-17 16:33 ` Joe Damato
2025-04-17 10:21 ` Xiao Liang
2025-04-17 13:46 ` Jakub Kicinski
2025-04-17 16:43 ` Joe Damato
2025-04-17 16:53 ` Jakub Kicinski
2025-04-17 17:06 ` Joe Damato
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=20250417013301.39228-2-jdamato@fastly.com \
--to=jdamato@fastly.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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