代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。