From: Yuan Wang Date: Wed, 18 May 2022 13:36:33 +0000 (+0800) Subject: examples/vhost: fix crash when no VMDq X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6f3d83c7f207d435d960ad881f127e9971a81069;p=dpdk.git examples/vhost: fix crash when no VMDq 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") Cc: stable@dpdk.org Signed-off-by: Yuan Wang Reviewed-by: Chenbo Xia --- diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 5bc34b0c52..e7fee5aa1b 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -431,6 +431,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;