From f14e8156a096aaa3ba97498b90e028019aa3252a Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 23 Oct 2021 19:53:46 +0000 Subject: [PATCH] Use a single command to install xdp instead of remove+add --- install.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 8106def..b791d8e 100755 --- a/install.sh +++ b/install.sh @@ -29,12 +29,10 @@ fi echo "Before unload drop count was:" ./dropcount.sh || echo "Not loaded" -ip link set "$1" xdp off -ip link set "$1" xdpgeneric off # Note that sometimes the automated fallback does not work properly so we have to || generic here -ip link set "$1" xdpoffload obj xdp sec $XDP_SECTION || ( - echo "Failed to install in NIC, testing in driver..." && ip link set "$1" xdpdrv obj xdp sec $XDP_SECTION || ( - echo "Failed to install in driver, using generic..." && ip link set "$1" xdpgeneric obj xdp sec $XDP_SECTION +ip -force link set "$1" xdpoffload obj xdp sec $XDP_SECTION || ( + echo "Failed to install in NIC, testing in driver..." && ip -force link set "$1" xdpdrv obj xdp sec $XDP_SECTION || ( + echo "Failed to install in driver, using generic..." && ip -force link set "$1" xdpgeneric obj xdp sec $XDP_SECTION ) ) echo "$STATS_RULES" > installed-rules.txt -- 2.39.5