DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] doc: update definition of lcore id and lcore index
@ 2018-01-31 16:46 Marko Kovacevic
  2018-02-01 15:04 ` Bruce Richardson
  2018-02-01 16:53 ` [dpdk-dev] [PATCH v2] " Marko Kovacevic
  0 siblings, 2 replies; 6+ messages in thread
From: Marko Kovacevic @ 2018-01-31 16:46 UTC (permalink / raw)
  To: dev; +Cc: john.mcnamara, vipin.varghese, bruce.richardson, Marko Kovacevic

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

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
---
 lib/librte_eal/common/include/rte_lcore.h | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index d84bcff..349ac36 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -57,7 +57,9 @@ 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.
  * @return
  *  Logical core ID (in EAL thread) or LCORE_ID_ANY (in non-EAL thread)
  */
@@ -94,8 +96,19 @@ rte_lcore_count(void)
 
 /**
  * Return the index of the lcore starting from zero.
- * The order is physical or given by command line (-l option).
  *
+ * For example: <Core parameters - Mapping description>
+ * 1. '-c 0xf0' - CPU core ID 4 is index 0, 5
+ * is 1 and so on.
+ *
+ * 2. '-l 22-25' - CPU core ID 22 is index 0
+ * 23 is 1 and so on.
+ *
+ * 3. '-l 22,18' - CPU core ID 22 is index 0 and
+ * 18 is 1
+ *
+ * 4. '-c 0xcc' - CPU core ID 2 is index 0, 3 is index 1,
+ * 6 is index 2 and 7 is index 3.
  * @param lcore_id
  *   The targeted lcore, or -1 for the current one.
  * @return
-- 
2.9.5

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v1] doc: update definition of lcore id and lcore index
  2018-01-31 16:46 [dpdk-dev] [PATCH v1] doc: update definition of lcore id and lcore index Marko Kovacevic
@ 2018-02-01 15:04 ` Bruce Richardson
  2018-02-01 16:53 ` [dpdk-dev] [PATCH v2] " Marko Kovacevic
  1 sibling, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2018-02-01 15:04 UTC (permalink / raw)
  To: Marko Kovacevic; +Cc: dev, john.mcnamara, vipin.varghese

On Wed, Jan 31, 2018 at 04:46:46PM +0000, Marko Kovacevic wrote:
> Added examples in lcore index for better
> explanation on various examples,
> Sited examples for lcore id.
> 
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> ---
>  lib/librte_eal/common/include/rte_lcore.h | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
> index d84bcff..349ac36 100644
> --- a/lib/librte_eal/common/include/rte_lcore.h
> +++ b/lib/librte_eal/common/include/rte_lcore.h
> @@ -57,7 +57,9 @@ 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.

Good idea to clarify this!
I'd suggest the second sentence might do with being reworked a little
though - the lcore ID will also be the processor id even if no args i.e.
no -c or -l arguments are passed.

How about:
 * Note: in most cases the lcore id returned here will also correspond
 *   to the processor id of the CPU on which the thread is pinned, this
 *   will not be the case if the user has explicitly changed the thread to
 *   core affinities using --lcores EAL argument e.g. --lcores '(0-3)@10'
 *   to run threads with lcore IDs 0, 1, 2 and 3 on physical core 10.

It's longer, I know, but hopefully a bit clearer for the user.

/Bruce

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] doc: update definition of lcore id and lcore index
  2018-01-31 16:46 [dpdk-dev] [PATCH v1] doc: update definition of lcore id and lcore index Marko Kovacevic
  2018-02-01 15:04 ` Bruce Richardson
@ 2018-02-01 16:53 ` Marko Kovacevic
  2018-02-02 15:02   ` [dpdk-dev] [PATCH v3] " Marko Kovacevic
  1 sibling, 1 reply; 6+ messages in thread
From: Marko Kovacevic @ 2018-02-01 16:53 UTC (permalink / raw)
  To: dev; +Cc: john.mcnamara, vipin.varghese, bruce.richardson, Marko Kovacevic

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

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>

---
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(-)

diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index d84bcff..44c5780 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -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.
-- 
2.9.5

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v3] doc: update definition of lcore id and lcore index
  2018-02-01 16:53 ` [dpdk-dev] [PATCH v2] " Marko Kovacevic
@ 2018-02-02 15:02   ` Marko Kovacevic
  2018-02-06 12:28     ` Mcnamara, John
  0 siblings, 1 reply; 6+ messages in thread
From: Marko Kovacevic @ 2018-02-02 15:02 UTC (permalink / raw)
  To: dev
  Cc: john.mcnamara, vipin.varghese, bruce.richardson, stable, Marko Kovacevic

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

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>

---
V3:
 - Rephrased examples for lcore index and id - Bruce

V2:
 - Added clearer description to lcore id - Bruce
 - Reframed examples for lcore index - Bruce
---
 lib/librte_eal/common/include/rte_lcore.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index d84bcff..0472220 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -57,7 +57,14 @@ 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.
+ *
+ * Note: in most cases the lcore id returned here will also correspond
+ *   to the processor id of the CPU on which the thread is pinned, this
+ *   will not be the case if the user has explicitly changed the thread to
+ *   core affinities using --lcores EAL argument e.g. --lcores '(0-3)@10'
+ *   to run threads with lcore IDs 0, 1, 2 and 3 on physical core 10..
+ *
  * @return
  *  Logical core ID (in EAL thread) or LCORE_ID_ANY (in non-EAL thread)
  */
@@ -94,7 +101,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.
-- 
2.9.5

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v3] doc: update definition of lcore id and lcore index
  2018-02-02 15:02   ` [dpdk-dev] [PATCH v3] " Marko Kovacevic
@ 2018-02-06 12:28     ` Mcnamara, John
  2018-02-06 21:11       ` Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Mcnamara, John @ 2018-02-06 12:28 UTC (permalink / raw)
  To: Kovacevic, Marko, dev; +Cc: Varghese, Vipin, Richardson, Bruce, stable



> -----Original Message-----
> From: Kovacevic, Marko
> Sent: Friday, February 2, 2018 3:03 PM
> To: dev@dpdk.org
> Cc: Mcnamara, John <john.mcnamara@intel.com>; Varghese, Vipin
> <vipin.varghese@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; stable@dpdk.org; Kovacevic, Marko
> <marko.kovacevic@intel.com>
> Subject: [PATCH v3] 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.

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v3] doc: update definition of lcore id and lcore index
  2018-02-06 12:28     ` Mcnamara, John
@ 2018-02-06 21:11       ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2018-02-06 21:11 UTC (permalink / raw)
  To: Kovacevic, Marko; +Cc: dev, Mcnamara, John, Varghese, Vipin, Richardson, Bruce

> > Added examples in lcore index for better explanation on various examples,
> > Sited examples for lcore id.
> 
> Acked-by: John McNamara <john.mcnamara@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-06 21:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 16:46 [dpdk-dev] [PATCH v1] doc: update definition of lcore id and lcore index Marko Kovacevic
2018-02-01 15:04 ` Bruce Richardson
2018-02-01 16:53 ` [dpdk-dev] [PATCH v2] " Marko Kovacevic
2018-02-02 15:02   ` [dpdk-dev] [PATCH v3] " Marko Kovacevic
2018-02-06 12:28     ` Mcnamara, John
2018-02-06 21:11       ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).