[dpdk-stable] patch 'ethdev: fix secondary process memory overwrite' has been queued to LTS release 18.11.7

Kevin Traynor ktraynor at redhat.com
Fri Feb 14 18:03:01 CET 2020


Hi,

FYI, your patch has been queued to LTS release 18.11.7

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/20/20. 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. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/ab4272aefa97c8a92fc07fe8e653b979a99e46d1

Thanks.

Kevin.

---
>From ab4272aefa97c8a92fc07fe8e653b979a99e46d1 Mon Sep 17 00:00:00 2001
From: Fang TongHao <fangtonghao at sangfor.com.cn>
Date: Fri, 17 Jan 2020 10:08:04 +0800
Subject: [PATCH] ethdev: fix secondary process memory overwrite

[ upstream commit 99ef90317da69a5e6ecc831ad05c6d2053e2b065 ]

Avoid overwriting device flags and other information in device
data stored in shared memory when a secondary process
probes PCI device.

Fixes: 494adb7f63f2 ("ethdev: add device fields from PCI layer")

Signed-off-by: Fang TongHao <fangtonghao at sangfor.com.cn>
Reviewed-by: Andrew Rybchenko <arybchenko at solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 lib/librte_ethdev/rte_ethdev_pci.h | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h
index ccdbb46ec0..cca94ec864 100644
--- a/lib/librte_ethdev/rte_ethdev_pci.h
+++ b/lib/librte_ethdev/rte_ethdev_pci.h
@@ -43,4 +43,6 @@
 /**
  * Copy pci device info to the Ethernet device data.
+ * Shared memory (eth_dev->data) only updated by primary process, so it is safe
+ * to call this function from both primary and secondary processes.
  *
  * @param eth_dev
@@ -61,12 +63,14 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev,
 	eth_dev->intr_handle = &pci_dev->intr_handle;
 
-	eth_dev->data->dev_flags = 0;
-	if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC)
-		eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
-	if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_RMV)
-		eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_RMV;
+	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+		eth_dev->data->dev_flags = 0;
+		if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_LSC)
+			eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
+		if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_RMV)
+			eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_RMV;
 
-	eth_dev->data->kdrv = pci_dev->kdrv;
-	eth_dev->data->numa_node = pci_dev->device.numa_node;
+		eth_dev->data->kdrv = pci_dev->kdrv;
+		eth_dev->data->numa_node = pci_dev->device.numa_node;
+	}
 }
 
-- 
2.21.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-14 17:02:37.450599160 +0000
+++ 0007-ethdev-fix-secondary-process-memory-overwrite.patch	2020-02-14 17:02:36.932408335 +0000
@@ -1 +1 @@
-From 99ef90317da69a5e6ecc831ad05c6d2053e2b065 Mon Sep 17 00:00:00 2001
+From ab4272aefa97c8a92fc07fe8e653b979a99e46d1 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 99ef90317da69a5e6ecc831ad05c6d2053e2b065 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org



More information about the stable mailing list