Commit e3c09623 authored by Stanislav Fomichev's avatar Stanislav Fomichev Committed by Jakub Kicinski
Browse files

selftests: ncdevmem: Properly reset flow steering



ntuple off/on might be not enough to do it on all NICs.
Add a bunch of shell crap to explicitly remove the rules.

Reviewed-by: default avatarMina Almasry <almasrymina@google.com>
Reviewed-by: default avatarJoe Damato <jdamato@fastly.com>
Signed-off-by: default avatarStanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20241107181211.3934153-8-sdf@fomichev.me


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 93305635
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -217,13 +217,18 @@ void validate_buffer(void *line, size_t size)

static int reset_flow_steering(void)
{
	int ret = 0;

	ret = run_command("sudo ethtool -K %s ntuple off >&2", ifname);
	if (ret)
		return ret;
	/* Depending on the NIC, toggling ntuple off and on might not
	 * be allowed. Additionally, attempting to delete existing filters
	 * will fail if no filters are present. Therefore, do not enforce
	 * the exit status.
	 */

	return run_command("sudo ethtool -K %s ntuple on >&2", ifname);
	run_command("sudo ethtool -K %s ntuple off >&2", ifname);
	run_command("sudo ethtool -K %s ntuple on >&2", ifname);
	run_command(
		"sudo ethtool -n %s | grep 'Filter:' | awk '{print $2}' | xargs -n1 ethtool -N %s delete >&2",
		ifname, ifname);
	return 0;
}

static int configure_headersplit(bool on)