All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
To: "Loftus, Ciara" <ciara.loftus@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "thomas@monjalon.net" <thomas@monjalon.net>,
	"ferruh.yigit@xilinx.com" <ferruh.yigit@xilinx.com>
Subject: Re: [PATCH] net/af_xdp: make compatible with libbpf v0.8.0
Date: Mon, 27 Jun 2022 17:50:29 +0300	[thread overview]
Message-ID: <de7ad265-5376-ecfa-6eaf-bd67a98db8d5@oktetlabs.ru> (raw)
In-Reply-To: <MW4PR11MB587299B7CA012181CFEC827A8EB99@MW4PR11MB5872.namprd11.prod.outlook.com>

On 6/27/22 17:17, Loftus, Ciara wrote:
>>
>> 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 <ciara.loftus@intel.com>
>>> ---
>>>    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?
> 
> Hi Andrew,
> 
> Thank you for the feedback. Is the feature-based checking something that we can push to the next release?
> 
> We are already using the pkg-config version-check method for other libraries/features in the meson.build file:
> * libxdp >= v1.2.2 # earliest compatible libxdp release
> * libbpf >= v0.7.0 # bpf_object__* functions
> * libbpf >= v0.2.0 # shared umem feature
> 
> If we change to your suggested method I think we should change them all in one patch. IMO it's probably too close to the release to change them all right now. What do you think?
> 
> Thanks,
> Ciara

Hi Ciara,

yes, ideally we should avoid usage of version-based check everywhere,
but I don't think that it is critical to switch at once. We can use it
for new checks right now and rewrite old/existing checks a bit later in
the next release.

Please, note that my notes are related to review notes from Thomas who
asked by file_library() method is removed. Yes, it is confusing and it
is better to avoid it. Usage of feature-based checks would allow to
preserve find_library() as well.

Andrew.


  reply	other threads:[~2022-06-27 14:50 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 10:23 [PATCH] net/af_xdp: make compatible with libbpf v0.8.0 Ciara Loftus
2022-06-24 11:45 ` Andrew Rybchenko
2022-06-27 14:17   ` Loftus, Ciara
2022-06-27 14:50     ` Andrew Rybchenko [this message]
2022-06-27 15:24       ` Loftus, Ciara
2022-06-28  9:15         ` Andrew Rybchenko
2022-06-28 10:07           ` Loftus, Ciara
2022-07-21 12:16             ` Loftus, Ciara
2022-06-28 12:18 ` [PATCH v2] " Ciara Loftus
2022-10-05  9:50 ` [PATCH v3 0/6] " Andrew Rybchenko
2022-10-05  9:50   ` [PATCH v3] mempool: fix get objects from mempool with cache Andrew Rybchenko
2022-10-05  9:56     ` Andrew Rybchenko
2022-10-05  9:50   ` [PATCH v3 1/6] net/af_xdp: move XDP library presence flag to right branch Andrew Rybchenko
2022-10-05  9:50   ` [PATCH v3 2/6] net/af_xdp: make it clear which libxdp version is required Andrew Rybchenko
2022-10-05  9:50   ` [PATCH v3 3/6] net/af_xdp: avoid version-based check for shared UMEM Andrew Rybchenko
2022-10-05  9:50   ` [PATCH v3 4/6] net/af_xdp: avoid version-based check for program load mech Andrew Rybchenko
2022-10-05  9:50   ` [PATCH v3 5/6] net/af_xdp: log errors on XDP program removal failures Andrew Rybchenko
2022-10-05  9:50   ` [PATCH v3 6/6] net/af_xdp: make compatible with libbpf v0.8.0 Andrew Rybchenko
2022-10-06  6:26 ` [PATCH v4 0/6] " Andrew Rybchenko
2022-10-06  6:26   ` [PATCH v4 1/6] net/af_xdp: move XDP library presence flag to right branch Andrew Rybchenko
2022-10-06  6:26   ` [PATCH v4 2/6] net/af_xdp: make it clear which libxdp version is required Andrew Rybchenko
2022-10-06  6:26   ` [PATCH v4 3/6] net/af_xdp: avoid version-based check for shared UMEM Andrew Rybchenko
2022-10-06  6:26   ` [PATCH v4 4/6] net/af_xdp: avoid version-based check for program load mech Andrew Rybchenko
2022-10-06  6:26   ` [PATCH v4 5/6] net/af_xdp: log errors on XDP program removal failures Andrew Rybchenko
2022-10-06  6:26   ` [PATCH v4 6/6] net/af_xdp: make compatible with libbpf v0.8.0 Andrew Rybchenko
2022-10-07 17:19     ` Ferruh Yigit
2022-10-07 17:28       ` Ferruh Yigit
2022-10-07 17:40   ` [PATCH v4 0/6] " Ferruh Yigit
2022-12-20 14:05 ` [PATCH] " Kevin Traynor
2022-12-21  6:09   ` Andrew Rybchenko
2022-12-21  9:28     ` Kevin Traynor
2023-03-15 11:47       ` Kevin Traynor
2023-03-16 13:31         ` Kevin Traynor
2023-03-23 10:23           ` Kevin Traynor
2023-04-04 15:51       ` Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=de7ad265-5376-ecfa-6eaf-bd67a98db8d5@oktetlabs.ru \
    --to=andrew.rybchenko@oktetlabs.ru \
    --cc=ciara.loftus@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@xilinx.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.