net/af_xdp: pass cflags to appropriate build components

Message ID 20230921102923.65738-1-shibin.koikkara.reeny@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series net/af_xdp: pass cflags to appropriate build components |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation fail Compilation issues
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Koikkara Reeny, Shibin Sept. 21, 2023, 10:29 a.m. UTC
  Commit 33d66940e9ba ("build: use C11 standard") enforces
the C11 standard so some changes need to be made to the
af_xdp driver meson build to ensure that the appropriate
cflags are passed when checking if certain functions are
available in the libbpf/libxdp libraries.

Fixes: 33d66940e9ba ("build: use C11 standard")

Signed-off-by: Shibin Koikkara Reeny <shibin.koikkara.reeny@intel.com>
---
 drivers/net/af_xdp/meson.build | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Bruce Richardson Sept. 21, 2023, 10:43 a.m. UTC | #1
On Thu, Sep 21, 2023 at 10:29:23AM +0000, Shibin Koikkara Reeny wrote:
> Commit 33d66940e9ba ("build: use C11 standard") enforces
> the C11 standard so some changes need to be made to the
> af_xdp driver meson build to ensure that the appropriate
> cflags are passed when checking if certain functions are
> available in the libbpf/libxdp libraries.
> 
> Fixes: 33d66940e9ba ("build: use C11 standard")

Not sure if that is the correct offending commit, or just the commit that
exposes the already-present issue. I'd add the following also to the commit
log:

Fixes: e024c7e838fc ("net/af_xdp: avoid version-based check for shared UMEM")

That fixline would imply a possible backport though, but no issue has been
seen on versions of DPDK not using C11, so I think we skip backporting this
for now. Putting stable@dpdk.org on CC in case the LTS maintainers have
additional input.

For the code fix itself:
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> Signed-off-by: Shibin Koikkara Reeny <shibin.koikkara.reeny@intel.com>
> ---
>  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 9a8dbb4d49..3319acca65 100644
> --- a/drivers/net/af_xdp/meson.build
> +++ b/drivers/net/af_xdp/meson.build
> @@ -56,17 +56,17 @@ if build
>    '''
>  
>    if cc.has_function('xsk_socket__create_shared', prefix : xsk_check_prefix,
> -                     dependencies : ext_deps)
> +                     dependencies : ext_deps, args: cflags)
>        cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM']
>    endif
>    if cc.has_function('bpf_object__next_program',
>                       prefix : '#include <bpf/libbpf.h>',
> -                     dependencies : bpf_dep)
> +                     dependencies : bpf_dep, args: cflags)
>        cflags += ['-DRTE_NET_AF_XDP_LIBBPF_OBJ_OPEN']
>    endif
>    if cc.has_function('bpf_xdp_attach',
>                       prefix : '#include <bpf/libbpf.h>',
> -                     dependencies : bpf_dep)
> +                     dependencies : bpf_dep, args: cflags)
>        cflags += ['-DRTE_NET_AF_XDP_LIBBPF_XDP_ATTACH']
>    endif
>  endif
> -- 
> 2.25.1
>
  
Bruce Richardson Sept. 21, 2023, 10:47 a.m. UTC | #2
On Thu, Sep 21, 2023 at 10:29:23AM +0000, Shibin Koikkara Reeny wrote:
> Commit 33d66940e9ba ("build: use C11 standard") enforces
> the C11 standard so some changes need to be made to the
> af_xdp driver meson build to ensure that the appropriate
> cflags are passed when checking if certain functions are
> available in the libbpf/libxdp libraries.
> 

By way of additional follow-up.

Can you please describe the actual issue encountered in the commit log, and
how the code change fixes it.  Ideally, the commit title should also start
with "fix" and a short description of the issue. For example "fix build
with libxdp version..." or "fix compiler error when ...". Focus more on the
problem rather than the solution, since anyone looking at the commit in
future is more likely to be interested in what is solves rather than what
it does.

You can include my ack in a V2 with updated description.

/Bruce

> Fixes: 33d66940e9ba ("build: use C11 standard")
> 
> Signed-off-by: Shibin Koikkara Reeny <shibin.koikkara.reeny@intel.com>
> ---
>  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 9a8dbb4d49..3319acca65 100644
> --- a/drivers/net/af_xdp/meson.build
> +++ b/drivers/net/af_xdp/meson.build
> @@ -56,17 +56,17 @@ if build
>    '''
>  
>    if cc.has_function('xsk_socket__create_shared', prefix : xsk_check_prefix,
> -                     dependencies : ext_deps)
> +                     dependencies : ext_deps, args: cflags)
>        cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM']
>    endif
>    if cc.has_function('bpf_object__next_program',
>                       prefix : '#include <bpf/libbpf.h>',
> -                     dependencies : bpf_dep)
> +                     dependencies : bpf_dep, args: cflags)
>        cflags += ['-DRTE_NET_AF_XDP_LIBBPF_OBJ_OPEN']
>    endif
>    if cc.has_function('bpf_xdp_attach',
>                       prefix : '#include <bpf/libbpf.h>',
> -                     dependencies : bpf_dep)
> +                     dependencies : bpf_dep, args: cflags)
>        cflags += ['-DRTE_NET_AF_XDP_LIBBPF_XDP_ATTACH']
>    endif
>  endif
> -- 
> 2.25.1
>
  

Patch

diff --git a/drivers/net/af_xdp/meson.build b/drivers/net/af_xdp/meson.build
index 9a8dbb4d49..3319acca65 100644
--- a/drivers/net/af_xdp/meson.build
+++ b/drivers/net/af_xdp/meson.build
@@ -56,17 +56,17 @@  if build
   '''
 
   if cc.has_function('xsk_socket__create_shared', prefix : xsk_check_prefix,
-                     dependencies : ext_deps)
+                     dependencies : ext_deps, args: cflags)
       cflags += ['-DRTE_NET_AF_XDP_SHARED_UMEM']
   endif
   if cc.has_function('bpf_object__next_program',
                      prefix : '#include <bpf/libbpf.h>',
-                     dependencies : bpf_dep)
+                     dependencies : bpf_dep, args: cflags)
       cflags += ['-DRTE_NET_AF_XDP_LIBBPF_OBJ_OPEN']
   endif
   if cc.has_function('bpf_xdp_attach',
                      prefix : '#include <bpf/libbpf.h>',
-                     dependencies : bpf_dep)
+                     dependencies : bpf_dep, args: cflags)
       cflags += ['-DRTE_NET_AF_XDP_LIBBPF_XDP_ATTACH']
   endif
 endif