From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4B6A9A0032; Fri, 24 Jun 2022 13:45:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E059B4069D; Fri, 24 Jun 2022 13:45:53 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id A7521400EF for ; Fri, 24 Jun 2022 13:45:52 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 03F9EAA; Fri, 24 Jun 2022 14:45:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 03F9EAA DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1656071152; bh=GfYRRBh/3V8Ae+Fwdp6PWvfx4hgvvsHV49LwMHjNiaU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=O0zN04mt2ihFnb/vn7xhDtii1fiR+hv/fD9k4EsnTd71r7xc3iaAqyAmTraTL+PD+ k/THWx5QnTQzvLHKe2KukQJZbzGz6D8Mm+yNAyhKyjInG6hkoF4tptnfONuv9C7w97 mlQTS9MiDrobqN6JWf3IzW6y3RCqapuvo0zkp7bw= Message-ID: Date: Fri, 24 Jun 2022 14:45:51 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] net/af_xdp: make compatible with libbpf v0.8.0 Content-Language: en-US To: Ciara Loftus , dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@xilinx.com References: <20220624102354.1516606-1-ciara.loftus@intel.com> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20220624102354.1516606-1-ciara.loftus@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 6/24/22 13:23, Ciara Loftus wrote: > libbpf v0.8.0 deprecates the bpf_get_link_xdp_id and bpf_set_link_xdp_fd > functions. Use meson to detect if libbpf >= v0.7.0 is linked and if so, use > the recommended replacement functions bpf_xdp_query_id, bpf_xdp_attach > and bpf_xdp_detach which are available to use since libbpf v0.7.0. > > Also prevent linking with libbpf versions > v0.8.0. > > Signed-off-by: Ciara Loftus > --- > doc/guides/nics/af_xdp.rst | 3 ++- > drivers/net/af_xdp/compat.h | 36 ++++++++++++++++++++++++++++- > drivers/net/af_xdp/meson.build | 7 ++---- > drivers/net/af_xdp/rte_eth_af_xdp.c | 19 +++------------ > 4 files changed, 42 insertions(+), 23 deletions(-) Don't we need to mention these changes in release notes? > > diff --git a/doc/guides/nics/af_xdp.rst b/doc/guides/nics/af_xdp.rst > index 56681c8365..9edb48df67 100644 > --- a/doc/guides/nics/af_xdp.rst > +++ b/doc/guides/nics/af_xdp.rst > @@ -43,7 +43,8 @@ Prerequisites > This is a Linux-specific PMD, thus the following prerequisites apply: > > * A Linux Kernel (version > v4.18) with XDP sockets configuration enabled; > -* Both libxdp >=v1.2.2 and libbpf libraries installed, or, libbpf <=v0.6.0 > +* Both libxdp >=v1.2.2 and libbpf <=v0.8.0 libraries installed, or, libbpf > + <=v0.6.0. > * If using libxdp, it requires an environment variable called > LIBXDP_OBJECT_PATH to be set to the location of where libxdp placed its bpf > object files. This is usually in /usr/local/lib/bpf or /usr/local/lib64/bpf. > diff --git a/drivers/net/af_xdp/compat.h b/drivers/net/af_xdp/compat.h > index 28ea64aeaa..8f4ac8b5ea 100644 > --- a/drivers/net/af_xdp/compat.h > +++ b/drivers/net/af_xdp/compat.h > @@ -60,7 +60,7 @@ tx_syscall_needed(struct xsk_ring_prod *q __rte_unused) > } > #endif > > -#ifdef RTE_NET_AF_XDP_LIBBPF_OBJ_OPEN > +#ifdef RTE_NET_AF_XDP_LIBBPF_V070 Typically version-based checks are considered as bad. Isn't it better use feature-based checks/defines?