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 2E8B77CB6; Wed, 13 Sep 2017 09:33:29 +0200 (CEST) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2017 00:33:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,386,1500966000"; d="scan'208";a="128265571" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga004.jf.intel.com with ESMTP; 13 Sep 2017 00:33:26 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 13 Sep 2017 00:33:07 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 13 Sep 2017 00:33:06 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.219]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.168]) with mapi id 14.03.0319.002; Wed, 13 Sep 2017 15:32:54 +0800 From: "Wu, Jingjing" To: "Xing, Beilei" , "Dai, Wei" CC: "dev@dpdk.org" , "Dai, Wei" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] net/i40e: fix mirror rule reset when port is stopped Thread-Index: AQHTKqgKjA1GhyW7rUC8/ArDTA12OKKyb1vA Date: Wed, 13 Sep 2017 07:32:53 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810E48C44@SHSMSX103.ccr.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> In-Reply-To: <94479800C636CB44BD422CB454846E013201ACB7@SHSMSX101.ccr.corp.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-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, 13 Sep 2017 07:33:31 -0000 > -----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 p= ort is > stopped >=20 >=20 > > -----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; > > + 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--; > > + } >=20 > little comment: else statement can be omitted here. >=20 Another minor coding style comment: Do not use braces (``{`` and ``}``) for control statements with zero or jus= t a single statement, unless that statement is more than a single line in w= hich case the braces are permitted. > > } > > - pf->nb_mirror_rule =3D 0; > > > > if (!rte_intr_allow_others(intr_handle)) > > /* resume to the default handler */ > > -- > > 2.7.5