aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/drivers/net/hw/ncdevmem.c
diff options
context:
space:
mode:
authorMina Almasry <[email protected]>2025-05-23 23:05:22 +0000
committerJakub Kicinski <[email protected]>2025-05-28 02:19:36 +0000
commit243d47a5e1e47b2b72d654d7278fc8bff0199b0c (patch)
treebb75ca721ff9f835b2751ff25e1baab6ca452552 /tools/testing/selftests/drivers/net/hw/ncdevmem.c
parentnet: devmem: ksft: add exit_wait to make rx test pass (diff)
downloadkernel-243d47a5e1e47b2b72d654d7278fc8bff0199b0c.tar.gz
kernel-243d47a5e1e47b2b72d654d7278fc8bff0199b0c.zip
net: devmem: ksft: add 5 tuple FS support
ncdevmem supports drivers that are limited to either 3-tuple or 5-tuple FS support, but the ksft is currently 3-tuple only. Support drivers that have 5-tuple FS supported by adding a ksft arg. Signed-off-by: Mina Almasry <[email protected]> fix 5-tuple fix 5-tuple Acked-by: Stanislav Fomichev <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/drivers/net/hw/ncdevmem.c')
-rw-r--r--tools/testing/selftests/drivers/net/hw/ncdevmem.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/testing/selftests/drivers/net/hw/ncdevmem.c b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
index fc7ba7d71502..a226f2c7af83 100644
--- a/tools/testing/selftests/drivers/net/hw/ncdevmem.c
+++ b/tools/testing/selftests/drivers/net/hw/ncdevmem.c
@@ -373,7 +373,8 @@ static int configure_flow_steering(struct sockaddr_in6 *server_sin)
server_addr = strrchr(server_addr, ':') + 1;
}
- return run_command("sudo ethtool -N %s flow-type %s %s %s dst-ip %s %s %s dst-port %s queue %d >&2",
+ /* Try configure 5-tuple */
+ if (run_command("sudo ethtool -N %s flow-type %s %s %s dst-ip %s %s %s dst-port %s queue %d >&2",
ifname,
type,
client_ip ? "src-ip" : "",
@@ -381,7 +382,17 @@ static int configure_flow_steering(struct sockaddr_in6 *server_sin)
server_addr,
client_ip ? "src-port" : "",
client_ip ? port : "",
- port, start_queue);
+ port, start_queue))
+ /* If that fails, try configure 3-tuple */
+ if (run_command("sudo ethtool -N %s flow-type %s dst-ip %s dst-port %s queue %d >&2",
+ ifname,
+ type,
+ server_addr,
+ port, start_queue))
+ /* If that fails, return error */
+ return -1;
+
+ return 0;
}
static int bind_rx_queue(unsigned int ifindex, unsigned int dmabuf_fd,