Skip to contentSkip to conversation

doc: update definition of lcore id and lcore index

PATCH Superseded Marko Kovacevic 1 participant 1 message Feb 1, 2018

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 doc: update definition of lcore id and lcore index

Added examples in lcore index for better
explanation on various examples,
Sited examples for lcore id.

---
V2:
- Added clearer description to lcore id - Bruce
- Reframed examples for lcore index - Bruce

---
 lib/librte_eal/common/include/rte_lcore.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
lib/librte_eal/common/include/rte_lcore.h +12 -2
index d84bcff..44c5780 100644
@@ -57,7 +57,12 @@ RTE_DECLARE_PER_LCORE(unsigned, _lcore_id);  /**< Per thread "lcore id". */
 RTE_DECLARE_PER_LCORE(rte_cpuset_t, _cpuset); /**< Per thread "cpuset". */
 
 /**
- * Return the ID of the execution unit we are running on.
+ * Return the Application thread ID of the execution unit.
+ *
+ * If option '-l' or '-c' is provided the lcore ID is the actual
+ * CPU ID. If option '--lcore' is provided the lcore ID is the
+ * index starting from 0.
+ *
  * @return
  *  Logical core ID (in EAL thread) or LCORE_ID_ANY (in non-EAL thread)
  */
@@ -94,7 +99,12 @@ rte_lcore_count(void)
 
 /**
  * Return the index of the lcore starting from zero.
- * The order is physical or given by command line (-l option).
+ *
+ * When option -c or -l is given, the index corresponds
+ * to the order in the list.
+ * For example:
+ * -c 0x30, lcore 4 has index 0, and 5 has index 1.
+ * -l 22,18 lcore 22 has index 0, and 18 has index 1.
  *
  * @param lcore_id
  *   The targeted lcore, or -1 for the current one.
Signature · 1 line
2.9.5