[PATCH v4 1/6] net/af_xdp: move XDP library presence flag to right branch

Andrew Rybchenko andrew.rybchenko at oktetlabs.ru
Thu Oct 6 08:26:49 CEST 2022


RTE_NET_AF_XDP_LIBXDP is a conditional to include xdp/xsk.h and should
be set as soon as we know that the header is present.
RTE_NET_AF_XDP_SHARED_UMEM is one of conditions to use
xsk_socket__create_shared().
Both do not depend on libbpf and bpf/bpf.h presence.

Since else branch below returns error, there is no functional changes,
just style which will help on further rework.

Signed-off-by: Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>
---
 drivers/net/af_xdp/meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/af_xdp/meson.build b/drivers/net/af_xdp/meson.build
index 1e0de23705..882d0b9518 100644
--- a/drivers/net/af_xdp/meson.build
+++ b/drivers/net/af_xdp/meson.build
@@ -17,10 +17,10 @@ endif
 
 if cc.has_header('linux/if_xdp.h')
     if xdp_dep.found() and cc.has_header('xdp/xsk.h')
+        cflags += ['-DRTE_NET_AF_XDP_LIBXDP']
+        cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM']
+        ext_deps += xdp_dep
         if bpf_dep.found() and cc.has_header('bpf/bpf.h')
-            cflags += ['-DRTE_NET_AF_XDP_LIBXDP']
-            cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM']
-            ext_deps += xdp_dep
             ext_deps += bpf_dep
             bpf_ver_dep = dependency('libbpf', version : '>=0.7.0',
                                  required: false, method: 'pkg-config')
-- 
2.30.2



More information about the dev mailing list