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 D798CA09FF for ; Mon, 28 Dec 2020 08:15:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7291DC9EE; Mon, 28 Dec 2020 08:15:21 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 085AEC9B2; Mon, 28 Dec 2020 08:15:16 +0100 (CET) IronPort-SDR: V0THgbkngm6HjpqLRAusn2RrVtrsGb9E6y5P6ZsuK6mqbWWzDFASay7xcjqSdfOZzcTjXq5Kxr VRYmrSHJ5WFQ== X-IronPort-AV: E=McAfee;i="6000,8403,9847"; a="237908445" X-IronPort-AV: E=Sophos;i="5.78,454,1599548400"; d="scan'208";a="237908445" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2020 23:15:14 -0800 IronPort-SDR: fLYa9PrORYK3wzeZC23uu/sOyqHA7NlkaPudceAZAlWAaKFdT4NA9iAriWZxd/VgHsVV1rOmAc mXvTUw4JmSbQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,454,1599548400"; d="scan'208";a="343638796" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP; 27 Dec 2020 23:15:14 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 27 Dec 2020 23:15:13 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX601.ccr.corp.intel.com (10.109.6.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 28 Dec 2020 15:15:12 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Mon, 28 Dec 2020 15:15:12 +0800 From: "Guo, Jia" To: "Xing, Beilei" , "dev@dpdk.org" CC: "stable@dpdk.org" , "Sun, Chenmin" Thread-Topic: [PATCH v2] net/i40e: fix flex payload rule conflict issue Thread-Index: AQHW3OIiHNHCI0XyEUCsRYqCmqa7DaoMFjlw Date: Mon, 28 Dec 2020 07:15:11 +0000 Message-ID: <6b0ab68e80364f8cb56dee33327e528e@intel.com> References: <20201229054639.92132-1-beilei.xing@intel.com> <20201229061736.92666-1-beilei.xing@intel.com> In-Reply-To: <20201229061736.92666-1-beilei.xing@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH v2] net/i40e: fix flex payload rule conflict issue 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" Hi, beilei > -----Original Message----- > From: Xing, Beilei > Sent: Tuesday, December 29, 2020 2:18 PM > To: Guo, Jia ; dev@dpdk.org > Cc: Xing, Beilei ; stable@dpdk.org; Sun, Chenmin > > Subject: [PATCH v2] net/i40e: fix flex payload rule conflict issue >=20 > From: Beilei Xing >=20 > With the following commands, the second flow can't be created successfull= y. >=20 > 1. flow create 0 ingress pattern eth / ipv4 / udp / > raw relative is 1 pattern is 0102030405 / end > actions drop / end > 2. flow destroy 0 rule 0 > 3. flow create 0 ingress pattern eth / ipv4 / udp / > raw relative is 1 pattern is 010203040506 / end > actions drop / end >=20 > The root cause is that a flag for flex pit isn't reset. >=20 > Fixes: 6ced3dd72f5f ("net/i40e: support flexible payload parsing for FDIR= ") > Cc: stable@dpdk.org >=20 > Reported-by: Chenmin Sun > Signed-off-by: Beilei Xing > --- >=20 > v2 changes: > - Add fix line. > - Refine comments. >=20 > drivers/net/i40e/i40e_flow.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c > index b09ff6590d..65e0b69356 100644 > --- a/drivers/net/i40e/i40e_flow.c > +++ b/drivers/net/i40e/i40e_flow.c > @@ -5284,6 +5284,7 @@ i40e_flow_destroy(struct rte_eth_dev *dev, > enum rte_filter_type filter_type =3D flow->filter_type; > struct i40e_fdir_info *fdir_info =3D &pf->fdir; > int ret =3D 0; > + int i; >=20 > switch (filter_type) { > case RTE_ETH_FILTER_ETHERTYPE: > @@ -5299,9 +5300,13 @@ i40e_flow_destroy(struct rte_eth_dev *dev, > &((struct i40e_fdir_filter *)flow->rule)->fdir, > 0); >=20 > - /* If the last flow is destroyed, disable fdir. */ > + /* When the last flow is destroyed. */ > if (!ret && TAILQ_EMPTY(&pf->fdir.fdir_list)) { > + /* Disable FDIR processing. */ > i40e_fdir_rx_proc_enable(dev, 0); > + /* Reset the flex_pit_flag. */ > + for (i =3D 0; i < I40E_MAX_FLXPLD_LAYER; i++) > + pf->fdir.flex_pit_flag[i] =3D 0; Why reset all flex_pit_flag when destroy the last flow, if destroy other fl= ow, is it no need to reset corresponding flex_pit_flag which set before whe= n the flow added? And reset flag should be ahead of the FDIR disabling I think. > } > break; > case RTE_ETH_FILTER_HASH: > @@ -5515,6 +5520,9 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf) > pf->fdir.flex_mask_flag[pctype] =3D 0; > } >=20 > + for (i =3D 0; i < I40E_MAX_FLXPLD_LAYER; i++) > + pf->fdir.flex_pit_flag[i] =3D 0; > + > /* Disable FDIR processing as all FDIR rules are now flushed > */ > i40e_fdir_rx_proc_enable(dev, 0); > } > -- > 2.26.2