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 E5F37A328D for ; Tue, 22 Oct 2019 11:33:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6B8311BEB3; Tue, 22 Oct 2019 11:33:09 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 02CA61BEA7 for ; Tue, 22 Oct 2019 11:33:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571736787; 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=X4lgP4l7RmDxVSI61jHQZTAnXfhwGWuH7O4KR3MOg6I=; b=RWffS7+M1W/1tgVe+Jy/AM3l6WDtfg1MseqgM9sTVtfXnx1tA8Go+vg4wb8gG0ni1sLEpe SJ309Us0PJgWI+VJ3qH9/C1s8DtrQGTgaqGWqezUCvp0/sBgHGHaIZkZOL4GCXjhHkDy+n YluErT3CTHF23m0G7PfMN8+kJucdwjc= 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-161-EHPYyWBgOUy4xG1u1wt-Gg-1; Tue, 22 Oct 2019 05:33:05 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 766A05E4; Tue, 22 Oct 2019 09:33:03 +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 A0649601AF; Tue, 22 Oct 2019 09:32:59 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stephen@networkplumber.org, anatoly.burakov@intel.com, thomas@monjalon.net, Neil Horman , John McNamara , Marko Kovacevic , Harry van Haaren , Harini Ramakrishnan , Omar Cardona , Anand Rawat , Ranjit Menon Date: Tue, 22 Oct 2019 11:32:34 +0200 Message-Id: <1571736761-32134-2-git-send-email-david.marchand@redhat.com> In-Reply-To: <1571736761-32134-1-git-send-email-david.marchand@redhat.com> References: <1571736761-32134-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: EHPYyWBgOUy4xG1u1wt-Gg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH 1/8] 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 --- 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 40121b9..d7e14b4 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -202,6 +202,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