17 Star 12 Fork 76

src-openEuler/dpdk

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0052-net-hns3-restrict-tunnel-flow-rule-to-one-header.patch 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
huangdengdui 提交于 2024-11-11 18:33 . sync some patchs from upstreaming
From 0448f90a404a332052aacd45e8445c9fd22cfc61 Mon Sep 17 00:00:00 2001
From: Chengwen Feng <[email protected]>
Date: Fri, 18 Oct 2024 14:19:38 +0800
Subject: [PATCH] net/hns3: restrict tunnel flow rule to one header
[ upstream commit 8887c207b9373a1875031c5346706f698322d66d ]
The device's flow director supports a maximum of one tunnel header, if
passed more than one tunnel header from rte-flow API, the driver should
return error.
Fixes: fcba820d9b9e ("net/hns3: support flow director")
Signed-off-by: Chengwen Feng <[email protected]>
Signed-off-by: Jie Hai <[email protected]>
---
drivers/net/hns3/hns3_flow.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/hns3/hns3_flow.c b/drivers/net/hns3/hns3_flow.c
index 37eb2b4..e287420 100644
--- a/drivers/net/hns3/hns3_flow.c
+++ b/drivers/net/hns3/hns3_flow.c
@@ -1221,6 +1221,11 @@ hns3_parse_tunnel(const struct rte_flow_item *item, struct hns3_fdir_rule *rule,
"Tunnel packets must configure "
"with mask");
+ if (rule->key_conf.spec.tunnel_type != 0)
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item, "Too many tunnel headers!");
+
switch (item->type) {
case RTE_FLOW_ITEM_TYPE_VXLAN:
case RTE_FLOW_ITEM_TYPE_VXLAN_GPE:
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/dpdk.git
[email protected]:src-openeuler/dpdk.git
src-openeuler
dpdk
dpdk
master

搜索帮助