From: Simon Horman <horms@kernel.org>
To: Bobby Eshleman <bobbyeshleman@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Kuniyuki Iwashima <kuniyu@google.com>,
Willem de Bruijn <willemb@google.com>,
Neal Cardwell <ncardwell@google.com>,
David Ahern <dsahern@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Jonathan Corbet <corbet@lwn.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Shuah Khan <shuah@kernel.org>,
Donald Hunter <donald.hunter@gmail.com>,
Mina Almasry <almasrymina@google.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arch@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kselftest@vger.kernel.org,
Stanislav Fomichev <sdf@fomichev.me>,
Bobby Eshleman <bobbyeshleman@meta.com>
Subject: Re: [PATCH net-next v7 5/5] selftests: drv-net: devmem: add autorelease tests
Date: Wed, 26 Nov 2025 10:02:51 +0000 [thread overview]
Message-ID: <aSbQS5HqMkfDhktz@horms.kernel.org> (raw)
In-Reply-To: <20251119-scratch-bobbyeshleman-devmem-tcp-token-upstream-v7-5-1abc8467354c@meta.com>
On Wed, Nov 19, 2025 at 07:37:12PM -0800, Bobby Eshleman wrote:
> From: Bobby Eshleman <bobbyeshleman@meta.com>
>
> Add tests cases that check the autorelease modes (on and off). The new
> tests are the same as the old ones, but just pass a flag to ncdevmem to
> select the autorelease mode.
>
> Only for RX tests is autorelease checked, as the autorelease ncdevmem
> flag is unused in the TX case and doesn't apply to TX bind operations.
>
> Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
> ---
> Note: I tested successfully with kperf, but I'm troubleshooting
> some mlx5 issues with ncdevmem so this patch, though simple, is not
> fully validated. Will respond to this thread when solve the issue.
>
> Changes in v7:
> - use autorelease netlink
> - remove sockopt tests
> ---
> tools/testing/selftests/drivers/net/hw/devmem.py | 22 ++++++++++++++++++++--
> tools/testing/selftests/drivers/net/hw/ncdevmem.c | 19 +++++++++++++------
> 2 files changed, 33 insertions(+), 8 deletions(-)
>
> diff --git a/tools/testing/selftests/drivers/net/hw/devmem.py b/tools/testing/selftests/drivers/net/hw/devmem.py
> index 45c2d49d55b6..dddb9d77cb28 100755
> --- a/tools/testing/selftests/drivers/net/hw/devmem.py
> +++ b/tools/testing/selftests/drivers/net/hw/devmem.py
> @@ -25,7 +25,23 @@ def check_rx(cfg) -> None:
>
> port = rand_port()
> socat = f"socat -u - TCP{cfg.addr_ipver}:{cfg.baddr}:{port},bind={cfg.remote_baddr}:{port}"
> - listen_cmd = f"{cfg.bin_local} -l -f {cfg.ifname} -s {cfg.addr} -p {port} -c {cfg.remote_addr} -v 7"
> + listen_cmd = f"{cfg.bin_local} -l -f {cfg.ifname} -s {cfg.addr} -p {port} -c {cfg.remote_addr} -v 7 -a 0"
> +
> + with bkg(listen_cmd, exit_wait=True) as ncdevmem:
> + wait_port_listen(port)
> + cmd(f"yes $(echo -e \x01\x02\x03\x04\x05\x06) | \
> + head -c 1K | {socat}", host=cfg.remote, shell=True)
> +
> + ksft_eq(ncdevmem.ret, 0)
> +
> +
> +@ksft_disruptive
> +def check_rx_autorelease(cfg) -> None:
> + require_devmem(cfg)
> +
> + port = rand_port()
> + socat = f"socat -u - TCP{cfg.addr_ipver}:{cfg.baddr}:{port},bind={cfg.remote_baddr}:{port}"
> + listen_cmd = f"{cfg.bin_local} -l -f {cfg.ifname} -s {cfg.addr} -p {port} -c {cfg.remote_addr} -v 7 -a 1"
>
> with bkg(listen_cmd, exit_wait=True) as ncdevmem:
> wait_port_listen(port)
> @@ -68,7 +84,9 @@ def main() -> None:
> cfg.bin_local = path.abspath(path.dirname(__file__) + "/ncdevmem")
> cfg.bin_remote = cfg.remote.deploy(cfg.bin_local)
>
> - ksft_run([check_rx, check_tx, check_tx_chunks],
> + ksft_run([check_rx, check_rx_autorelease,
> + check_tx, check_tx_autorelease,
> + check_tx_chunks, check_tx_chunks_autorelease],
> args=(cfg, ))
> ksft_exit()
>
Hi Bobby,
Sorry if this is a duplicate: I drafted this before bit AFAIKT
I accidently hit the worng key and deleted it.
I see that check_rx_autorelease is implemented above,
but I don't see an implementatoin of check_tx_autorelease
or check_tx_chunks_autorelease. Perhaps they should be added too?
Flagged by pylint and ruff.
Also confirmed by running devmem.py using vng (possibly incorrectly).
This patch also adds some other pylint warnings, about missing
documentation and lines that are too long. Although there are
already instances of the same warning in this file. So I'm not
sure how we should feel about that.
...
next prev parent reply other threads:[~2025-11-26 10:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 3:37 [PATCH net-next v7 0/5] net: devmem: improve cpu cost of RX token management Bobby Eshleman
2025-11-20 3:37 ` [PATCH net-next v7 1/5] net: devmem: rename tx_vec to vec in dmabuf binding Bobby Eshleman
2025-11-20 3:37 ` [PATCH net-next v7 2/5] net: devmem: refactor sock_devmem_dontneed for autorelease split Bobby Eshleman
2025-11-20 3:37 ` [PATCH net-next v7 3/5] net: devmem: implement autorelease token management Bobby Eshleman
2025-11-20 12:19 ` Paolo Abeni
2025-11-20 15:31 ` Bobby Eshleman
2025-11-21 16:39 ` Stanislav Fomichev
2025-11-21 17:58 ` [PATCH net-next v7 3/5] net: devmem: implement autorelease token managementy Bobby Eshleman
2025-11-26 10:11 ` [PATCH net-next v7 3/5] net: devmem: implement autorelease token management Simon Horman
2025-11-20 3:37 ` [PATCH net-next v7 4/5] net: devmem: document NETDEV_A_DMABUF_AUTORELEASE netlink attribute Bobby Eshleman
2025-11-20 3:37 ` [PATCH net-next v7 5/5] selftests: drv-net: devmem: add autorelease tests Bobby Eshleman
2025-11-26 10:02 ` Simon Horman [this message]
2025-12-09 19:52 ` [PATCH net-next v7 0/5] net: devmem: improve cpu cost of RX token management Bobby Eshleman
2025-12-09 19:55 ` Mina Almasry
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=aSbQS5HqMkfDhktz@horms.kernel.org \
--to=horms@kernel.org \
--cc=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=arnd@arndb.de \
--cc=bobbyeshleman@gmail.com \
--cc=bobbyeshleman@meta.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--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).