DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/3] fix misc dma driver build errors
@ 2022-06-23 13:49 Bruce Richardson
  2022-06-23 13:49 ` [PATCH 1/3] raw/ioat: fix build error for missing errno Bruce Richardson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bruce Richardson @ 2022-06-23 13:49 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

The use of function attributes to enable AVX2 on idxd builds is not
supported by older compilers, so we need additional checks in the
dma/idxd driver to disable that in cases where it is not buildable.

This fix revealed further issues with the older rawdev driver, which
only gets build when the dma driver is disabled.

Bruce Richardson (3):
  raw/ioat: fix build error for missing rte_errno
  raw/ioat: fix build when ioat dmadev enabled
  dma/idxd: fix non-AVX builds with older compilers

 drivers/dma/idxd/meson.build           | 11 +++++++++++
 drivers/raw/ioat/ioat_common.c         |  2 ++
 drivers/raw/ioat/ioat_private.h        |  4 ++--
 drivers/raw/ioat/ioat_rawdev.c         |  2 --
 drivers/raw/ioat/rte_idxd_rawdev_fns.h |  1 +
 5 files changed, 16 insertions(+), 4 deletions(-)

--
2.34.1


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

* [PATCH 1/3] raw/ioat: fix build error for missing errno
  2022-06-23 13:49 [PATCH 0/3] fix misc dma driver build errors Bruce Richardson
@ 2022-06-23 13:49 ` Bruce Richardson
  2022-06-23 13:49 ` [PATCH 2/3] raw/ioat: fix build when ioat dmadev enabled Bruce Richardson
  2022-06-23 13:49 ` [PATCH 3/3] dma/idxd: fix non-AVX builds with older compilers Bruce Richardson
  2 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2022-06-23 13:49 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable

The inline functions in rte_idxd_rawdev_fns.h make use of rte_errno, but
the header with its definition is not included by that file leading to
build errors.

Fixes: f82c87eb14a4 ("raw/ioat: move idxd functions to separate file")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/raw/ioat/rte_idxd_rawdev_fns.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/raw/ioat/rte_idxd_rawdev_fns.h b/drivers/raw/ioat/rte_idxd_rawdev_fns.h
index 3ea25f6ca9..a07892faa0 100644
--- a/drivers/raw/ioat/rte_idxd_rawdev_fns.h
+++ b/drivers/raw/ioat/rte_idxd_rawdev_fns.h
@@ -16,6 +16,7 @@
  */

 #include <stdint.h>
+#include <rte_errno.h>

 /*
  * Defines used in the data path for interacting with IDXD hardware.
--
2.34.1


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

* [PATCH 2/3] raw/ioat: fix build when ioat dmadev enabled
  2022-06-23 13:49 [PATCH 0/3] fix misc dma driver build errors Bruce Richardson
  2022-06-23 13:49 ` [PATCH 1/3] raw/ioat: fix build error for missing errno Bruce Richardson
@ 2022-06-23 13:49 ` Bruce Richardson
  2022-06-23 13:49 ` [PATCH 3/3] dma/idxd: fix non-AVX builds with older compilers Bruce Richardson
  2 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2022-06-23 13:49 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, stable

The build of the raw/ioat driver only occurs when the equivalent dmadev
drivers are disabled. Complications occur when the ioat dmadev is being
built but not the idxd. In this case, only the idxd part of raw/ioat
gets built, but the definition of the logtype is in the ioat part,
causing build errors.

  .../raw_ioat_idxd_bus.c.o: In function `idxd_vdev_mmap_wq':
  idxd_bus.c:(.text+0x116): undefined reference to `ioat_pmd_logtype'

Fix this by moving the logtype definition to the common C file, and
renaming it to avoid conflicts with a similarly named value in the
dma/ioat driver.

Fixes: ff06fa2cf3ba ("raw/ioat: probe idxd PCI")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/raw/ioat/ioat_common.c  | 2 ++
 drivers/raw/ioat/ioat_private.h | 4 ++--
 drivers/raw/ioat/ioat_rawdev.c  | 2 --
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/raw/ioat/ioat_common.c b/drivers/raw/ioat/ioat_common.c
index 60de41152a..e44e181e58 100644
--- a/drivers/raw/ioat/ioat_common.c
+++ b/drivers/raw/ioat/ioat_common.c
@@ -9,6 +9,8 @@
 
 #include "ioat_private.h"
 
+RTE_LOG_REGISTER_DEFAULT(ioat_rawdev_logtype, INFO);
+
 static const char * const xstat_names[] = {
 		"failed_enqueues", "successful_enqueues",
 		"copies_started", "copies_completed"
diff --git a/drivers/raw/ioat/ioat_private.h b/drivers/raw/ioat/ioat_private.h
index f032d5fe3d..7fb685a3d7 100644
--- a/drivers/raw/ioat/ioat_private.h
+++ b/drivers/raw/ioat/ioat_private.h
@@ -18,10 +18,10 @@
 #include <rte_rawdev_pmd.h>
 #include "rte_ioat_rawdev.h"
 
-extern int ioat_pmd_logtype;
+extern int ioat_rawdev_logtype;
 
 #define IOAT_PMD_LOG(level, fmt, args...) rte_log(RTE_LOG_ ## level, \
-		ioat_pmd_logtype, "IOAT: %s(): " fmt "\n", __func__, ##args)
+		ioat_rawdev_logtype, "IOAT: %s(): " fmt "\n", __func__, ##args)
 
 #define IOAT_PMD_DEBUG(fmt, args...)  IOAT_PMD_LOG(DEBUG, fmt, ## args)
 #define IOAT_PMD_INFO(fmt, args...)   IOAT_PMD_LOG(INFO, fmt, ## args)
diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c
index 5396671d4f..11341fcf5d 100644
--- a/drivers/raw/ioat/ioat_rawdev.c
+++ b/drivers/raw/ioat/ioat_rawdev.c
@@ -28,8 +28,6 @@ static struct rte_pci_driver ioat_pmd_drv;
 #define IOAT_DEVICE_ID_BDXF	0x6f2F
 #define IOAT_DEVICE_ID_ICX	0x0b00
 
-RTE_LOG_REGISTER_DEFAULT(ioat_pmd_logtype, INFO);
-
 #define DESC_SZ sizeof(struct rte_ioat_generic_hw_desc)
 #define COMPLETION_SZ sizeof(__m128i)
 
-- 
2.34.1


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

* [PATCH 3/3] dma/idxd: fix non-AVX builds with older compilers
  2022-06-23 13:49 [PATCH 0/3] fix misc dma driver build errors Bruce Richardson
  2022-06-23 13:49 ` [PATCH 1/3] raw/ioat: fix build error for missing errno Bruce Richardson
  2022-06-23 13:49 ` [PATCH 2/3] raw/ioat: fix build when ioat dmadev enabled Bruce Richardson
@ 2022-06-23 13:49 ` Bruce Richardson
  2022-06-24  8:24   ` Jiang, YuX
  2 siblings, 1 reply; 6+ messages in thread
From: Bruce Richardson @ 2022-06-23 13:49 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

When building without AVX2 support using an older compiler e.g. gcc 4.8
on Centos/RHEL 7, we get build errors due to the use of AVX2 intrinsics.
This is because the compiler does not support
"__attribute__((target(AVX2)))" function attribute. Disable build of
this driver such edge cases.

Generic builds using recent compilers, and all builds with a minimum
baseline of AVX2 are unaffected by this change.

Fixes: aa802b10237c ("dma/idxd: fix AVX2 in non-datapath functions")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/dma/idxd/meson.build | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/dma/idxd/meson.build b/drivers/dma/idxd/meson.build
index dcc0a297d7..c5403b431c 100644
--- a/drivers/dma/idxd/meson.build
+++ b/drivers/dma/idxd/meson.build
@@ -4,6 +4,17 @@
 build = dpdk_conf.has('RTE_ARCH_X86')
 reason = 'only supported on x86'

+test_avx2_code = '''
+#include <x86intrin.h>
+__attribute__((target("avx2")))
+__m256i fn(void *x) { return _mm256_loadu_si256(x); }
+'''
+if build and not cc.compiles(test_avx2_code, args:machine_args)
+    build = false
+    reason = 'missing support for AVX2 function attribute'
+    subdir_done()
+endif
+
 deps += ['bus_pci']
 sources = files(
         'idxd_common.c',
--
2.34.1


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

* RE: [PATCH 3/3] dma/idxd: fix non-AVX builds with older compilers
  2022-06-23 13:49 ` [PATCH 3/3] dma/idxd: fix non-AVX builds with older compilers Bruce Richardson
@ 2022-06-24  8:24   ` Jiang, YuX
  2022-06-26  8:29     ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Jiang, YuX @ 2022-06-24  8:24 UTC (permalink / raw)
  To: Richardson, Bruce, dev; +Cc: Richardson, Bruce

> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Thursday, June 23, 2022 9:50 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: [PATCH 3/3] dma/idxd: fix non-AVX builds with older compilers
> 
> When building without AVX2 support using an older compiler e.g. gcc 4.8 on
> Centos/RHEL 7, we get build errors due to the use of AVX2 intrinsics.
> This is because the compiler does not support
> "__attribute__((target(AVX2)))" function attribute. Disable build of this
> driver such edge cases.
> 
> Generic builds using recent compilers, and all builds with a minimum baseline
> of AVX2 are unaffected by this change.
> 
> Fixes: aa802b10237c ("dma/idxd: fix AVX2 in non-datapath functions")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
Tested-by: Yu Jiang <YuX.Jiang@intel.com>

Tested env as below:
OS: CentOS7.9/kernel: 3.10.0-1160.62.1.el7.x86_64
Compiler: gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

Best regards,
Yu Jiang

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

* Re: [PATCH 3/3] dma/idxd: fix non-AVX builds with older compilers
  2022-06-24  8:24   ` Jiang, YuX
@ 2022-06-26  8:29     ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2022-06-26  8:29 UTC (permalink / raw)
  To: Richardson, Bruce; +Cc: dev, Jiang, YuX

> > When building without AVX2 support using an older compiler e.g. gcc 4.8 on
> > Centos/RHEL 7, we get build errors due to the use of AVX2 intrinsics.
> > This is because the compiler does not support
> > "__attribute__((target(AVX2)))" function attribute. Disable build of this
> > driver such edge cases.
> > 
> > Generic builds using recent compilers, and all builds with a minimum baseline
> > of AVX2 are unaffected by this change.
> > 
> > Fixes: aa802b10237c ("dma/idxd: fix AVX2 in non-datapath functions")
> > 
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> Tested-by: Yu Jiang <YuX.Jiang@intel.com>
> 
> Tested env as below:
> OS: CentOS7.9/kernel: 3.10.0-1160.62.1.el7.x86_64
> Compiler: gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)

Series applied, thanks.






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

end of thread, other threads:[~2022-06-26  8:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 13:49 [PATCH 0/3] fix misc dma driver build errors Bruce Richardson
2022-06-23 13:49 ` [PATCH 1/3] raw/ioat: fix build error for missing errno Bruce Richardson
2022-06-23 13:49 ` [PATCH 2/3] raw/ioat: fix build when ioat dmadev enabled Bruce Richardson
2022-06-23 13:49 ` [PATCH 3/3] dma/idxd: fix non-AVX builds with older compilers Bruce Richardson
2022-06-24  8:24   ` Jiang, YuX
2022-06-26  8:29     ` 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).