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

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Thu Jul 7 09:54:39 CEST 2022


Hi,

FYI, your patch has been queued to stable release 19.11.13

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

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

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From ac099749a9140b7aa93a22bcf2a6b21470c4a5a9 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 135aafa5b4..073668022b 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -236,6 +236,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.37.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2022-07-07 09:54:13.039296130 +0200
+++ 0044-examples-vhost-fix-crash-when-no-VMDq.patch	2022-07-07 09:54:10.921824345 +0200
@@ -1 +1 @@
-From 6f3d83c7f207d435d960ad881f127e9971a81069 Mon Sep 17 00:00:00 2001
+From ac099749a9140b7aa93a22bcf2a6b21470c4a5a9 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 135aafa5b4..073668022b 100644
@@ -23 +24 @@
-@@ -431,6 +431,10 @@ port_init(uint16_t port)
+@@ -236,6 +236,10 @@ port_init(uint16_t port)


More information about the stable mailing list