[dpdk-dev] eal/common: Fix enabled core number with core list argument

Message ID 1421780083-4923-1-git-send-email-repk@triplefau.lt (mailing list archive)
State Accepted, archived
Headers

Commit Message

Remi Pommarel Jan. 20, 2015, 6:54 p.m. UTC
  When using core list argument to define which core to enable (ie -l) the
core_num field of the rte configuration is not updated the same way as using
coremask. This causes rte_lcore_num() to yield different value from the one
using coremask.

Signed-off-by: Remi Pommarel <repk@triplefau.lt>
---
 lib/librte_eal/common/eal_common_options.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Thomas Monjalon Jan. 27, 2015, 11:45 a.m. UTC | #1
> When using core list argument to define which core to enable (ie -l) the
> core_num field of the rte configuration is not updated the same way as using
> coremask. This causes rte_lcore_num() to yield different value from the one
> using coremask.
> 
> Signed-off-by: Remi Pommarel <repk@triplefau.lt>

Good catch, it was forgotten when adding this option.

Fixes: d888cb8b9613 ("add core list input format")
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>

Applied

Thanks
  

Patch

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index e2810ab..67e02dc 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -268,6 +268,9 @@  eal_parse_corelist(const char *corelist)
 	if (count == 0)
 		return -1;
 
+	/* Update the count of enabled logical cores of the EAL configuration */
+	cfg->lcore_count = count;
+
 	lcores_parsed = 1;
 	return 0;
 }