From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 4C5304F9C; Tue, 25 Sep 2018 19:16:04 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7783130001EF; Tue, 25 Sep 2018 17:16:03 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FF9F1084430; Tue, 25 Sep 2018 17:16:00 +0000 (UTC) To: Xiao Wang Cc: xiaolong.ye@intel.com, tiwei.bie@intel.com, dev@dpdk.org, "stable@dpdk.org" References: <20180910110531.138449-1-xiao.w.wang@intel.com> <20180914012517.44977-1-xiao.w.wang@intel.com> From: Kevin Traynor Organization: Red Hat Message-ID: <57299da3-af0a-01a1-d4f5-0fbe8b9ce0be@redhat.com> Date: Tue, 25 Sep 2018 18:15:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180914012517.44977-1-xiao.w.wang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 25 Sep 2018 17:16:03 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH v2] 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: Tue, 25 Sep 2018 17:16:04 -0000 On 09/14/2018 02:25 AM, Xiao Wang wrote: > If the device is not clearly reset by the previous driver and holds > some invalid ring addr, and the relay thread kicks it before HW is > properly re-configured, a bad DMA request may happen. > > Besides, the notify_addr which is used by the relay thread is set in > the vdpa_ifcvf_start function, if a kick relay happens before > vdpa_ifcvf_start finishes, a null addr is accessed. > > Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver") > Looks like this should be in stable branch too. Can you confirm? > Signed-off-by: Xiao Wang > --- > v2: > * Add description for the fix in the commit log. > --- > 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 = setup_notify_relay(internal); > + ret = vdpa_ifcvf_start(internal); > if (ret) > goto err; > > - ret = vdpa_ifcvf_start(internal); > + ret = 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 = unset_notify_relay(internal); > if (ret) > goto err; > > + vdpa_ifcvf_stop(internal); > + > ret = vdpa_disable_vfio_intr(internal); > if (ret) > goto err; >