From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 556A92BE6 for ; Tue, 11 Dec 2018 07:58:35 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Dec 2018 22:58:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,341,1539673200"; d="scan'208";a="99732376" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 10 Dec 2018 22:58:34 -0800 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Dec 2018 22:58:34 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Dec 2018 22:58:33 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.59]) by shsmsx102.ccr.corp.intel.com ([169.254.2.182]) with mapi id 14.03.0415.000; Tue, 11 Dec 2018 14:58:31 +0800 From: "Zhang, Qi Z" To: "Yan, Zhirun" , "dev@dpdk.org" , "Wang, Haiyue" Thread-Topic: [PATCH v1] net/i40e: avoid invalid operations after reset Thread-Index: AQHUkGIvUzyFvTBruUSKlRwDnG4rqqV37t2wgACP6ACAAJblQA== Date: Tue, 11 Dec 2018 06:58:31 +0000 Message-ID: <039ED4275CED7440929022BC67E70611532FC7D8@SHSMSX103.ccr.corp.intel.com> References: <20181210160446.36825-1-zhirun.yan@intel.com> <039ED4275CED7440929022BC67E70611532FC065@SHSMSX103.ccr.corp.intel.com> <2F9759EBFF61914290A3BA61BDBE2C860B9D4540@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <2F9759EBFF61914290A3BA61BDBE2C860B9D4540@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmU0Yzk4MjktYjZlMC00ZGYzLTllMDQtMjg3ZjdmYjczM2ZjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiN2tqc0t4VVNMVDJLZWhOV0Vsc0xTZytQa3RySUxRYWZKM1h3XC94Rjdwd2U1ckhYWEdac3FlQlQ0UzVtMkFiVUUifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 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 v1] net/i40e: avoid invalid operations after reset 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: Tue, 11 Dec 2018 06:58:35 -0000 > -----Original Message----- > From: Yan, Zhirun > Sent: Tuesday, December 11, 2018 1:32 PM > To: Zhang, Qi Z ; dev@dpdk.org; Wang, Haiyue > > Subject: RE: [PATCH v1] net/i40e: avoid invalid operations after reset >=20 >=20 >=20 > > -----Original Message----- > > From: Zhang, Qi Z > > Sent: Monday, December 10, 2018 9:13 PM > > To: Yan, Zhirun ; dev@dpdk.org; Wang, Haiyue > > > > Subject: RE: [PATCH v1] net/i40e: avoid invalid operations after reset > > > > > > > > > -----Original Message----- > > > From: Yan, Zhirun > > > Sent: Tuesday, December 11, 2018 12:05 AM > > > To: dev@dpdk.org; Wang, Haiyue ; Zhang, Qi Z > > > > > > Cc: Yan, Zhirun > > > Subject: [PATCH v1] net/i40e: avoid invalid operations after reset > > > > > > if reset but not reinit adminq, some operations in > > > i40evf_dev_close() like > > > i40evf_dev_promiscuous_disable() and > > > i40evf_dev_allmulticast_disable() will result in failures. > > > > > > Fixes: cae18d2b0fb4 ("net/i40e: add workaround promiscuous disable") > > > > > > Signed-off-by: Zhirun Yan > > > Signed-off-by: Haiyue Wang > > > --- > > > drivers/net/i40e/i40e_ethdev_vf.c | 9 ++++++--- > > > 1 file changed, 6 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c > > > b/drivers/net/i40e/i40e_ethdev_vf.c > > > index ae55b9b18..a1f4a729f 100644 > > > --- a/drivers/net/i40e/i40e_ethdev_vf.c > > > +++ b/drivers/net/i40e/i40e_ethdev_vf.c > > > @@ -2245,6 +2245,7 @@ static void > > > i40evf_dev_close(struct rte_eth_dev *dev) { > > > struct i40e_hw *hw =3D > > > I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); > > > + struct i40e_vf *vf =3D > > > I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); > > > > > > i40evf_dev_stop(dev); > > > i40e_dev_free_queues(dev); > > > @@ -2253,10 +2254,12 @@ i40evf_dev_close(struct rte_eth_dev *dev) > > > * it is a workaround solution when work with kernel driver > > > * and it is not the normal way > > > */ > > > - i40evf_dev_promiscuous_disable(dev); > > > - i40evf_dev_allmulticast_disable(dev); > > > + if (!vf->vf_reset) { > > > > I didn't see when vf_reset will be cleared to false? Is it another bug? > > > After reset VF, vf->vf_reset will be cleared to false after calling > i40evf_request_queues(). > This patch is used to fix request_queues. If the patch is going to fix another new patch, then it should be part of t= hat :) But my suggestion is we could keep this patch as independent,=20 because strictly even without the request queue patch, the issue is still v= alid, since there will be other cases that pf will reset VF. But the problem here is your fix rely on that vf_reset flag should always b= e updated correctly, but actually it does not, it is not cleared always, th= at means once vf reset happened,=20 in following dev_close, you will always skip those adminq command. >>From my view, there should be a fix to clear the vf_reset and vf->pend_msg,= and i40evf_check_vf_reset_done looks like the right place to do this.=20 ideally your "request queues" patch should not touch these flag >=20 > > > > > + i40evf_dev_promiscuous_disable(dev); > > > + i40evf_dev_allmulticast_disable(dev); > > > + i40evf_reset_vf(hw); > > > + } > > > > > - i40evf_reset_vf(hw); > > > i40e_shutdown_adminq(hw); > > > i40evf_disable_irq0(hw); > > > rte_eal_alarm_cancel(i40evf_dev_alarm_handler, dev); > > > -- > > > 2.17.1