projects
/
flowspec-xdp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b2597a1
)
Print diagnostics about install location
author
Matt Corallo
<git@bluematt.me>
Sun, 4 Apr 2021 17:15:06 +0000
(13:15 -0400)
committer
Matt Corallo
<git@bluematt.me>
Sun, 4 Apr 2021 17:16:59 +0000
(13:16 -0400)
install.sh
patch
|
blob
|
history
diff --git
a/install.sh
b/install.sh
index d93664c4146c92015f0d6b07b40e5a6e3467fd34..be3ead3d23e9b59f01ea2bd71fa768c2827f9ffd 100755
(executable)
--- a/
install.sh
+++ b/
install.sh
@@
-5,7
+5,7
@@
RULES="$(birdc show route table flowspec4)
$(birdc show route table flowspec6)"
echo "$RULES" | ./genrules.py --8021q=drop-vlan --v6frag=ignore-parse-if-rule --ihl=drop-options
$(birdc show route table flowspec6)"
echo "$RULES" | ./genrules.py --8021q=drop-vlan --v6frag=ignore-parse-if-rule --ihl=drop-options
-clang -std=c99 -pedantic -Wall -Wextra -Wno-pointer-arith -Wno-unused-variable -O
s -emit-llvm -c xdp.c -o - | llc
-march=bpf -filetype=obj -o xdp
+clang -std=c99 -pedantic -Wall -Wextra -Wno-pointer-arith -Wno-unused-variable -O
3 -emit-llvm -c xdp.c -o - | llc -O3
-march=bpf -filetype=obj -o xdp
echo "Before unload drop count was:"
./dropcount.sh || echo "Not loaded"
echo "Before unload drop count was:"
./dropcount.sh || echo "Not loaded"
@@
-13,4
+13,8
@@
echo "Before unload drop count was:"
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" 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" xdp obj xdp sec xdp_drop || ip link set "$1" xdpgeneric obj xdp sec xdp_drop
+ip link set "$1" xdpoffload obj xdp sec xdp_drop || (
+ echo "Failed to install in NIC, testing in driver..." && ip link set "$1" xdpdrv obj xdp sec xdp_drop || (
+ echo "Failed to install in driver, using generic..." && ip link set "$1" xdpgeneric obj xdp sec xdp_drop
+ )
+)