From: Stanislav Fomichev <stfomichev@gmail.com>
To: Mina Almasry <almasrymina@google.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, viro@zeniv.linux.org.uk,
horms@kernel.org, andrew+netdev@lunn.ch, shuah@kernel.org,
sagi@grimberg.me, willemb@google.com, asml.silence@gmail.com,
jdamato@fastly.com, kaiyuanz@google.com,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next 3/3] selftests: ncdevmem: add tx test with multiple IOVs
Date: Wed, 21 May 2025 10:41:29 -0700 [thread overview]
Message-ID: <aC4QSV1OFNtodw9Y@mini-arch> (raw)
In-Reply-To: <CAHS8izMEaPUDnoQaYTaTMY719FJ_-Rb-Ui7ika_yZGQ70VWiVQ@mail.gmail.com>
On 05/21, Mina Almasry wrote:
> On Tue, May 20, 2025 at 1:30 PM Stanislav Fomichev <stfomichev@gmail.com> wrote:
> >
> > Use prime 3 for length to make offset slowly drift away.
> >
> > Signed-off-by: Stanislav Fomichev <stfomichev@gmail.com>
> > ---
> > .../testing/selftests/drivers/net/hw/devmem.py | 17 ++++++++++++++++-
> > 1 file changed, 16 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/drivers/net/hw/devmem.py b/tools/testing/selftests/drivers/net/hw/devmem.py
> > index 7fc686cf47a2..d7f6a76eb2b7 100755
> > --- a/tools/testing/selftests/drivers/net/hw/devmem.py
> > +++ b/tools/testing/selftests/drivers/net/hw/devmem.py
> > @@ -49,12 +49,27 @@ from lib.py import ksft_disruptive
> > ksft_eq(socat.stdout.strip(), "hello\nworld")
> >
> >
> > +@ksft_disruptive
> > +def check_tx_chunks(cfg) -> None:
> > + cfg.require_ipver("6")
> > + require_devmem(cfg)
> > +
> > + port = rand_port()
> > + listen_cmd = f"socat -U - TCP6-LISTEN:{port}"
> > +
> > + with bkg(listen_cmd, exit_wait=True) as socat:
> > + wait_port_listen(port)
> > + cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_remote} -f {cfg.ifname} -s {cfg.addr_v['6']} -p {port} -z 3", host=cfg.remote, shell=True)
> > +
> > + ksft_eq(socat.stdout.strip(), "hello\nworld")
> > +
> > +
> > def main() -> None:
> > with NetDrvEpEnv(__file__) as cfg:
> > cfg.bin_local = path.abspath(path.dirname(__file__) + "/ncdevmem")
> > cfg.bin_remote = cfg.remote.deploy(cfg.bin_local)
> >
> > - ksft_run([check_rx, check_tx],
> > + ksft_run([check_rx, check_tx, check_tx_chunks],
> > args=(cfg, ))
> > ksft_exit()
> >
> > --
> > 2.49.0
> >
>
> I was hoping we'd add the test coverage without the need to add test
> cases to the ksft. I was thinking maybe ncdevmem can do rand() each
> sendmsg loop and send a different set of chunks, so that we don't need
> a flag.
>
> But it may be too hacky to have the test be non-deterministic, so up to you
>
> Acked-by: Mina Almasry <almasrymina@google.com>
Thanks! Let's spell it out explicitly for now. Doing it at random seems
like an option when we start sending more data (after your series
that converts the tests to -v).
next prev parent reply other threads:[~2025-05-21 17:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-20 20:30 [PATCH net-next 1/3] net: devmem: support single IOV with sendmsg Stanislav Fomichev
2025-05-20 20:30 ` [PATCH net-next 2/3] selftests: ncdevmem: make chunking optional Stanislav Fomichev
2025-05-21 17:21 ` Mina Almasry
2025-05-21 17:39 ` Stanislav Fomichev
2025-05-21 19:08 ` Mina Almasry
2025-05-20 20:30 ` [PATCH net-next 3/3] selftests: ncdevmem: add tx test with multiple IOVs Stanislav Fomichev
2025-05-21 17:22 ` Mina Almasry
2025-05-21 17:41 ` Stanislav Fomichev [this message]
2025-05-21 17:16 ` [PATCH net-next 1/3] net: devmem: support single IOV with sendmsg Mina Almasry
2025-05-21 17:33 ` Stanislav Fomichev
2025-05-21 18:44 ` Mina Almasry
2025-05-22 8:31 ` Pavel Begunkov
2025-05-28 1:30 ` 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=aC4QSV1OFNtodw9Y@mini-arch \
--to=stfomichev@gmail.com \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=asml.silence@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jdamato@fastly.com \
--cc=kaiyuanz@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sagi@grimberg.me \
--cc=shuah@kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willemb@google.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).