File 0001-fix-cpu-compatibility.patch of Package dpdk

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

Added 0001-fix-cpu-compatibility.patch to address issue with older CPUs (bsc#1125961, bsc#1099474)

Updated 2026-02-17 for version 25.11

---
 drivers/bus/vdev/vdev.c         |    4 ++++
 lib/eal/common/eal_common_bus.c |    4 ++++
 lib/eal/include/rte_common.h    |   14 +++++++++++++-
 3 files changed, 21 insertions(+), 1 deletion(-)

--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -53,7 +53,11 @@
 
 /* register a driver */
 RTE_EXPORT_INTERNAL_SYMBOL(rte_vdev_register)
+#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);
--- a/lib/eal/common/eal_common_bus.c
+++ b/lib/eal/common/eal_common_bus.c
@@ -25,7 +25,11 @@
 }
 
 RTE_EXPORT_INTERNAL_SYMBOL(rte_bus_register)
+#if defined(__x86_64__) ||  defined(__i386__)
+void __attribute__((target ("sse2")))
+#else
 void
+#endif
 rte_bus_register(struct rte_bus *bus)
 {
 	RTE_VERIFY(bus);
--- a/lib/eal/include/rte_common.h
+++ b/lib/eal/include/rte_common.h
@@ -358,8 +358,20 @@
  */
 #ifndef RTE_INIT_PRIO /* Allow to override from EAL */
 #ifndef RTE_TOOLCHAIN_MSVC
+#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
 #else
 /* definition from the Microsoft CRT */
 typedef int(__cdecl *_PIFV)(void);
openSUSE Build Service is sponsored by