* Re: [PATCH] build: remove obsolete compiler checks
2025-07-18 12:14 [PATCH] build: remove obsolete compiler checks Bruce Richardson
@ 2025-07-18 12:21 ` David Marchand
2025-07-18 12:34 ` Bruce Richardson
2025-07-18 12:45 ` David Marchand
` (2 subsequent siblings)
3 siblings, 1 reply; 13+ messages in thread
From: David Marchand @ 2025-07-18 12:21 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev
On Fri, Jul 18, 2025 at 2:14 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> DPDK now recommends compiler versions GCC 8+, and Clang 7+, so remove
> checks and workarounds for versions old than these.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> config/meson.build | 5 ----
> drivers/event/meson.build | 5 +---
> drivers/meson.build | 2 +-
> drivers/net/virtio/meson.build | 2 +-
> lib/eal/arm/include/rte_memcpy_64.h | 8 -------
> lib/eal/arm/include/rte_vect.h | 37 ++---------------------------
> lib/eal/ppc/include/rte_altivec.h | 1 -
> lib/meson.build | 2 +-
> lib/vhost/meson.build | 4 ++--
> lib/vhost/vhost.c | 16 -------------
> 10 files changed, 8 insertions(+), 74 deletions(-)
Two nits:
[snip]
> diff --git a/drivers/event/meson.build b/drivers/event/meson.build
> index d6706b57f7..b0bc3f40f1 100644
> --- a/drivers/event/meson.build
> +++ b/drivers/event/meson.build
> @@ -14,9 +14,6 @@ drivers = [
> 'opdl',
> 'skeleton',
> 'sw',
> + 'octeontx',
> ]
Sort alphabetically?
> -if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and
> - dpdk_conf.has('RTE_ARCH_ARM64'))
> - drivers += 'octeontx'
> -endif
> std_deps = ['eventdev', 'kvargs']
[snip]
> diff --git a/lib/eal/arm/include/rte_memcpy_64.h b/lib/eal/arm/include/rte_memcpy_64.h
> index 90039039be..57fe24eb10 100644
> --- a/lib/eal/arm/include/rte_memcpy_64.h
> +++ b/lib/eal/arm/include/rte_memcpy_64.h
> @@ -89,14 +89,6 @@ n <= (size_t)RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD)
> **************************************/
>
>
> -#if RTE_CC_IS_GNU && !defined RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK
> -#if (GCC_VERSION < 50400)
> -#warning "The GCC version is quite old, which may result in sub-optimal \
> -performance of the compiled code. It is suggested that at least GCC 5.4.0 \
> -be used."
> -#endif
> -#endif
> -
This flag can be removed from meson too.
config/arm/meson.build: #
['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
> static __rte_always_inline
> void rte_mov16(uint8_t *dst, const uint8_t *src)
> {
--
David Marchand
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] build: remove obsolete compiler checks
2025-07-18 12:21 ` David Marchand
@ 2025-07-18 12:34 ` Bruce Richardson
0 siblings, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2025-07-18 12:34 UTC (permalink / raw)
To: David Marchand; +Cc: dev
On Fri, Jul 18, 2025 at 02:21:45PM +0200, David Marchand wrote:
> On Fri, Jul 18, 2025 at 2:14 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > DPDK now recommends compiler versions GCC 8+, and Clang 7+, so remove
> > checks and workarounds for versions old than these.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> > config/meson.build | 5 ----
> > drivers/event/meson.build | 5 +---
> > drivers/meson.build | 2 +-
> > drivers/net/virtio/meson.build | 2 +-
> > lib/eal/arm/include/rte_memcpy_64.h | 8 -------
> > lib/eal/arm/include/rte_vect.h | 37 ++---------------------------
> > lib/eal/ppc/include/rte_altivec.h | 1 -
> > lib/meson.build | 2 +-
> > lib/vhost/meson.build | 4 ++--
> > lib/vhost/vhost.c | 16 -------------
> > 10 files changed, 8 insertions(+), 74 deletions(-)
>
> Two nits:
>
> [snip]
>
> > diff --git a/drivers/event/meson.build b/drivers/event/meson.build
> > index d6706b57f7..b0bc3f40f1 100644
> > --- a/drivers/event/meson.build
> > +++ b/drivers/event/meson.build
> > @@ -14,9 +14,6 @@ drivers = [
> > 'opdl',
> > 'skeleton',
> > 'sw',
> > + 'octeontx',
> > ]
>
> Sort alphabetically?
>
Absolutely, yes.
>
> > -if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and
> > - dpdk_conf.has('RTE_ARCH_ARM64'))
> > - drivers += 'octeontx'
> > -endif
> > std_deps = ['eventdev', 'kvargs']
>
> [snip]
>
> > diff --git a/lib/eal/arm/include/rte_memcpy_64.h b/lib/eal/arm/include/rte_memcpy_64.h
> > index 90039039be..57fe24eb10 100644
> > --- a/lib/eal/arm/include/rte_memcpy_64.h
> > +++ b/lib/eal/arm/include/rte_memcpy_64.h
> > @@ -89,14 +89,6 @@ n <= (size_t)RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD)
> > **************************************/
> >
> >
> > -#if RTE_CC_IS_GNU && !defined RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK
> > -#if (GCC_VERSION < 50400)
> > -#warning "The GCC version is quite old, which may result in sub-optimal \
> > -performance of the compiled code. It is suggested that at least GCC 5.4.0 \
> > -be used."
> > -#endif
> > -#endif
> > -
>
> This flag can be removed from meson too.
> config/arm/meson.build: #
> ['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
>
Yep, seems there are no more references to it in the code.
Will fix in V2, after all CI's have had their chance to have their say.
/Bruce
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] build: remove obsolete compiler checks
2025-07-18 12:14 [PATCH] build: remove obsolete compiler checks Bruce Richardson
2025-07-18 12:21 ` David Marchand
@ 2025-07-18 12:45 ` David Marchand
2025-07-18 13:05 ` Bruce Richardson
2025-07-25 16:06 ` [PATCH v2] " Bruce Richardson
2025-08-19 11:25 ` [PATCH v3 1/2] " Bruce Richardson
3 siblings, 1 reply; 13+ messages in thread
From: David Marchand @ 2025-07-18 12:45 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev
On Fri, Jul 18, 2025 at 2:14 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
> diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
> index d3caa3a3b4..a9ff87e863 100644
> --- a/drivers/net/virtio/meson.build
> +++ b/drivers/net/virtio/meson.build
> @@ -31,7 +31,7 @@ if arch_subdir == 'x86'
> sources_avx512 += files('virtio_rxtx_packed.c')
> if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
> cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
> - elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
> + elif (toolchain == 'clang')
> cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
> endif
> endif
One other nit, not blocking.
There should be no need for special casing clang vs gcc, since clang
supports gcc syntax in general.
https://clang.llvm.org/docs/AttributeReference.html#pragma-unroll-pragma-nounroll
The code could check for RTE_TOOLCHAIN_GCC/CLANG directly, and we
don't need a separate define passed from cmdline.
(idem in lib/vhost)
--
David Marchand
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] build: remove obsolete compiler checks
2025-07-18 12:45 ` David Marchand
@ 2025-07-18 13:05 ` Bruce Richardson
2025-07-18 13:36 ` David Marchand
0 siblings, 1 reply; 13+ messages in thread
From: Bruce Richardson @ 2025-07-18 13:05 UTC (permalink / raw)
To: David Marchand; +Cc: dev
On Fri, Jul 18, 2025 at 02:45:48PM +0200, David Marchand wrote:
> On Fri, Jul 18, 2025 at 2:14 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> > diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
> > index d3caa3a3b4..a9ff87e863 100644
> > --- a/drivers/net/virtio/meson.build
> > +++ b/drivers/net/virtio/meson.build
> > @@ -31,7 +31,7 @@ if arch_subdir == 'x86'
> > sources_avx512 += files('virtio_rxtx_packed.c')
> > if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
> > cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
> > - elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
> > + elif (toolchain == 'clang')
> > cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
> > endif
> > endif
>
> One other nit, not blocking.
>
> There should be no need for special casing clang vs gcc, since clang
> supports gcc syntax in general.
> https://clang.llvm.org/docs/AttributeReference.html#pragma-unroll-pragma-nounroll
>
I was actually thinking of doing a follow-up patch to remove the "if" and
instead do:
cflags += '-DVIRTIO_' + toolchain.to_upper() + "_UNROLL_PRAGMA"
on the basis that having a define for any other unknown compilers would be
harmless. However, you are right that there seems to be little reason to do
this in meson.build, and the code can do it directly itself. I'll leave
this part as it is in the patch for now.
/Bruce
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH] build: remove obsolete compiler checks
2025-07-18 13:05 ` Bruce Richardson
@ 2025-07-18 13:36 ` David Marchand
0 siblings, 0 replies; 13+ messages in thread
From: David Marchand @ 2025-07-18 13:36 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, Maxime Coquelin
On Fri, Jul 18, 2025 at 3:06 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> On Fri, Jul 18, 2025 at 02:45:48PM +0200, David Marchand wrote:
> > On Fri, Jul 18, 2025 at 2:14 PM Bruce Richardson
> > <bruce.richardson@intel.com> wrote:
> > > diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
> > > index d3caa3a3b4..a9ff87e863 100644
> > > --- a/drivers/net/virtio/meson.build
> > > +++ b/drivers/net/virtio/meson.build
> > > @@ -31,7 +31,7 @@ if arch_subdir == 'x86'
> > > sources_avx512 += files('virtio_rxtx_packed.c')
> > > if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
> > > cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
> > > - elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
> > > + elif (toolchain == 'clang')
> > > cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
> > > endif
> > > endif
> >
> > One other nit, not blocking.
> >
> > There should be no need for special casing clang vs gcc, since clang
> > supports gcc syntax in general.
> > https://clang.llvm.org/docs/AttributeReference.html#pragma-unroll-pragma-nounroll
> >
> I was actually thinking of doing a follow-up patch to remove the "if" and
> instead do:
>
> cflags += '-DVIRTIO_' + toolchain.to_upper() + "_UNROLL_PRAGMA"
>
> on the basis that having a define for any other unknown compilers would be
> harmless. However, you are right that there seems to be little reason to do
> this in meson.build, and the code can do it directly itself. I'll leave
> this part as it is in the patch for now.
Cc: Maxime (who is off atm)
I wonder if this pragma stuff really helps..
One quick test on the loop in vhost_flush_enqueue_batch_packed() shows
the same generated code with gcc 10 and gcc 15 when compiling with -O3
(thanks to godbolt.org).
Let's leave it as is for now, but I would be for dropping this strange
construct, only used with the virtio ring packed layout iirc.
--
David Marchand
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2] build: remove obsolete compiler checks
2025-07-18 12:14 [PATCH] build: remove obsolete compiler checks Bruce Richardson
2025-07-18 12:21 ` David Marchand
2025-07-18 12:45 ` David Marchand
@ 2025-07-25 16:06 ` Bruce Richardson
2025-07-28 18:18 ` Stephen Hemminger
2025-08-19 8:10 ` David Marchand
2025-08-19 11:25 ` [PATCH v3 1/2] " Bruce Richardson
3 siblings, 2 replies; 13+ messages in thread
From: Bruce Richardson @ 2025-07-25 16:06 UTC (permalink / raw)
To: dev; +Cc: david.marchand, Bruce Richardson
DPDK now recommends compiler versions GCC 8+, and Clang 7+, so remove
checks and workarounds for versions old than these.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
V2: Fix feedback from V1.
* remove obsolete comment from arm/meson.build
* sort octeontx alphabetically in driver list
---
config/arm/meson.build | 1 -
config/meson.build | 5 ----
drivers/event/meson.build | 5 +---
drivers/meson.build | 2 +-
drivers/net/virtio/meson.build | 2 +-
lib/eal/arm/include/rte_memcpy_64.h | 8 -------
lib/eal/arm/include/rte_vect.h | 37 ++---------------------------
lib/eal/ppc/include/rte_altivec.h | 1 -
lib/meson.build | 2 +-
lib/vhost/meson.build | 4 ++--
lib/vhost/vhost.c | 16 -------------
11 files changed, 8 insertions(+), 75 deletions(-)
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 35b7553e74..c0dc42e7d1 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -13,7 +13,6 @@ flags_common = [
# ['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
# unless there are strong reasons.
- # ['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
# ['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
# ['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
diff --git a/config/meson.build b/config/meson.build
index f31fef216c..c7a780dcc8 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -492,11 +492,6 @@ if get_option('b_lto')
else
error('compiler does not support fat LTO objects - please turn LTO off')
endif
- # workaround for gcc bug 81440
- if cc.get_id() == 'gcc' and cc.version().version_compare('<8.0')
- add_project_arguments('-Wno-lto-type-mismatch', language: 'c')
- add_project_link_arguments('-Wno-lto-type-mismatch', language: 'c')
- endif
endif
if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address,undefined'
diff --git a/drivers/event/meson.build b/drivers/event/meson.build
index d6706b57f7..ddaa0300ac 100644
--- a/drivers/event/meson.build
+++ b/drivers/event/meson.build
@@ -11,12 +11,9 @@ drivers = [
'dpaa',
'dpaa2',
'dsw',
+ 'octeontx',
'opdl',
'skeleton',
'sw',
]
-if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and
- dpdk_conf.has('RTE_ARCH_ARM64'))
- drivers += 'octeontx'
-endif
std_deps = ['eventdev', 'kvargs']
diff --git a/drivers/meson.build b/drivers/meson.build
index b62880db02..2760f4d593 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -237,7 +237,7 @@ foreach subpath:subdirs
enabled_drivers += name
lib_name = '_'.join(['rte', class, name])
cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=' + '.'.join([log_prefix, name])
- if annotate_locks and cc.get_id() == 'clang' and cc.version().version_compare('>=3.5.0')
+ if annotate_locks and cc.get_id() == 'clang'
cflags += '-DRTE_ANNOTATE_LOCKS'
cflags += '-Wthread-safety'
endif
diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
index d3caa3a3b4..a9ff87e863 100644
--- a/drivers/net/virtio/meson.build
+++ b/drivers/net/virtio/meson.build
@@ -31,7 +31,7 @@ if arch_subdir == 'x86'
sources_avx512 += files('virtio_rxtx_packed.c')
if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
- elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
+ elif (toolchain == 'clang')
cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
endif
endif
diff --git a/lib/eal/arm/include/rte_memcpy_64.h b/lib/eal/arm/include/rte_memcpy_64.h
index 90039039be..57fe24eb10 100644
--- a/lib/eal/arm/include/rte_memcpy_64.h
+++ b/lib/eal/arm/include/rte_memcpy_64.h
@@ -89,14 +89,6 @@ n <= (size_t)RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD)
**************************************/
-#if RTE_CC_IS_GNU && !defined RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK
-#if (GCC_VERSION < 50400)
-#warning "The GCC version is quite old, which may result in sub-optimal \
-performance of the compiled code. It is suggested that at least GCC 5.4.0 \
-be used."
-#endif
-#endif
-
static __rte_always_inline
void rte_mov16(uint8_t *dst, const uint8_t *src)
{
diff --git a/lib/eal/arm/include/rte_vect.h b/lib/eal/arm/include/rte_vect.h
index c97d299a3e..149458288e 100644
--- a/lib/eal/arm/include/rte_vect.h
+++ b/lib/eal/arm/include/rte_vect.h
@@ -67,11 +67,8 @@ vaddvq_u16(uint16x8_t a)
#endif
-#if (defined(RTE_ARCH_ARM) && defined(RTE_ARCH_32)) || \
-(defined(RTE_ARCH_ARM64) && RTE_CC_IS_GNU && (GCC_VERSION < 70000))
-/* NEON intrinsic vcopyq_laneq_u32() is not supported in ARMv7-A(AArch32)
- * On AArch64, this intrinsic is supported since GCC version 7.
- */
+#if defined(RTE_ARCH_ARM) && defined(RTE_ARCH_32)
+/* NEON intrinsic vcopyq_laneq_u32() is not supported in ARMv7-A(AArch32) */
static inline uint32x4_t
vcopyq_laneq_u32(uint32x4_t a, const int lane_a,
uint32x4_t b, const int lane_b)
@@ -80,36 +77,6 @@ vcopyq_laneq_u32(uint32x4_t a, const int lane_a,
}
#endif
-#if defined(RTE_ARCH_ARM64)
-#if RTE_CC_IS_GNU && (GCC_VERSION < 70000)
-
-/* NEON intrinsic vreinterpretq_u64_p128() is supported since GCC version 7 */
-static inline uint64x2_t
-vreinterpretq_u64_p128(poly128_t x)
-{
- return (uint64x2_t)x;
-}
-
-/* NEON intrinsic vreinterpretq_p64_u64() is supported since GCC version 7 */
-static inline poly64x2_t
-vreinterpretq_p64_u64(uint64x2_t x)
-{
- return (poly64x2_t)x;
-}
-
-/* NEON intrinsic vgetq_lane_p64() is supported since GCC version 7 */
-static inline poly64_t
-vgetq_lane_p64(poly64x2_t x, const int lane)
-{
- RTE_ASSERT(lane >= 0 && lane <= 1);
-
- poly64_t *p = (poly64_t *)&x;
-
- return p[lane];
-}
-#endif
-#endif
-
/*
* If (0 <= index <= 15), then call the ASIMD ext instruction on the
* 128 bit regs v0 and v1 with the appropriate index.
diff --git a/lib/eal/ppc/include/rte_altivec.h b/lib/eal/ppc/include/rte_altivec.h
index 7c088d2d16..bc8548f11e 100644
--- a/lib/eal/ppc/include/rte_altivec.h
+++ b/lib/eal/ppc/include/rte_altivec.h
@@ -6,7 +6,6 @@
#ifndef _RTE_ALTIVEC_H_
#define _RTE_ALTIVEC_H_
-/* To include altivec.h, GCC version must be >= 4.8 */
#include <altivec.h>
/*
diff --git a/lib/meson.build b/lib/meson.build
index 0d56b2083b..a67efaf718 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -244,7 +244,7 @@ foreach l:libraries
cflags += '-DRTE_USE_FUNCTION_VERSIONING'
endif
cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=lib.' + l
- if annotate_locks and cc.get_id() == 'clang' and cc.version().version_compare('>=3.5.0')
+ if annotate_locks and cc.get_id() == 'clang'
cflags += '-DRTE_ANNOTATE_LOCKS'
cflags += '-Wthread-safety'
endif
diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
index 9c6325aa0e..a74d0cff7c 100644
--- a/lib/vhost/meson.build
+++ b/lib/vhost/meson.build
@@ -8,9 +8,9 @@ endif
if has_libnuma
dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
endif
-if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
+if (toolchain == 'gcc')
cflags += '-DVHOST_GCC_UNROLL_PRAGMA'
-elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
+elif (toolchain == 'clang')
cflags += '-DVHOST_CLANG_UNROLL_PRAGMA'
endif
dpdk_conf.set('RTE_LIBRTE_VHOST_POSTCOPY', cc.has_header('linux/userfaultfd.h'))
diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
index a2e3e2635d..416f082dca 100644
--- a/lib/vhost/vhost.c
+++ b/lib/vhost/vhost.c
@@ -128,16 +128,8 @@ __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq,
static __rte_always_inline void
vhost_set_bit(unsigned int nr, volatile uint8_t *addr)
{
-#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100)
- /*
- * __sync_ built-ins are deprecated, but rte_atomic_ ones
- * are sub-optimized in older GCC versions.
- */
- __sync_fetch_and_or_1(addr, (1U << nr));
-#else
rte_atomic_fetch_or_explicit((volatile uint8_t __rte_atomic *)addr, (1U << nr),
rte_memory_order_relaxed);
-#endif
}
static __rte_always_inline void
@@ -207,17 +199,9 @@ __vhost_log_cache_sync(struct virtio_net *dev, struct vhost_virtqueue *vq)
for (i = 0; i < vq->log_cache_nb_elem; i++) {
struct log_cache_entry *elem = vq->log_cache + i;
-#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100)
- /*
- * '__sync' builtins are deprecated, but 'rte_atomic' ones
- * are sub-optimized in older GCC versions.
- */
- __sync_fetch_and_or(log_base + elem->offset, elem->val);
-#else
rte_atomic_fetch_or_explicit(
(unsigned long __rte_atomic *)(log_base + elem->offset),
elem->val, rte_memory_order_relaxed);
-#endif
}
rte_atomic_thread_fence(rte_memory_order_release);
--
2.48.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] build: remove obsolete compiler checks
2025-07-25 16:06 ` [PATCH v2] " Bruce Richardson
@ 2025-07-28 18:18 ` Stephen Hemminger
2025-08-19 8:10 ` David Marchand
1 sibling, 0 replies; 13+ messages in thread
From: Stephen Hemminger @ 2025-07-28 18:18 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev, david.marchand
On Fri, 25 Jul 2025 17:06:28 +0100
Bruce Richardson <bruce.richardson@intel.com> wrote:
> DPDK now recommends compiler versions GCC 8+, and Clang 7+, so remove
> checks and workarounds for versions old than these.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] build: remove obsolete compiler checks
2025-07-25 16:06 ` [PATCH v2] " Bruce Richardson
2025-07-28 18:18 ` Stephen Hemminger
@ 2025-08-19 8:10 ` David Marchand
2025-08-19 9:04 ` Bruce Richardson
2025-08-19 11:10 ` Bruce Richardson
1 sibling, 2 replies; 13+ messages in thread
From: David Marchand @ 2025-08-19 8:10 UTC (permalink / raw)
To: Bruce Richardson; +Cc: dev
Hello Bruce,
On Fri, Jul 25, 2025 at 6:07 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
> diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
> index d3caa3a3b4..a9ff87e863 100644
> --- a/drivers/net/virtio/meson.build
> +++ b/drivers/net/virtio/meson.build
> @@ -31,7 +31,7 @@ if arch_subdir == 'x86'
> sources_avx512 += files('virtio_rxtx_packed.c')
> if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
> cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
> - elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
> + elif (toolchain == 'clang')
> cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
> endif
> endif
[snip]
> diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
> index 9c6325aa0e..a74d0cff7c 100644
> --- a/lib/vhost/meson.build
> +++ b/lib/vhost/meson.build
> @@ -8,9 +8,9 @@ endif
> if has_libnuma
> dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
> endif
> -if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
> +if (toolchain == 'gcc')
> cflags += '-DVHOST_GCC_UNROLL_PRAGMA'
> -elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
> +elif (toolchain == 'clang')
> cflags += '-DVHOST_CLANG_UNROLL_PRAGMA'
> endif
> dpdk_conf.set('RTE_LIBRTE_VHOST_POSTCOPY', cc.has_header('linux/userfaultfd.h'))
Sorry, I did not notice in the v1, but lib/vhost and
drivers/net/virtio have the same construct, yet only lib/vhost gets
updated on the gcc version check in this patch.
Is this intentional?
Since GCC 8.0+ is recommended, I would keep the version check in both
vhost and net/virtio.
Other than this, it lgtm.
Reviewed-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] build: remove obsolete compiler checks
2025-08-19 8:10 ` David Marchand
@ 2025-08-19 9:04 ` Bruce Richardson
2025-08-19 11:10 ` Bruce Richardson
1 sibling, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2025-08-19 9:04 UTC (permalink / raw)
To: David Marchand; +Cc: dev
On Tue, Aug 19, 2025 at 10:10:21AM +0200, David Marchand wrote:
> Hello Bruce,
>
> On Fri, Jul 25, 2025 at 6:07 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> > diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
> > index d3caa3a3b4..a9ff87e863 100644
> > --- a/drivers/net/virtio/meson.build
> > +++ b/drivers/net/virtio/meson.build
> > @@ -31,7 +31,7 @@ if arch_subdir == 'x86'
> > sources_avx512 += files('virtio_rxtx_packed.c')
> > if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
> > cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
> > - elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
> > + elif (toolchain == 'clang')
> > cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
> > endif
> > endif
>
> [snip]
>
> > diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
> > index 9c6325aa0e..a74d0cff7c 100644
> > --- a/lib/vhost/meson.build
> > +++ b/lib/vhost/meson.build
> > @@ -8,9 +8,9 @@ endif
> > if has_libnuma
> > dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
> > endif
> > -if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
> > +if (toolchain == 'gcc')
> > cflags += '-DVHOST_GCC_UNROLL_PRAGMA'
> > -elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
> > +elif (toolchain == 'clang')
> > cflags += '-DVHOST_CLANG_UNROLL_PRAGMA'
> > endif
> > dpdk_conf.set('RTE_LIBRTE_VHOST_POSTCOPY', cc.has_header('linux/userfaultfd.h'))
>
> Sorry, I did not notice in the v1, but lib/vhost and
> drivers/net/virtio have the same construct, yet only lib/vhost gets
> updated on the gcc version check in this patch.
> Is this intentional?
Not that I remember, I seem to have missed that.
>
> Since GCC 8.0+ is recommended, I would keep the version check in both
> vhost and net/virtio.
I think I actually checked this out, and decided that it was ok to drop the
check. I will reconfirm that, see how this is used and if it really
needs 8.3 GCC.
>
> Other than this, it lgtm.
> Reviewed-by: David Marchand <david.marchand@redhat.com>
>
>
> --
> David Marchand
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2] build: remove obsolete compiler checks
2025-08-19 8:10 ` David Marchand
2025-08-19 9:04 ` Bruce Richardson
@ 2025-08-19 11:10 ` Bruce Richardson
1 sibling, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2025-08-19 11:10 UTC (permalink / raw)
To: David Marchand; +Cc: dev
On Tue, Aug 19, 2025 at 10:10:21AM +0200, David Marchand wrote:
> Hello Bruce,
>
> On Fri, Jul 25, 2025 at 6:07 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> > diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
> > index d3caa3a3b4..a9ff87e863 100644
> > --- a/drivers/net/virtio/meson.build
> > +++ b/drivers/net/virtio/meson.build
> > @@ -31,7 +31,7 @@ if arch_subdir == 'x86'
> > sources_avx512 += files('virtio_rxtx_packed.c')
> > if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
> > cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
> > - elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
> > + elif (toolchain == 'clang')
> > cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
> > endif
> > endif
>
> [snip]
>
> > diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
> > index 9c6325aa0e..a74d0cff7c 100644
> > --- a/lib/vhost/meson.build
> > +++ b/lib/vhost/meson.build
> > @@ -8,9 +8,9 @@ endif
> > if has_libnuma
> > dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
> > endif
> > -if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
> > +if (toolchain == 'gcc')
> > cflags += '-DVHOST_GCC_UNROLL_PRAGMA'
> > -elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
> > +elif (toolchain == 'clang')
> > cflags += '-DVHOST_CLANG_UNROLL_PRAGMA'
> > endif
> > dpdk_conf.set('RTE_LIBRTE_VHOST_POSTCOPY', cc.has_header('linux/userfaultfd.h'))
>
> Sorry, I did not notice in the v1, but lib/vhost and
> drivers/net/virtio have the same construct, yet only lib/vhost gets
> updated on the gcc version check in this patch.
> Is this intentional?
>
> Since GCC 8.0+ is recommended, I would keep the version check in both
> vhost and net/virtio.
>
Checking quickly with Godbolt, the pragma seems to be recognised by GCC 8.1
in the same way as with GCC 8.3. Therefore removing the version check looks
the correct option to me.
However, a better cleanup is to remove these defines from the meson.build
file completely, and instead just check for GCC and clang directly in the
header file.
/Bruce
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v3 1/2] build: remove obsolete compiler checks
2025-07-18 12:14 [PATCH] build: remove obsolete compiler checks Bruce Richardson
` (2 preceding siblings ...)
2025-07-25 16:06 ` [PATCH v2] " Bruce Richardson
@ 2025-08-19 11:25 ` Bruce Richardson
2025-08-19 11:25 ` [PATCH v3 2/2] virtio: simplify use of pragmas Bruce Richardson
3 siblings, 1 reply; 13+ messages in thread
From: Bruce Richardson @ 2025-08-19 11:25 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, Stephen Hemminger, David Marchand
DPDK now recommends compiler versions GCC 8+, and Clang 7+, so remove
checks and workarounds for versions old than these.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
V3: fix inconsistency between build files for vhost and net/virtio
V2: Fix feedback from V1.
* remove obsolete comment from arm/meson.build
* sort octeontx alphabetically in driver list
---
config/arm/meson.build | 1 -
config/meson.build | 5 ----
drivers/event/meson.build | 5 +---
drivers/meson.build | 2 +-
drivers/net/virtio/meson.build | 4 ++--
lib/eal/arm/include/rte_memcpy_64.h | 8 -------
lib/eal/arm/include/rte_vect.h | 37 ++---------------------------
lib/eal/ppc/include/rte_altivec.h | 1 -
lib/meson.build | 2 +-
lib/vhost/meson.build | 4 ++--
lib/vhost/vhost.c | 16 -------------
11 files changed, 9 insertions(+), 76 deletions(-)
diff --git a/config/arm/meson.build b/config/arm/meson.build
index 35b7553e74..c0dc42e7d1 100644
--- a/config/arm/meson.build
+++ b/config/arm/meson.build
@@ -13,7 +13,6 @@ flags_common = [
# ['RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD', 512],
# Leave below RTE_ARM64_MEMCPY_xxx options commented out,
# unless there are strong reasons.
- # ['RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK', false],
# ['RTE_ARM64_MEMCPY_ALIGN_MASK', 0xF],
# ['RTE_ARM64_MEMCPY_STRICT_ALIGN', false],
diff --git a/config/meson.build b/config/meson.build
index f31fef216c..c7a780dcc8 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -492,11 +492,6 @@ if get_option('b_lto')
else
error('compiler does not support fat LTO objects - please turn LTO off')
endif
- # workaround for gcc bug 81440
- if cc.get_id() == 'gcc' and cc.version().version_compare('<8.0')
- add_project_arguments('-Wno-lto-type-mismatch', language: 'c')
- add_project_link_arguments('-Wno-lto-type-mismatch', language: 'c')
- endif
endif
if get_option('b_sanitize') == 'address' or get_option('b_sanitize') == 'address,undefined'
diff --git a/drivers/event/meson.build b/drivers/event/meson.build
index d6706b57f7..ddaa0300ac 100644
--- a/drivers/event/meson.build
+++ b/drivers/event/meson.build
@@ -11,12 +11,9 @@ drivers = [
'dpaa',
'dpaa2',
'dsw',
+ 'octeontx',
'opdl',
'skeleton',
'sw',
]
-if not (toolchain == 'gcc' and cc.version().version_compare('<4.8.6') and
- dpdk_conf.has('RTE_ARCH_ARM64'))
- drivers += 'octeontx'
-endif
std_deps = ['eventdev', 'kvargs']
diff --git a/drivers/meson.build b/drivers/meson.build
index b62880db02..2760f4d593 100644
--- a/drivers/meson.build
+++ b/drivers/meson.build
@@ -237,7 +237,7 @@ foreach subpath:subdirs
enabled_drivers += name
lib_name = '_'.join(['rte', class, name])
cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=' + '.'.join([log_prefix, name])
- if annotate_locks and cc.get_id() == 'clang' and cc.version().version_compare('>=3.5.0')
+ if annotate_locks and cc.get_id() == 'clang'
cflags += '-DRTE_ANNOTATE_LOCKS'
cflags += '-Wthread-safety'
endif
diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
index d3caa3a3b4..be653edb34 100644
--- a/drivers/net/virtio/meson.build
+++ b/drivers/net/virtio/meson.build
@@ -29,9 +29,9 @@ if arch_subdir == 'x86'
if cc_has_avx512
cflags += ['-DVIRTIO_RXTX_PACKED_VEC']
sources_avx512 += files('virtio_rxtx_packed.c')
- if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
+ if toolchain == 'gcc'
cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
- elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
+ elif toolchain == 'clang'
cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
endif
endif
diff --git a/lib/eal/arm/include/rte_memcpy_64.h b/lib/eal/arm/include/rte_memcpy_64.h
index 90039039be..57fe24eb10 100644
--- a/lib/eal/arm/include/rte_memcpy_64.h
+++ b/lib/eal/arm/include/rte_memcpy_64.h
@@ -89,14 +89,6 @@ n <= (size_t)RTE_ARM64_MEMCPY_UNALIGNED_THRESHOLD)
**************************************/
-#if RTE_CC_IS_GNU && !defined RTE_ARM64_MEMCPY_SKIP_GCC_VER_CHECK
-#if (GCC_VERSION < 50400)
-#warning "The GCC version is quite old, which may result in sub-optimal \
-performance of the compiled code. It is suggested that at least GCC 5.4.0 \
-be used."
-#endif
-#endif
-
static __rte_always_inline
void rte_mov16(uint8_t *dst, const uint8_t *src)
{
diff --git a/lib/eal/arm/include/rte_vect.h b/lib/eal/arm/include/rte_vect.h
index c97d299a3e..149458288e 100644
--- a/lib/eal/arm/include/rte_vect.h
+++ b/lib/eal/arm/include/rte_vect.h
@@ -67,11 +67,8 @@ vaddvq_u16(uint16x8_t a)
#endif
-#if (defined(RTE_ARCH_ARM) && defined(RTE_ARCH_32)) || \
-(defined(RTE_ARCH_ARM64) && RTE_CC_IS_GNU && (GCC_VERSION < 70000))
-/* NEON intrinsic vcopyq_laneq_u32() is not supported in ARMv7-A(AArch32)
- * On AArch64, this intrinsic is supported since GCC version 7.
- */
+#if defined(RTE_ARCH_ARM) && defined(RTE_ARCH_32)
+/* NEON intrinsic vcopyq_laneq_u32() is not supported in ARMv7-A(AArch32) */
static inline uint32x4_t
vcopyq_laneq_u32(uint32x4_t a, const int lane_a,
uint32x4_t b, const int lane_b)
@@ -80,36 +77,6 @@ vcopyq_laneq_u32(uint32x4_t a, const int lane_a,
}
#endif
-#if defined(RTE_ARCH_ARM64)
-#if RTE_CC_IS_GNU && (GCC_VERSION < 70000)
-
-/* NEON intrinsic vreinterpretq_u64_p128() is supported since GCC version 7 */
-static inline uint64x2_t
-vreinterpretq_u64_p128(poly128_t x)
-{
- return (uint64x2_t)x;
-}
-
-/* NEON intrinsic vreinterpretq_p64_u64() is supported since GCC version 7 */
-static inline poly64x2_t
-vreinterpretq_p64_u64(uint64x2_t x)
-{
- return (poly64x2_t)x;
-}
-
-/* NEON intrinsic vgetq_lane_p64() is supported since GCC version 7 */
-static inline poly64_t
-vgetq_lane_p64(poly64x2_t x, const int lane)
-{
- RTE_ASSERT(lane >= 0 && lane <= 1);
-
- poly64_t *p = (poly64_t *)&x;
-
- return p[lane];
-}
-#endif
-#endif
-
/*
* If (0 <= index <= 15), then call the ASIMD ext instruction on the
* 128 bit regs v0 and v1 with the appropriate index.
diff --git a/lib/eal/ppc/include/rte_altivec.h b/lib/eal/ppc/include/rte_altivec.h
index 7c088d2d16..bc8548f11e 100644
--- a/lib/eal/ppc/include/rte_altivec.h
+++ b/lib/eal/ppc/include/rte_altivec.h
@@ -6,7 +6,6 @@
#ifndef _RTE_ALTIVEC_H_
#define _RTE_ALTIVEC_H_
-/* To include altivec.h, GCC version must be >= 4.8 */
#include <altivec.h>
/*
diff --git a/lib/meson.build b/lib/meson.build
index 0d56b2083b..a67efaf718 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -244,7 +244,7 @@ foreach l:libraries
cflags += '-DRTE_USE_FUNCTION_VERSIONING'
endif
cflags += '-DRTE_LOG_DEFAULT_LOGTYPE=lib.' + l
- if annotate_locks and cc.get_id() == 'clang' and cc.version().version_compare('>=3.5.0')
+ if annotate_locks and cc.get_id() == 'clang'
cflags += '-DRTE_ANNOTATE_LOCKS'
cflags += '-Wthread-safety'
endif
diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
index 9c6325aa0e..0a7a76f6db 100644
--- a/lib/vhost/meson.build
+++ b/lib/vhost/meson.build
@@ -8,9 +8,9 @@ endif
if has_libnuma
dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
endif
-if (toolchain == 'gcc' and cc.version().version_compare('>=8.3.0'))
+if toolchain == 'gcc'
cflags += '-DVHOST_GCC_UNROLL_PRAGMA'
-elif (toolchain == 'clang' and cc.version().version_compare('>=3.7.0'))
+elif toolchain == 'clang'
cflags += '-DVHOST_CLANG_UNROLL_PRAGMA'
endif
dpdk_conf.set('RTE_LIBRTE_VHOST_POSTCOPY', cc.has_header('linux/userfaultfd.h'))
diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
index a2e3e2635d..416f082dca 100644
--- a/lib/vhost/vhost.c
+++ b/lib/vhost/vhost.c
@@ -128,16 +128,8 @@ __vhost_iova_to_vva(struct virtio_net *dev, struct vhost_virtqueue *vq,
static __rte_always_inline void
vhost_set_bit(unsigned int nr, volatile uint8_t *addr)
{
-#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100)
- /*
- * __sync_ built-ins are deprecated, but rte_atomic_ ones
- * are sub-optimized in older GCC versions.
- */
- __sync_fetch_and_or_1(addr, (1U << nr));
-#else
rte_atomic_fetch_or_explicit((volatile uint8_t __rte_atomic *)addr, (1U << nr),
rte_memory_order_relaxed);
-#endif
}
static __rte_always_inline void
@@ -207,17 +199,9 @@ __vhost_log_cache_sync(struct virtio_net *dev, struct vhost_virtqueue *vq)
for (i = 0; i < vq->log_cache_nb_elem; i++) {
struct log_cache_entry *elem = vq->log_cache + i;
-#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION < 70100)
- /*
- * '__sync' builtins are deprecated, but 'rte_atomic' ones
- * are sub-optimized in older GCC versions.
- */
- __sync_fetch_and_or(log_base + elem->offset, elem->val);
-#else
rte_atomic_fetch_or_explicit(
(unsigned long __rte_atomic *)(log_base + elem->offset),
elem->val, rte_memory_order_relaxed);
-#endif
}
rte_atomic_thread_fence(rte_memory_order_release);
--
2.48.1
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v3 2/2] virtio: simplify use of pragmas
2025-08-19 11:25 ` [PATCH v3 1/2] " Bruce Richardson
@ 2025-08-19 11:25 ` Bruce Richardson
0 siblings, 0 replies; 13+ messages in thread
From: Bruce Richardson @ 2025-08-19 11:25 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
In virtio/vhost there is use of pragmas to get clang or gcc to unroll
loops. This was originally done using compiler version checks in the
meson.build file, but with all supported gcc and clang versions now
supporting the needed pragmas, we can simplify things by just having the
headers check directly for gcc or clang.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/virtio/meson.build | 5 -----
drivers/net/virtio/virtio_rxtx_packed.h | 16 ++++++----------
lib/vhost/meson.build | 5 -----
lib/vhost/vhost.h | 14 +++++---------
4 files changed, 11 insertions(+), 29 deletions(-)
diff --git a/drivers/net/virtio/meson.build b/drivers/net/virtio/meson.build
index be653edb34..54a28538c3 100644
--- a/drivers/net/virtio/meson.build
+++ b/drivers/net/virtio/meson.build
@@ -29,11 +29,6 @@ if arch_subdir == 'x86'
if cc_has_avx512
cflags += ['-DVIRTIO_RXTX_PACKED_VEC']
sources_avx512 += files('virtio_rxtx_packed.c')
- if toolchain == 'gcc'
- cflags += '-DVIRTIO_GCC_UNROLL_PRAGMA'
- elif toolchain == 'clang'
- cflags += '-DVIRTIO_CLANG_UNROLL_PRAGMA'
- endif
endif
cflags += ['-DVIRTIO_RXTX_VEC']
sources += files('virtio_rxtx_simple_sse.c')
diff --git a/drivers/net/virtio/virtio_rxtx_packed.h b/drivers/net/virtio/virtio_rxtx_packed.h
index 12bfcee809..f7cc60bb51 100644
--- a/drivers/net/virtio/virtio_rxtx_packed.h
+++ b/drivers/net/virtio/virtio_rxtx_packed.h
@@ -67,19 +67,15 @@
#endif
#define PACKED_BATCH_MASK (PACKED_BATCH_SIZE - 1)
-#ifdef VIRTIO_GCC_UNROLL_PRAGMA
-#define virtio_for_each_try_unroll(iter, val, size) _Pragma("GCC unroll 4") \
- for (iter = val; iter < size; iter++)
-#endif
-
-#ifdef VIRTIO_CLANG_UNROLL_PRAGMA
+#if defined __clang__
#define virtio_for_each_try_unroll(iter, val, size) _Pragma("unroll 4") \
for (iter = val; iter < size; iter++)
-#endif
-
-#ifndef virtio_for_each_try_unroll
-#define virtio_for_each_try_unroll(iter, val, size) \
+#elif defined __GNUC__
+#define virtio_for_each_try_unroll(iter, val, size) _Pragma("GCC unroll 4") \
for (iter = val; iter < size; iter++)
+#else
+#define virtio_for_each_try_unroll(iter, val, num) \
+ for (iter = val; iter < num; iter++)
#endif
static inline void
diff --git a/lib/vhost/meson.build b/lib/vhost/meson.build
index 0a7a76f6db..6a24981d10 100644
--- a/lib/vhost/meson.build
+++ b/lib/vhost/meson.build
@@ -8,11 +8,6 @@ endif
if has_libnuma
dpdk_conf.set10('RTE_LIBRTE_VHOST_NUMA', true)
endif
-if toolchain == 'gcc'
- cflags += '-DVHOST_GCC_UNROLL_PRAGMA'
-elif toolchain == 'clang'
- cflags += '-DVHOST_CLANG_UNROLL_PRAGMA'
-endif
dpdk_conf.set('RTE_LIBRTE_VHOST_POSTCOPY', cc.has_header('linux/userfaultfd.h'))
cflags += no_wvla_cflag
diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
index 6ffc3f20c1..e9e71c1707 100644
--- a/lib/vhost/vhost.h
+++ b/lib/vhost/vhost.h
@@ -69,17 +69,13 @@
sizeof(struct vring_packed_desc))
#define PACKED_BATCH_MASK (PACKED_BATCH_SIZE - 1)
-#ifdef VHOST_GCC_UNROLL_PRAGMA
-#define vhost_for_each_try_unroll(iter, val, size) _Pragma("GCC unroll 4") \
- for (iter = val; iter < size; iter++)
-#endif
-
-#ifdef VHOST_CLANG_UNROLL_PRAGMA
+#if defined __clang__
#define vhost_for_each_try_unroll(iter, val, size) _Pragma("unroll 4") \
for (iter = val; iter < size; iter++)
-#endif
-
-#ifndef vhost_for_each_try_unroll
+#elif defined __GNUC__
+#define vhost_for_each_try_unroll(iter, val, size) _Pragma("GCC unroll 4") \
+ for (iter = val; iter < size; iter++)
+#else
#define vhost_for_each_try_unroll(iter, val, num) \
for (iter = val; iter < num; iter++)
#endif
--
2.48.1
^ permalink raw reply [flat|nested] 13+ messages in thread