From: Juanlu Herrero <juanlu@fastmail.com>
To: David Wei <dw@davidwei.uk>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 5/5] selftests: net: add rss_multiqueue test variant to iou-zcrx
Date: Mon, 13 Apr 2026 11:01:59 -0500 [thread overview]
Message-ID: <ad0S9CPmtPgICDf7@jlhe0197-mac> (raw)
In-Reply-To: <d3777e86-2859-491d-8071-77871df13c08@davidwei.uk>
On Fri, Apr 10, 2026 at 03:26:54PM -0600, David Wei wrote:
> On 2026-04-08 09:38, Juanlu Herrero wrote:
> > Add multi-port support to the iou-zcrx test binary and a new
> > rss_multiqueue Python test variant that exercises multi-queue zero-copy
> > receive with per-port flow rule steering.
> >
> > In multi-port mode, the server creates N listening sockets on
> > consecutive ports (cfg_port, cfg_port+1, ...) and uses epoll to accept
> > one connection per socket. Each client thread connects to its
> > corresponding port. Per-port ntuple flow rules steer traffic to
> > different NIC hardware queues, each with its own zcrx instance.
> >
> > For single-thread mode (the default), behavior is unchanged: one socket
> > on cfg_port, one thread, one queue.
> >
> > Signed-off-by: Juanlu Herrero <juanlu@fastmail.com>
> > ---
> > .../selftests/drivers/net/hw/iou-zcrx.c | 81 ++++++++++++++-----
> > .../selftests/drivers/net/hw/iou-zcrx.py | 45 ++++++++++-
> > 2 files changed, 104 insertions(+), 22 deletions(-)
> >
> > diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
> > index 646682167bb0..1f33d7127185 100644
> > --- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
> > +++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
>
> Please make all changes in iou-zcrx.c in a single patch. Then patch 5
> only changes the Python selftest.
>
> [...]
> > @@ -397,12 +410,36 @@ static void run_server(void)
> > if (cfg_dry_run)
> > goto join;
> > + epfd = epoll_create1(0);
> > + if (epfd < 0)
> > + error(1, 0, "epoll_create1()");
> > +
> > for (i = 0; i < cfg_num_threads; i++) {
> > - ctxs[i].connfd = accept(fd, NULL, NULL);
> > - if (ctxs[i].connfd < 0)
> > - error(1, 0, "accept()");
> > + ev.events = EPOLLIN;
> > + ev.data.u32 = i;
> > + if (epoll_ctl(epfd, EPOLL_CTL_ADD, fds[i], &ev) < 0)
> > + error(1, 0, "epoll_ctl()");
> > }
> > + accepted = 0;
> > + while (accepted < cfg_num_threads) {
>
> You're using epoll here but it is still accepting a fixed nr of
> connections. The server should be able to accept an arbitrary nr of
> connections, dispatching them to the server worker threads.
>
> Also with multiple queues, connections must be dispatched according to
> their NAPI IDs to the correct server workers.
>
> > + nfds = epoll_wait(epfd, events, 64, 5000);
> > + if (nfds < 0)
> > + error(1, 0, "epoll_wait()");
> > + if (nfds == 0)
> > + error(1, 0, "epoll_wait() timeout");
> > +
> > + for (i = 0; i < nfds; i++) {
> > + int idx = events[i].data.u32;
> > +
> > + ctxs[idx].connfd = accept(fds[idx], NULL, NULL);
> > + if (ctxs[idx].connfd < 0)
> > + error(1, 0, "accept()");
> > + accepted++;
> > + }
> > + }
> > +
> > + close(epfd);
> > pthread_barrier_wait(&barrier);
> > join:
Makes sense, I will re-work the patches and address the epoll & NAPI
id feedback. Thanks!
next prev parent reply other threads:[~2026-04-13 16:02 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 16:38 [PATCH 0/5] selftests: net: add multithread and multiqueue support to iou-zcrx Juanlu Herrero
2026-04-08 16:38 ` [PATCH 1/5] selftests: net: fix get_refill_ring_size() to use its local variable Juanlu Herrero
2026-04-08 16:38 ` [PATCH 2/5] selftests: net: add multithread client support to iou-zcrx Juanlu Herrero
2026-04-09 15:51 ` David Wei
2026-04-13 15:19 ` Juanlu Herrero
2026-04-13 15:44 ` Juanlu Herrero
2026-04-08 16:38 ` [PATCH 3/5] selftests: net: remove unused variable in process_recvzc() Juanlu Herrero
2026-04-08 16:38 ` [PATCH 4/5] selftests: net: add multithread server support to iou-zcrx Juanlu Herrero
2026-04-08 16:38 ` [PATCH 5/5] selftests: net: add rss_multiqueue test variant " Juanlu Herrero
2026-04-10 22:26 ` David Wei
2026-04-13 16:01 ` Juanlu Herrero [this message]
2026-04-17 16:49 ` [PATCH v2 0/6] selftests: net: multithread + rss_multiqueue support for iou-zcrx Juanlu Herrero
2026-04-17 16:49 ` [PATCH v2 1/6] selftests: net: fix get_refill_ring_size() to use its local variable Juanlu Herrero
2026-04-17 16:49 ` [PATCH v2 2/6] selftests: net: remove unused variable in process_recvzc() Juanlu Herrero
2026-04-17 16:49 ` [PATCH v2 3/6] selftests: net: refactor server state into struct thread_ctx Juanlu Herrero
2026-04-17 16:49 ` [PATCH v2 4/6] selftests: net: add multithread client support to iou-zcrx Juanlu Herrero
2026-04-17 16:49 ` [PATCH v2 5/6] selftests: net: add multithread server " Juanlu Herrero
2026-04-17 16:49 ` [PATCH v2 6/6] selftests: net: add rss_multiqueue test variant " Juanlu Herrero
2026-04-18 16:49 ` [PATCH v2 0/6] selftests: net: multithread + rss_multiqueue support for iou-zcrx Jakub Kicinski
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=ad0S9CPmtPgICDf7@jlhe0197-mac \
--to=juanlu@fastmail.com \
--cc=dw@davidwei.uk \
--cc=netdev@vger.kernel.org \
/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