[dpdk-stable] patch 'net/ifc: do not notify before HW ready' has been queued to stable release 18.08.1

Kevin Traynor ktraynor at redhat.com
Tue Nov 20 20:12:39 CET 2018


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 <xiao.w.wang at intel.com>
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 <xiao.w.wang at intel.com>
Reviewed-by: Xiaolong Ye <xiaolong.ye at intel.com>
---
 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 <xiao.w.wang at intel.com>
 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 at dpdk.org
 
 Signed-off-by: Xiao Wang <xiao.w.wang at intel.com>
 Reviewed-by: Xiaolong Ye <xiaolong.ye at intel.com>


More information about the stable mailing list