selftests: ncdevmem: Make client_ip optional
[ Upstream commit 0ebd75f5f2392c2ada04c6e11447415911fe1506 ] Support 3-tuple filtering by making client_ip optional. When -c is not passed, don't specify src-ip/src-port in the filter. Reviewed-by: Mina Almasry <almasrymina@google.com> Reviewed-by: Joe Damato <jdamato@fastly.com> Signed-off-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.link/20241107181211.3934153-5-sdf@fomichev.me Signed-off-by: Jakub Kicinski <kuba@kernel.org> Stable-dep-of: 97c4e094a4b2 ("tests/ncdevmem: Fix double-free of queue array") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0738648a7d
commit
04db681f3c
@@ -62,7 +62,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
static char *server_ip = "192.168.1.4";
|
static char *server_ip = "192.168.1.4";
|
||||||
static char *client_ip = "192.168.1.2";
|
static char *client_ip;
|
||||||
static char *port = "5201";
|
static char *port = "5201";
|
||||||
static size_t do_validation;
|
static size_t do_validation;
|
||||||
static int start_queue = 8;
|
static int start_queue = 8;
|
||||||
@@ -236,8 +236,14 @@ static int configure_channels(unsigned int rx, unsigned int tx)
|
|||||||
|
|
||||||
static int configure_flow_steering(void)
|
static int configure_flow_steering(void)
|
||||||
{
|
{
|
||||||
return run_command("sudo ethtool -N %s flow-type tcp4 src-ip %s dst-ip %s src-port %s dst-port %s queue %d >&2",
|
return run_command("sudo ethtool -N %s flow-type tcp4 %s %s dst-ip %s %s %s dst-port %s queue %d >&2",
|
||||||
ifname, client_ip, server_ip, port, port, start_queue);
|
ifname,
|
||||||
|
client_ip ? "src-ip" : "",
|
||||||
|
client_ip ?: "",
|
||||||
|
server_ip,
|
||||||
|
client_ip ? "src-port" : "",
|
||||||
|
client_ip ? port : "",
|
||||||
|
port, start_queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int bind_rx_queue(unsigned int ifindex, unsigned int dmabuf_fd,
|
static int bind_rx_queue(unsigned int ifindex, unsigned int dmabuf_fd,
|
||||||
|
|||||||
Reference in New Issue
Block a user