Use a single command to install xdp instead of remove+add
authorMatt Corallo <git@bluematt.me>
Sat, 23 Oct 2021 19:53:46 +0000 (19:53 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 28 Oct 2021 01:34:22 +0000 (01:34 +0000)
install.sh

index 8106defcede58a12000699055160daf35c3e5856..b791d8ee5c0b98c692e14e9102cecd149b3b8a04 100755 (executable)
@@ -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