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 EA69A7D4E; Thu, 7 Sep 2017 09:51:27 +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; 07 Sep 2017 00:51:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,357,1500966000"; d="scan'208";a="126408672" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 07 Sep 2017 00:51:09 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 7 Sep 2017 00:51:02 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.219]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Thu, 7 Sep 2017 15:50:49 +0800 From: "Wu, Jingjing" To: "Dai, Wei" , "Xing, Beilei" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/i40e: fix mirror rule reset when port is stopped Thread-Index: AQHTJyGIuqT0i9ZWSU2G1HZS2xp6TKKpDH9Q Date: Thu, 7 Sep 2017 07:50:49 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810E424CD@SHSMSX103.ccr.corp.intel.com> References: <1504709549-50804-1-git-send-email-wei.dai@intel.com> In-Reply-To: <1504709549-50804-1-git-send-email-wei.dai@intel.com> Accept-Language: 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: [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 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 07:51:28 -0000 > -----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 >=20 > 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( ). >=20 > Fixes: a4def5edf0fc ("i40e: enable port mirroring") > Cc: stable@dpdk.org >=20 > Signed-off-by: Wei Dai > --- > drivers/net/i40e/i40e_ethdev.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.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) >=20 > /* 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; >=20 It is correct to remove mirror rule in HW. But looking into the function i4= 0e_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); } Thanks Jingjing