examples/performance-thread: fix build with low core count
authorHonnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Fri, 16 Oct 2020 06:03:49 +0000 (01:03 -0500)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 30 Oct 2020 14:45:59 +0000 (15:45 +0100)
When the value of RTE_MAX_LCORE is small, it results in the
following compilation error.

../examples/performance-thread/l3fwd-thread/main.c:2338:34: error:
iteration 4 invokes undefined behavior
[-Werror=aggressive-loop-optimizations]

Fixes: d48415e1fee3 ("examples/performance-thread: add l3fwd-thread app")
Cc: stable@dpdk.org
Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Tested-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Reviewed-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
examples/performance-thread/l3fwd-thread/main.c

index e96076f..7bf61db 100644 (file)
@@ -599,8 +599,8 @@ struct thread_rx_conf rx_thread[MAX_RX_THREAD];
 struct thread_tx_conf {
        struct thread_conf conf;
 
-       uint16_t tx_queue_id[RTE_MAX_LCORE];
-       struct mbuf_table tx_mbufs[RTE_MAX_LCORE];
+       uint16_t tx_queue_id[RTE_MAX_ETHPORTS];
+       struct mbuf_table tx_mbufs[RTE_MAX_ETHPORTS];
 
        struct rte_ring *ring;
        struct lthread_cond **ready;