examples/multi_process: do not dereference global config struct
authorDavid Marchand <david.marchand@redhat.com>
Wed, 15 May 2019 07:54:21 +0000 (09:54 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 29 May 2019 22:29:16 +0000 (00:29 +0200)
Prefer the existing apis rather than direct access the configuration
structure.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
examples/multi_process/symmetric_mp/main.c

index c310e94..62771e0 100644 (file)
@@ -271,7 +271,7 @@ static void
 assign_ports_to_cores(void)
 {
 
-       const unsigned lcores = rte_eal_get_configuration()->lcore_count;
+       const unsigned int lcores = rte_lcore_count();
        const unsigned port_pairs = num_ports / 2;
        const unsigned pairs_per_lcore = port_pairs / lcores;
        unsigned extra_pairs = port_pairs % lcores;