[v3,01/17] raw/ioat: only build if dmadev not present

Message ID 20210908103016.1661914-2-kevin.laatz@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series add dmadev driver for idxd devices |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-testing warning apply patch failure

Commit Message

Kevin Laatz Sept. 8, 2021, 10:30 a.m. UTC
  From: Bruce Richardson <bruce.richardson@intel.com>

Only build the rawdev IDXD/IOAT drivers if the dmadev drivers are not
present.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/raw/ioat/meson.build | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
  

Comments

Conor Walsh Sept. 8, 2021, 4 p.m. UTC | #1
> From: Bruce Richardson <bruce.richardson@intel.com>
>
> Only build the rawdev IDXD/IOAT drivers if the dmadev drivers are not
> present.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>   drivers/raw/ioat/meson.build | 23 ++++++++++++++++++++---
>   1 file changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/raw/ioat/meson.build b/drivers/raw/ioat/meson.build
> index 0e81cb5951..7bd9ac912b 100644
> --- a/drivers/raw/ioat/meson.build
> +++ b/drivers/raw/ioat/meson.build
> @@ -2,14 +2,31 @@
>   # Copyright 2019 Intel Corporation
Minor nit the copyright should be updated to 2019-2021
>   build = dpdk_conf.has('RTE_ARCH_X86')
> +# only use ioat rawdev driver if we don't have the equivalent dmadev ones
> +if not dpdk_conf.has('RTE_DMA_IDXD') and not dpdk_conf.has('RTE_DMA_IOAT')

When disabling the dmadev drivers using -Ddisable_drivers=dma/* the 
rawdev driver isnt available to use for dma devices.

The way this is ATM if dmadev is disabled it doesnt build rawdev.

The logic should be - if dpdk_conf.has('RTE_DMA_IDXD') and 
dpdk_conf.has('RTE_DMA_IOAT')

<snip>

Reviewed-by: Conor Walsh <conor.walsh@intel.com>
  
Kevin Laatz Sept. 9, 2021, 11:11 a.m. UTC | #2
On 08/09/2021 17:00, Conor Walsh wrote:
>
>> From: Bruce Richardson <bruce.richardson@intel.com>
>>
>> Only build the rawdev IDXD/IOAT drivers if the dmadev drivers are not
>> present.
>>
>> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>> ---
>>   drivers/raw/ioat/meson.build | 23 ++++++++++++++++++++---
>>   1 file changed, 20 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/raw/ioat/meson.build b/drivers/raw/ioat/meson.build
>> index 0e81cb5951..7bd9ac912b 100644
>> --- a/drivers/raw/ioat/meson.build
>> +++ b/drivers/raw/ioat/meson.build
>> @@ -2,14 +2,31 @@
>>   # Copyright 2019 Intel Corporation
> Minor nit the copyright should be updated to 2019-2021
>>   build = dpdk_conf.has('RTE_ARCH_X86')
>> +# only use ioat rawdev driver if we don't have the equivalent dmadev 
>> ones
>> +if not dpdk_conf.has('RTE_DMA_IDXD') and not 
>> dpdk_conf.has('RTE_DMA_IOAT')
>
> When disabling the dmadev drivers using -Ddisable_drivers=dma/* the 
> rawdev driver isnt available to use for dma devices.
>
> The way this is ATM if dmadev is disabled it doesnt build rawdev.
>
> The logic should be - if dpdk_conf.has('RTE_DMA_IDXD') and 
> dpdk_conf.has('RTE_DMA_IOAT')
>

Will fix this in v4, thanks!
  

Patch

diff --git a/drivers/raw/ioat/meson.build b/drivers/raw/ioat/meson.build
index 0e81cb5951..7bd9ac912b 100644
--- a/drivers/raw/ioat/meson.build
+++ b/drivers/raw/ioat/meson.build
@@ -2,14 +2,31 @@ 
 # Copyright 2019 Intel Corporation
 
 build = dpdk_conf.has('RTE_ARCH_X86')
+# only use ioat rawdev driver if we don't have the equivalent dmadev ones
+if not dpdk_conf.has('RTE_DMA_IDXD') and not dpdk_conf.has('RTE_DMA_IOAT')
+    build = false
+    subdir_done()
+endif
+
 reason = 'only supported on x86'
 sources = files(
-        'idxd_bus.c',
-        'idxd_pci.c',
         'ioat_common.c',
-        'ioat_rawdev.c',
         'ioat_rawdev_test.c',
 )
+
+if not dpdk_conf.has('RTE_DMA_IDXD')
+    sources += files(
+            'idxd_bus.c',
+            'idxd_pci.c',
+    )
+endif
+
+if not dpdk_conf.has('RTE_DMA_IOAT')
+    sources += files (
+            'ioat_rawdev.c',
+    )
+endif
+
 deps += ['bus_pci', 'mbuf', 'rawdev']
 headers = files(
         'rte_ioat_rawdev.h',