[dpdk-stable] [PATCH] net/i40e: fix gcc 11 build warning on POWER architecture

David Christensen drc at linux.vnet.ibm.com
Thu Oct 14 21:05:00 CEST 2021


Building DPDK with a gcc 11 based compiler such as the IBM Advanced
Toolchain 15 (1) generates a stringop-overflow warning when using -O3
optimization (DPDK default for production releases):

writing 1 byte into a region of size 0 [-Wstringop-overflow=]

The issue has been reported to the gcc project (2) but can be resolved
by preventing the compiler from unrolling the loop as part of the -O3
optimization.

(1) https://www.ibm.com/support/pages/advance-toolchain-linux-power
(2) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102316

Bugzilla ID: 743

Signed-off-by: David Christensen <drc at linux.vnet.ibm.com>
---
 drivers/net/i40e/i40e_flow.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index e41a84f1d7..17ab7ad9b9 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -3047,6 +3047,10 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				return -rte_errno;
 			}
 
+#if defined(RTE_ARCH_PPC_64) && defined(RTE_TOOLCHAIN_GCC) && \
+(GCC_VERSION >= 110000)
+#pragma GCC unroll 1
+#endif
 			for (i = 0; i < raw_spec->length; i++) {
 				j = i + next_dst_off;
 				filter->input.flow_ext.flexbytes[j] =
-- 
2.27.0



More information about the stable mailing list