patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] drivers: skip build of sub-libs not supporting IOVA mode
@ 2023-02-19 11:55 Thomas Monjalon
  2023-03-02 13:52 ` Zhang, Qi Z
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Thomas Monjalon @ 2023-02-19 11:55 UTC (permalink / raw)
  To: dev
  Cc: David Marchand, Bruce Richardson, Qi Zhang, stable, Jingjing Wu,
	Beilei Xing, Timothy McDaniel, Ajit Khaparde, Somnath Kotur,
	John Daley, Hyong Youb Kim, Dongdong Liu, Yisen Zhuang,
	Yuying Zhang, Maxime Coquelin, Chenbo Xia, Shijith Thotton,
	Olivier Matz

If IOVA as PA is disabled and the driver does not support IOVA as VA,
the build of the driver was disabled.
Unfortunately some drivers were building some sub-libraries
(with specific options for vector paths) which were not disabled.

The build parsing of those drivers need to be skipped earlier
to avoid defining the sub-libraries.

Fixes: a986c2b7973d ("build: add option to configure IOVA mode as PA")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/common/idpf/meson.build | 4 ++++
 drivers/event/dlb2/meson.build  | 5 ++++-
 drivers/meson.build             | 4 ++--
 drivers/net/bnxt/meson.build    | 4 ++++
 drivers/net/enic/meson.build    | 4 ++++
 drivers/net/hns3/meson.build    | 4 +---
 drivers/net/i40e/meson.build    | 4 ++++
 drivers/net/iavf/meson.build    | 3 +++
 drivers/net/virtio/meson.build  | 4 ++++
 9 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/drivers/common/idpf/meson.build b/drivers/common/idpf/meson.build
index 58059ef443..74c0e92cac 100644
--- a/drivers/common/idpf/meson.build
+++ b/drivers/common/idpf/meson.build
@@ -1,6 +1,10 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2022 Intel Corporation
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 deps += ['mbuf']
 
 sources = files(
diff --git a/drivers/event/dlb2/meson.build b/drivers/event/dlb2/meson.build
index a2e60273c5..8ae7db0011 100644
--- a/drivers/event/dlb2/meson.build
+++ b/drivers/event/dlb2/meson.build
@@ -1,4 +1,3 @@
-
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019-2020 Intel Corporation
 
@@ -8,6 +7,10 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86_64')
         subdir_done()
 endif
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 sources = files(
         'dlb2.c',
         'dlb2_iface.c',
diff --git a/drivers/meson.build b/drivers/meson.build
index 0618c31a69..9c10e2633d 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -127,9 +127,9 @@ foreach subpath:subdirs
             # pull in driver directory which should update all the local variables
             subdir(drv_path)
 
-            if dpdk_conf.get('RTE_IOVA_AS_PA') == 0 and not pmd_supports_disable_iova_as_pa and not always_enable.contains(drv_path)
+            if not get_option('enable_iova_as_pa') and not pmd_supports_disable_iova_as_pa and not always_enable.contains(drv_path)
                 build = false
-                reason = 'driver does not support disabling IOVA as PA mode'
+                reason = 'IOVA as VA not supported'
             endif
 
             # get dependency objs from strings
diff --git a/drivers/net/bnxt/meson.build b/drivers/net/bnxt/meson.build
index 09d494e90f..c9ca09089a 100644
--- a/drivers/net/bnxt/meson.build
+++ b/drivers/net/bnxt/meson.build
@@ -8,6 +8,10 @@ if is_windows
     subdir_done()
 endif
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 headers = files('rte_pmd_bnxt.h')
 cflags_options = [
         '-DSUPPORT_CFA_HW_ALL=1',
diff --git a/drivers/net/enic/meson.build b/drivers/net/enic/meson.build
index 7131a25f09..f1f7f5432a 100644
--- a/drivers/net/enic/meson.build
+++ b/drivers/net/enic/meson.build
@@ -7,6 +7,10 @@ if is_windows
     subdir_done()
 endif
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 sources = files(
         'base/vnic_cq.c',
         'base/vnic_dev.c',
diff --git a/drivers/net/hns3/meson.build b/drivers/net/hns3/meson.build
index e1a5afa2ec..743fae9db7 100644
--- a/drivers/net/hns3/meson.build
+++ b/drivers/net/hns3/meson.build
@@ -13,9 +13,7 @@ if arch_subdir != 'x86' and arch_subdir != 'arm' or not dpdk_conf.get('RTE_ARCH_
     subdir_done()
 endif
 
-if dpdk_conf.get('RTE_IOVA_AS_PA') == 0
-    build = false
-    reason = 'driver does not support disabling IOVA as PA mode'
+if not get_option('enable_iova_as_pa')
     subdir_done()
 endif
 
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index e00c1a9ef9..689606a1de 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -13,6 +13,10 @@ if arch_subdir == 'riscv'
     subdir_done()
 endif
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 cflags += ['-DPF_DRIVER',
     '-DVF_DRIVER',
     '-DINTEGRATED_VF',
diff --git a/drivers/net/iavf/meson.build b/drivers/net/iavf/meson.build
index 6df771f917..c95503adda 100644
--- a/drivers/net/iavf/meson.build
+++ b/drivers/net/iavf/meson.build
@@ -1,6 +1,9 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
 
 cflags += ['-Wno-strict-aliasing']
 
diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
index 0ffd77024e..b8ba1807fa 100644
--- a/drivers/net/virtio/meson.build
+++ b/drivers/net/virtio/meson.build
@@ -7,6 +7,10 @@ if is_windows
     subdir_done()
 endif
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 sources += files(
         'virtio.c',
         'virtio_cvq.c',
-- 
2.39.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] drivers: skip build of sub-libs not supporting IOVA mode
  2023-02-19 11:55 [PATCH] drivers: skip build of sub-libs not supporting IOVA mode Thomas Monjalon
@ 2023-03-02 13:52 ` Zhang, Qi Z
  2023-03-02 13:57   ` Thomas Monjalon
  2023-03-02 14:26 ` Morten Brørup
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Zhang, Qi Z @ 2023-03-02 13:52 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: David Marchand, Richardson, Bruce, stable, Wu, Jingjing, Xing,
	Beilei, McDaniel, Timothy, Ajit Khaparde, Somnath Kotur, Daley,
	John, Hyong Youb Kim, Dongdong Liu, Yisen Zhuang, Zhang, Yuying,
	Maxime Coquelin, Xia, Chenbo, Shijith Thotton, Matz, Olivier



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Sunday, February 19, 2023 7:55 PM
> To: dev@dpdk.org
> Cc: David Marchand <david.marchand@redhat.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> stable@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>; McDaniel, Timothy <timothy.mcdaniel@intel.com>;
> Ajit Khaparde <ajit.khaparde@broadcom.com>; Somnath Kotur
> <somnath.kotur@broadcom.com>; Daley, John <johndale@cisco.com>;
> Hyong Youb Kim <hyonkim@cisco.com>; Dongdong Liu
> <liudongdong3@huawei.com>; Yisen Zhuang <yisen.zhuang@huawei.com>;
> Zhang, Yuying <yuying.zhang@intel.com>; Maxime Coquelin
> <maxime.coquelin@redhat.com>; Xia, Chenbo <chenbo.xia@intel.com>;
> Shijith Thotton <sthotton@marvell.com>; Matz, Olivier
> <olivier.matz@6wind.com>
> Subject: [PATCH] drivers: skip build of sub-libs not supporting IOVA mode
> 
> If IOVA as PA is disabled and the driver does not support IOVA as VA, the
> build of the driver was disabled.
> Unfortunately some drivers were building some sub-libraries (with specific
> options for vector paths) which were not disabled.
> 
> The build parsing of those drivers need to be skipped earlier to avoid
> defining the sub-libraries.
> 
> Fixes: a986c2b7973d ("build: add option to configure IOVA mode as PA")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  drivers/common/idpf/meson.build | 4 ++++
> drivers/event/dlb2/meson.build  | 5 ++++-
>  drivers/meson.build             | 4 ++--
>  drivers/net/bnxt/meson.build    | 4 ++++
>  drivers/net/enic/meson.build    | 4 ++++
>  drivers/net/hns3/meson.build    | 4 +---
>  drivers/net/i40e/meson.build    | 4 ++++
>  drivers/net/iavf/meson.build    | 3 +++
>  drivers/net/virtio/meson.build  | 4 ++++
>  9 files changed, 30 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/common/idpf/meson.build
> b/drivers/common/idpf/meson.build index 58059ef443..74c0e92cac 100644
> --- a/drivers/common/idpf/meson.build
> +++ b/drivers/common/idpf/meson.build
> @@ -1,6 +1,10 @@
>  # SPDX-License-Identifier: BSD-3-Clause  # Copyright(c) 2022 Intel
> Corporation
> 
> +if not get_option('enable_iova_as_pa')
> +    subdir_done()
> +endif


> +
>  deps += ['mbuf']
> 
>  sources = files(
> diff --git a/drivers/event/dlb2/meson.build
> b/drivers/event/dlb2/meson.build index a2e60273c5..8ae7db0011 100644
> --- a/drivers/event/dlb2/meson.build
> +++ b/drivers/event/dlb2/meson.build
> @@ -1,4 +1,3 @@
> -
>  # SPDX-License-Identifier: BSD-3-Clause  # Copyright(c) 2019-2020 Intel
> Corporation
> 
> @@ -8,6 +7,10 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86_64')
>          subdir_done()
>  endif
> 
> +if not get_option('enable_iova_as_pa')
> +    subdir_done()
> +endif
> +
>  sources = files(
>          'dlb2.c',
>          'dlb2_iface.c',
> diff --git a/drivers/meson.build b/drivers/meson.build index
> 0618c31a69..9c10e2633d 100644
> --- a/drivers/meson.build
> +++ b/drivers/meson.build
> @@ -127,9 +127,9 @@ foreach subpath:subdirs
>              # pull in driver directory which should update all the local variables
>              subdir(drv_path)
> 
> -            if dpdk_conf.get('RTE_IOVA_AS_PA') == 0 and not
> pmd_supports_disable_iova_as_pa and not
> always_enable.contains(drv_path)
> +            if not get_option('enable_iova_as_pa') and not
> + pmd_supports_disable_iova_as_pa and not
> + always_enable.contains(drv_path)
>                  build = false
> -                reason = 'driver does not support disabling IOVA as PA mode'
> +                reason = 'IOVA as VA not supported'
>              endif

If we check enable_iova_as_pa for each unsupported driver , do we still need "pmd_supports_disable_iova_as_pa"?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drivers: skip build of sub-libs not supporting IOVA mode
  2023-03-02 13:52 ` Zhang, Qi Z
@ 2023-03-02 13:57   ` Thomas Monjalon
  2023-03-02 14:16     ` Zhang, Qi Z
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas Monjalon @ 2023-03-02 13:57 UTC (permalink / raw)
  To: Zhang, Qi Z
  Cc: dev, David Marchand, Richardson, Bruce, stable, Wu, Jingjing,
	Xing, Beilei, McDaniel, Timothy, Ajit Khaparde, Somnath Kotur,
	Daley, John, Hyong Youb Kim, Dongdong Liu, Yisen Zhuang, Zhang,
	Yuying, Maxime Coquelin, Xia, Chenbo, Shijith Thotton, Matz,
	Olivier

02/03/2023 14:52, Zhang, Qi Z:
> From: Thomas Monjalon <thomas@monjalon.net>
> > If IOVA as PA is disabled and the driver does not support IOVA as VA, the
> > build of the driver was disabled.
> > Unfortunately some drivers were building some sub-libraries (with specific
> > options for vector paths) which were not disabled.
> > 
> > The build parsing of those drivers need to be skipped earlier to avoid
> > defining the sub-libraries.
> > 
> > Fixes: a986c2b7973d ("build: add option to configure IOVA mode as PA")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
[...]
> > --- a/drivers/meson.build
> > +++ b/drivers/meson.build
> > @@ -127,9 +127,9 @@ foreach subpath:subdirs
> >              # pull in driver directory which should update all the local variables
> >              subdir(drv_path)
> > 
> > -            if dpdk_conf.get('RTE_IOVA_AS_PA') == 0 and not
> > pmd_supports_disable_iova_as_pa and not
> > always_enable.contains(drv_path)
> > +            if not get_option('enable_iova_as_pa') and not
> > + pmd_supports_disable_iova_as_pa and not
> > + always_enable.contains(drv_path)
> >                  build = false
> > -                reason = 'driver does not support disabling IOVA as PA mode'
> > +                reason = 'IOVA as VA not supported'
> >              endif
> 
> If we check enable_iova_as_pa for each unsupported driver , do we still need "pmd_supports_disable_iova_as_pa"?

They are a bit redundant.
The idea is to use pmd_supports_disable_iova_as_pa (could be renamed)
as it is simpler to use.
But in the case of drivers having sub-libs (always enabled),
we need an extra check of enable_iova_as_pa inside the driver file.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] drivers: skip build of sub-libs not supporting IOVA mode
  2023-03-02 13:57   ` Thomas Monjalon
@ 2023-03-02 14:16     ` Zhang, Qi Z
  2023-03-03 14:23       ` Thomas Monjalon
  0 siblings, 1 reply; 9+ messages in thread
From: Zhang, Qi Z @ 2023-03-02 14:16 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, David Marchand, Richardson, Bruce, stable, Wu, Jingjing,
	Xing, Beilei, McDaniel, Timothy, Ajit Khaparde, Somnath Kotur,
	Daley, John, Hyong Youb Kim, Dongdong Liu, Yisen Zhuang, Zhang,
	Yuying, Maxime Coquelin, Xia, Chenbo, Shijith Thotton, Matz,
	Olivier



> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Thursday, March 2, 2023 9:58 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; David Marchand <david.marchand@redhat.com>;
> Richardson, Bruce <bruce.richardson@intel.com>; stable@dpdk.org; Wu,
> Jingjing <jingjing.wu@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> McDaniel, Timothy <timothy.mcdaniel@intel.com>; Ajit Khaparde
> <ajit.khaparde@broadcom.com>; Somnath Kotur
> <somnath.kotur@broadcom.com>; Daley, John <johndale@cisco.com>;
> Hyong Youb Kim <hyonkim@cisco.com>; Dongdong Liu
> <liudongdong3@huawei.com>; Yisen Zhuang <yisen.zhuang@huawei.com>;
> Zhang, Yuying <yuying.zhang@intel.com>; Maxime Coquelin
> <maxime.coquelin@redhat.com>; Xia, Chenbo <chenbo.xia@intel.com>;
> Shijith Thotton <sthotton@marvell.com>; Matz, Olivier
> <olivier.matz@6wind.com>
> Subject: Re: [PATCH] drivers: skip build of sub-libs not supporting IOVA mode
> 
> 02/03/2023 14:52, Zhang, Qi Z:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > If IOVA as PA is disabled and the driver does not support IOVA as
> > > VA, the build of the driver was disabled.
> > > Unfortunately some drivers were building some sub-libraries (with
> > > specific options for vector paths) which were not disabled.
> > >
> > > The build parsing of those drivers need to be skipped earlier to
> > > avoid defining the sub-libraries.
> > >
> > > Fixes: a986c2b7973d ("build: add option to configure IOVA mode as
> > > PA")
> > > Cc: stable@dpdk.org
> > >
> > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> [...]
> > > --- a/drivers/meson.build
> > > +++ b/drivers/meson.build
> > > @@ -127,9 +127,9 @@ foreach subpath:subdirs
> > >              # pull in driver directory which should update all the local
> variables
> > >              subdir(drv_path)
> > >
> > > -            if dpdk_conf.get('RTE_IOVA_AS_PA') == 0 and not
> > > pmd_supports_disable_iova_as_pa and not
> > > always_enable.contains(drv_path)
> > > +            if not get_option('enable_iova_as_pa') and not
> > > + pmd_supports_disable_iova_as_pa and not
> > > + always_enable.contains(drv_path)
> > >                  build = false
> > > -                reason = 'driver does not support disabling IOVA as PA mode'
> > > +                reason = 'IOVA as VA not supported'
> > >              endif
> >
> > If we check enable_iova_as_pa for each unsupported driver , do we still
> need "pmd_supports_disable_iova_as_pa"?
> 
> They are a bit redundant.

That's why I prefer my previous solution for i40e and iavf,
because, someday we may claim pmd_supports_disable_iova_as_pa = true but still leave avx part not be fixed.

> The idea is to use pmd_supports_disable_iova_as_pa (could be renamed) as
> it is simpler to use.
> But in the case of drivers having sub-libs (always enabled), we need an extra
> check of enable_iova_as_pa inside the driver file.

 


> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH] drivers: skip build of sub-libs not supporting IOVA mode
  2023-02-19 11:55 [PATCH] drivers: skip build of sub-libs not supporting IOVA mode Thomas Monjalon
  2023-03-02 13:52 ` Zhang, Qi Z
@ 2023-03-02 14:26 ` Morten Brørup
  2023-03-02 16:01 ` [EXT] " Shijith Thotton
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Morten Brørup @ 2023-03-02 14:26 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: David Marchand, Bruce Richardson, Qi Zhang, stable, Jingjing Wu,
	Beilei Xing, Timothy McDaniel, Ajit Khaparde, Somnath Kotur,
	John Daley, Hyong Youb Kim, Dongdong Liu, Yisen Zhuang,
	Yuying Zhang, Maxime Coquelin, Chenbo Xia, Shijith Thotton,
	Olivier Matz

> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Sunday, 19 February 2023 12.55
> 
> If IOVA as PA is disabled and the driver does not support IOVA as VA,
> the build of the driver was disabled.
> Unfortunately some drivers were building some sub-libraries
> (with specific options for vector paths) which were not disabled.
> 
> The build parsing of those drivers need to be skipped earlier
> to avoid defining the sub-libraries.
> 
> Fixes: a986c2b7973d ("build: add option to configure IOVA mode as PA")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---

Acked-by: Morten Brørup <mb@smartsharesystems.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [EXT] [PATCH] drivers: skip build of sub-libs not supporting IOVA mode
  2023-02-19 11:55 [PATCH] drivers: skip build of sub-libs not supporting IOVA mode Thomas Monjalon
  2023-03-02 13:52 ` Zhang, Qi Z
  2023-03-02 14:26 ` Morten Brørup
@ 2023-03-02 16:01 ` Shijith Thotton
       [not found] ` <20230306161328.3802696-1-thomas@monjalon.net>
       [not found] ` <20230314142958.3479004-1-thomas@monjalon.net>
  4 siblings, 0 replies; 9+ messages in thread
From: Shijith Thotton @ 2023-03-02 16:01 UTC (permalink / raw)
  To: Thomas Monjalon, dev
  Cc: David Marchand, Bruce Richardson, Qi Zhang, stable, Jingjing Wu,
	Beilei Xing, Timothy McDaniel, Ajit Khaparde, Somnath Kotur,
	John Daley, Hyong Youb Kim, Dongdong Liu, Yisen Zhuang,
	Yuying Zhang, Maxime Coquelin, Chenbo Xia, Olivier Matz

>If IOVA as PA is disabled and the driver does not support IOVA as VA,
>the build of the driver was disabled.
>Unfortunately some drivers were building some sub-libraries
>(with specific options for vector paths) which were not disabled.
>
>The build parsing of those drivers need to be skipped earlier
>to avoid defining the sub-libraries.
>
>Fixes: a986c2b7973d ("build: add option to configure IOVA mode as PA")
>Cc: stable@dpdk.org
>
>Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>---
 
Acked-by: Shijith Thotton <sthotton@marvell.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] drivers: skip build of sub-libs not supporting IOVA mode
  2023-03-02 14:16     ` Zhang, Qi Z
@ 2023-03-03 14:23       ` Thomas Monjalon
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2023-03-03 14:23 UTC (permalink / raw)
  To: Zhang, Qi Z
  Cc: dev, David Marchand, Richardson, Bruce, stable, Wu, Jingjing,
	Xing, Beilei, McDaniel, Timothy, Ajit Khaparde, Somnath Kotur,
	Daley, John, Hyong Youb Kim, Dongdong Liu, Yisen Zhuang, Zhang,
	Yuying, Maxime Coquelin, Xia, Chenbo, Shijith Thotton, Matz,
	Olivier

02/03/2023 15:16, Zhang, Qi Z:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 02/03/2023 14:52, Zhang, Qi Z:
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > If IOVA as PA is disabled and the driver does not support IOVA as
> > > > VA, the build of the driver was disabled.
> > > > Unfortunately some drivers were building some sub-libraries (with
> > > > specific options for vector paths) which were not disabled.
> > > >
> > > > The build parsing of those drivers need to be skipped earlier to
> > > > avoid defining the sub-libraries.
> > > >
> > > > Fixes: a986c2b7973d ("build: add option to configure IOVA mode as
> > > > PA")
> > > > Cc: stable@dpdk.org
> > > >
> > > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > [...]
> > > > --- a/drivers/meson.build
> > > > +++ b/drivers/meson.build
> > > > @@ -127,9 +127,9 @@ foreach subpath:subdirs
> > > >              # pull in driver directory which should update all the local
> > variables
> > > >              subdir(drv_path)
> > > >
> > > > -            if dpdk_conf.get('RTE_IOVA_AS_PA') == 0 and not
> > > > pmd_supports_disable_iova_as_pa and not
> > > > always_enable.contains(drv_path)
> > > > +            if not get_option('enable_iova_as_pa') and not
> > > > + pmd_supports_disable_iova_as_pa and not
> > > > + always_enable.contains(drv_path)
> > > >                  build = false
> > > > -                reason = 'driver does not support disabling IOVA as PA mode'
> > > > +                reason = 'IOVA as VA not supported'
> > > >              endif
> > >
> > > If we check enable_iova_as_pa for each unsupported driver , do we still
> > need "pmd_supports_disable_iova_as_pa"?
> > 
> > They are a bit redundant.
> 
> That's why I prefer my previous solution for i40e and iavf,
> because, someday we may claim pmd_supports_disable_iova_as_pa = true but still leave avx part not be fixed.

Both are in the same file, so I don't see how it could be missed,
especially if those lines are placed together.

We have a variable used commonly with a standardized message, we must use it,
at least to allow easy grep of this support.

> > The idea is to use pmd_supports_disable_iova_as_pa (could be renamed) as
> > it is simpler to use.
> > But in the case of drivers having sub-libs (always enabled), we need an extra
> > check of enable_iova_as_pa inside the driver file.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 2/2] drivers: skip build of sub-libs not supporting IOVA mode
       [not found] ` <20230306161328.3802696-1-thomas@monjalon.net>
@ 2023-03-06 16:13   ` Thomas Monjalon
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2023-03-06 16:13 UTC (permalink / raw)
  To: dev
  Cc: David Marchand, Bruce Richardson, Qi Zhang, Morten Brørup,
	Shijith Thotton, stable, Jingjing Wu, Beilei Xing,
	Timothy McDaniel, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Yuying Zhang, Maxime Coquelin, Chenbo Xia,
	Olivier Matz

If IOVA as PA is disabled and the driver requires the IOVA field,
the build of the driver was disabled.
Unfortunately some drivers were building some sub-libraries
(with specific options for vector paths) which were not disabled.

The build parsing of those drivers need to be skipped earlier
to avoid defining the sub-libraries.

Fixes: a986c2b7973d ("build: add option to configure IOVA mode as PA")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Shijith Thotton <sthotton@marvell.com>
---
 drivers/common/idpf/meson.build | 4 ++++
 drivers/event/dlb2/meson.build  | 5 ++++-
 drivers/net/bnxt/meson.build    | 4 ++++
 drivers/net/enic/meson.build    | 4 ++++
 drivers/net/i40e/meson.build    | 4 ++++
 drivers/net/iavf/meson.build    | 3 +++
 drivers/net/virtio/meson.build  | 4 ++++
 7 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/drivers/common/idpf/meson.build b/drivers/common/idpf/meson.build
index 58059ef443..74c0e92cac 100644
--- a/drivers/common/idpf/meson.build
+++ b/drivers/common/idpf/meson.build
@@ -1,6 +1,10 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2022 Intel Corporation
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 deps += ['mbuf']
 
 sources = files(
diff --git a/drivers/event/dlb2/meson.build b/drivers/event/dlb2/meson.build
index a2e60273c5..8ae7db0011 100644
--- a/drivers/event/dlb2/meson.build
+++ b/drivers/event/dlb2/meson.build
@@ -1,4 +1,3 @@
-
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019-2020 Intel Corporation
 
@@ -8,6 +7,10 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86_64')
         subdir_done()
 endif
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 sources = files(
         'dlb2.c',
         'dlb2_iface.c',
diff --git a/drivers/net/bnxt/meson.build b/drivers/net/bnxt/meson.build
index 09d494e90f..c9ca09089a 100644
--- a/drivers/net/bnxt/meson.build
+++ b/drivers/net/bnxt/meson.build
@@ -8,6 +8,10 @@ if is_windows
     subdir_done()
 endif
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 headers = files('rte_pmd_bnxt.h')
 cflags_options = [
         '-DSUPPORT_CFA_HW_ALL=1',
diff --git a/drivers/net/enic/meson.build b/drivers/net/enic/meson.build
index 7131a25f09..f1f7f5432a 100644
--- a/drivers/net/enic/meson.build
+++ b/drivers/net/enic/meson.build
@@ -7,6 +7,10 @@ if is_windows
     subdir_done()
 endif
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 sources = files(
         'base/vnic_cq.c',
         'base/vnic_dev.c',
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index e00c1a9ef9..689606a1de 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -13,6 +13,10 @@ if arch_subdir == 'riscv'
     subdir_done()
 endif
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 cflags += ['-DPF_DRIVER',
     '-DVF_DRIVER',
     '-DINTEGRATED_VF',
diff --git a/drivers/net/iavf/meson.build b/drivers/net/iavf/meson.build
index 6df771f917..c95503adda 100644
--- a/drivers/net/iavf/meson.build
+++ b/drivers/net/iavf/meson.build
@@ -1,6 +1,9 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
 
 cflags += ['-Wno-strict-aliasing']
 
diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
index 0ffd77024e..b8ba1807fa 100644
--- a/drivers/net/virtio/meson.build
+++ b/drivers/net/virtio/meson.build
@@ -7,6 +7,10 @@ if is_windows
     subdir_done()
 endif
 
+if not get_option('enable_iova_as_pa')
+    subdir_done()
+endif
+
 sources += files(
         'virtio.c',
         'virtio_cvq.c',
-- 
2.39.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v3 5/5] drivers: skip build of sub-libs not supporting IOVA mode
       [not found] ` <20230314142958.3479004-1-thomas@monjalon.net>
@ 2023-03-14 14:29   ` Thomas Monjalon
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Monjalon @ 2023-03-14 14:29 UTC (permalink / raw)
  To: dev
  Cc: David Marchand, Bruce Richardson, Qi Zhang, Morten Brørup,
	Shijith Thotton, stable, Jingjing Wu, Beilei Xing,
	Timothy McDaniel, Ajit Khaparde, Somnath Kotur, John Daley,
	Hyong Youb Kim, Yuying Zhang, Maxime Coquelin, Chenbo Xia,
	Olivier Matz

If IOVA as PA is disabled and the driver requires the IOVA field,
the build of the driver was disabled.
Unfortunately some drivers were building some sub-libraries
(with specific options for vector paths) which were not disabled.

The build parsing of those drivers need to be skipped earlier
to avoid defining the sub-libraries.

Fixes: a986c2b7973d ("build: add option to configure IOVA mode as PA")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Shijith Thotton <sthotton@marvell.com>
---
 drivers/common/idpf/meson.build | 4 ++++
 drivers/event/dlb2/meson.build  | 5 ++++-
 drivers/net/bnxt/meson.build    | 4 ++++
 drivers/net/enic/meson.build    | 4 ++++
 drivers/net/i40e/meson.build    | 4 ++++
 drivers/net/iavf/meson.build    | 3 +++
 drivers/net/virtio/meson.build  | 4 ++++
 7 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/drivers/common/idpf/meson.build b/drivers/common/idpf/meson.build
index 58059ef443..63f60accd9 100644
--- a/drivers/common/idpf/meson.build
+++ b/drivers/common/idpf/meson.build
@@ -1,6 +1,10 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2022 Intel Corporation
 
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+    subdir_done()
+endif
+
 deps += ['mbuf']
 
 sources = files(
diff --git a/drivers/event/dlb2/meson.build b/drivers/event/dlb2/meson.build
index a2e60273c5..515d1795fe 100644
--- a/drivers/event/dlb2/meson.build
+++ b/drivers/event/dlb2/meson.build
@@ -1,4 +1,3 @@
-
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2019-2020 Intel Corporation
 
@@ -8,6 +7,10 @@ if not is_linux or not dpdk_conf.has('RTE_ARCH_X86_64')
         subdir_done()
 endif
 
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+    subdir_done()
+endif
+
 sources = files(
         'dlb2.c',
         'dlb2_iface.c',
diff --git a/drivers/net/bnxt/meson.build b/drivers/net/bnxt/meson.build
index 09d494e90f..0288ed6262 100644
--- a/drivers/net/bnxt/meson.build
+++ b/drivers/net/bnxt/meson.build
@@ -8,6 +8,10 @@ if is_windows
     subdir_done()
 endif
 
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+    subdir_done()
+endif
+
 headers = files('rte_pmd_bnxt.h')
 cflags_options = [
         '-DSUPPORT_CFA_HW_ALL=1',
diff --git a/drivers/net/enic/meson.build b/drivers/net/enic/meson.build
index 7131a25f09..0a0992c3cb 100644
--- a/drivers/net/enic/meson.build
+++ b/drivers/net/enic/meson.build
@@ -7,6 +7,10 @@ if is_windows
     subdir_done()
 endif
 
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+    subdir_done()
+endif
+
 sources = files(
         'base/vnic_cq.c',
         'base/vnic_dev.c',
diff --git a/drivers/net/i40e/meson.build b/drivers/net/i40e/meson.build
index e00c1a9ef9..8e53b87a65 100644
--- a/drivers/net/i40e/meson.build
+++ b/drivers/net/i40e/meson.build
@@ -13,6 +13,10 @@ if arch_subdir == 'riscv'
     subdir_done()
 endif
 
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+    subdir_done()
+endif
+
 cflags += ['-DPF_DRIVER',
     '-DVF_DRIVER',
     '-DINTEGRATED_VF',
diff --git a/drivers/net/iavf/meson.build b/drivers/net/iavf/meson.build
index 6df771f917..fc09ffa2ae 100644
--- a/drivers/net/iavf/meson.build
+++ b/drivers/net/iavf/meson.build
@@ -1,6 +1,9 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
 
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+    subdir_done()
+endif
 
 cflags += ['-Wno-strict-aliasing']
 
diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
index 0ffd77024e..ef016c1566 100644
--- a/drivers/net/virtio/meson.build
+++ b/drivers/net/virtio/meson.build
@@ -7,6 +7,10 @@ if is_windows
     subdir_done()
 endif
 
+if dpdk_conf.get('RTE_IOVA_IN_MBUF') == 0
+    subdir_done()
+endif
+
 sources += files(
         'virtio.c',
         'virtio_cvq.c',
-- 
2.39.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-14 14:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-19 11:55 [PATCH] drivers: skip build of sub-libs not supporting IOVA mode Thomas Monjalon
2023-03-02 13:52 ` Zhang, Qi Z
2023-03-02 13:57   ` Thomas Monjalon
2023-03-02 14:16     ` Zhang, Qi Z
2023-03-03 14:23       ` Thomas Monjalon
2023-03-02 14:26 ` Morten Brørup
2023-03-02 16:01 ` [EXT] " Shijith Thotton
     [not found] ` <20230306161328.3802696-1-thomas@monjalon.net>
2023-03-06 16:13   ` [PATCH v2 2/2] " Thomas Monjalon
     [not found] ` <20230314142958.3479004-1-thomas@monjalon.net>
2023-03-14 14:29   ` [PATCH v3 5/5] " Thomas Monjalon

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).