From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B29E337B7 for ; Thu, 13 Sep 2018 09:24:12 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2018 00:24:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,368,1531810800"; d="scan'208";a="90063720" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 13 Sep 2018 00:23:59 -0700 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 13 Sep 2018 00:23:59 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 13 Sep 2018 00:23:59 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.205]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.143]) with mapi id 14.03.0319.002; Thu, 13 Sep 2018 15:23:17 +0800 From: "Wang, Xiao W" To: "Ye, Xiaolong" CC: "Bie, Tiwei" , "dev@dpdk.org" Thread-Topic: [PATCH] net/ifc: do not notify before HW ready Thread-Index: AQHUSPcrdzfNkEVat0Cfcqk1CJvg8qTtqgGAgAAYX/A= Date: Thu, 13 Sep 2018 07:23:17 +0000 Message-ID: References: <20180910110531.138449-1-xiao.w.wang@intel.com> <20180913125519.GA13400@intel.com> In-Reply-To: <20180913125519.GA13400@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTY4OTE0MGEtYTI0Zi00MjgxLTkyMzItYzNjMTlmZWM5ODU4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiNzZEelpHQmxKWXBYTG83cXpJTm5TTEZLZjlUQ3hoK0ZYaEZzcGtcL2dXVFoxVjJwS1NyVWdrdEN0K1ZNSVVqcWwifQ== 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] net/ifc: do not notify before HW ready 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, 13 Sep 2018 07:24:13 -0000 Hi Xiaolong, > -----Original Message----- > From: Ye, Xiaolong > Sent: Thursday, September 13, 2018 8:55 PM > To: Wang, Xiao W > Cc: Bie, Tiwei ; dev@dpdk.org > Subject: Re: [PATCH] net/ifc: do not notify before HW ready >=20 > Hi, Xiao >=20 > On 09/10, Xiao Wang wrote: > >Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver") >=20 > Could you help describe what problem is without this fix in commit log? Generally a driver should finish all the device configurations first then n= otify the HW for data processing. Without this fix, the potential problems are: 1. If the device is not clearly reset by the previous driver and holds some= invalid ring addr, and the vDPA relay thread kicks it, a bad DMA request m= ay happen. 2. The notify_addr which is used by the relay thread is set in the vdpa_ifc= vf_start function. If there's really a kick relay before vdpa_ifcvf_start f= inishes, a null addr is accessed. Would add the description in the commit log in v2. Thanks for the comment, Xiao >=20 > Thanks, > Xiaolong > > > >Signed-off-by: Xiao Wang > >--- > > drivers/net/ifc/ifcvf_vdpa.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > >diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c > >index 3c5430dc0..7d3085d8d 100644 > >--- a/drivers/net/ifc/ifcvf_vdpa.c > >+++ b/drivers/net/ifc/ifcvf_vdpa.c > >@@ -503,11 +503,11 @@ update_datapath(struct ifcvf_internal *internal) > > if (ret) > > goto err; > > > >- ret =3D setup_notify_relay(internal); > >+ ret =3D vdpa_ifcvf_start(internal); > > if (ret) > > goto err; > > > >- ret =3D vdpa_ifcvf_start(internal); > >+ ret =3D setup_notify_relay(internal); > > if (ret) > > goto err; > > > >@@ -515,12 +515,12 @@ update_datapath(struct ifcvf_internal *internal) > > } else if (rte_atomic32_read(&internal->running) && > > (!rte_atomic32_read(&internal->started) || > > !rte_atomic32_read(&internal->dev_attached))) { > >- vdpa_ifcvf_stop(internal); > >- > > ret =3D unset_notify_relay(internal); > > if (ret) > > goto err; > > > >+ vdpa_ifcvf_stop(internal); > >+ > > ret =3D vdpa_disable_vfio_intr(internal); > > if (ret) > > goto err; > >-- > >2.15.1 > >