On 10/7/2022 6:19 PM, Ferruh Yigit wrote:
On 10/6/2022 7:26 AM, Andrew Rybchenko wrote:
From: Ciara Loftus <ciara.lof...@intel.com>

libbpf v0.8.0 deprecates the bpf_get_link_xdp_id() and
bpf_set_link_xdp_fd() functions. Use meson to detect if
bpf_xdp_attach() is available and if so, use the recommended
replacement functions bpf_xdp_query_id(), bpf_xdp_attach()
and bpf_xdp_detach().

Signed-off-by: Ciara Loftus <ciara.lof...@intel.com>
Signed-off-by: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru>

<...>

diff --git a/drivers/net/af_xdp/meson.build b/drivers/net/af_xdp/meson.build
index 9d5ffab96b..858047989e 100644
--- a/drivers/net/af_xdp/meson.build
+++ b/drivers/net/af_xdp/meson.build
@@ -64,4 +64,9 @@ if build
                       dependencies : bpf_dep)
        cflags += ['-DRTE_NET_AF_XDP_LIBBPF_OBJ_OPEN']
    endif
+  if cc.has_function('bpf_xdp_attach',
+                     prefix : '#include <bpf/libbpf.h>',
+                     dependencies : bpf_dep)
+      cflags += ['-DRTE_NET_AF_XDP_LIBBPF_XDP_ATTACH']
+  endif

meson is not detecting functions, I am getting following log, any idea what is going wrong:

Run-time dependency libxdp found: YES 1.2.2
Run-time dependency libbpf found: YES 0.8.1
Has header "linux/if_xdp.h" : YES
Has header "xdp/xsk.h" : YES
Has header "bpf/bpf.h" : YES
Checking for function "xsk_socket__create_shared" with dependencies libxdp, libbpf: NO
Checking for function "bpf_object__next_program" with dependency libbpf: NO
Checking for function "bpf_xdp_attach" with dependency libbpf: NO


It is OK, this was my environment issue, libbpf.so permission was wrong although I compile and installed from source, anyway latest log:

Run-time dependency libxdp found: YES 1.2.2
Run-time dependency libbpf found: YES 0.8.1
Has header "linux/if_xdp.h" : YES
Has header "xdp/xsk.h" : YES
Has header "bpf/bpf.h" : YES
Checking for function "xsk_socket__create_shared" with dependencies libxdp, libbpf: YES Checking for function "bpf_object__next_program" with dependency libbpf: YES
Checking for function "bpf_xdp_attach" with dependency libbpf: YES

Reply via email to