bpf, xdp: Extract common XDP program attachment logic
authorAndrii Nakryiko <andriin@fb.com>
Wed, 22 Jul 2020 06:45:56 +0000 (23:45 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 26 Jul 2020 03:37:02 +0000 (20:37 -0700)
commitd4baa9368a5e4d694e787e0442ddd6ab95d6fd96
tree1bb6e81dd5b28c224b1f28ee9817f0779971f3a1
parent7f0a838254bdd9114b978ef2541a6ce330307e9e
bpf, xdp: Extract common XDP program attachment logic

Further refactor XDP attachment code. dev_change_xdp_fd() is split into two
parts: getting bpf_progs from FDs and attachment logic, working with
bpf_progs. This makes attachment  logic a bit more straightforward and
prepares code for bpf_xdp_link inclusion, which will share the common logic.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200722064603.3350758-4-andriin@fb.com
net/core/dev.c