]> git.proxmox.com Git - mirror_iproute2.git/commit - ip/iplink_xdp.c
bpf: add support for generic xdp
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 28 Apr 2017 13:44:29 +0000 (15:44 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 1 May 2017 16:28:19 +0000 (09:28 -0700)
commita872b870a51135cde29e595a4782d910a9d39393
tree1d96c7eb784b7c9be0bc85f30b228c7bea0eb33f
parent7ff1fce5490b8c5c13de614529f82fd1a89b868f
bpf: add support for generic xdp

Follow-up to commit c7272ca72009 ("bpf: add initial support for
attaching xdp progs") to also support generic XDP. This adds an
indicator for loaded generic XDP programs when programs are loaded
as shown in c7272ca72009, but the driver still lacks native XDP
support.

  # ip link
  [...]
  3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 xdpgeneric qdisc [...]
      link/ether 0c:c4:7a:03:f9:25 brd ff:ff:ff:ff:ff:ff
  [...]

In case the driver does support native XDP, but the user wants
to load the program as generic XDP (e.g. for testing purposes),
then this can be done with the same semantics as in c7272ca72009,
but with 'xdpgeneric' instead of 'xdp' command for loading:

  # ip -force link set dev eno1 xdpgeneric obj xdp.o

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: David S. Miller <davem@davemloft.net>
ip/iplink.c
ip/iplink_xdp.c
ip/xdp.h
man/man8/ip-link.8.in