From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 0B31C23B; Wed, 20 Sep 2017 11:23:18 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Sep 2017 02:23:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,420,1500966000"; d="scan'208";a="153962467" Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by fmsmga006.fm.intel.com with ESMTP; 20 Sep 2017 02:23:17 -0700 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 20 Sep 2017 10:23:16 +0100 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.75]) by irsmsx111.ger.corp.intel.com ([169.254.2.30]) with mapi id 14.03.0319.002; Wed, 20 Sep 2017 10:23:16 +0100 From: "Ananyev, Konstantin" To: "Dai, Wei" , "Wu, Jingjing" , "Xing, Beilei" CC: "dev@dpdk.org" , "Dai, Wei" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v5] net/i40e: fix mirror rule reset when port is stopped Thread-Index: AQHTMckXQh/D9iBJlUeURaEc/zTtQKK9f75A Date: Wed, 20 Sep 2017 09:23:16 +0000 Message-ID: <2601191342CEEE43887BDE71AB9772584F24D244@irsmsx105.ger.corp.intel.com> References: <1505873529-64121-1-git-send-email-wei.dai@intel.com> <1505881001-12200-1-git-send-email-wei.dai@intel.com> In-Reply-To: <1505881001-12200-1-git-send-email-wei.dai@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOTQ2OGYxYzYtNWMzNC00MTE5LTlkODctMTA3NmE4M2M2ZTYyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImtCcWtDK25TaGM0UU94bzFNSTlzazQzRENDRzMrWGFCQ3pCdGxDTU9FZzg9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v5] 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 09:23:20 -0000 Hi Wei, >=20 > When an i40e PF port is stopped, all mirror rules should be removed. > All rule related software and hardware resources should also be > removed. Could you clarify why we have to remove all mirror rules when PF is stopped= ? As I remember mirror rule can direct to VF, which still can be running, no? Konstantin=20 >=20 > Fixes: a4def5edf0fc ("i40e: enable port mirroring") > Cc: stable@dpdk.org >=20 > Signed-off-by: Wei Dai > Tested-by: Lijuan Tu > --- > drivers/net/i40e/i40e_ethdev.c | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index f12aefa..14cf6c0 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -361,6 +361,12 @@ static int i40e_dev_sync_phy_type(struct i40e_hw *hw= ); > static void i40e_configure_registers(struct i40e_hw *hw); > static void i40e_hw_init(struct rte_eth_dev *dev); > static int i40e_config_qinq(struct i40e_hw *hw, struct i40e_vsi *vsi); > +static enum i40e_status_code i40e_aq_del_mirror_rule(struct i40e_hw *hw, > + uint16_t seid, > + uint16_t rule_type, > + uint16_t *entries, > + uint16_t count, > + uint16_t rule_id); > static int i40e_mirror_rule_set(struct rte_eth_dev *dev, > struct rte_eth_mirror_conf *mirror_conf, > uint8_t sw_id, uint8_t on); > @@ -2069,6 +2075,7 @@ i40e_dev_stop(struct rte_eth_dev *dev) > struct rte_pci_device *pci_dev =3D RTE_ETH_DEV_TO_PCI(dev); > struct rte_intr_handle *intr_handle =3D &pci_dev->intr_handle; > int i; > + int ret; >=20 > if (hw->adapter_stopped =3D=3D 1) > return; > @@ -2096,10 +2103,22 @@ i40e_dev_stop(struct rte_eth_dev *dev) >=20 > /* Remove all mirror rules */ > while ((p_mirror =3D TAILQ_FIRST(&pf->mirror_list))) { > + 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); > + > + /* remove mirror software resource any way */ > TAILQ_REMOVE(&pf->mirror_list, p_mirror, rules); > rte_free(p_mirror); > + pf->nb_mirror_rule--; > } > - pf->nb_mirror_rule =3D 0; >=20 > if (!rte_intr_allow_others(intr_handle)) > /* resume to the default handler */ > -- > 2.7.5