* [PATCH 21.11 0/2] Fix UNH CI af_xdp build errors.
@ 2022-05-06 11:03 Kevin Traynor
2022-05-06 11:03 ` [PATCH 21.11 1/2] net/af_xdp: use libxdp if available Kevin Traynor
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Kevin Traynor @ 2022-05-06 11:03 UTC (permalink / raw)
To: ciara.loftus, stable; +Cc: bluca, christian.ehrhardt, xuemingl, Kevin Traynor
UNH CI is reporting [0] build errors [1] for 21.11 branch on Arch Linux.
The cause is that libbpf 0.7.0 has been installed and now that af_xdp is
being compiled with that version there are some deprecated calls being used.
This can be fixed by taking some patches from DPDK main branch to use
libxdp.
It will be nice if we can keep it working for users who upgrade
library versions, but the most important is to not cause regressions
for users who do not.
Ciara, please let me know if you see any any issues with these patches
for 21.11 branch?
Reproduced compile failures on F35 with updated library versions without
the patches and passing when patches applied.
Compile tested on F35 with new versions:
Run-time dependency libxdp found: YES 1.2.2
Run-time dependency libbpf found: YES 0.7.0
Also compile tested for regressions on F35 with packaged versions:
Dependency libxdp found: NO found 1.1.0 but need: '>=1.2.2'
Run-time dependency libxdp found: NO (tried pkgconfig)
Run-time dependency libbpf found: YES 0.4.0
thanks,
Kevin.
[0] https://dpdkdashboard.iol.unh.edu/results/dashboard/tarballs/19678/
[1]
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:43:
../drivers/net/af_xdp/compat.h: In function ‘create_shared_socket’:
../drivers/net/af_xdp/compat.h:25:9: error: ‘xsk_socket__create_shared’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
25 | return xsk_socket__create_shared(xsk_ptr, ifname, queue_id, umem, rx,
| ^~~~~~
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:317:5: note: declared here
317 | int xsk_socket__create_shared(struct xsk_socket **xsk_ptr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘af_xdp_rx_zc’:
../drivers/net/af_xdp/rte_eth_af_xdp.c:285:25: error: ‘xsk_socket__fd’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
285 | (void)recvfrom(xsk_socket__fd(rxq->xsk), NULL, 0,
| ^
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:257:5: note: declared here
257 | int xsk_socket__fd(const struct xsk_socket *xsk);
| ^~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘kick_tx’:
../drivers/net/af_xdp/rte_eth_af_xdp.c:470:17: error: ‘xsk_socket__fd’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
470 | while (send(xsk_socket__fd(txq->pair->xsk), NULL,
| ^~~~~
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:257:5: note: declared here
257 | int xsk_socket__fd(const struct xsk_socket *xsk);
| ^~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘eth_stats_get’:
../drivers/net/af_xdp/rte_eth_af_xdp.c:819:17: error: ‘xsk_socket__fd’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
819 | ret = getsockopt(xsk_socket__fd(rxq->xsk), SOL_XDP,
| ^~~
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:257:5: note: declared here
257 | int xsk_socket__fd(const struct xsk_socket *xsk);
| ^~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘eth_dev_close’:
../drivers/net/af_xdp/rte_eth_af_xdp.c:897:17: error: ‘xsk_socket__delete’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
897 | xsk_socket__delete(rxq->xsk);
| ^~~~~~~~~~~~~~~~~~
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:330:6: note: declared here
330 | void xsk_socket__delete(struct xsk_socket *xsk);
| ^~~~~~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c:901:25: error: ‘xsk_umem__delete’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
901 | (void)xsk_umem__delete(rxq->umem->umem);
| ^
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:328:5: note: declared here
328 | int xsk_umem__delete(struct xsk_umem *umem);
| ^~~~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘xdp_umem_configure’:
../drivers/net/af_xdp/rte_eth_af_xdp.c:1064:17: error: ‘xsk_umem__create’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
1064 | ret = xsk_umem__create(&umem->umem, base_addr, umem_size,
| ^~~
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:292:5: note: declared here
292 | int xsk_umem__create(struct xsk_umem **umem,
| ^~~~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘load_custom_xdp_prog’:
../drivers/net/af_xdp/rte_eth_af_xdp.c:1156:9: error: ‘bpf_prog_load_deprecated’ is deprecated: libbpf v0.7+: use bpf_object__open() and bpf_object__load() instead [-Werror=deprecated-declarations]
1156 | ret = bpf_prog_load(prog_path, BPF_PROG_TYPE_XDP, &obj, &prog_fd);
| ^~~
In file included from /usr/include/bpf/xsk.h:20,
from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/libbpf.h:850:16: note: declared here
850 | LIBBPF_API int bpf_prog_load_deprecated(const char *file, enum bpf_prog_type type,
| ^~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘configure_preferred_busy_poll’:
../drivers/net/af_xdp/rte_eth_af_xdp.c:1192:9: error: ‘xsk_socket__fd’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
1192 | int fd = xsk_socket__fd(rxq->xsk);
| ^~~
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:257:5: note: declared here
257 | int xsk_socket__fd(const struct xsk_socket *xsk);
| ^~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘xsk_configure’:
../drivers/net/af_xdp/rte_eth_af_xdp.c:1291:17: error: ‘xsk_socket__create’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
1291 | ret = xsk_socket__create(&rxq->xsk, internals->if_name,
| ^~~
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:310:5: note: declared here
310 | int xsk_socket__create(struct xsk_socket **xsk,
| ^~~~~~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c:1304:17: error: ‘xsk_socket__fd’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
1304 | fd = xsk_socket__fd(rxq->xsk);
| ^~
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:257:5: note: declared here
257 | int xsk_socket__fd(const struct xsk_socket *xsk);
| ^~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c:1338:9: error: ‘xsk_socket__delete’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
1338 | xsk_socket__delete(rxq->xsk);
| ^~~~~~~~~~~~~~~~~~
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:330:6: note: declared here
330 | void xsk_socket__delete(struct xsk_socket *xsk);
| ^~~~~~~~~~~~~~~~~~
../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘eth_rx_queue_setup’:
../drivers/net/af_xdp/rte_eth_af_xdp.c:1390:9: error: ‘xsk_socket__fd’ is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp [-Werror=deprecated-declarations]
1390 | rxq->fds[0].fd = xsk_socket__fd(rxq->xsk);
| ^~~
In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
/usr/include/bpf/xsk.h:257:5: note: declared here
257 | int xsk_socket__fd(const struct xsk_socket *xsk);
| ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Ciara Loftus (2):
net/af_xdp: use libxdp if available
net/af_xdp: make compatible with libbpf >= 0.7.0
doc/guides/nics/af_xdp.rst | 6 ++--
drivers/net/af_xdp/compat.h | 45 ++++++++++++++++++++++++++++-
drivers/net/af_xdp/meson.build | 44 +++++++++++++++++++++++-----
drivers/net/af_xdp/rte_eth_af_xdp.c | 10 +++----
4 files changed, 87 insertions(+), 18 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 21.11 1/2] net/af_xdp: use libxdp if available
2022-05-06 11:03 [PATCH 21.11 0/2] Fix UNH CI af_xdp build errors Kevin Traynor
@ 2022-05-06 11:03 ` Kevin Traynor
2022-05-06 11:03 ` [PATCH 21.11 2/2] net/af_xdp: make compatible with libbpf >= 0.7.0 Kevin Traynor
2022-05-06 12:13 ` [PATCH 21.11 0/2] Fix UNH CI af_xdp build errors Loftus, Ciara
2 siblings, 0 replies; 5+ messages in thread
From: Kevin Traynor @ 2022-05-06 11:03 UTC (permalink / raw)
To: ciara.loftus, stable; +Cc: bluca, christian.ehrhardt, xuemingl
From: Ciara Loftus <ciara.loftus@intel.com>
[ upstream commit fa4dfda5fe9c3483944955986b60f4d536c4a8bc ]
AF_XDP support is deprecated in libbpf since v0.7.0 [1]. The libxdp library
now provides the functionality which once was in libbpf and which the
AF_XDP PMD relies on. This commit updates the AF_XDP meson build to use the
libxdp library if a version >= v1.2.2 is available. If it is not available,
only versions of libbpf prior to v0.7.0 are allowed, as they still contain
the required AF_XDP functionality.
libbpf still remains a dependency even if libxdp is present, as we use
libbpf APIs for program loading.
The minimum required kernel version for libxdp for use with AF_XDP is v5.3.
For the library to be fully-featured, a kernel v5.10 or newer is
recommended. The full compatibility information can be found in the libxdp
README.
v1.2.2 of libxdp includes an important fix required for linking with DPDK
which is why this version or greater is required. Meson uses pkg-config to
verify the version of libxdp on the system, so it is necessary that the
library is discoverable using pkg-config in order for the PMD to use it. To
verify this, you can run: pkg-config --modversion libxdp
[1] https://github.com/libbpf/libbpf/commit/277846bc6c15
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
doc/guides/nics/af_xdp.rst | 6 ++---
drivers/net/af_xdp/compat.h | 6 ++++-
drivers/net/af_xdp/meson.build | 39 +++++++++++++++++++++++------
drivers/net/af_xdp/rte_eth_af_xdp.c | 1 -
4 files changed, 39 insertions(+), 13 deletions(-)
diff --git a/doc/guides/nics/af_xdp.rst b/doc/guides/nics/af_xdp.rst
index c9d0e1ad6c..db02ea1984 100644
--- a/doc/guides/nics/af_xdp.rst
+++ b/doc/guides/nics/af_xdp.rst
@@ -44,7 +44,5 @@ This is a Linux-specific PMD, thus the following prerequisites apply:
* A Linux Kernel (version > v4.18) with XDP sockets configuration enabled;
-* libbpf (within kernel version > v5.1-rc4) with latest af_xdp support installed,
- User can install libbpf via `make install_lib` && `make install_headers` in
- <kernel src tree>/tools/lib/bpf;
+* Both libxdp >=v1.2.2 and libbpf libraries installed, or, libbpf <=v0.6.0
* A Kernel bound interface to attach to;
* For need_wakeup feature, it requires kernel version later than v5.3-rc1;
@@ -144,3 +142,3 @@ Limitations
on this feature can be found at [1].
- [1] https://lwn.net/Articles/837010/
\ No newline at end of file
+ [1] https://lwn.net/Articles/837010/
diff --git a/drivers/net/af_xdp/compat.h b/drivers/net/af_xdp/compat.h
index 3880dc7dd7..bf40c6572e 100644
--- a/drivers/net/af_xdp/compat.h
+++ b/drivers/net/af_xdp/compat.h
@@ -3,10 +3,14 @@
*/
+#ifdef RTE_NET_AF_XDP_LIBXDP
+#include <xdp/xsk.h>
+#else
#include <bpf/xsk.h>
+#endif
#include <linux/version.h>
#include <poll.h>
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE && \
- defined(RTE_LIBRTE_AF_XDP_PMD_SHARED_UMEM)
+ defined(RTE_NET_AF_XDP_SHARED_UMEM)
#define ETH_AF_XDP_SHARED_UMEM 1
#endif
diff --git a/drivers/net/af_xdp/meson.build b/drivers/net/af_xdp/meson.build
index 3ed2b29784..93e895eab9 100644
--- a/drivers/net/af_xdp/meson.build
+++ b/drivers/net/af_xdp/meson.build
@@ -10,4 +10,5 @@ endif
sources = files('rte_eth_af_xdp.c')
+xdp_dep = dependency('libxdp', version : '>=1.2.2', required: false, method: 'pkg-config')
bpf_dep = dependency('libbpf', required: false, method: 'pkg-config')
if not bpf_dep.found()
@@ -15,13 +16,37 @@ if not bpf_dep.found()
endif
-if bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('linux/if_xdp.h')
- ext_deps += bpf_dep
- bpf_ver_dep = dependency('libbpf', version : '>=0.2.0',
- required: false, method: 'pkg-config')
- if bpf_ver_dep.found()
- dpdk_conf.set('RTE_LIBRTE_AF_XDP_PMD_SHARED_UMEM', 1)
+if cc.has_header('linux/if_xdp.h')
+ if xdp_dep.found() and cc.has_header('xdp/xsk.h')
+ 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
+ else
+ build = false
+ reason = 'missing dependency, libbpf'
+ endif
+ elif bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('bpf/bpf.h')
+ # libxdp not found. Rely solely on libbpf for xsk functionality
+ # which is only available in versions <= v0.6.0.
+ bpf_ver_dep = dependency('libbpf', version : '<=0.6.0',
+ required: false, method: 'pkg-config')
+ if bpf_ver_dep.found()
+ ext_deps += bpf_dep
+ bpf_shumem_ver_dep = dependency('libbpf', version : '>=0.2.0',
+ required: false, method: 'pkg-config')
+ if bpf_shumem_ver_dep.found()
+ cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM']
+ endif
+ else
+ build = false
+ reason = 'missing dependency, "libxdp" or "libbpf <= v0.6.0"'
+ endif
+ else
+ build = false
+ reason = 'missing dependency, "libxdp" and "libbpf"'
endif
else
build = false
- reason = 'missing dependency, "libbpf"'
+ reason = 'missing header, "linux/if_xdp.h"'
endif
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 80aa55fb22..0366211243 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -17,5 +17,4 @@
#include "af_xdp_deps.h"
#include <bpf/bpf.h>
-#include <bpf/xsk.h>
#include <rte_ethdev.h>
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 21.11 2/2] net/af_xdp: make compatible with libbpf >= 0.7.0
2022-05-06 11:03 [PATCH 21.11 0/2] Fix UNH CI af_xdp build errors Kevin Traynor
2022-05-06 11:03 ` [PATCH 21.11 1/2] net/af_xdp: use libxdp if available Kevin Traynor
@ 2022-05-06 11:03 ` Kevin Traynor
2022-05-06 12:13 ` [PATCH 21.11 0/2] Fix UNH CI af_xdp build errors Loftus, Ciara
2 siblings, 0 replies; 5+ messages in thread
From: Kevin Traynor @ 2022-05-06 11:03 UTC (permalink / raw)
To: ciara.loftus, stable; +Cc: bluca, christian.ehrhardt, xuemingl
From: Ciara Loftus <ciara.loftus@intel.com>
[ upstream commit 8d3d9c72513ac116996a05700f18c10b332e7699 ]
libbpf v0.7.0 deprecates the bpf_prog_load function. Use meson to detect
if libbpf >= v0.7.0 is linked and if so, use the recommended replacement
functions bpf_object__open_file and bpf_object__load.
Signed-off-by: Ciara Loftus <ciara.loftus@intel.com>
---
drivers/net/af_xdp/compat.h | 39 +++++++++++++++++++++++++++++
drivers/net/af_xdp/meson.build | 5 ++++
drivers/net/af_xdp/rte_eth_af_xdp.c | 9 +++----
3 files changed, 48 insertions(+), 5 deletions(-)
diff --git a/drivers/net/af_xdp/compat.h b/drivers/net/af_xdp/compat.h
index bf40c6572e..28ea64aeaa 100644
--- a/drivers/net/af_xdp/compat.h
+++ b/drivers/net/af_xdp/compat.h
@@ -8,4 +8,5 @@
#include <bpf/xsk.h>
#endif
+#include <bpf/bpf.h>
#include <linux/version.h>
#include <poll.h>
@@ -59,2 +60,40 @@ tx_syscall_needed(struct xsk_ring_prod *q __rte_unused)
}
#endif
+
+#ifdef RTE_NET_AF_XDP_LIBBPF_OBJ_OPEN
+static int load_program(const char *prog_path, struct bpf_object **obj)
+{
+ struct bpf_program *prog;
+ int err;
+
+ *obj = bpf_object__open_file(prog_path, NULL);
+ err = libbpf_get_error(*obj);
+ if (err)
+ return -1;
+
+ err = bpf_object__load(*obj);
+ if (err)
+ goto out;
+
+ prog = bpf_object__next_program(*obj, NULL);
+ if (!prog)
+ goto out;
+
+ return bpf_program__fd(prog);
+
+out:
+ bpf_object__close(*obj);
+ return -1;
+}
+#else
+static int load_program(const char *prog_path, struct bpf_object **obj)
+{
+ int ret, prog_fd;
+
+ ret = bpf_prog_load(prog_path, BPF_PROG_TYPE_XDP, obj, &prog_fd);
+ if (ret)
+ return -1;
+
+ return prog_fd;
+}
+#endif
diff --git a/drivers/net/af_xdp/meson.build b/drivers/net/af_xdp/meson.build
index 93e895eab9..1e0de23705 100644
--- a/drivers/net/af_xdp/meson.build
+++ b/drivers/net/af_xdp/meson.build
@@ -23,4 +23,9 @@ if cc.has_header('linux/if_xdp.h')
ext_deps += xdp_dep
ext_deps += bpf_dep
+ bpf_ver_dep = dependency('libbpf', version : '>=0.7.0',
+ required: false, method: 'pkg-config')
+ if bpf_ver_dep.found()
+ cflags += ['-DRTE_NET_AF_XDP_LIBBPF_OBJ_OPEN']
+ endif
else
build = false
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index 0366211243..9db76d4562 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -16,5 +16,4 @@
#include <linux/sockios.h>
#include "af_xdp_deps.h"
-#include <bpf/bpf.h>
#include <rte_ethdev.h>
@@ -1150,11 +1149,11 @@ static int
load_custom_xdp_prog(const char *prog_path, int if_index, struct bpf_map **map)
{
- int ret, prog_fd = -1;
+ int ret, prog_fd;
struct bpf_object *obj;
- ret = bpf_prog_load(prog_path, BPF_PROG_TYPE_XDP, &obj, &prog_fd);
- if (ret) {
+ prog_fd = load_program(prog_path, &obj);
+ if (prog_fd < 0) {
AF_XDP_LOG(ERR, "Failed to load program %s\n", prog_path);
- return ret;
+ return -1;
}
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH 21.11 0/2] Fix UNH CI af_xdp build errors.
2022-05-06 11:03 [PATCH 21.11 0/2] Fix UNH CI af_xdp build errors Kevin Traynor
2022-05-06 11:03 ` [PATCH 21.11 1/2] net/af_xdp: use libxdp if available Kevin Traynor
2022-05-06 11:03 ` [PATCH 21.11 2/2] net/af_xdp: make compatible with libbpf >= 0.7.0 Kevin Traynor
@ 2022-05-06 12:13 ` Loftus, Ciara
2022-05-10 8:37 ` Kevin Traynor
2 siblings, 1 reply; 5+ messages in thread
From: Loftus, Ciara @ 2022-05-06 12:13 UTC (permalink / raw)
To: Kevin Traynor, stable; +Cc: bluca, christian.ehrhardt, xuemingl
>
> UNH CI is reporting [0] build errors [1] for 21.11 branch on Arch Linux.
>
> The cause is that libbpf 0.7.0 has been installed and now that af_xdp is
> being compiled with that version there are some deprecated calls being
> used.
>
> This can be fixed by taking some patches from DPDK main branch to use
> libxdp.
>
> It will be nice if we can keep it working for users who upgrade
> library versions, but the most important is to not cause regressions
> for users who do not.
>
> Ciara, please let me know if you see any any issues with these patches
> for 21.11 branch?
Hi Kevin,
The patches look good to me and I ran them through a suite of tests on my platform and all passed.
Thanks,
Ciara
>
> Reproduced compile failures on F35 with updated library versions without
> the patches and passing when patches applied.
>
> Compile tested on F35 with new versions:
> Run-time dependency libxdp found: YES 1.2.2
> Run-time dependency libbpf found: YES 0.7.0
>
> Also compile tested for regressions on F35 with packaged versions:
> Dependency libxdp found: NO found 1.1.0 but need: '>=1.2.2'
> Run-time dependency libxdp found: NO (tried pkgconfig)
> Run-time dependency libbpf found: YES 0.4.0
>
> thanks,
> Kevin.
>
> [0] https://dpdkdashboard.iol.unh.edu/results/dashboard/tarballs/19678/
> [1]
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:43:
> ../drivers/net/af_xdp/compat.h: In function ‘create_shared_socket’:
> ../drivers/net/af_xdp/compat.h:25:9: error: ‘xsk_socket__create_shared’ is
> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
> [-Werror=deprecated-declarations]
> 25 | return xsk_socket__create_shared(xsk_ptr, ifname, queue_id,
> umem, rx,
> | ^~~~~~
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:317:5: note: declared here
> 317 | int xsk_socket__create_shared(struct xsk_socket **xsk_ptr,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘af_xdp_rx_zc’:
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:285:25: error: ‘xsk_socket__fd’ is
> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
> [-Werror=deprecated-declarations]
> 285 | (void)recvfrom(xsk_socket__fd(rxq->xsk), NULL, 0,
> | ^
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:257:5: note: declared here
> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
> | ^~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘kick_tx’:
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:470:17: error: ‘xsk_socket__fd’ is
> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
> [-Werror=deprecated-declarations]
> 470 | while (send(xsk_socket__fd(txq->pair->xsk), NULL,
> | ^~~~~
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:257:5: note: declared here
> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
> | ^~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘eth_stats_get’:
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:819:17: error: ‘xsk_socket__fd’ is
> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
> [-Werror=deprecated-declarations]
> 819 | ret = getsockopt(xsk_socket__fd(rxq->xsk), SOL_XDP,
> | ^~~
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:257:5: note: declared here
> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
> | ^~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘eth_dev_close’:
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:897:17: error: ‘xsk_socket__delete’
> is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
> [-Werror=deprecated-declarations]
> 897 | xsk_socket__delete(rxq->xsk);
> | ^~~~~~~~~~~~~~~~~~
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:330:6: note: declared here
> 330 | void xsk_socket__delete(struct xsk_socket *xsk);
> | ^~~~~~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:901:25: error: ‘xsk_umem__delete’
> is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
> [-Werror=deprecated-declarations]
> 901 | (void)xsk_umem__delete(rxq->umem->umem);
> | ^
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:328:5: note: declared here
> 328 | int xsk_umem__delete(struct xsk_umem *umem);
> | ^~~~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function
> ‘xdp_umem_configure’:
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1064:17: error:
> ‘xsk_umem__create’ is deprecated: libbpf v0.7+: AF_XDP support
> deprecated and moved to libxdp [-Werror=deprecated-declarations]
> 1064 | ret = xsk_umem__create(&umem->umem, base_addr,
> umem_size,
> | ^~~
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:292:5: note: declared here
> 292 | int xsk_umem__create(struct xsk_umem **umem,
> | ^~~~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function
> ‘load_custom_xdp_prog’:
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1156:9: error:
> ‘bpf_prog_load_deprecated’ is deprecated: libbpf v0.7+: use
> bpf_object__open() and bpf_object__load() instead [-Werror=deprecated-
> declarations]
> 1156 | ret = bpf_prog_load(prog_path, BPF_PROG_TYPE_XDP, &obj,
> &prog_fd);
> | ^~~
> In file included from /usr/include/bpf/xsk.h:20,
> from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/libbpf.h:850:16: note: declared here
> 850 | LIBBPF_API int bpf_prog_load_deprecated(const char *file, enum
> bpf_prog_type type,
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function
> ‘configure_preferred_busy_poll’:
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1192:9: error: ‘xsk_socket__fd’ is
> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
> [-Werror=deprecated-declarations]
> 1192 | int fd = xsk_socket__fd(rxq->xsk);
> | ^~~
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:257:5: note: declared here
> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
> | ^~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘xsk_configure’:
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1291:17: error:
> ‘xsk_socket__create’ is deprecated: libbpf v0.7+: AF_XDP support
> deprecated and moved to libxdp [-Werror=deprecated-declarations]
> 1291 | ret = xsk_socket__create(&rxq->xsk, internals->if_name,
> | ^~~
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:310:5: note: declared here
> 310 | int xsk_socket__create(struct xsk_socket **xsk,
> | ^~~~~~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1304:17: error: ‘xsk_socket__fd’ is
> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
> [-Werror=deprecated-declarations]
> 1304 | fd = xsk_socket__fd(rxq->xsk);
> | ^~
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:257:5: note: declared here
> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
> | ^~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1338:9: error: ‘xsk_socket__delete’
> is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
> [-Werror=deprecated-declarations]
> 1338 | xsk_socket__delete(rxq->xsk);
> | ^~~~~~~~~~~~~~~~~~
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:330:6: note: declared here
> 330 | void xsk_socket__delete(struct xsk_socket *xsk);
> | ^~~~~~~~~~~~~~~~~~
> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘eth_rx_queue_setup’:
> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1390:9: error: ‘xsk_socket__fd’ is
> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
> [-Werror=deprecated-declarations]
> 1390 | rxq->fds[0].fd = xsk_socket__fd(rxq->xsk);
> | ^~~
> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
> /usr/include/bpf/xsk.h:257:5: note: declared here
> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
> | ^~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> Ciara Loftus (2):
> net/af_xdp: use libxdp if available
> net/af_xdp: make compatible with libbpf >= 0.7.0
>
> doc/guides/nics/af_xdp.rst | 6 ++--
> drivers/net/af_xdp/compat.h | 45 ++++++++++++++++++++++++++++-
> drivers/net/af_xdp/meson.build | 44 +++++++++++++++++++++++-----
> drivers/net/af_xdp/rte_eth_af_xdp.c | 10 +++----
> 4 files changed, 87 insertions(+), 18 deletions(-)
>
> --
> 2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 21.11 0/2] Fix UNH CI af_xdp build errors.
2022-05-06 12:13 ` [PATCH 21.11 0/2] Fix UNH CI af_xdp build errors Loftus, Ciara
@ 2022-05-10 8:37 ` Kevin Traynor
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Traynor @ 2022-05-10 8:37 UTC (permalink / raw)
To: Loftus, Ciara, stable; +Cc: bluca, christian.ehrhardt, xuemingl
On 06/05/2022 13:13, Loftus, Ciara wrote:
>>
>> UNH CI is reporting [0] build errors [1] for 21.11 branch on Arch Linux.
>>
>> The cause is that libbpf 0.7.0 has been installed and now that af_xdp is
>> being compiled with that version there are some deprecated calls being
>> used.
>>
>> This can be fixed by taking some patches from DPDK main branch to use
>> libxdp.
>>
>> It will be nice if we can keep it working for users who upgrade
>> library versions, but the most important is to not cause regressions
>> for users who do not.
>>
>> Ciara, please let me know if you see any any issues with these patches
>> for 21.11 branch?
>
> Hi Kevin,
>
> The patches look good to me and I ran them through a suite of tests on my platform and all passed.
>
Thanks for reviewing and testing Ciara. I have pushed to 21.11 branch.
> Thanks,
> Ciara
>
>
>>
>> Reproduced compile failures on F35 with updated library versions without
>> the patches and passing when patches applied.
>>
>> Compile tested on F35 with new versions:
>> Run-time dependency libxdp found: YES 1.2.2
>> Run-time dependency libbpf found: YES 0.7.0
>>
>> Also compile tested for regressions on F35 with packaged versions:
>> Dependency libxdp found: NO found 1.1.0 but need: '>=1.2.2'
>> Run-time dependency libxdp found: NO (tried pkgconfig)
>> Run-time dependency libbpf found: YES 0.4.0
>>
>> thanks,
>> Kevin.
>>
>> [0] https://dpdkdashboard.iol.unh.edu/results/dashboard/tarballs/19678/
>> [1]
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:43:
>> ../drivers/net/af_xdp/compat.h: In function ‘create_shared_socket’:
>> ../drivers/net/af_xdp/compat.h:25:9: error: ‘xsk_socket__create_shared’ is
>> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
>> [-Werror=deprecated-declarations]
>> 25 | return xsk_socket__create_shared(xsk_ptr, ifname, queue_id,
>> umem, rx,
>> | ^~~~~~
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:317:5: note: declared here
>> 317 | int xsk_socket__create_shared(struct xsk_socket **xsk_ptr,
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘af_xdp_rx_zc’:
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:285:25: error: ‘xsk_socket__fd’ is
>> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
>> [-Werror=deprecated-declarations]
>> 285 | (void)recvfrom(xsk_socket__fd(rxq->xsk), NULL, 0,
>> | ^
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:257:5: note: declared here
>> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
>> | ^~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘kick_tx’:
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:470:17: error: ‘xsk_socket__fd’ is
>> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
>> [-Werror=deprecated-declarations]
>> 470 | while (send(xsk_socket__fd(txq->pair->xsk), NULL,
>> | ^~~~~
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:257:5: note: declared here
>> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
>> | ^~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘eth_stats_get’:
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:819:17: error: ‘xsk_socket__fd’ is
>> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
>> [-Werror=deprecated-declarations]
>> 819 | ret = getsockopt(xsk_socket__fd(rxq->xsk), SOL_XDP,
>> | ^~~
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:257:5: note: declared here
>> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
>> | ^~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘eth_dev_close’:
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:897:17: error: ‘xsk_socket__delete’
>> is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
>> [-Werror=deprecated-declarations]
>> 897 | xsk_socket__delete(rxq->xsk);
>> | ^~~~~~~~~~~~~~~~~~
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:330:6: note: declared here
>> 330 | void xsk_socket__delete(struct xsk_socket *xsk);
>> | ^~~~~~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:901:25: error: ‘xsk_umem__delete’
>> is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
>> [-Werror=deprecated-declarations]
>> 901 | (void)xsk_umem__delete(rxq->umem->umem);
>> | ^
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:328:5: note: declared here
>> 328 | int xsk_umem__delete(struct xsk_umem *umem);
>> | ^~~~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function
>> ‘xdp_umem_configure’:
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1064:17: error:
>> ‘xsk_umem__create’ is deprecated: libbpf v0.7+: AF_XDP support
>> deprecated and moved to libxdp [-Werror=deprecated-declarations]
>> 1064 | ret = xsk_umem__create(&umem->umem, base_addr,
>> umem_size,
>> | ^~~
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:292:5: note: declared here
>> 292 | int xsk_umem__create(struct xsk_umem **umem,
>> | ^~~~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function
>> ‘load_custom_xdp_prog’:
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1156:9: error:
>> ‘bpf_prog_load_deprecated’ is deprecated: libbpf v0.7+: use
>> bpf_object__open() and bpf_object__load() instead [-Werror=deprecated-
>> declarations]
>> 1156 | ret = bpf_prog_load(prog_path, BPF_PROG_TYPE_XDP, &obj,
>> &prog_fd);
>> | ^~~
>> In file included from /usr/include/bpf/xsk.h:20,
>> from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/libbpf.h:850:16: note: declared here
>> 850 | LIBBPF_API int bpf_prog_load_deprecated(const char *file, enum
>> bpf_prog_type type,
>> | ^~~~~~~~~~~~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function
>> ‘configure_preferred_busy_poll’:
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1192:9: error: ‘xsk_socket__fd’ is
>> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
>> [-Werror=deprecated-declarations]
>> 1192 | int fd = xsk_socket__fd(rxq->xsk);
>> | ^~~
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:257:5: note: declared here
>> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
>> | ^~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘xsk_configure’:
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1291:17: error:
>> ‘xsk_socket__create’ is deprecated: libbpf v0.7+: AF_XDP support
>> deprecated and moved to libxdp [-Werror=deprecated-declarations]
>> 1291 | ret = xsk_socket__create(&rxq->xsk, internals->if_name,
>> | ^~~
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:310:5: note: declared here
>> 310 | int xsk_socket__create(struct xsk_socket **xsk,
>> | ^~~~~~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1304:17: error: ‘xsk_socket__fd’ is
>> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
>> [-Werror=deprecated-declarations]
>> 1304 | fd = xsk_socket__fd(rxq->xsk);
>> | ^~
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:257:5: note: declared here
>> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
>> | ^~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1338:9: error: ‘xsk_socket__delete’
>> is deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
>> [-Werror=deprecated-declarations]
>> 1338 | xsk_socket__delete(rxq->xsk);
>> | ^~~~~~~~~~~~~~~~~~
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:330:6: note: declared here
>> 330 | void xsk_socket__delete(struct xsk_socket *xsk);
>> | ^~~~~~~~~~~~~~~~~~
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c: In function ‘eth_rx_queue_setup’:
>> ../drivers/net/af_xdp/rte_eth_af_xdp.c:1390:9: error: ‘xsk_socket__fd’ is
>> deprecated: libbpf v0.7+: AF_XDP support deprecated and moved to libxdp
>> [-Werror=deprecated-declarations]
>> 1390 | rxq->fds[0].fd = xsk_socket__fd(rxq->xsk);
>> | ^~~
>> In file included from ../drivers/net/af_xdp/rte_eth_af_xdp.c:19:
>> /usr/include/bpf/xsk.h:257:5: note: declared here
>> 257 | int xsk_socket__fd(const struct xsk_socket *xsk);
>> | ^~~~~~~~~~~~~~
>> cc1: all warnings being treated as errors
>>
>> Ciara Loftus (2):
>> net/af_xdp: use libxdp if available
>> net/af_xdp: make compatible with libbpf >= 0.7.0
>>
>> doc/guides/nics/af_xdp.rst | 6 ++--
>> drivers/net/af_xdp/compat.h | 45 ++++++++++++++++++++++++++++-
>> drivers/net/af_xdp/meson.build | 44 +++++++++++++++++++++++-----
>> drivers/net/af_xdp/rte_eth_af_xdp.c | 10 +++----
>> 4 files changed, 87 insertions(+), 18 deletions(-)
>>
>> --
>> 2.34.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-10 8:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06 11:03 [PATCH 21.11 0/2] Fix UNH CI af_xdp build errors Kevin Traynor
2022-05-06 11:03 ` [PATCH 21.11 1/2] net/af_xdp: use libxdp if available Kevin Traynor
2022-05-06 11:03 ` [PATCH 21.11 2/2] net/af_xdp: make compatible with libbpf >= 0.7.0 Kevin Traynor
2022-05-06 12:13 ` [PATCH 21.11 0/2] Fix UNH CI af_xdp build errors Loftus, Ciara
2022-05-10 8:37 ` Kevin Traynor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).