patch 'examples/vhost: fix crash when no VMDq' has been queued to stable release 20.11.6

Xueming Li xuemingl at nvidia.com
Tue Jun 21 10:02:36 CEST 2022


Hi,

FYI, your patch has been queued to stable release 20.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 06/23/22. 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/steevenlee/dpdk

This queued commit can be viewed at:
https://github.com/steevenlee/dpdk/commit/27dda79b5d23c2badbf870e2a4edcc3bf430c118

Thanks.

Xueming Li <xuemingl at nvidia.com>

---
>From 27dda79b5d23c2badbf870e2a4edcc3bf430c118 Mon Sep 17 00:00:00 2001
From: Yuan Wang <yuanx.wang at intel.com>
Date: Wed, 18 May 2022 21:36:33 +0800
Subject: [PATCH] examples/vhost: fix crash when no VMDq
Cc: Xueming Li <xuemingl at nvidia.com>

[ upstream commit 6f3d83c7f207d435d960ad881f127e9971a81069 ]

If the VMDq limits is 0, a divide-by-zero error occurs.
This patch replaces throwing a floating point exception with
a normal error message.

Fixes: d19533e86f ("examples/vhost: copy old vhost example")

Signed-off-by: Yuan Wang <yuanx.wang at intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
---
 examples/vhost/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index fc07b31b2e..24e37f7ce5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -255,6 +255,10 @@ port_init(uint16_t port)
 
 		return retval;
 	}
+	if (dev_info.max_vmdq_pools == 0) {
+		RTE_LOG(ERR, VHOST_PORT, "Failed to get VMDq info.\n");
+		return -1;
+	}
 
 	rxconf = &dev_info.default_rxconf;
 	txconf = &dev_info.default_txconf;
-- 
2.35.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-21 15:37:53.293101523 +0800
+++ 0090-examples-vhost-fix-crash-when-no-VMDq.patch	2022-06-21 15:37:49.187785117 +0800
@@ -1 +1 @@
-From 6f3d83c7f207d435d960ad881f127e9971a81069 Mon Sep 17 00:00:00 2001
+From 27dda79b5d23c2badbf870e2a4edcc3bf430c118 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 6f3d83c7f207d435d960ad881f127e9971a81069 ]
@@ -11 +13,0 @@
-Cc: stable at dpdk.org
@@ -20 +22 @@
-index 5bc34b0c52..e7fee5aa1b 100644
+index fc07b31b2e..24e37f7ce5 100644
@@ -23 +25 @@
-@@ -431,6 +431,10 @@ port_init(uint16_t port)
+@@ -255,6 +255,10 @@ port_init(uint16_t port)


More information about the stable mailing list