examples/qos_sched: fix build with gcc 10
authorTimothy Redaelli <tredaelli@redhat.com>
Wed, 5 Feb 2020 17:05:46 +0000 (18:05 +0100)
committerDavid Marchand <david.marchand@redhat.com>
Wed, 4 Mar 2020 09:25:20 +0000 (10:25 +0100)
GCC 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.

Fixes: be1e533238c0 ("examples/qos_sched: add TC and queue config flexibility")
Cc: stable@dpdk.org
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: David Marchand <david.marchand@redhat.com>
examples/qos_sched/cfg_file.c
examples/qos_sched/main.h

index 5714c3f..f078e4f 100644 (file)
@@ -20,6 +20,9 @@
  * for new entries do we add in */
 #define CFG_ALLOC_ENTRY_BATCH 16
 
+uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
+uint32_t n_active_queues;
+
 int
 cfg_load_port(struct rte_cfgfile *cfg, struct rte_sched_port_params *port_params)
 {
index baa2b3e..23bc418 100644 (file)
@@ -148,8 +148,8 @@ extern struct burst_conf burst_conf;
 extern struct ring_thresh rx_thresh;
 extern struct ring_thresh tx_thresh;
 
-uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
-uint32_t n_active_queues;
+extern uint32_t active_queues[RTE_SCHED_QUEUES_PER_PIPE];
+extern uint32_t n_active_queues;
 
 extern struct rte_sched_port_params port_params;
 extern struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS];