From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9235C235; Wed, 20 Sep 2017 03:45:29 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Sep 2017 18:45:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,419,1500966000"; d="scan'208";a="151213652" Received: from kmsmsx151.gar.corp.intel.com ([172.21.73.86]) by orsmga005.jf.intel.com with ESMTP; 19 Sep 2017 18:45:27 -0700 Received: from pgsmsx106.gar.corp.intel.com ([169.254.9.199]) by KMSMSX151.gar.corp.intel.com ([169.254.10.180]) with mapi id 14.03.0319.002; Wed, 20 Sep 2017 09:44:17 +0800 From: "Dai, Wei" To: "Wu, Jingjing" , "Xing, Beilei" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] net/i40e: fix mirror rule reset when port is stopped Thread-Index: AQHTKqgKFxz9yOd9NkKPDh6R65zFxqK7AIsAgAINp2A= Date: Wed, 20 Sep 2017 01:44:16 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D650B99F6B@PGSMSX106.gar.corp.intel.com> References: <1504709549-50804-1-git-send-email-wei.dai@intel.com> <1505095919-4682-1-git-send-email-wei.dai@intel.com> <94479800C636CB44BD422CB454846E013201ACB7@SHSMSX101.ccr.corp.intel.com> <9BB6961774997848B5B42BEC655768F810E76E4C@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810E76E4C@SHSMSX103.ccr.corp.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZGZiMTM3OTYtNDI0MS00ODdkLTgyMzEtN2YzYmVjYTM2ZTJlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjgrdjNtNVZ1bVhIRWpFVjdGT3puemlDTzFRWXRFMldPMFlWeGNpbU83RW89In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [172.30.20.206] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix mirror rule reset when port is stopped 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, 20 Sep 2017 01:45:30 -0000 Many thanks to Jingjing and Beilei. Sorry, this patch is a wrong v2 due to a building error. I have submitted another v2 . Anyway, I will submit v3 patch per your feedback.=20 > -----Original Message----- > From: Wu, Jingjing > Sent: Tuesday, September 19, 2017 10:21 AM > To: Xing, Beilei ; Dai, Wei > Cc: dev@dpdk.org; Dai, Wei ; stable@dpdk.org > Subject: RE: [dpdk-dev] [PATCH v2] net/i40e: fix mirror rule reset when p= ort > is stopped >=20 >=20 >=20 > > -----Original Message----- > > From: Xing, Beilei > > Sent: Monday, September 11, 2017 10:46 AM > > To: Dai, Wei ; Wu, Jingjing > > Cc: dev@dpdk.org; Dai, Wei ; stable@dpdk.org > > Subject: RE: [dpdk-dev] [PATCH v2] net/i40e: fix mirror rule reset > > when port is stopped > > > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Dai > > > Sent: Monday, September 11, 2017 10:12 AM > > > To: Wu, Jingjing ; Xing, Beilei > > > > > > Cc: dev@dpdk.org; Dai, Wei ; stable@dpdk.org > > > Subject: [dpdk-dev] [PATCH v2] net/i40e: fix mirror rule reset when > > > port is stopped > > > > > > When an i40e PF port is stopped, all mirror rules should be removed. > > > All rule related software and hardware resources should also be > removed. > > > > > > Fixes: a4def5edf0fc ("i40e: enable port mirroring") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Wei Dai > > > Tested-by: Lijuan Tu > > > --- > > > drivers/net/i40e/i40e_ethdev.c | 18 +++++++++++++++--- > > > 1 file changed, 15 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > > b/drivers/net/i40e/i40e_ethdev.c index 5f26e24..a278748 100644 > > > --- a/drivers/net/i40e/i40e_ethdev.c > > > +++ b/drivers/net/i40e/i40e_ethdev.c > > > @@ -2094,10 +2094,22 @@ i40e_dev_stop(struct rte_eth_dev *dev) > > > > > > /* Remove all mirror rules */ > > > while ((p_mirror =3D TAILQ_FIRST(&pf->mirror_list))) { > > > - TAILQ_REMOVE(&pf->mirror_list, p_mirror, rules); > > > - rte_free(p_mirror); > > > + int ret; >=20 > You can move the declaration of ret to the beginning of the func. >=20 > > > + ret =3D i40e_aq_del_mirror_rule(hw, pf->main_vsi->veb->seid, > > > + p_mirror->rule_type, > > > + p_mirror->entries, > > > + p_mirror->num_entries, > > > + p_mirror->id); > > > + if (ret < 0) { > > > + PMD_DRV_LOG(ERR, "failed to remove mirror rule: " > > > + "status =3D %d, aq_err =3D %d.", ret, > > > + hw->aq.asq_last_status); > > > + } else { > > > + TAILQ_REMOVE(&pf->mirror_list, p_mirror, rules); > > > + rte_free(p_mirror); > > > + pf->nb_mirror_rule--; > > > + } > > > > little comment: else statement can be omitted here. >=20 > Same comment, software entries need to be released. >=20 > Thanks > Jingjing