[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250624093824.4c0dd380@kernel.org>
Date: Tue, 24 Jun 2025 09:38:24 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Breno Leitao <leitao@...ian.org>
Cc: Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Paolo Abeni
<pabeni@...hat.com>, Shuah Khan <shuah@...nel.org>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
linux-kselftest@...r.kernel.org, Willem de Bruijn
<willemdebruijn.kernel@...il.com>, gustavold@...il.com
Subject: Re: [PATCH net-next] selftests: net: add netpoll basic
functionality test
On Tue, 24 Jun 2025 15:27:27 +0100 Breno Leitao wrote:
> > > + try:
> > > + for key, value in config_data.items():
> > > + if DEBUG:
> > > + ksft_pr(f"Setting {key} to {value}")
> > > + with open(
> > > + f"{NETCONSOLE_CONFIGFS_PATH}/{target_name}/{key}",
> >
> > Could be personal preference but I think that using temp variable to
> > store the argument looks better than breaking out the function call
> > over 5 lines..
>
> I was not able to get what you mean here, sorry.
>
> We have config_data, which is a dictionary that stores the netconsole
> keys (as in configfs) and their value, which will be set in the code below.
>
> What would this temp variable look like, and how it would look like?
path = f"{NETCONSOLE_CONFIGFS_PATH}/{target_name}/{key}"
with open(path, "r", encoding="utf-8") as f:
...
> > > +def test_netpoll(cfg: NetDrvEpEnv, netdevnl: NetdevFamily) -> None:
> > > + """
> > > + Test netpoll by sending traffic to the interface and then sending
> > > + netconsole messages to trigger a poll
> > > + """
> > > +
> > > + target_name = generate_random_netcons_name()
> > > + ifname = cfg.dev["ifname"]
> > > + traffic = None
> > > +
> > > + try:
> > > + set_single_rx_tx_queue(ifname)
> > > + traffic = GenerateTraffic(cfg)
> > > + check_traffic_flowing(cfg, netdevnl)
> >
> > Any reason to perform this check? GenerateTraffic() already waits for
> > traffic to ramp up. Do we need to adjust the logic there, or make some
> > methods public?
>
> Not really. I can just remove this code, in fact, given
> GenerateTraffic() already waits for the code. Or, I can add under DEBUG.
Let's not put functional changes under DEBUG, just prints.
It could make it so that the test fails without DEBUG and passes with.
> As we discussed in the RFC thread, I will add support for bpftrace in
> the v2.
Powered by blists - more mailing lists