From patchwork Wed Sep 13 10:34:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 131379 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E7C3042588; Wed, 13 Sep 2023 12:37:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3EE04067C; Wed, 13 Sep 2023 12:37:03 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id CB76D402E2 for ; Wed, 13 Sep 2023 12:37:01 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 89510320085B; Wed, 13 Sep 2023 06:37:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 13 Sep 2023 06:37:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1694601420; x=1694687820; bh=hlyDNq+UviAf6NbnW8IY9uFsNlBNIABWbp3 kCjdFB0g=; b=nwdU12Ly1lLtNE/rBTqKopGguTU3VhpjaB2O0pbEUX5jo2YY8RX fomdzta5arSp5j3H7A5/n+wldVCRjV2CjlNBDq0mRF1aeGlPMu3GRkxy8oGEGXxZ fXOa8p09jmegmZcRy7FPUb80N1xCVQkKQsagcpmK9DEK3P5OemHpQ9vI3cyce9/Y PutpF2B899Z5BjPE05fj2kcIwvOjI8EjyU+1dx2ddfjpWHEAsMT8stgcRDclwFs/ YcTi0CQdzRdf/NjitUd7BlqxytgBQYfQm0GDZ/o/+pi5Vf0N7IPQ2UqXLNSrau4l wIieom8jALca5IxuFM4SU1g3OKn66mg5jfQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1694601420; x=1694687820; bh=hlyDNq+UviAf6NbnW8IY9uFsNlBNIABWbp3 kCjdFB0g=; b=XeJJlcf8vOGumXVolPG/O1JDdtHYr5t0zMLD2eR9Qj6ZvhOfylO Ci0VIwiyakwo/3So4Qn5WTeBklZuuVe5MoiPP9t0SLqfiLI7B3np6Zw//WjrWYMW nsbuquUNwJzWRavlG08bVI/PAsmFNF2BV6qAW4kEXfbpZ8+P4Ecvgo9hOrHrDv+p psn8tgwwxYPEsoTqWKyq9AmmeSqtfTU5Aisj93eQ81B6jhXlRx7o9amzVg1QtRqf WxMmu/muegBWQzaS+a2nR1CFrsrNnFVouCkqBEJmKFF3ggAEzKIjLDq5CXjR9LdC dhjZ/AIG94NEPLLvNA7tJR+6xsMv1AtYU3Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeikedgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefvhhho mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne cuggftrfgrthhtvghrnheptdeiffffgeefteelhfekueetueduffejgfelvedtieejudek gfevheetheehgeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Sep 2023 06:36:58 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Tyler Retzlaff , David Marchand , Ferruh Yigit , =?utf-8?q?Morten_Br=C3=B8rup?= Subject: [PATCH v2 04/11] eal: promote thread API as stable Date: Wed, 13 Sep 2023 12:34:23 +0200 Message-ID: <20230913103600.1935292-5-thomas@monjalon.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230913103600.1935292-1-thomas@monjalon.net> References: <20230906162226.1618088-1-thomas@monjalon.net> <20230913103600.1935292-1-thomas@monjalon.net> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The rte_thread API must be used to ease OS porting. One step of this process is to mark the necessary API as stable. Signed-off-by: Thomas Monjalon Acked-by: Morten Brørup Acked-by: Tyler Retzlaff --- doc/guides/rel_notes/release_23_11.rst | 1 + lib/eal/include/rte_thread.h | 64 -------------------------- lib/eal/version.map | 40 ++++++++-------- 3 files changed, 20 insertions(+), 85 deletions(-) diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst index d3d500f294..d7562fd646 100644 --- a/doc/guides/rel_notes/release_23_11.rst +++ b/doc/guides/rel_notes/release_23_11.rst @@ -115,6 +115,7 @@ API Changes * eal: The thread API has changed. The function ``rte_thread_create_control()`` does not take attributes anymore. + The whole thread API was promoted to stable level. ABI Changes diff --git a/lib/eal/include/rte_thread.h b/lib/eal/include/rte_thread.h index 28cc5220a4..dd1f62523f 100644 --- a/lib/eal/include/rte_thread.h +++ b/lib/eal/include/rte_thread.h @@ -73,9 +73,6 @@ typedef struct { typedef struct eal_tls_key *rte_thread_key; /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Create a new thread that will invoke the 'thread_func' routine. * * @param thread_id @@ -94,15 +91,11 @@ typedef struct eal_tls_key *rte_thread_key; * On success, return 0. * On failure, return a positive errno-style error number. */ -__rte_experimental int rte_thread_create(rte_thread_t *thread_id, const rte_thread_attr_t *thread_attr, rte_thread_func thread_func, void *arg); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Create a control thread. * * Creates a control thread with the given name and attributes. The @@ -124,15 +117,11 @@ int rte_thread_create(rte_thread_t *thread_id, * On success, returns 0; on error, it returns a negative value * corresponding to the error number. */ -__rte_experimental int rte_thread_create_control(rte_thread_t *thread, const char *name, rte_thread_func thread_func, void *arg); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Waits for the thread identified by 'thread_id' to terminate * * @param thread_id @@ -145,13 +134,9 @@ rte_thread_create_control(rte_thread_t *thread, const char *name, * On success, return 0. * On failure, return a positive errno-style error number. */ -__rte_experimental int rte_thread_join(rte_thread_t thread_id, uint32_t *value_ptr); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Indicate that the return value of the thread is not needed and * all thread resources should be release when the thread terminates. * @@ -162,25 +147,17 @@ int rte_thread_join(rte_thread_t thread_id, uint32_t *value_ptr); * On success, return 0. * On failure, return a positive errno-style error number. */ -__rte_experimental int rte_thread_detach(rte_thread_t thread_id); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Get the id of the calling thread. * * @return * Return the thread id of the calling thread. */ -__rte_experimental rte_thread_t rte_thread_self(void); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Set the name of the thread. * This API is a noop if the underlying platform does not * support setting the thread name or the platform-specific @@ -193,14 +170,10 @@ rte_thread_t rte_thread_self(void); * The name to set. Truncated to RTE_THREAD_NAME_SIZE, * including terminating NUL if necessary. */ -__rte_experimental void rte_thread_set_name(rte_thread_t thread_id, const char *thread_name); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Check if 2 thread ids are equal. * * @param t1 @@ -213,13 +186,9 @@ rte_thread_set_name(rte_thread_t thread_id, const char *thread_name); * If the ids are equal, return nonzero. * Otherwise, return 0. */ -__rte_experimental int rte_thread_equal(rte_thread_t t1, rte_thread_t t2); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Initialize the attributes of a thread. * These attributes can be passed to the rte_thread_create() function * that will create a new thread and set its attributes according to attr. @@ -231,13 +200,9 @@ int rte_thread_equal(rte_thread_t t1, rte_thread_t t2); * On success, return 0. * On failure, return a positive errno-style error number. */ -__rte_experimental int rte_thread_attr_init(rte_thread_attr_t *attr); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Set the thread priority value in the thread attributes pointed to * by 'thread_attr'. * @@ -251,16 +216,12 @@ int rte_thread_attr_init(rte_thread_attr_t *attr); * On success, return 0. * On failure, return a positive errno-style error number. */ -__rte_experimental int rte_thread_attr_set_priority(rte_thread_attr_t *thread_attr, enum rte_thread_priority priority); #ifdef RTE_HAS_CPUSET /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Set the CPU affinity value in the thread attributes pointed to * by 'thread_attr'. * @@ -274,14 +235,10 @@ int rte_thread_attr_set_priority(rte_thread_attr_t *thread_attr, * On success, return 0. * On failure, return a positive errno-style error number. */ -__rte_experimental int rte_thread_attr_set_affinity(rte_thread_attr_t *thread_attr, rte_cpuset_t *cpuset); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Get the value of CPU affinity that is set in the thread attributes pointed * to by 'thread_attr'. * @@ -295,14 +252,10 @@ int rte_thread_attr_set_affinity(rte_thread_attr_t *thread_attr, * On success, return 0. * On failure, return a positive errno-style error number. */ -__rte_experimental int rte_thread_attr_get_affinity(rte_thread_attr_t *thread_attr, rte_cpuset_t *cpuset); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Set the affinity of thread 'thread_id' to the cpu set * specified by 'cpuset'. * @@ -316,14 +269,10 @@ int rte_thread_attr_get_affinity(rte_thread_attr_t *thread_attr, * On success, return 0. * On failure, return a positive errno-style error number. */ -__rte_experimental int rte_thread_set_affinity_by_id(rte_thread_t thread_id, const rte_cpuset_t *cpuset); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Get the affinity of thread 'thread_id' and store it * in 'cpuset'. * @@ -337,7 +286,6 @@ int rte_thread_set_affinity_by_id(rte_thread_t thread_id, * On success, return 0. * On failure, return a positive errno-style error number. */ -__rte_experimental int rte_thread_get_affinity_by_id(rte_thread_t thread_id, rte_cpuset_t *cpuset); @@ -364,9 +312,6 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp); #endif /* RTE_HAS_CPUSET */ /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Get the priority of a thread. * * @param thread_id @@ -379,14 +324,10 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp); * On success, return 0. * On failure, return a positive errno-style error number. */ -__rte_experimental int rte_thread_get_priority(rte_thread_t thread_id, enum rte_thread_priority *priority); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Set the priority of a thread. * * @param thread_id @@ -399,7 +340,6 @@ int rte_thread_get_priority(rte_thread_t thread_id, * On success, return 0. * On failure, return a positive errno-style error number. */ -__rte_experimental int rte_thread_set_priority(rte_thread_t thread_id, enum rte_thread_priority priority); @@ -421,7 +361,6 @@ int rte_thread_set_priority(rte_thread_t thread_id, * ENOEXEC - Specific OS error. */ -__rte_experimental int rte_thread_key_create(rte_thread_key *key, void (*destructor)(void *)); @@ -437,7 +376,6 @@ int rte_thread_key_create(rte_thread_key *key, * rte_errno can be: EINVAL - Invalid parameter passed. * ENOEXEC - Specific OS error. */ -__rte_experimental int rte_thread_key_delete(rte_thread_key key); /** @@ -454,7 +392,6 @@ int rte_thread_key_delete(rte_thread_key key); * rte_errno can be: EINVAL - Invalid parameter passed. * ENOEXEC - Specific OS error. */ -__rte_experimental int rte_thread_value_set(rte_thread_key key, const void *value); /** @@ -469,7 +406,6 @@ int rte_thread_value_set(rte_thread_key key, const void *value); * rte_errno can be: EINVAL - Invalid parameter passed. * ENOEXEC - Specific OS error. */ -__rte_experimental void *rte_thread_value_get(rte_thread_key key); #ifdef __cplusplus diff --git a/lib/eal/version.map b/lib/eal/version.map index 7940431e5a..33b853d7be 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -257,12 +257,31 @@ DPDK_24 { rte_strscpy; rte_strsplit; rte_sys_gettid; + rte_thread_attr_get_affinity; + rte_thread_attr_init; + rte_thread_attr_set_affinity; + rte_thread_attr_set_priority; + rte_thread_create; + rte_thread_create_control; + rte_thread_detach; + rte_thread_equal; rte_thread_get_affinity; + rte_thread_get_affinity_by_id; + rte_thread_get_priority; rte_thread_is_intr; + rte_thread_join; + rte_thread_key_create; + rte_thread_key_delete; rte_thread_register; + rte_thread_self; rte_thread_set_affinity; + rte_thread_set_affinity_by_id; + rte_thread_set_name; + rte_thread_set_priority; rte_thread_setname; rte_thread_unregister; + rte_thread_value_get; + rte_thread_value_set; rte_uuid_compare; rte_uuid_is_null; rte_uuid_parse; @@ -368,10 +387,6 @@ EXPERIMENTAL { # added in 21.05 rte_devargs_reset; rte_intr_callback_unregister_sync; - rte_thread_key_create; - rte_thread_key_delete; - rte_thread_value_get; - rte_thread_value_set; rte_version_minor; rte_version_month; rte_version_prefix; @@ -392,26 +407,9 @@ EXPERIMENTAL { # added in 22.07 rte_drand; - rte_thread_get_affinity_by_id; - rte_thread_get_priority; - rte_thread_self; - rte_thread_set_affinity_by_id; - rte_thread_set_priority; - - # added in 22.11 - rte_thread_attr_get_affinity; - rte_thread_attr_init; - rte_thread_attr_set_affinity; - rte_thread_attr_set_priority; - rte_thread_create; - rte_thread_detach; - rte_thread_equal; - rte_thread_join; # added in 23.03 rte_lcore_register_usage_cb; - rte_thread_create_control; - rte_thread_set_name; __rte_eal_trace_generic_blob; # added in 23.07