From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C3D1E42588; Wed, 13 Sep 2023 13:45:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF38340A67; Wed, 13 Sep 2023 13:45:18 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 7E50140A67 for ; Wed, 13 Sep 2023 13:45:16 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id DC33D3200977; Wed, 13 Sep 2023 07:45:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 13 Sep 2023 07:45:15 -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= 1694605513; x=1694691913; bh=EUKNyUWMwzAdPPKZvr+lgcbvVSZusN28/YR l3AeLfus=; b=ZOObUcLMvPtEXBY9h2wW1Gyo9Kv0X6jSm+kwmUcUJbOjTBAcBlf mvDcOKbRNQUP0jVjlCcAhDfxl7VTwBFy9QwakNq4HCblmR36mmwAADbIiSiFZcAX F4KAehYIhm3+L/1vC9gNUknvSZYEDLlKO1v8eZ2Xqb2mFbi4g4nxzfNRRIqiI3/k nyOBt60BD2a4KojvxlfAQMgOheSyhQrHoyhYqPG4r1x1r+7kadKgEeURM9dF6jYR VSbtVqHVZrBIP0DywOd2qEiIwnTyuZiGgo+6EUn3fMeBtm8RLWOqs+o7uRfKcSsq t3mNe7AG/7uA0f0gpubByPPcu1wlI3W4W9Q== 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= 1694605513; x=1694691913; bh=EUKNyUWMwzAdPPKZvr+lgcbvVSZusN28/YR l3AeLfus=; b=RHbe1BJ9IIoQKVC3A8/FNmEBWB4IBc8UtPcm16ZDfZl5t/JWx8k 065xh59d9edgj+ULHlc+vam9WHWDnXrYmN4g49gPKlnPeci9l6NtvLw8OCphNzyB 59kMDSeRBljsxrsaNR+/DWjvR3l6DyqVm71Ohi7ezvY8L9dONORNycDSVFPXdaOr RNZamHC4IBugSVg2DdzX57kAmMoB2/l2rMTyZeuU9vU4Azl07xvi9Lf1xYZJYw10 xvlImBplkVlxZSj1hP9DPY23s9Djt+sa47Uc2aNoIvGj5yPGgJg8lSWNM2wS/qMP 7WgnXzCtj1ul4MTYUQfsLeDOFYjk13pZtaA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeikedggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhggtgfgsehtkeertdertdejnecuhfhrohhmpefvhhho mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne cuggftrfgrthhtvghrnheptdeiffffgeefteelhfekueetueduffejgfelvedtieejudek gfevheetheehgeejnecuvehluhhsthgvrhfuihiivgepfeenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Sep 2023 07:45:10 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Tyler Retzlaff , David Marchand , Ferruh Yigit , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Chengwen Feng , Kevin Laatz , Bruce Richardson , Jingjing Wu , Beilei Xing , Qiming Yang , Qi Zhang , Wenjun Wu , Jiawen Wu , Jian Wang , Harman Kalra , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam Subject: [PATCH v3 03/11] eal: remove attributes from control thread creation Date: Wed, 13 Sep 2023 13:28:16 +0200 Message-ID: <20230913114351.1940459-4-thomas@monjalon.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230913114351.1940459-1-thomas@monjalon.net> References: <20230906162226.1618088-1-thomas@monjalon.net> <20230913114351.1940459-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 experimental function rte_thread_create_control() is supposed to wrap actions needed to create a control thread in DPDK. This function should be easy to port on any OS. As such, the thread attributes should not be customizable in this API. The thread priority should be normal, and the affinity is on "free cores". That's why the custom attributes parameter thread_attr is dropped. Signed-off-by: Thomas Monjalon Acked-by: Morten Brørup Acked-by: Tyler Retzlaff --- app/test/test_threads.c | 2 +- doc/guides/rel_notes/release_23_11.rst | 3 +++ drivers/dma/skeleton/skeleton_dmadev.c | 3 +-- drivers/net/iavf/iavf_vchnl.c | 2 +- drivers/net/ice/ice_dcf_parent.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 1 - drivers/net/txgbe/txgbe_ethdev.c | 2 +- lib/eal/common/eal_common_thread.c | 5 ++--- lib/eal/include/rte_thread.h | 5 +---- lib/eal/windows/eal_interrupts.c | 2 +- 10 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/test/test_threads.c b/app/test/test_threads.c index 8c27e2bae1..4ac3f2671a 100644 --- a/app/test/test_threads.c +++ b/app/test/test_threads.c @@ -240,7 +240,7 @@ test_thread_control_create_join(void) thread_id_ready = 0; RTE_TEST_ASSERT(rte_thread_create_control(&thread_id, "dpdk-test-thcc", - NULL, thread_main, &thread_main_id) == 0, + thread_main, &thread_main_id) == 0, "Failed to create thread."); while (__atomic_load_n(&thread_id_ready, __ATOMIC_ACQUIRE) == 0) diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst index 333e1d95a2..d3d500f294 100644 --- a/doc/guides/rel_notes/release_23_11.rst +++ b/doc/guides/rel_notes/release_23_11.rst @@ -113,6 +113,9 @@ API Changes Also, make sure to start the actual text at the margin. ======================================================= +* eal: The thread API has changed. + The function ``rte_thread_create_control()`` does not take attributes anymore. + ABI Changes ----------- diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c index 493224542f..4fc2319668 100644 --- a/drivers/dma/skeleton/skeleton_dmadev.c +++ b/drivers/dma/skeleton/skeleton_dmadev.c @@ -128,8 +128,7 @@ skeldma_start(struct rte_dma_dev *dev) rte_mb(); snprintf(name, sizeof(name), "dpdk-dma-skel%d", dev->data->dev_id); - ret = rte_thread_create_control(&hw->thread, name, NULL, - cpucopy_thread, dev); + ret = rte_thread_create_control(&hw->thread, name, cpucopy_thread, dev); if (ret) { SKELDMA_LOG(ERR, "Start cpucopy thread fail!"); return -EINVAL; diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index c31a6d5c98..6baa6d5955 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -136,7 +136,7 @@ iavf_dev_event_handler_init(void) pthread_mutex_init(&handler->lock, NULL); if (rte_thread_create_control(&handler->tid, "dpdk-iavf-event", - NULL, iavf_dev_event_handle, NULL)) { + iavf_dev_event_handle, NULL)) { __atomic_fetch_sub(&handler->ndev, 1, __ATOMIC_RELAXED); return -1; } diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c index ad98a531de..d3bb65874f 100644 --- a/drivers/net/ice/ice_dcf_parent.c +++ b/drivers/net/ice/ice_dcf_parent.c @@ -182,7 +182,7 @@ start_vsi_reset_thread(struct ice_dcf_hw *dcf_hw, bool vfr, uint16_t vf_id) param->vf_id = vf_id; snprintf(name, sizeof(name), "dpdk-ice-rst%u", vf_id); - ret = rte_thread_create_control(&thread, name, NULL, + ret = rte_thread_create_control(&thread, name, ice_dcf_vsi_update_service_handler, param); if (ret != 0) { PMD_DRV_LOG(ERR, "Failed to start the thread for reset handling"); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 7eac05ee60..64e7e5d7d6 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -4330,7 +4330,6 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG; if (rte_thread_create_control(&ad->link_thread_tid, "dpdk-ixgbe-link", - NULL, ixgbe_dev_setup_link_thread_handler, dev) < 0) { PMD_DRV_LOG(ERR, diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index 6f2f5a1841..198fac8318 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -2897,7 +2897,7 @@ txgbe_dev_link_update_share(struct rte_eth_dev *dev, */ intr->flags |= TXGBE_FLAG_NEED_LINK_CONFIG; if (rte_thread_create_control(&ad->link_thread_tid, - "dpdk-txgbe-link", NULL, + "dpdk-txgbe-link", txgbe_dev_setup_link_thread_handler, dev) < 0) { PMD_DRV_LOG(ERR, "Create link thread failed!"); __atomic_clear(&ad->link_thread_running, __ATOMIC_SEQ_CST); diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c index 6605bd017e..07ac721da1 100644 --- a/lib/eal/common/eal_common_thread.c +++ b/lib/eal/common/eal_common_thread.c @@ -349,8 +349,7 @@ rte_ctrl_thread_create(pthread_t *thread, const char *name, int rte_thread_create_control(rte_thread_t *thread, const char *name, - const rte_thread_attr_t *attr, rte_thread_func start_routine, - void *arg) + rte_thread_func start_routine, void *arg) { struct rte_thread_ctrl_params *params; enum __rte_ctrl_thread_status ctrl_thread_status; @@ -365,7 +364,7 @@ rte_thread_create_control(rte_thread_t *thread, const char *name, params->ret = 0; params->ctrl_thread_status = CTRL_THREAD_LAUNCHING; - ret = rte_thread_create(thread, attr, control_thread_start, params); + ret = rte_thread_create(thread, NULL, control_thread_start, params); if (ret != 0) { free(params); return -ret; diff --git a/lib/eal/include/rte_thread.h b/lib/eal/include/rte_thread.h index 6233142322..28cc5220a4 100644 --- a/lib/eal/include/rte_thread.h +++ b/lib/eal/include/rte_thread.h @@ -116,8 +116,6 @@ int rte_thread_create(rte_thread_t *thread_id, * @param name * The name of the control thread * (max RTE_THREAD_NAME_SIZE characters including '\0'). - * @param thread_attr - * Attributes for the new thread. * @param thread_func * Function to be executed by the new thread. * @param arg @@ -129,8 +127,7 @@ int rte_thread_create(rte_thread_t *thread_id, __rte_experimental int rte_thread_create_control(rte_thread_t *thread, const char *name, - const rte_thread_attr_t *thread_attr, rte_thread_func thread_func, - void *arg); + rte_thread_func thread_func, void *arg); /** * @warning diff --git a/lib/eal/windows/eal_interrupts.c b/lib/eal/windows/eal_interrupts.c index b1b1228c2b..66a49c844a 100644 --- a/lib/eal/windows/eal_interrupts.c +++ b/lib/eal/windows/eal_interrupts.c @@ -98,7 +98,7 @@ rte_eal_intr_init(void) return -1; } - ret = rte_thread_create_control(&intr_thread, "dpdk-intr", NULL, + ret = rte_thread_create_control(&intr_thread, "dpdk-intr", eal_intr_thread_main, NULL); if (ret != 0) { rte_errno = -ret; -- 2.42.0