File 0002-fix-cpu-compatibility.patch of Package dpdk.16537

From: mvarlese@suse.de

diff -Nuar dpdk-18.11.old/drivers/bus/vdev/vdev.c dpdk-18.11/drivers/bus/vdev/vdev.c
--- dpdk-18.11.old/drivers/bus/vdev/vdev.c	2019-02-20 14:26:48.849061397 +0100
+++ dpdk-18.11/drivers/bus/vdev/vdev.c	2019-02-20 14:33:12.638554838 +0100
@@ -55,7 +55,11 @@
 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 -Nuar dpdk-18.11.old/lib/librte_eal/common/eal_common_bus.c dpdk-18.11/lib/librte_eal/common/eal_common_bus.c
--- dpdk-18.11.old/lib/librte_eal/common/eal_common_bus.c	2019-02-20 14:26:48.801061210 +0100
+++ dpdk-18.11/lib/librte_eal/common/eal_common_bus.c	2019-02-20 14:28:52.933544223 +0100
@@ -43,8 +43,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 -Nuar dpdk-18.11.old/lib/librte_eal/common/include/rte_common.h dpdk-18.11/lib/librte_eal/common/include/rte_common.h
--- dpdk-18.11.old/lib/librte_eal/common/include/rte_common.h	2019-02-20 14:26:48.809061243 +0100
+++ dpdk-18.11/lib/librte_eal/common/include/rte_common.h	2019-02-20 14:51:56.275496936 +0100
@@ -103,8 +103,21 @@
  *   Priority number must be above 100.
  *   Lowest number is the first to run.
  */
+#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
+
 
 /**
  * Run function before main() with low priority.
openSUSE Build Service is sponsored by