From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0A4AAA04DD; Thu, 22 Oct 2020 10:20:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DFA0AA905; Thu, 22 Oct 2020 10:20:35 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 11CF166DA; Thu, 22 Oct 2020 10:20:32 +0200 (CEST) IronPort-SDR: HOjQD4DovRwauSf2Kn9AdPn/wnX0ORK1Dd0YH7y99H+e1txlzkg+fm7XONn1V2aR3tK0XUyLYb r5nDYzMJiBew== X-IronPort-AV: E=McAfee;i="6000,8403,9781"; a="167589367" X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="167589367" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Oct 2020 01:20:31 -0700 IronPort-SDR: oJCyU2KGXbu0yjlO9AnMvOGT0U8ev78UA0FxTMUe5I32zzQTjGbFtdn6ulGPzJZnB7J3gvTICp AlodyKeEqQig== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,404,1596524400"; d="scan'208";a="316647292" Received: from dpdk-beileix-3.sh.intel.com ([10.67.110.213]) by orsmga003.jf.intel.com with ESMTP; 22 Oct 2020 01:20:29 -0700 From: beilei.xing@intel.com To: dev@dpdk.org Cc: jia.guo@intel.com, Beilei Xing , stable@dpdk.org Date: Fri, 23 Oct 2020 16:15:09 +0800 Message-Id: <20201023081509.13087-1-beilei.xing@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/i40e: fix FDIR issue for ETH + VLAN pattern X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Beilei Xing Currently, can't create more than one following flow for ETH + VLAN pattern: > flow create 0 ingress pattern eth / vlan vid is 350 / end actions queue index 2 / end The root cause is the keys of all such flows are the same. Fixes: 42044b69c67d ("net/i40e: support input set selection for FDIR") Cc: stable@dpdk.org Signed-off-by: Beilei Xing --- drivers/net/i40e/i40e_flow.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index adc5da1c53..60043322a1 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -28,6 +28,9 @@ #define I40E_IPV6_FRAG_HEADER 44 #define I40E_TENANT_ARRAY_NUM 3 #define I40E_TCI_MASK 0xFFFF +#define I40E_PRI_MASK 0xE000 +#define I40E_CFI_MASK 0x1000 +#define I40E_VID_MASK 0x0FFF static int i40e_flow_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, @@ -2705,12 +2708,22 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, RTE_ASSERT(!(input_set & I40E_INSET_LAST_ETHER_TYPE)); if (vlan_spec && vlan_mask) { - if (vlan_mask->tci == - rte_cpu_to_be_16(I40E_TCI_MASK)) { - input_set |= I40E_INSET_VLAN_INNER; - filter->input.flow_ext.vlan_tci = - vlan_spec->tci; + if (vlan_mask->tci != + rte_cpu_to_be_16(I40E_TCI_MASK) && + vlan_mask->tci != + rte_cpu_to_be_16(I40E_PRI_MASK) && + vlan_mask->tci != + rte_cpu_to_be_16(I40E_CFI_MASK) && + vlan_mask->tci != + rte_cpu_to_be_16(I40E_VID_MASK)) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ITEM, + item, + "Unsupported TCI mask."); } + input_set |= I40E_INSET_VLAN_INNER; + filter->input.flow_ext.vlan_tci = + vlan_spec->tci; } if (vlan_spec && vlan_mask && vlan_mask->inner_type) { if (vlan_mask->inner_type != RTE_BE16(0xffff)) { -- 2.26.2