From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 43F661B74C; Wed, 7 Feb 2018 08:56:53 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2018 23:56:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,471,1511856000"; d="scan'208";a="199320372" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 06 Feb 2018 23:56:51 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 6 Feb 2018 23:56:49 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 6 Feb 2018 23:56:48 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.125]) with mapi id 14.03.0319.002; Wed, 7 Feb 2018 15:56:47 +0800 From: "Wu, Jingjing" To: "Xing, Beilei" , "Zhang, Qi Z" CC: "dev@dpdk.org" , "Chilikin, Andrey" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/i40e: fix issue during customized info update Thread-Index: AQHTmZ9lmMoJwuATHkmMMbd7UjPK26OYntbg Date: Wed, 7 Feb 2018 07:56:46 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810F6EFF2@SHSMSX103.ccr.corp.intel.com> References: <1517298807-8148-1-git-send-email-beilei.xing@intel.com> In-Reply-To: <1517298807-8148-1-git-send-email-beilei.xing@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzVlMTgxNWItNTY4YS00ZTdhLThhNGEtM2Y4NDRmNjJiYzNkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IkUrT1pmWTVKSVNRckNuUXowV2luM3FsR055VlhXZkd3SlwvR080Mlo5RlRRPSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action 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-dev] [PATCH] net/i40e: fix issue during customized info update 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: , X-List-Received-Date: Wed, 07 Feb 2018 07:56:55 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Beilei Xing > Sent: Tuesday, January 30, 2018 3:53 PM > To: Zhang, Qi Z > Cc: dev@dpdk.org; Chilikin, Andrey ; stable@dp= dk.org > Subject: [dpdk-dev] [PATCH] net/i40e: fix issue during customized info up= date >=20 > Customized info is updated without checking package > operation - ADD or DEL, it only covers ADD operation > currently. This patch adds process for DEL operation. >=20 > Fixes: e163c18a15b0 ("net/i40e: update ptype and pctype info") > Cc: stable@dpdk.org >=20 > Signed-off-by: Beilei Xing > --- > drivers/net/i40e/i40e_ethdev.c | 48 +++++++++++++++++++++++++++++++++--= ------ > drivers/net/i40e/i40e_ethdev.h | 4 +++- > drivers/net/i40e/i40e_flow.c | 2 +- > drivers/net/i40e/rte_pmd_i40e.c | 6 ++++-- > 4 files changed, 47 insertions(+), 13 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 1ba18f2..f228a03 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -11206,7 +11206,8 @@ i40e_find_customized_pctype(struct i40e_pf *pf, u= int8_t > index) > static int > i40e_update_customized_pctype(struct rte_eth_dev *dev, uint8_t *pkg, > uint32_t pkg_size, uint32_t proto_num, > - struct rte_pmd_i40e_proto_info *proto) > + struct rte_pmd_i40e_proto_info *proto, > + enum rte_pmd_i40e_package_op op) > { > struct i40e_pf *pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > uint32_t pctype_num; > @@ -11219,6 +11220,12 @@ i40e_update_customized_pctype(struct rte_eth_dev= *dev, > uint8_t *pkg, > uint32_t i, j, n; > int ret; >=20 > + if (op !=3D RTE_PMD_I40E_PKG_OP_WR_ADD && > + op !=3D RTE_PMD_I40E_PKG_OP_WR_DEL) { > + PMD_DRV_LOG(ERR, "Unsupported operation."); > + return -1; > + } > + > ret =3D rte_pmd_i40e_get_ddp_info(pkg, pkg_size, > (uint8_t *)&pctype_num, sizeof(pctype_num), > RTE_PMD_I40E_PKG_INFO_PCTYPE_NUM); > @@ -11281,8 +11288,13 @@ i40e_update_customized_pctype(struct rte_eth_dev= *dev, > uint8_t *pkg, > i40e_find_customized_pctype(pf, > I40E_CUSTOMIZED_GTPU); > if (new_pctype) { > - new_pctype->pctype =3D pctype_value; > - new_pctype->valid =3D true; > + if (op =3D=3D RTE_PMD_I40E_PKG_OP_WR_ADD) { > + new_pctype->pctype =3D pctype_value; > + new_pctype->valid =3D true; > + } else { > + new_pctype->pctype =3D I40E_FILTER_PCTYPE_INVALID; > + new_pctype->valid =3D false; > + } > } > } >=20 > @@ -11292,8 +11304,9 @@ i40e_update_customized_pctype(struct rte_eth_dev = *dev, > uint8_t *pkg, >=20 > static int > i40e_update_customized_ptype(struct rte_eth_dev *dev, uint8_t *pkg, > - uint32_t pkg_size, uint32_t proto_num, > - struct rte_pmd_i40e_proto_info *proto) > + uint32_t pkg_size, uint32_t proto_num, > + struct rte_pmd_i40e_proto_info *proto, > + enum rte_pmd_i40e_package_op op) > { > struct rte_pmd_i40e_ptype_mapping *ptype_mapping; > uint16_t port_id =3D dev->data->port_id; > @@ -11306,6 +11319,12 @@ i40e_update_customized_ptype(struct rte_eth_dev = *dev, > uint8_t *pkg, > bool in_tunnel; > int ret; >=20 > + if (op !=3D RTE_PMD_I40E_PKG_OP_WR_ADD && > + op !=3D RTE_PMD_I40E_PKG_OP_WR_DEL) { > + PMD_DRV_LOG(ERR, "Unsupported operation."); > + return -1; > + } > + > /* get information about new ptype num */ > ret =3D rte_pmd_i40e_get_ddp_info(pkg, pkg_size, > (uint8_t *)&ptype_num, sizeof(ptype_num), > @@ -11348,6 +11367,8 @@ i40e_update_customized_ptype(struct rte_eth_dev *= dev, > uint8_t *pkg, > for (i =3D 0; i < ptype_num; i++) { > ptype_mapping[i].hw_ptype =3D ptype[i].ptype_id; > ptype_mapping[i].sw_ptype =3D 0; > + if (op =3D=3D RTE_PMD_I40E_PKG_OP_WR_DEL) > + continue; Think about if the original ptype is replaced. How about Just use rte_pmd_i40e_ptype_mapping_reset? Thanks Jingjing