* [PATCH 1/2] examples/qos_sched: fix unused but set global errors
@ 2026-09-03 19:16 Stephen Hemminger
2026-09-03 19:16 ` [PATCH 2/2] examples/vhost: remove unused but set globals Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2026-09-03 19:16 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, stable, Cristian Dumitrescu
The QoS sched example tracks numa and port mask but never
uses them. Remove the dead code.
clang 23 reports:
qos_sched/args.c:26:17: error: variable 'app_numa_mask' set but not used
[-Werror,-Wunused-but-set-global]
qos_sched/args.c:27:17: error: variable 'app_used_port_mask' set but not used
[-Werror,-Wunused-but-set-global]
Fixes: de3cfa2c9823 ("sched: initial import")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/qos_sched/args.c | 5 -----
examples/qos_sched/init.c | 1 -
2 files changed, 6 deletions(-)
diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index 886542b3c1..04e2a0e03c 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -23,8 +23,6 @@
#define SYS_CPU_DIR "/sys/devices/system/cpu/cpu%u/topology/"
static uint32_t app_main_core = 1;
-static uint32_t app_numa_mask;
-static uint64_t app_used_port_mask = 0;
static uint64_t app_used_rx_port_mask = 0;
static uint64_t app_used_tx_port_mask = 0;
@@ -214,7 +212,6 @@ app_parse_flow_conf(const char *conf_str)
return -1;
}
app_used_rx_port_mask |= mask;
- app_used_port_mask |= mask;
mask = 1lu << pconf->tx_port;
if (app_used_tx_port_mask & mask) {
@@ -223,7 +220,6 @@ app_parse_flow_conf(const char *conf_str)
return -1;
}
app_used_tx_port_mask |= mask;
- app_used_port_mask |= mask;
nb_pfc++;
@@ -404,7 +400,6 @@ app_parse_args(int argc, char **argv)
RTE_LOG(ERR, APP, "pfc %u: RX and WT must be on the same socket\n", i + 1);
return -1;
}
- app_numa_mask |= 1 << rte_lcore_to_socket_id(qos_conf[i].rx_core);
}
return 0;
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 561f9e0619..9f4b2e0082 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -19,7 +19,6 @@
#include "main.h"
#include "cfg_file.h"
-uint32_t app_numa_mask = 0;
static uint32_t app_inited_port_mask = 0;
int app_pipe_to_profile[MAX_SCHED_SUBPORTS][MAX_SCHED_PIPES];
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] examples/vhost: remove unused but set globals
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
2026-09-04 7:20 ` David Marchand
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2026-09-03 19:16 UTC (permalink / raw)
To: dev
Cc: Stephen Hemminger, stable, Maxime Coquelin, Chenbo Xia,
Huawei Xie, Changchun Ouyang
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] examples/vhost: remove unused but set globals
2026-09-03 19:16 ` [PATCH 2/2] examples/vhost: remove unused but set globals Stephen Hemminger
@ 2026-09-04 7:20 ` David Marchand
0 siblings, 0 replies; 3+ messages in thread
From: David Marchand @ 2026-09-04 7:20 UTC (permalink / raw)
To: Stephen Hemminger
Cc: dev, stable, Maxime Coquelin, Chenbo Xia, Huawei Xie,
Changchun Ouyang
On Thu, 3 Sept 2026 at 21:16, Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> 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")
$ git grep num_queues 84b02d16c53981e9163a3f1600651a533770553a^ --
examples/vhost/main.c
84b02d16c53981e9163a3f1600651a533770553a^:examples/vhost/main.c:static
uint32_t num_queues = 0;
84b02d16c53981e9163a3f1600651a533770553a^:examples/vhost/main.c:
num_queues = dev_info.max_rx_queues;
84b02d16c53981e9163a3f1600651a533770553a^:examples/vhost/main.c:
rx_rings = (uint16_t)num_queues,
84b02d16c53981e9163a3f1600651a533770553a^:examples/vhost/main.c:
= dev->device_fh * (num_queues / num_devices);
$ git grep num_queues 84b02d16c53981e9163a3f1600651a533770553a --
examples/vhost/main.c
84b02d16c53981e9163a3f1600651a533770553a:examples/vhost/main.c:static
uint32_t num_queues = 0;
84b02d16c53981e9163a3f1600651a533770553a:examples/vhost/main.c:
num_queues = num_pf_queues + num_vmdq_queues;
The last usage of this variable was removed with:
Fixes: 84b02d16c539 ("examples/vhost: support new VMDQ API for i40e")
> Cc: stable@dpdk.org
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Otherwise, lgtm.
--
David Marchand
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-04 7:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 19:16 [PATCH 1/2] examples/qos_sched: fix unused but set global errors Stephen Hemminger
2026-09-03 19:16 ` [PATCH 2/2] examples/vhost: remove unused but set globals Stephen Hemminger
2026-09-04 7:20 ` David Marchand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox