[V3] net/qede: reduce the optimization level for gcc > 11
Thierry Herbelot
thierry.herbelot at 6wind.com
Tue Sep 9 07:40:23 CEST 2025
The qede PMD stopped working under Ubuntu-24.04 (using gcc-13) when
compiled with -O3 (default level for all DPDK code). A bug is opened
for this issue (see Link). The same issue is also seen with gcc-12
and gcc-14. The issue is not seen with clang-20.
A first workaround is to just disable all optimizations (-O0), which
restores packet Rx with Qlogic NICs. However, the performance impact
is not acceptable (around 50% drop).
A better compromise is to use -O1 for the qede PMD:
- there is some perf impact,
- but the PMD is working as expected (packets are correctly received).
When compiling with both -O2 and -O3 and gcc > 11, there is no packet
reception when using the qede PMD. The root cause could be missing
'volatile' keywords or missing memory barriers in the qede PMD code.
Link: https://bugs.dpdk.org/show_bug.cgi?id=1379
Signed-off-by: Thierry Herbelot <thierry.herbelot at 6wind.com>
---
V2: be more precise when dropping optimization level (only for gcc > 11)
V3: even more precise: the issue appears with gcc-12
---
drivers/net/qede/base/meson.build | 4 ++++
drivers/net/qede/meson.build | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/drivers/net/qede/base/meson.build b/drivers/net/qede/base/meson.build
index a6dad3ec7bcc..acab6e8ac938 100644
--- a/drivers/net/qede/base/meson.build
+++ b/drivers/net/qede/base/meson.build
@@ -55,3 +55,7 @@ foreach flag: error_cflags
base_cflags += flag
endif
endforeach
+# no packet Rx with gcc > 11 with compiling with default -O3 or -O2
+if (cc.get_id() == 'gcc' and cc.version().version_compare('>=12.0'))
+ base_cflags += '-O1'
+endif
diff --git a/drivers/net/qede/meson.build b/drivers/net/qede/meson.build
index e1b21d6ff5cd..86c3503a82f6 100644
--- a/drivers/net/qede/meson.build
+++ b/drivers/net/qede/meson.build
@@ -22,3 +22,7 @@ sources = files(
if cc.has_argument('-Wno-format-nonliteral')
cflags += '-Wno-format-nonliteral'
endif
+# no packet Rx with gcc > 11 with compiling with default -O3 or -O2
+if (cc.get_id() == 'gcc' and cc.version().version_compare('>=12.0'))
+ cflags += '-O1'
+endif
--
2.39.2
More information about the dev
mailing list