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 5B909A046B for ; Tue, 23 Jul 2019 07:28:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 48E961BF58; Tue, 23 Jul 2019 07:28:12 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id BA5931BF58; Tue, 23 Jul 2019 07:28:10 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jul 2019 22:28:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,297,1559545200"; d="scan'208";a="171852546" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 22 Jul 2019 22:28:08 -0700 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 22 Jul 2019 22:28:08 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 22 Jul 2019 22:28:08 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.134]) by shsmsx102.ccr.corp.intel.com ([169.254.2.3]) with mapi id 14.03.0439.000; Tue, 23 Jul 2019 13:28:06 +0800 From: "Xing, Beilei" To: "Ye, Xiaolong" , "Yigit, Ferruh" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH 1/2] net/i40e: fix ether pattern rule for fdir Thread-Index: AQHVQQxdNt6dERPs9kK1v5JSDIxkk6bXrH4A Date: Tue, 23 Jul 2019 05:28:06 +0000 Message-ID: <94479800C636CB44BD422CB454846E013CE09286@SHSMSX101.ccr.corp.intel.com> References: <20190722120639.62468-1-xiaolong.ye@intel.com> In-Reply-To: <20190722120639.62468-1-xiaolong.ye@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH 1/2] net/i40e: fix ether pattern rule for fdir X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" > -----Original Message----- > From: Ye, Xiaolong > Sent: Monday, July 22, 2019 8:07 PM > To: Yigit, Ferruh ; Xing, Beilei > ; Zhang, Qi Z > Cc: dev@dpdk.org; Ye, Xiaolong ; stable@dpdk.org > Subject: [PATCH 1/2] net/i40e: fix ether pattern rule for fdir >=20 > i40e FDIR doesn't allow to create flow with empty spec and mask for > ethertype pattern. Without this patch, below flow would be created > successfully which is unexpected. >=20 > > flow create 0 ingress pattern eth / end actions drop / end >=20 > Fixes: 7d83c152a207 ("net/i40e: parse flow director filter") > Cc: stable@dpdk.org > Cc: beilei.xing@intel.com >=20 > Signed-off-by: Xiaolong Ye > --- > drivers/net/i40e/i40e_flow.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c = index > 48a6782a8..3c0af70c0 100644 > --- a/drivers/net/i40e/i40e_flow.c > +++ b/drivers/net/i40e/i40e_flow.c > @@ -2442,6 +2442,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev > *dev, > uint64_t input_set =3D I40E_INSET_NONE; > uint16_t frag_off; > enum rte_flow_item_type item_type; > + enum rte_flow_item_type next_type; > enum rte_flow_item_type l3 =3D RTE_FLOW_ITEM_TYPE_END; > enum rte_flow_item_type cus_proto =3D RTE_FLOW_ITEM_TYPE_END; > uint32_t i, j; > @@ -2482,6 +2483,16 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev > *dev, > case RTE_FLOW_ITEM_TYPE_ETH: > eth_spec =3D item->spec; > eth_mask =3D item->mask; > + next_type =3D (item + 1)->type; > + > + if (next_type =3D=3D RTE_FLOW_ITEM_TYPE_END && > + (!eth_spec || !eth_mask)) { > + rte_flow_error_set(error, EINVAL, > + > RTE_FLOW_ERROR_TYPE_ITEM, > + item, > + "NULL eth spec/mask."); > + return -rte_errno; > + } >=20 > if (eth_spec && eth_mask) { > if (!rte_is_zero_ether_addr(ð_mask->src) > || @@ -2494,8 +2505,6 @@ i40e_flow_parse_fdir_pattern(struct > rte_eth_dev *dev, > } > } > if (eth_spec && eth_mask && eth_mask->type) { > - enum rte_flow_item_type next =3D (item + 1)- > >type; > - > if (eth_mask->type !=3D RTE_BE16(0xffff)) { > rte_flow_error_set(error, EINVAL, >=20 > RTE_FLOW_ERROR_TYPE_ITEM, > @@ -2506,7 +2515,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev > *dev, >=20 > ether_type =3D rte_be_to_cpu_16(eth_spec- > >type); >=20 > - if (next =3D=3D RTE_FLOW_ITEM_TYPE_VLAN || > + if (next_type =3D=3D > RTE_FLOW_ITEM_TYPE_VLAN || > ether_type =3D=3D RTE_ETHER_TYPE_IPV4 || > ether_type =3D=3D RTE_ETHER_TYPE_IPV6 || > ether_type =3D=3D RTE_ETHER_TYPE_ARP || > -- > 2.17.0 Acked-by: Beilei Xing