[dpdk-stable] patch 'ethdev: avoid getting uninitialized info for bad port' has been queued to LTS release 18.11.3

Kevin Traynor ktraynor at redhat.com
Thu Sep 5 12:17:01 CEST 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 09/12/19. 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/4551d9c814af6efde293ec280a5ffdbd8442be7d

Thanks.

Kevin Traynor

---
>From 4551d9c814af6efde293ec280a5ffdbd8442be7d Mon Sep 17 00:00:00 2001
From: Andrew Rybchenko <arybchenko at solarflare.com>
Date: Tue, 23 Jul 2019 13:11:21 +0100
Subject: [PATCH] ethdev: avoid getting uninitialized info for bad port

[ upstream commit b6719879855da581c4b6dc29680b54c10e109439 ]

rte_eth_dev_info_get() returns void and caller does know if the function
does its job or not. Changing of the return value to int would be
API/ABI breakage which requires deprecation process and cannot be
backported to stable branches. For now, make sure that device info is
initialized even in the case of invalid port ID.

Fixes: a30268e9a2d0 ("ethdev: reset whole dev info structure before filling")

Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
Acked-by: Thomas Monjalon <thomas at monjalon.net>
---
 lib/librte_ethdev/rte_ethdev.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 191658da1..3c75d3c78 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2518,8 +2518,13 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 	};
 
-	RTE_ETH_VALID_PORTID_OR_RET(port_id);
-	dev = &rte_eth_devices[port_id];
-
+	/*
+	 * Init dev_info before port_id check since caller does not have
+	 * return status and does not know if get is successful or not.
+	 */
 	memset(dev_info, 0, sizeof(struct rte_eth_dev_info));
+
+	RTE_ETH_VALID_PORTID_OR_RET(port_id);
+	dev = &rte_eth_devices[port_id];
+
 	dev_info->rx_desc_lim = lim;
 	dev_info->tx_desc_lim = lim;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-09-05 10:36:47.609775697 +0100
+++ 0001-ethdev-avoid-getting-uninitialized-info-for-bad-port.patch	2019-09-05 10:36:47.436702294 +0100
@@ -1 +1 @@
-From b6719879855da581c4b6dc29680b54c10e109439 Mon Sep 17 00:00:00 2001
+From 4551d9c814af6efde293ec280a5ffdbd8442be7d Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b6719879855da581c4b6dc29680b54c10e109439 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -22 +23 @@
-index 64191737c..17d183e1f 100644
+index 191658da1..3c75d3c78 100644
@@ -25 +26 @@
-@@ -2553,8 +2553,13 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
+@@ -2518,8 +2518,13 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)


More information about the stable mailing list