From b3919ca67a216f45d886b27658c120b7609c44a5 Mon Sep 17 00:00:00 2001 From: Dastin Wilski Date: Thu, 3 Feb 2022 09:19:01 +0000 Subject: af_xdp: change flag passed to bpf_set_link_xdp_fd Originally XDP_FLAGS_REPLACE was passed to the function. For kernels not defining this macro (for example 5.4) in if_link.h vpp sets it to 0. If kernel has this macro problem appears, replace flag requires specifying the program to be replaced. bpf_set_link_xdp_fd wraps around __bpf_set_link_xdp_fd_replace and passes 0 as old_fd, it leads to an error while assessing for replacement (if 0 is passed there is no assessing for replacement). To address this issue no flag is passed to the function, only 0. Type: improvement Signed-off-by: Dastin Wilski Change-Id: I3689ce7eb8c71c699f0e589111929979c2bbe213 --- src/plugins/af_xdp/device.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/plugins/af_xdp') diff --git a/src/plugins/af_xdp/device.c b/src/plugins/af_xdp/device.c index 87d1251c229..d107a39b199 100644 --- a/src/plugins/af_xdp/device.c +++ b/src/plugins/af_xdp/device.c @@ -212,10 +212,7 @@ af_xdp_load_program (af_xdp_create_if_args_t * args, af_xdp_device_t * ad) goto err0; } -#ifndef XDP_FLAGS_REPLACE -#define XDP_FLAGS_REPLACE 0 -#endif - if (bpf_set_link_xdp_fd (ad->linux_ifindex, fd, XDP_FLAGS_REPLACE)) + if (bpf_set_link_xdp_fd (ad->linux_ifindex, fd, 0)) { args->rv = VNET_API_ERROR_SYSCALL_ERROR_6; args->error = -- cgit 1.2.3-korg