@@ -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;
-
- return run_command("sudo ethtool -K %s ntuple on >&2", ifname);
+ /* 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.
+ */
+
+ 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)