lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250415171154.0382c7f7@kernel.org>
Date: Tue, 15 Apr 2025 17:11:54 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Joe Damato <jdamato@...tly.com>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew+netdev@...n.ch>, "David S.
 Miller" <davem@...emloft.net>, David Wei <dw@...idwei.uk>, Eric Dumazet
 <edumazet@...gle.com>, open list <linux-kernel@...r.kernel.org>, Paolo
 Abeni <pabeni@...hat.com>
Subject: Re: [RFC net 0/1] Fix netdevim to correctly mark NAPI IDs

On Tue, 15 Apr 2025 12:39:11 -0700 Joe Damato wrote:
> On Mon, Mar 31, 2025 at 04:39:17PM -0700, Jakub Kicinski wrote:
> > Up to you. The patch make me wonder how many other corner cases / bugs
> > we may be missing in drivers. And therefore if we shouldn't flesh out
> > more device-related tests. But exercising the core code makes sense
> > in itself so no strong feelings.  
> 
> Sorry to revive this old thread, but I have a bit of time to get
> this fixed now. I have a patch for netdevsim but am trying to figure
> out what the best way to write a test for this is.
> 
> Locally, I've hacked up a tools/testing/selftests/drivers/net/napi_id.py
> 
> I'm using NetDrvEpEnv, but am not sure: is there an easy way in
> Python to run stuff in a network namespace? Is there an example I
> can look at?
> 
> In my Python code, I was thinking that I'd call fork and have each
> python process (client and server) set their network namespace
> according to the NetDrvEpEnv cfg... but wasn't sure if there was a
> better/easier way ?
> 
> It looks like tools/testing/selftests/net/rds/test.py uses
> LoadLibrary to call setns before creating a socket.
> 
> Should I go in that direction too?

Why do you need a netns? The NetDrvEpEnv will create one for you
automatically and put one side of the netdevsim into it.
Do you mean that you need to adjust that other endpoint?
It's done the same way as if it was a remote machine:

	cmd(..., host=cfg.remote)

If you really need a netnes check out
tools/testing/selftests/net/lib/py/netns.py

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ