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

Kevin Traynor ktraynor at redhat.com
Thu Jun 9 13:36:38 CEST 2022


Hi,

FYI, your patch has been queued to stable release 21.11.2

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/13/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/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
>From d512315deffeb5f0496c865fe02c981a067a92b2 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

[ 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 6c3bd9e4b0..84844da68f 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -265,4 +265,8 @@ 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;
-- 
2.34.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-06-09 12:34:30.944888468 +0100
+++ 0051-examples-vhost-fix-crash-when-no-VMDq.patch	2022-06-09 12:34:29.767980678 +0100
@@ -1 +1 @@
-From 6f3d83c7f207d435d960ad881f127e9971a81069 Mon Sep 17 00:00:00 2001
+From d512315deffeb5f0496c865fe02c981a067a92b2 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6f3d83c7f207d435d960ad881f127e9971a81069 ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 5bc34b0c52..e7fee5aa1b 100644
+index 6c3bd9e4b0..84844da68f 100644
@@ -23 +24 @@
-@@ -432,4 +432,8 @@ port_init(uint16_t port)
+@@ -265,4 +265,8 @@ port_init(uint16_t port)



More information about the stable mailing list