From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id EBCC8A0096
	for <public@inbox.dpdk.org>; Mon,  8 Apr 2019 20:26:02 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 1F8F25942;
	Mon,  8 Apr 2019 20:25:33 +0200 (CEST)
Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com
 [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 5B21E5688
 for <dev@dpdk.org>; Mon,  8 Apr 2019 20:25:21 +0200 (CEST)
Received: by mail-pf1-f196.google.com with SMTP id t21so5791226pfh.2
 for <dev@dpdk.org>; Mon, 08 Apr 2019 11:25:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:in-reply-to:references;
 bh=3ridAZN/1T9M6kFd5SOhS6KCU4uzTbkMWPJ5SM2K97U=;
 b=ku0ivT1+6vIBhx5TCFkZi7lqZI4NPbeKQKCw3AII5IIZ0bctp3ATpTmcJirE03uXLp
 QruxTdtHrdxKv7r8XRtesSOSTffG5T1EH6lvXfK/vFtSXMOp4zW3muwi/GM3c7vi5gQK
 GMb6LQbdAfNyJ0EIGeBt5apptBdojA7BOlA5v2ww5hHQDfgyEScjifAUa8nHvvI+S7cb
 G+zg8ff+Q55l9sia81ccjlZuLzuC8sabBuI+ihdPY65lvWO4LOQtT00/m0XmdGCJTRUe
 xFzOeI7QpmDicJ4s+6ZK7mLde8r4206vqxll7ib+wzHsiyHpIrTe5ckJ5SERPkty2SpA
 ZR+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references;
 bh=3ridAZN/1T9M6kFd5SOhS6KCU4uzTbkMWPJ5SM2K97U=;
 b=l+BsHar77fK9i3qA552yPwNiYrXznRFlkPixLjHMo40/aSh+UWjnJ7ioYTVbpooyLo
 moAU6JTFG3/TdGXYrx+Pttn4LU6Z2z9gz28PHckhp/F+PWgd59YdQmNPyZ4zzfy0Lg+9
 LRVlu1T48ul8Ovx/qOg6Ib9n17nhPkEIAO+mLXF8DOg1a4BRLnXNdOS5bQAMSvs2wGyp
 SazrnRCD14SITHf8fQuWvjh2pLCIF1nAiYqA79QK30bSouXGqlBREmK8n+OddPzzYXzX
 kljiXi7rbiPhzJiZhaEE32MGhwKRPbISpm/AenJT29vFqmJE39g0Ae2LIJOqUJcD0KEQ
 e2Xg==
X-Gm-Message-State: APjAAAUBjqbA133uVOCK+gnwFE5MoxgQshf1a7je18GLcNqxa/QohZ4O
 Ijr4Ek6w5hEJwd2q5ufcvXAHI3PIFYwp9A==
X-Google-Smtp-Source: APXvYqxj/NTCj3Yd+rwu/JvQ0JSxTMlBBGyKyR4wdQZMeh5nqgRGg2WzIw0m5a/x9PRLN5OUsNR2Kg==
X-Received: by 2002:a63:5ec2:: with SMTP id s185mr30302021pgb.27.1554747920213; 
 Mon, 08 Apr 2019 11:25:20 -0700 (PDT)
Received: from shemminger-XPS-13-9360.lan (204-195-22-127.wavecable.com.
 [204.195.22.127])
 by smtp.gmail.com with ESMTPSA id d25sm40891081pfn.154.2019.04.08.11.25.19
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 08 Apr 2019 11:25:19 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon,  8 Apr 2019 11:25:10 -0700
Message-Id: <20190408182510.16078-6-stephen@networkplumber.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20190408182510.16078-1-stephen@networkplumber.org>
References: <20190408182510.16078-1-stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH v1 5/5] eal: make lcore_config private
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://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <20190408182510.nC35CJ9UsRJJVEJjxT1YOCH2wFIPLdt7ZhikhzDlwBM@z>

The internal structure of lcore_config should not be part of
visible API/ABI. Make it private to EAL.

Rearrange and resize the fields in the structure so it takes
less memory (and cache footprint).

THIS BREAKS ABI OF PREVIOUS RELEASES.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_eal/common/eal_common_launch.c |  2 ++
 lib/librte_eal/common/eal_private.h       | 22 +++++++++++++++++++++
 lib/librte_eal/common/include/rte_lcore.h | 24 -----------------------
 lib/librte_eal/common/rte_service.c       |  2 ++
 lib/librte_eal/rte_eal_version.map        |  1 -
 5 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_launch.c b/lib/librte_eal/common/eal_common_launch.c
index fe0ba3f0d617..cf52d717f68e 100644
--- a/lib/librte_eal/common/eal_common_launch.c
+++ b/lib/librte_eal/common/eal_common_launch.c
@@ -15,6 +15,8 @@
 #include <rte_per_lcore.h>
 #include <rte_lcore.h>
 
+#include "eal_private.h"
+
 /*
  * Wait until a lcore finished its job.
  */
diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h
index 798ede553b21..25e80547904f 100644
--- a/lib/librte_eal/common/eal_private.h
+++ b/lib/librte_eal/common/eal_private.h
@@ -10,6 +10,28 @@
 #include <stdio.h>
 
 #include <rte_dev.h>
+#include <rte_lcore.h>
+
+/**
+ * Structure storing internal configuration (per-lcore)
+ */
+struct lcore_config {
+	uint32_t core_id;      /**< core number on socket for this lcore */
+	uint32_t core_index;   /**< relative index, starting from 0 */
+	uint16_t socket_id;    /**< physical socket id for this lcore */
+	uint8_t core_role;         /**< role of core eg: OFF, RTE, SERVICE */
+	uint8_t detected;          /**< true if lcore was detected */
+	volatile enum rte_lcore_state_t state; /**< lcore state */
+	rte_cpuset_t cpuset;       /**< cpu set which the lcore affinity to */
+	pthread_t thread_id;       /**< pthread identifier */
+	int pipe_master2slave[2];  /**< communication pipe with master */
+	int pipe_slave2master[2];  /**< communication pipe with master */
+	lcore_function_t * volatile f;         /**< function to call */
+	void * volatile arg;       /**< argument of function */
+	volatile int ret;          /**< return value of function */
+};
+
+extern struct lcore_config lcore_config[RTE_MAX_LCORE];
 
 /**
  * Initialize the memzone subsystem (private to eal).
diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/common/include/rte_lcore.h
index 7687fe650f64..bc416bc8c19f 100644
--- a/lib/librte_eal/common/include/rte_lcore.h
+++ b/lib/librte_eal/common/include/rte_lcore.h
@@ -37,30 +37,6 @@ typedef cpuset_t rte_cpuset_t;
 } while (0)
 #endif
 
-/**
- * Structure storing internal configuration (per-lcore)
- */
-struct lcore_config {
-	unsigned detected;         /**< true if lcore was detected */
-	pthread_t thread_id;       /**< pthread identifier */
-	int pipe_master2slave[2];  /**< communication pipe with master */
-	int pipe_slave2master[2];  /**< communication pipe with master */
-	lcore_function_t * volatile f;         /**< function to call */
-	void * volatile arg;       /**< argument of function */
-	volatile int ret;          /**< return value of function */
-	volatile enum rte_lcore_state_t state; /**< lcore state */
-	unsigned socket_id;        /**< physical socket id for this lcore */
-	unsigned core_id;          /**< core number on socket for this lcore */
-	int core_index;            /**< relative index, starting from 0 */
-	rte_cpuset_t cpuset;       /**< cpu set which the lcore affinity to */
-	uint8_t core_role;         /**< role of core eg: OFF, RTE, SERVICE */
-};
-
-/**
- * Internal configuration (per-lcore)
- */
-extern struct lcore_config lcore_config[RTE_MAX_LCORE];
-
 RTE_DECLARE_PER_LCORE(unsigned, _lcore_id);  /**< Per thread "lcore id". */
 RTE_DECLARE_PER_LCORE(rte_cpuset_t, _cpuset); /**< Per thread "cpuset". */
 
diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rte_service.c
index 5f75e5a53fbf..8d53d966446a 100644
--- a/lib/librte_eal/common/rte_service.c
+++ b/lib/librte_eal/common/rte_service.c
@@ -21,6 +21,8 @@
 #include <rte_memory.h>
 #include <rte_malloc.h>
 
+#include "eal_private.h"
+
 #define RTE_SERVICE_NUM_MAX 64
 
 #define SERVICE_F_REGISTERED    (1 << 0)
diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map
index f6688327cad3..2f175f58ed42 100644
--- a/lib/librte_eal/rte_eal_version.map
+++ b/lib/librte_eal/rte_eal_version.map
@@ -4,7 +4,6 @@ DPDK_2.0 {
 	__rte_panic;
 	eal_parse_sysfs_value;
 	eal_timer_source;
-	lcore_config;
 	per_lcore__lcore_id;
 	per_lcore__rte_errno;
 	rte_calloc;
-- 
2.17.1