From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4281845B68; Fri, 18 Oct 2024 08:31:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 95E1740267; Fri, 18 Oct 2024 08:31:43 +0200 (CEST) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by mails.dpdk.org (Postfix) with ESMTP id C5CE54025F for ; Fri, 18 Oct 2024 08:31:39 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4XVF9k1gK7z1HLDL; Fri, 18 Oct 2024 14:27:22 +0800 (CST) Received: from kwepemf500004.china.huawei.com (unknown [7.202.181.242]) by mail.maildlp.com (Postfix) with ESMTPS id 87B381402E2; Fri, 18 Oct 2024 14:31:37 +0800 (CST) Received: from localhost.localdomain (10.28.79.22) by kwepemf500004.china.huawei.com (7.202.181.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 18 Oct 2024 14:31:36 +0800 From: Jie Hai To: , , , Yisen Zhuang , "Min Hu (Connor)" , Huisong Li , Ferruh Yigit , Chengwen Feng , "Wei Hu (Xavier)" CC: Subject: [PATCH 1/4] net/hns3: restrict FDIR only support one tunnel header Date: Fri, 18 Oct 2024 14:19:38 +0800 Message-ID: <20241018061941.29960-2-haijie1@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20241018061941.29960-1-haijie1@huawei.com> References: <20241018061941.29960-1-haijie1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemf500004.china.huawei.com (7.202.181.242) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Chengwen Feng 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 Signed-off-by: Jie Hai --- 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