Stop dumping match count before update, users can get it if they want
[flowspec-xdp] / install.sh
index 8106defcede58a12000699055160daf35c3e5856..1371807cd7fdf0fffcde963e5027ee9aba792b1a 100755 (executable)
@@ -21,20 +21,15 @@ STATS_RULES="$(echo "$RULES" | ./genrules.py --8021q=drop-vlan --v6frag=ignore-p
 clang $CLANG_ARGS -g -std=c99 -pedantic -Wall -Wextra -Wno-pointer-arith -Wno-unused-variable -Wno-unused-function -O3 -emit-llvm -c xdp.c -o xdp.bc
 if [ "$2" != "" ]; then
        clang $4 -g -std=c99 -pedantic -Wall -Wextra -Wno-pointer-arith -O3 -emit-llvm -c "$2" -o wrapper.bc
-       llvm-link xdp.bc wrapper.bc | llc -O3 -march=bpf -filetype=obj -o xdp
+       llvm-link xdp.bc wrapper.bc | llc -O3 -march=bpf -mcpu=probe -filetype=obj -o xdp
 else
-       cat xdp.bc | llc -O3 -march=bpf -filetype=obj -o xdp
+       cat xdp.bc | llc -O3 -march=bpf -mcpu=probe -filetype=obj -o xdp
 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