From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5B2C5A32A4 for ; Fri, 25 Oct 2019 15:56:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2A36F1C214; Fri, 25 Oct 2019 15:56:48 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 381151C212 for ; Fri, 25 Oct 2019 15:56:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572011804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mN7T5PYpKx3QPlfqXwbqz9MVzStzP0OHLpE+a6s9YIo=; b=hHkOtIpNMQw7otpB3WKxCb2HM1W5K+WJiDjlFDN8zNZ1/l1140T5Mk2FIp4coUyaRjaMxv W7JgFwaufSJOiX64xBGMhJJwoty+4JVSMSyMjO6pH44imZrfCMjKhcIaCZKygHOUnD90Q7 /7DODljl1S1pflS3Wk8OnEg69pmx/iU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-194-QGN5PxytMnmumwHBO4gtfA-1; Fri, 25 Oct 2019 09:56:38 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F6B91005500; Fri, 25 Oct 2019 13:56:35 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-129.brq.redhat.com [10.40.204.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id ABB3C1001B3F; Fri, 25 Oct 2019 13:56:29 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stephen@networkplumber.org, anatoly.burakov@intel.com, thomas@monjalon.net, ktraynor@redhat.com, Neil Horman , John McNamara , Marko Kovacevic , Harry van Haaren , Harini Ramakrishnan , Omar Cardona , Anand Rawat , Ranjit Menon Date: Fri, 25 Oct 2019 15:56:00 +0200 Message-Id: <1572011772-23271-2-git-send-email-david.marchand@redhat.com> In-Reply-To: <1572011772-23271-1-git-send-email-david.marchand@redhat.com> References: <1571736761-32134-1-git-send-email-david.marchand@redhat.com> <1572011772-23271-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: QGN5PxytMnmumwHBO4gtfA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH v3 01/12] eal: make lcore config private X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Stephen Hemminger The internal structure of lcore_config does not need to be part of visible API/ABI. Make it private to EAL. Rearrange the structure so it takes less memory (and cache footprint). Signed-off-by: Stephen Hemminger Signed-off-by: David Marchand Acked-by: Thomas Monjalon --- Based on Stephen v8: http://patchwork.dpdk.org/patch/60443/ Changes since Stephen v8: - do not change core_id, socket_id and core_index types, --- doc/guides/rel_notes/deprecation.rst | 4 ---- doc/guides/rel_notes/release_19_11.rst | 2 ++ lib/librte_eal/common/eal_common_launch.c | 2 ++ lib/librte_eal/common/eal_private.h | 25 +++++++++++++++++++++++++ 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 - lib/librte_eal/windows/eal/eal_thread.c | 1 + 8 files changed, 32 insertions(+), 29 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/de= precation.rst index 237813b..e4a33e0 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -23,10 +23,6 @@ Deprecation Notices * eal: The function ``rte_eal_remote_launch`` will return new error codes after read or write error on the pipe, instead of calling ``rte_panic``. =20 -* eal: The ``lcore_config`` struct and global symbol will be made private = to - remove it from the externally visible ABI and allow it to be updated in = the - future. - * eal: both declaring and identifying devices will be streamlined in v18.1= 1. New functions will appear to query a specific port from buses, classes o= f device and device drivers. Device declaration will be made coherent with= the diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/= release_19_11.rst index e77d226..d2c4e9e 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -312,6 +312,8 @@ ABI Changes Also, make sure to start the actual text at the margin. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D =20 +* eal: made the ``lcore_config`` struct and global symbol private. + =20 Shared Library Versions ----------------------- diff --git a/lib/librte_eal/common/eal_common_launch.c b/lib/librte_eal/com= mon/eal_common_launch.c index fe0ba3f..cf52d71 100644 --- a/lib/librte_eal/common/eal_common_launch.c +++ b/lib/librte_eal/common/eal_common_launch.c @@ -15,6 +15,8 @@ #include #include =20 +#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/ea= l_private.h index 798ede5..0e4b033 100644 --- a/lib/librte_eal/common/eal_private.h +++ b/lib/librte_eal/common/eal_private.h @@ -10,6 +10,31 @@ #include =20 #include +#include + +/** + * Structure storing internal configuration (per-lcore) + */ +struct lcore_config { +=09pthread_t thread_id; /**< pthread identifier */ +=09int pipe_master2slave[2]; /**< communication pipe with master */ +=09int pipe_slave2master[2]; /**< communication pipe with master */ + +=09lcore_function_t * volatile f; /**< function to call */ +=09void * volatile arg; /**< argument of function */ +=09volatile int ret; /**< return value of function */ + +=09volatile enum rte_lcore_state_t state; /**< lcore state */ +=09unsigned int socket_id; /**< physical socket id for this lcore */ +=09unsigned int core_id; /**< core number on socket for this lcore */ +=09int core_index; /**< relative index, starting from 0 */ +=09uint8_t core_role; /**< role of core eg: OFF, RTE, SERVICE */ +=09uint8_t detected; /**< true if lcore was detected */ + +=09rte_cpuset_t cpuset; /**< cpu set which the lcore affinity to */ +}; + +extern struct lcore_config lcore_config[RTE_MAX_LCORE]; =20 /** * Initialize the memzone subsystem (private to eal). diff --git a/lib/librte_eal/common/include/rte_lcore.h b/lib/librte_eal/com= mon/include/rte_lcore.h index c86f72e..0c68391 100644 --- a/lib/librte_eal/common/include/rte_lcore.h +++ b/lib/librte_eal/common/include/rte_lcore.h @@ -66,30 +66,6 @@ typedef cpuset_t rte_cpuset_t; } while (0) #endif =20 -/** - * Structure storing internal configuration (per-lcore) - */ -struct lcore_config { -=09unsigned detected; /**< true if lcore was detected */ -=09pthread_t thread_id; /**< pthread identifier */ -=09int pipe_master2slave[2]; /**< communication pipe with master */ -=09int pipe_slave2master[2]; /**< communication pipe with master */ -=09lcore_function_t * volatile f; /**< function to call */ -=09void * volatile arg; /**< argument of function */ -=09volatile int ret; /**< return value of function */ -=09volatile enum rte_lcore_state_t state; /**< lcore state */ -=09unsigned socket_id; /**< physical socket id for this lcore */ -=09unsigned core_id; /**< core number on socket for this lcore */ -=09int core_index; /**< relative index, starting from 0 */ -=09rte_cpuset_t cpuset; /**< cpu set which the lcore affinity to */ -=09uint8_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". */ =20 diff --git a/lib/librte_eal/common/rte_service.c b/lib/librte_eal/common/rt= e_service.c index beb9691..79235c0 100644 --- a/lib/librte_eal/common/rte_service.c +++ b/lib/librte_eal/common/rte_service.c @@ -21,6 +21,8 @@ #include #include =20 +#include "eal_private.h" + #define RTE_SERVICE_NUM_MAX 64 =20 #define SERVICE_F_REGISTERED (1 << 0) diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_ve= rsion.map index 7cbf82d..aeedf39 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -4,7 +4,6 @@ DPDK_2.0 { =09__rte_panic; =09eal_parse_sysfs_value; =09eal_timer_source; -=09lcore_config; =09per_lcore__lcore_id; =09per_lcore__rte_errno; =09rte_calloc; diff --git a/lib/librte_eal/windows/eal/eal_thread.c b/lib/librte_eal/windo= ws/eal/eal_thread.c index 906502f..0591d4c 100644 --- a/lib/librte_eal/windows/eal/eal_thread.c +++ b/lib/librte_eal/windows/eal/eal_thread.c @@ -12,6 +12,7 @@ #include #include =20 +#include "eal_private.h" =20 RTE_DEFINE_PER_LCORE(unsigned int, _lcore_id) =3D LCORE_ID_ANY; =20 --=20 1.8.3.1