From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 84D9F7D4E; Thu, 7 Sep 2017 11:22:13 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2017 02:22:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,357,1500966000"; d="scan'208";a="146495287" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by orsmga005.jf.intel.com with ESMTP; 07 Sep 2017 02:22:11 -0700 Received: from pgsmsx106.gar.corp.intel.com ([169.254.9.199]) by PGSMSX107.gar.corp.intel.com ([169.254.7.200]) with mapi id 14.03.0319.002; Thu, 7 Sep 2017 17:22:06 +0800 From: "Dai, Wei" To: "Wu, Jingjing" , "Xing, Beilei" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/i40e: fix mirror rule reset when port is stopped Thread-Index: AQHTJyGHiy0MQOKRA0S20IATaurQ9qKoh6uAgACdBBA= Date: Thu, 7 Sep 2017 09:22:05 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D650B95D1A@PGSMSX106.gar.corp.intel.com> References: <1504709549-50804-1-git-send-email-wei.dai@intel.com> <9BB6961774997848B5B42BEC655768F810E424CD@SHSMSX103.ccr.corp.intel.com> In-Reply-To: <9BB6961774997848B5B42BEC655768F810E424CD@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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTZiZGE3NDItZWJlNi00Y2IxLThkNzQtN2EyNGYyZjhmMzM0IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ik44Szhpb0dmcUo1dFB0R0d2bjZxeFk4ZG1YczVBSkJsTzZXMzZRVmFXVkk9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] 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: Thu, 07 Sep 2017 09:22:14 -0000 > -----Original Message----- > From: Wu, Jingjing > Sent: Thursday, September 7, 2017 3:51 PM > To: Dai, Wei ; Xing, Beilei > Cc: dev@dpdk.org; stable@dpdk.org > Subject: RE: [PATCH] net/i40e: fix mirror rule reset when port is stopped >=20 >=20 >=20 > > -----Original Message----- > > From: Dai, Wei > > Sent: Wednesday, September 6, 2017 10:52 PM > > To: Wu, Jingjing ; Xing, Beilei > > > > Cc: dev@dpdk.org; Dai, Wei ; stable@dpdk.org > > Subject: [PATCH] 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 SW and HW resources should also be removed. All of > > them are should be removed by calling i40e_mirror_rule_reset( ). > > > > Fixes: a4def5edf0fc ("i40e: enable port mirroring") > > Cc: stable@dpdk.org > > > > Signed-off-by: Wei Dai > > --- > > drivers/net/i40e/i40e_ethdev.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.c index 5f26e24..93fb6cd 100644 > > --- a/drivers/net/i40e/i40e_ethdev.c > > +++ b/drivers/net/i40e/i40e_ethdev.c > > @@ -2094,8 +2094,7 @@ 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); > > + i40e_mirror_rule_reset(dev, p_mirror->index); > > } > > pf->nb_mirror_rule =3D 0; > > > It is correct to remove mirror rule in HW. But looking into the function > i40e_mirror_rul_reset, it's waste to call the function here. > It is much economic to do like > while ((p_mirror =3D TAILQ_FIRST(&pf->mirror_list))) { > i40e_aq_del_mirror_rule(hw, seid, > p_mirror->rule_type, > p_mirror->entries, > p_mirror->num_entries, p_mirror->id); > TAILQ_REMOVE(&pf->mirror_list, p_mirror, rules); > rte_free(p_mirror); > i40e_mirror_rule_reset(dev, p_mirror->index); Indeed, the function i40e_mirror_rule_reset( ) includes above 3 code lines: I40e_aq_del_mirror_rule( ), TAILQ_REMOVE( ) and rte_free( ). So did you suggest that use these 3 lines instead of calling i40e_mirror_ru= le_reset( ) ? I mean i40e_mirror_rule_reset( ) is not necessary in your suggestion. What's more, all these are in i40e_dev_stop( ), so it doesn't matter which = method to get same result :-) > } >=20 > Thanks > Jingjing