summaryrefslogtreecommitdiff
path: root/samples/bpf/xdp_fwd_user.c
diff options
context:
space:
mode:
authorAndrii Nakryiko <andrii@kernel.org>2022-01-20 09:14:22 +0300
committerAlexei Starovoitov <ast@kernel.org>2022-01-21 08:22:02 +0300
commitd4e34bfcbe880493cabd726453b3f52715756616 (patch)
tree0765e092317f43977888061284ae78afaa9c0f65 /samples/bpf/xdp_fwd_user.c
parent544356524dd6ff5b0bb9099861ab8493a4387def (diff)
downloadlinux-d4e34bfcbe880493cabd726453b3f52715756616.tar.xz
samples/bpf: adapt samples/bpf to bpf_xdp_xxx() APIs
Use new bpf_xdp_*() APIs across all XDP-related BPF samples. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20220120061422.2710637-5-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'samples/bpf/xdp_fwd_user.c')
-rw-r--r--samples/bpf/xdp_fwd_user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/bpf/xdp_fwd_user.c b/samples/bpf/xdp_fwd_user.c
index 4ad896782f77..79ccd9891924 100644
--- a/samples/bpf/xdp_fwd_user.c
+++ b/samples/bpf/xdp_fwd_user.c
@@ -33,7 +33,7 @@ static int do_attach(int idx, int prog_fd, int map_fd, const char *name)
{
int err;
- err = bpf_set_link_xdp_fd(idx, prog_fd, xdp_flags);
+ err = bpf_xdp_attach(idx, prog_fd, xdp_flags, NULL);
if (err < 0) {
printf("ERROR: failed to attach program to %s\n", name);
return err;
@@ -51,7 +51,7 @@ static int do_detach(int idx, const char *name)
{
int err;
- err = bpf_set_link_xdp_fd(idx, -1, xdp_flags);
+ err = bpf_xdp_detach(idx, xdp_flags, NULL);
if (err < 0)
printf("ERROR: failed to detach program from %s\n", name);