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 862F34F9C for ; Tue, 20 Nov 2018 20:15:51 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E40CA3084243; Tue, 20 Nov 2018 19:15:50 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id D16F5600C3; Tue, 20 Nov 2018 19:15:49 +0000 (UTC) From: Kevin Traynor To: Xiao Wang Cc: Xiaolong Ye , dpdk stable Date: Tue, 20 Nov 2018 19:12:39 +0000 Message-Id: <20181120191252.30277-49-ktraynor@redhat.com> In-Reply-To: <20181120191252.30277-1-ktraynor@redhat.com> References: <20181120191252.30277-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 20 Nov 2018 19:15:51 +0000 (UTC) Subject: [dpdk-stable] patch 'net/ifc: do not notify before HW ready' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 19:15:51 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/23/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From d63e01c1dc8fca3351f121bff3ad2163cd99b398 Mon Sep 17 00:00:00 2001 From: Xiao Wang Date: Fri, 14 Sep 2018 09:25:17 +0800 Subject: [PATCH] net/ifc: do not notify before HW ready [ upstream commit 971c19c77c03df51aaea78648908ef269d8e0c42 ] 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") Signed-off-by: Xiao Wang Reviewed-by: Xiaolong Ye --- drivers/net/ifc/ifcvf_vdpa.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c index 88d814037..b9d006814 100644 --- a/drivers/net/ifc/ifcvf_vdpa.c +++ b/drivers/net/ifc/ifcvf_vdpa.c @@ -470,22 +470,22 @@ update_datapath(struct ifcvf_internal *internal) goto err; - ret = setup_notify_relay(internal); - if (ret) - goto err; - ret = vdpa_ifcvf_start(internal); if (ret) goto err; + ret = setup_notify_relay(internal); + if (ret) + goto err; + rte_atomic32_set(&internal->running, 1); } 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) -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-20 17:53:08.621666780 +0000 +++ 0049-net-ifc-do-not-notify-before-HW-ready.patch 2018-11-20 17:53:07.000000000 +0000 @@ -1,8 +1,10 @@ -From 971c19c77c03df51aaea78648908ef269d8e0c42 Mon Sep 17 00:00:00 2001 +From d63e01c1dc8fca3351f121bff3ad2163cd99b398 Mon Sep 17 00:00:00 2001 From: Xiao Wang Date: Fri, 14 Sep 2018 09:25:17 +0800 Subject: [PATCH] net/ifc: do not notify before HW ready +[ upstream commit 971c19c77c03df51aaea78648908ef269d8e0c42 ] + 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. @@ -12,7 +14,6 @@ vdpa_ifcvf_start finishes, a null addr is accessed. Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver") -Cc: stable@dpdk.org Signed-off-by: Xiao Wang Reviewed-by: Xiaolong Ye