Skip to content

Commit

Permalink
Add support for driver/native mode (iovisor#3574)
Browse files Browse the repository at this point in the history
Add support for driver/native mode in example xdp_drop_count.py.
  • Loading branch information
chendotjs authored Aug 13, 2021
1 parent 04893e3 commit b96ab53
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/networking/xdp/xdp_drop_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
def usage():
print("Usage: {0} [-S] <ifdev>".format(sys.argv[0]))
print(" -S: use skb mode\n")
print(" -D: use driver mode\n")
print(" -H: use hardware offload mode\n")
print("e.g.: {0} eth0\n".format(sys.argv[0]))
exit(1)
Expand All @@ -34,6 +35,9 @@ def usage():
if "-S" in sys.argv:
# XDP_FLAGS_SKB_MODE
flags |= BPF.XDP_FLAGS_SKB_MODE
if "-D" in sys.argv:
# XDP_FLAGS_DRV_MODE
flags |= BPF.XDP_FLAGS_DRV_MODE
if "-H" in sys.argv:
# XDP_FLAGS_HW_MODE
maptype = "array"
Expand Down

0 comments on commit b96ab53

Please sign in to comment.