From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <marko.kovacevic@intel.com>
Received: from mga09.intel.com (mga09.intel.com [134.134.136.24])
 by dpdk.org (Postfix) with ESMTP id D1126A491;
 Fri,  2 Feb 2018 16:02:55 +0100 (CET)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga006.fm.intel.com ([10.253.24.20])
 by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 02 Feb 2018 07:02:53 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.46,448,1511856000"; d="scan'208";a="200857509"
Received: from silpixa00399502.ir.intel.com (HELO
 silpixa00399502.ger.corp.intel.com) ([10.237.223.218])
 by fmsmga006.fm.intel.com with ESMTP; 02 Feb 2018 07:02:51 -0800
From: Marko Kovacevic <marko.kovacevic@intel.com>
To: dev@dpdk.org
Cc: john.mcnamara@intel.com, vipin.varghese@intel.com,
 bruce.richardson@intel.com, stable@dpdk.org,
 Marko Kovacevic <marko.kovacevic@intel.com>
Date: Fri,  2 Feb 2018 15:02:32 +0000
Message-Id: <20180202150232.6611-1-marko.kovacevic@intel.com>
X-Mailer: git-send-email 2.9.5
In-Reply-To: <20180201165347.15646-1-marko.kovacevic@intel.com>
References: <20180201165347.15646-1-marko.kovacevic@intel.com>
Subject: [dpdk-dev] [PATCH v3] doc: update definition of lcore id and lcore
	index
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 02 Feb 2018 15:02:57 -0000

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