DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jie Hai <haijie1@huawei.com>
To: <dev@dpdk.org>, <thomas@monjalon.net>, <ferruh.yigit@amd.com>,
	Yisen Zhuang <yisen.zhuang@huawei.com>,
	"Min Hu (Connor)" <humin29@huawei.com>,
	Huisong Li <lihuisong@huawei.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Chengwen Feng <fengchengwen@huawei.com>,
	"Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Cc: <haijie1@huawei.com>
Subject: [PATCH 1/4] net/hns3: restrict FDIR only support one tunnel header
Date: Fri, 18 Oct 2024 14:19:38 +0800	[thread overview]
Message-ID: <20241018061941.29960-2-haijie1@huawei.com> (raw)
In-Reply-To: <20241018061941.29960-1-haijie1@huawei.com>

From: Chengwen Feng <fengchengwen@huawei.com>

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")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Jie Hai <haijie1@huawei.com>
---
 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 37eb2b4c3807..e287420fb0f8 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.22.0


  reply	other threads:[~2024-10-18  6:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-18  6:19 [PATCH 0/4] net/hns3: support more flow pattern match Jie Hai
2024-10-18  6:19 ` Jie Hai [this message]
2024-10-18  6:19 ` [PATCH 2/4] net/hns3: support general tunnel flow match Jie Hai
2024-10-18  6:19 ` [PATCH 3/4] net/hns3: add FDIR VLAN match mode param string Jie Hai
2024-10-18  6:19 ` [PATCH 4/4] net/hns3: support outer VLAN flow match Jie Hai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241018061941.29960-2-haijie1@huawei.com \
    --to=haijie1@huawei.com \
    --cc=dev@dpdk.org \
    --cc=fengchengwen@huawei.com \
    --cc=ferruh.yigit@amd.com \
    --cc=ferruh.yigit@intel.com \
    --cc=humin29@huawei.com \
    --cc=lihuisong@huawei.com \
    --cc=thomas@monjalon.net \
    --cc=xavier.huwei@huawei.com \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).