[dpdk-stable] patch 'net/virtio-user: fix devargs parsing' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:03:56 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.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 05/21/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.

Thanks.

Luca Boccassi

---
>From 4c587687f7c913b75a9dabc5787fb556cd158cd4 Mon Sep 17 00:00:00 2001
From: Ivan Dyukov <i.dyukov at samsung.com>
Date: Mon, 30 Mar 2020 10:58:00 +0300
Subject: [PATCH] net/virtio-user: fix devargs parsing

[ upstream commit bc5b6c11bd81ada50345db5919dc6c7850f91de1 ]

strtoull returns 0 if it fails to parse input string. It's ignored
in get_integer_arg.

This patch handles error cases for strtoull function.

Fixes: ce2eabdd43ec ("net/virtio-user: add virtual device")

Signed-off-by: Ivan Dyukov <i.dyukov at samsung.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 drivers/net/virtio/virtio_user_ethdev.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 5637001dfc..741b3b0d60 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -477,12 +477,17 @@ static int
 get_integer_arg(const char *key __rte_unused,
 		const char *value, void *extra_args)
 {
+	uint64_t integer = 0;
 	if (!value || !extra_args)
 		return -EINVAL;
-
-	*(uint64_t *)extra_args = strtoull(value, NULL, 0);
-
-	return 0;
+	errno = 0;
+	integer = strtoull(value, NULL, 0);
+	/* extra_args keeps default value, it should be replaced
+	 * only in case of successful parsing of the 'value' arg
+	 */
+	if (errno == 0)
+		*(uint64_t *)extra_args = integer;
+	return -errno;
 }
 
 static struct rte_eth_dev *
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:48.574119922 +0100
+++ 0101-net-virtio-user-fix-devargs-parsing.patch	2020-05-19 14:04:44.312650112 +0100
@@ -1,15 +1,16 @@
-From bc5b6c11bd81ada50345db5919dc6c7850f91de1 Mon Sep 17 00:00:00 2001
+From 4c587687f7c913b75a9dabc5787fb556cd158cd4 Mon Sep 17 00:00:00 2001
 From: Ivan Dyukov <i.dyukov at samsung.com>
 Date: Mon, 30 Mar 2020 10:58:00 +0300
 Subject: [PATCH] net/virtio-user: fix devargs parsing
 
+[ upstream commit bc5b6c11bd81ada50345db5919dc6c7850f91de1 ]
+
 strtoull returns 0 if it fails to parse input string. It's ignored
 in get_integer_arg.
 
 This patch handles error cases for strtoull function.
 
 Fixes: ce2eabdd43ec ("net/virtio-user: add virtual device")
-Cc: stable at dpdk.org
 
 Signed-off-by: Ivan Dyukov <i.dyukov at samsung.com>
 Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>


More information about the stable mailing list