From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
stable@dpdk.org, Maxime Coquelin <maxime.coquelin@redhat.com>,
Chenbo Xia <chenbox@nvidia.com>,
Huawei Xie <huawei.xhw@alibaba-inc.com>,
Changchun Ouyang <changchun.ouyang@intel.com>
Subject: [PATCH 2/2] examples/vhost: remove unused but set globals
Date: Thu, 3 Sep 2026 12:16:02 -0700 [thread overview]
Message-ID: <20260903191602.924372-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20260903191602.924372-1-stephen@networkplumber.org>
The vhost example tracks number of queues but never uses the
variables. Remove num_queues and the num_vmdq_queues intermediate
that only fed it.
clang 23 reports:
vhost/main.c:86:17: error: variable 'num_queues' set but not used
[-Werror,-Wunused-but-set-global]
Fixes: d19533e86f1d ("examples/vhost: copy old vhost example")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/vhost/main.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 5978a50cfe..114e5f547c 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -82,8 +82,7 @@ static uint32_t enabled_port_mask = 0;
/* Promiscuous mode */
static uint32_t promiscuous;
-/* number of devices/queues to support*/
-static uint32_t num_queues = 0;
+/* number of devices to support */
static uint32_t num_devices;
static int mergeable;
@@ -162,7 +161,7 @@ static struct rte_eth_conf vmdq_conf_default = {
static unsigned lcore_ids[RTE_MAX_LCORE];
static uint16_t ports[RTE_MAX_ETHPORTS];
static unsigned num_ports = 0; /**< The number of ports specified in command line */
-static uint16_t num_pf_queues, num_vmdq_queues;
+static uint16_t num_pf_queues;
static uint16_t vmdq_pool_base, vmdq_queue_base;
static uint16_t queues_per_pool;
@@ -465,8 +464,6 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
/* NIC queues are divided into pf queues and vmdq queues. */
num_pf_queues = dev_info.max_rx_queues - dev_info.vmdq_queue_num;
queues_per_pool = dev_info.vmdq_queue_num / dev_info.max_vmdq_pools;
- num_vmdq_queues = num_devices * queues_per_pool;
- num_queues = num_pf_queues + num_vmdq_queues;
vmdq_queue_base = dev_info.vmdq_queue_base;
vmdq_pool_base = dev_info.vmdq_pool_base;
printf("pf queue num: %u, configured vmdq pool num: %u, each vmdq pool has %u queues\n",
--
2.53.0
next prev parent reply other threads:[~2026-09-03 19:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 19:16 [PATCH 1/2] examples/qos_sched: fix unused but set global errors Stephen Hemminger
2026-09-03 19:16 ` Stephen Hemminger [this message]
2026-09-04 7:20 ` [PATCH 2/2] examples/vhost: remove unused but set globals David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260903191602.924372-2-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=changchun.ouyang@intel.com \
--cc=chenbox@nvidia.com \
--cc=dev@dpdk.org \
--cc=huawei.xhw@alibaba-inc.com \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox