1 Star 0 Fork 72

叶青龙/dpdk

forked from src-openEuler/dpdk 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0336-net-i40e-fix-build-with-MinGW-GCC-12.patch 1.68 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2023-07-12 11:47 . fix build with GCC 12
From 9ba87edbe69cac90bf8aff9714e3724519c633bf Mon Sep 17 00:00:00 2001
From: Amit Prakash Shukla <amitprakashs@marvell.com>
Date: Wed, 24 Aug 2022 19:33:38 +0530
Subject: [PATCH] net/i40e: fix build with MinGW GCC 12
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit eb440cea1e05245f362ec7fca932f2d977f12359 ]
When compiling with MinGW GCC 12,
the rte_flow_item array is seen as read out of bound:
net/i40e/i40e_hash.c:389:47: error:
array subscript 50 is above array bounds of ‘const uint64_t[50]’
{aka ‘const long long unsigned int[50]’} [-Werror=array-bounds]
389 | item_hdr = pattern_item_header[last_item_type];
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
It seems the assert check done above this line has no impact.
A real check is added to make the compiler happy.
Fixes: ef4c16fd9148 ("net/i40e: refactor RSS flow")
Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
---
drivers/net/i40e/i40e_hash.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/i40e/i40e_hash.c b/drivers/net/i40e/i40e_hash.c
index 8962e9d97a..a1ff85fceb 100644
--- a/drivers/net/i40e/i40e_hash.c
+++ b/drivers/net/i40e/i40e_hash.c
@@ -384,8 +384,10 @@ i40e_hash_get_pattern_type(const struct rte_flow_item pattern[],
}
prev_item_type = last_item_type;
- assert(last_item_type < (enum rte_flow_item_type)
- RTE_DIM(pattern_item_header));
+ if (last_item_type >= (enum rte_flow_item_type)
+ RTE_DIM(pattern_item_header))
+ goto not_sup;
+
item_hdr = pattern_item_header[last_item_type];
assert(item_hdr);
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yeqinglong01/dpdk.git
git@gitee.com:yeqinglong01/dpdk.git
yeqinglong01
dpdk
dpdk
master

搜索帮助