From: Mina Almasry <almasrymina@google.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org
Cc: Mina Almasry <almasrymina@google.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Jesper Dangaard Brouer <hawk@kernel.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Neal Cardwell <ncardwell@google.com>,
Kuniyuki Iwashima <kuniyu@amazon.com>,
David Ahern <dsahern@kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Shuah Khan <shuah@kernel.org>,
sdf@fomichev.me, ap420073@gmail.com, praan@google.com,
shivajikant@google.com
Subject: [PATCH net-next v2 4/8] net: devmem: ksft: add ipv4 support
Date: Fri, 23 May 2025 23:05:20 +0000 [thread overview]
Message-ID: <20250523230524.1107879-5-almasrymina@google.com> (raw)
In-Reply-To: <20250523230524.1107879-1-almasrymina@google.com>
ncdevmem supports both ipv4 and ipv6, but the ksft is currently
ipv6-only. Propagate the ipv4 support to the ksft, so that folks that
are limited to these networks can also test.
Signed-off-by: Mina Almasry <almasrymina@google.com>
---
v2:
- Use cfg.addr and cfg.remote_addr instead of doing ipv4 and ipv6
special handling (Jakub)
---
tools/testing/selftests/drivers/net/hw/devmem.py | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/drivers/net/hw/devmem.py b/tools/testing/selftests/drivers/net/hw/devmem.py
index 7fc686cf47a2..9b3e2c78f457 100755
--- a/tools/testing/selftests/drivers/net/hw/devmem.py
+++ b/tools/testing/selftests/drivers/net/hw/devmem.py
@@ -21,30 +21,28 @@ def require_devmem(cfg):
@ksft_disruptive
def check_rx(cfg) -> None:
- cfg.require_ipver("6")
require_devmem(cfg)
port = rand_port()
- listen_cmd = f"{cfg.bin_local} -l -f {cfg.ifname} -s {cfg.addr_v['6']} -p {port}"
+ listen_cmd = f"{cfg.bin_local} -l -f {cfg.ifname} -s {cfg.addr} -p {port}"
- with bkg(listen_cmd) as socat:
+ with bkg(listen_cmd) as ncdevmem:
wait_port_listen(port)
- cmd(f"echo -e \"hello\\nworld\"| socat -u - TCP6:[{cfg.addr_v['6']}]:{port}", host=cfg.remote, shell=True)
+ cmd(f"echo -e \"hello\\nworld\"| socat -u - TCP{cfg.addr_ipver}:{cfg.addr}:{port}", host=cfg.remote, shell=True)
- ksft_eq(socat.stdout.strip(), "hello\nworld")
+ ksft_eq(ncdevmem.stdout.strip(), "hello\nworld")
@ksft_disruptive
def check_tx(cfg) -> None:
- cfg.require_ipver("6")
require_devmem(cfg)
port = rand_port()
- listen_cmd = f"socat -U - TCP6-LISTEN:{port}"
+ listen_cmd = f"socat -U - TCP{cfg.addr_ipver}-LISTEN:{port}"
- with bkg(listen_cmd, exit_wait=True) as socat:
+ with bkg(listen_cmd) 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}", host=cfg.remote, shell=True)
+ cmd(f"echo -e \"hello\\nworld\"| {cfg.bin_remote} -f {cfg.ifname} -s {cfg.addr} -p {port}", host=cfg.remote, shell=True)
ksft_eq(socat.stdout.strip(), "hello\nworld")
--
2.49.0.1151.ga128411c76-goog
next prev parent reply other threads:[~2025-05-23 23:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-23 23:05 [PATCH net-next v2 0/8] Devmem TCP minor cleanups and ksft improvements Mina Almasry
2025-05-23 23:05 ` [PATCH net-next v2 1/8] net: devmem: move list_add to net_devmem_bind_dmabuf Mina Almasry
2025-05-27 15:34 ` Stanislav Fomichev
2025-05-23 23:05 ` [PATCH net-next v2 2/8] page_pool: fix ugly page_pool formatting Mina Almasry
2025-05-27 15:34 ` Stanislav Fomichev
2025-05-23 23:05 ` [PATCH net-next v2 3/8] net: devmem: preserve sockc_err Mina Almasry
2025-05-27 15:34 ` Stanislav Fomichev
2025-05-23 23:05 ` Mina Almasry [this message]
2025-05-27 15:33 ` [PATCH net-next v2 4/8] net: devmem: ksft: add ipv4 support Stanislav Fomichev
2025-05-23 23:05 ` [PATCH net-next v2 5/8] net: devmem: ksft: add exit_wait to make rx test pass Mina Almasry
2025-05-23 23:05 ` [PATCH net-next v2 6/8] net: devmem: ksft: add 5 tuple FS support Mina Almasry
2025-05-27 15:33 ` Stanislav Fomichev
2025-05-23 23:05 ` [PATCH net-next v2 7/8] net: devmem: ksft: upgrade rx test to send 1K data Mina Almasry
2025-05-23 23:05 ` [PATCH net-next v2 8/8] net: devmem: ncdevmem: remove unused variable Mina Almasry
2025-05-28 2:30 ` [PATCH net-next v2 0/8] Devmem TCP minor cleanups and ksft improvements patchwork-bot+netdevbpf
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=20250523230524.1107879-5-almasrymina@google.com \
--to=almasrymina@google.com \
--cc=andrew+netdev@lunn.ch \
--cc=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--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=praan@google.com \
--cc=sdf@fomichev.me \
--cc=shivajikant@google.com \
--cc=shuah@kernel.org \
/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
all inboxes | Powered by JetHome®