netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: David Wei <dw@davidwei.uk>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Daniel Borkmann <daniel@iogearbox.net>
Subject: Re: [PATCH net-next v1 2/7] selftests/net: add MemPrvEnv env
Date: Fri, 21 Nov 2025 17:41:22 -0800	[thread overview]
Message-ID: <20251121174122.32eff22a@kernel.org> (raw)
In-Reply-To: <1cfe74a1-092c-406b-9fe5-e1206aedb473@davidwei.uk>

On Fri, 21 Nov 2025 09:14:49 -0800 David Wei wrote:
> On 2025-11-20 19:18, Jakub Kicinski wrote:
> > On Wed, 19 Nov 2025 19:30:11 -0800 David Wei wrote:  
> >> Memory provider HW selftests (i.e. zcrx, devmem) require setting up a
> >> netdev with e.g. flow steering rules. Add a new MemPrvEnv that sets up
> >> the test env, restoring it to the original state prior to the test. This
> >> also speeds up tests since each individual test case don't need to
> >> repeat the setup/teardown.  
> > 
> > Hm, this feels a bit too specific to the particular use case.
> > I think we have a gap in terms of the Env classes for setting up
> > "a container" tests. Meaning - NetDrvEpEnv + an extra NetNs with
> > a netkit / veth.  init net gets set up to forward traffic to and
> > from the netkit / veth with BPF or routing. And the container
> > needs its own IP address from a new set of params.
> > 
> > I think that's the extent of the setup provided by the env.
> > We can then reuse the env for all "container+offload" cases.
> > The rest belongs in each test module.  
> 
> Got it. You'd like me to basically reverse the current env setup.

🤔️ not sure

> Move the netns, netkit/veth setup, bpf forwarding using the new
> LOCAL_PREFIX env var etc into the env setup.

Yes to that, I think.

> Move the NIC queue stuff back out into helpers and call it from the
> test module.

Don't go too hard on the helpers, tho. "code reuse" is explicitly 
an anti-goal for selftests. I really don't want net/lib/py
to become a framework folks must learn to understand or debug tests.

  reply	other threads:[~2025-11-22  1:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20  3:30 [PATCH net-next v1 0/7] selftests/net: add netkit netns ping test David Wei
2025-11-20  3:30 ` [PATCH net-next v1 1/7] selftests/net: add suffix to ksft_run David Wei
2025-11-21  3:13   ` Jakub Kicinski
2025-11-22  3:28     ` David Wei
2025-11-20  3:30 ` [PATCH net-next v1 2/7] selftests/net: add MemPrvEnv env David Wei
2025-11-21  3:18   ` Jakub Kicinski
2025-11-21 17:14     ` David Wei
2025-11-22  1:41       ` Jakub Kicinski [this message]
2025-11-22  2:24         ` David Wei
2025-11-20  3:30 ` [PATCH net-next v1 3/7] selftests/net: modify iou-zcrx.py to use MemPrvEnv David Wei
2025-11-20  3:30 ` [PATCH net-next v1 4/7] selftests/net: add rand_ifname() helper David Wei
2025-11-21  3:19   ` Jakub Kicinski
2025-11-21 17:19     ` David Wei
2025-11-20  3:30 ` [PATCH net-next v1 5/7] selftests/net: add bpf skb forwarding program David Wei
2025-11-21  3:20   ` Jakub Kicinski
2025-11-21 17:40     ` David Wei
2025-11-22  1:36       ` Jakub Kicinski
2025-11-20  3:30 ` [PATCH net-next v1 6/7] selftests/net: add LOCAL_PREFIX_V{4,6} env to HW selftests David Wei
2025-11-21  3:24   ` Jakub Kicinski
2025-11-21 17:19     ` David Wei
2025-11-20  3:30 ` [PATCH net-next v1 7/7] selftests/net: add a netkit netns ping test David Wei

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=20251121174122.32eff22a@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dw@davidwei.uk \
    --cc=edumazet@google.com \
    --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;
as well as URLs for NNTP newsgroup(s).