[3/4] examples/multi_process: do not dereference global config struct

Message ID 1557906862-1116-3-git-send-email-david.marchand@redhat.com
State Accepted
Delegated to: Thomas Monjalon
Headers show
Series
  • [1/4] net/cxgbe: do not dereference global config struct
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

David Marchand May 15, 2019, 7:54 a.m.
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>
---
 examples/multi_process/symmetric_mp/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Maxime Coquelin May 15, 2019, 10:07 a.m. | #1
On 5/15/19 9:54 AM, David Marchand wrote:
> 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>
> ---
>   examples/multi_process/symmetric_mp/main.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

Patch

diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index c310e94..62771e0 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -271,7 +271,7 @@  struct port_stats{
 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;