OSDN Git Service

tools: bpftool: add net attach command to attach XDP on interface
authorDaniel T. Lee <danieltimlee@gmail.com>
Tue, 13 Aug 2019 02:46:18 +0000 (11:46 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 16 Aug 2019 00:00:33 +0000 (17:00 -0700)
commit04949ccc273e14d28aa004ac6954af0898ca3d12
treed7e65df295666cfa337b89056ded967d6fb9e96e
parenta9436dca115d121d98e0b30f078f3294ce13fa18
tools: bpftool: add net attach command to attach XDP on interface

By this commit, using `bpftool net attach`, user can attach XDP prog on
interface. New type of enum 'net_attach_type' has been made, as stat ted at
cover-letter, the meaning of 'attach' is, prog will be attached on interface.

With 'overwrite' option at argument, attached XDP program could be replaced.
Added new helper 'net_parse_dev' to parse the network device at argument.

BPF prog will be attached through libbpf 'bpf_set_link_xdp_fd'.

Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/net.c