SHA256
1
0
forked from pool/dpdk
dpdk/0001-fix-cpu-compatibility.patch

74 lines
2.4 KiB
Diff
Raw Normal View History

From e2950fec9cd9c235a7847ed97b6914174857bf93 Mon Sep 17 00:00:00 2001
From: "mvarlese@suse.de" <mvarlese@suse.de>
Date: Wed, 29 Apr 2020 12:24:16 +0200
Subject: [PATCH] fix cpu compatibility
---
drivers/bus/vdev/vdev.c | 4 ++++
lib/librte_eal/common/eal_common_bus.c | 5 ++++-
lib/librte_eal/common/include/rte_common.h | 14 +++++++++++++-
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index a89ea2353..cf8e8dca6 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -55,7 +55,11 @@ static struct vdev_custom_scans vdev_custom_scans =
static rte_spinlock_t vdev_custom_scan_lock = RTE_SPINLOCK_INITIALIZER;
/* register a driver */
+#if defined(__x86_64__) || defined(__i386__)
+void __attribute__((target ("sse2")))
+#else
void
+#endif
rte_vdev_register(struct rte_vdev_driver *driver)
{
TAILQ_INSERT_TAIL(&vdev_driver_list, driver, next);
diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c
index baa5b532a..58f3fdbaa 100644
--- a/lib/librte_eal/common/eal_common_bus.c
+++ b/lib/librte_eal/common/eal_common_bus.c
@@ -15,8 +15,11 @@
static struct rte_bus_list rte_bus_list =
TAILQ_HEAD_INITIALIZER(rte_bus_list);
-
+#if defined(__x86_64__) || defined(__i386__)
+void __attribute__((target ("sse2")))
+#else
void
+#endif
rte_bus_register(struct rte_bus *bus)
{
RTE_VERIFY(bus);
diff --git a/lib/librte_eal/common/include/rte_common.h b/lib/librte_eal/common/include/rte_common.h
index c35283807..8f4f98ed4 100644
--- a/lib/librte_eal/common/include/rte_common.h
+++ b/lib/librte_eal/common/include/rte_common.h
@@ -107,8 +107,20 @@ typedef uint16_t unaligned_uint16_t;
* Lowest number is the first to run.
*/
#ifndef RTE_INIT_PRIO /* Allow to override from EAL */
+#if defined(__x86_64__) || defined(__i386__)
#define RTE_INIT_PRIO(func, prio) \
-static void __attribute__((constructor(RTE_PRIO(prio)), used)) func(void)
+static void \
+ __attribute__((constructor(RTE_PRIO(prio)), used)) \
+ __attribute__((target ("sse2"))) \
+ __attribute__((target ("no-sse3"))) \
+ __attribute__((target ("no-sse4"))) \
+ func(void)
+#else
+#define RTE_INIT_PRIO(func, prio) \
+static void \
+ __attribute__((constructor(RTE_PRIO(prio)), used)) \
+ func(void)
+#endif
#endif
/**
--
2.16.4