From patchwork Wed Sep 13 10:34:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 132 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 9051042588; Wed, 13 Sep 2023 12:36:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19868402E2; Wed, 13 Sep 2023 12:36:13 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 6E15A402CF for ; Wed, 13 Sep 2023 12:36:11 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id DDE323200914; Wed, 13 Sep 2023 06:36:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 13 Sep 2023 06:36:09 -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= 1694601368; x=1694687768; bh=XQH+jVaYqMpAn+Yg/sD7DR2OuZLfz7NT62t aVck7y+I=; b=FlV8jBLjUwUNHzyEKIeUh7iIrgYTToV2oGtgXItzJ+DFJHet8BI JJ0/QxCmukFl68WLfcNmCXiCFrd6uJeTCu8GSO13lmJ8RzoPXp6pjyvapM6iUTHe eEg7fDCCqL6w8MpmYL9X4HKmVQdqRhlFWyee7lTjv3djr4wEfO02uEdyFoaqPQ1Y nKsAeRO++KS0BRpNFzVm1C3/wPTjb2SV318jxTkPoohfhSKk3/iik/qjRMFeVeU+ 489Jl/1/W1th12rgz4vEWYnpjwV6K3zL3P7xxL6QhM6NNOkRqTFMOwE21HaeM7l+ 2cNdeJTD8+jMx7yMAWVs69vUT6cJMCSJYmA== 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= 1694601368; x=1694687768; bh=XQH+jVaYqMpAn+Yg/sD7DR2OuZLfz7NT62t aVck7y+I=; b=RvQpwWL9LXO4XLI0WtOGfaeA+wwFSzTD6T6mDa4G/wY0A/hFF76 NbfvgvEsR9Ddlfw7+ZJFa4ptlDc+7lLo95Mu9dLkqFIiywHH02TuiVG7Rqw0Nx9m /IB/WAzA4p044VU9o+ysuVJh6OaEUNXyElECBgfkgoc+aLlHO7+mnylo6YsGDTxD uc0kyIindCDw3pPkEDj9EoGjIhnOaA2cOKZ463tNxh9GhLhscXOHrL32iGnb8nGz dJkhqqLkbpv64nYtt0G/8a2W8/jSWaww/ga2jtTvW3RTQfaFicL/XTQGboS+Sr/D JZHxEYRoP9qz018X2vA25jDhTx6tJslnR4g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeikedgvdelucetufdoteggodetrfdotf 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:06 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Tyler Retzlaff , David Marchand , Ferruh Yigit Subject: [PATCH v2 00/11] rework thread management Date: Wed, 13 Sep 2023 12:34:19 +0200 Message-ID: <20230913103600.1935292-1-thomas@monjalon.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230906162226.1618088-1-thomas@monjalon.net> References: <20230906162226.1618088-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 main effect of this patch series is to remove calls to pthread functions except for pthread_cancel and locks. The function rte_thread_create_control() does not take thread attributes settings anymore as it looks a useless complication of the API. Then the rte_thread API is made stable, so we can remove the old deprecated functions rte_thread_setname() and rte_ctrl_thread_create(). Some new internal functions are added in rte_thread to make sure all internal thread names are prefixed with "dpdk-". Few other cleanups are done. Future work about pthread portability are about: - cancel - mutex --- v2 changes: - replace (|_) with _? in checkpatch - simplify thread name size doc - build time check of internal thread name size - clean control thread params struct Thomas Monjalon (11): devtools: warn when adding some pthread calls eal: rename thread name length definition eal: remove attributes from control thread creation eal: promote thread API as stable eal: force prefix for internal threads lib: convert to internal control threads drivers: convert to internal control threads examples: convert to normal control threads test: convert threads creation eal: remove deprecated thread functions lib: remove pthread.h from includes app/test/process.h | 10 +- app/test/test_lcores.c | 9 +- app/test/test_link_bonding.c | 2 + app/test/test_pdump.c | 6 +- app/test/test_pdump.h | 2 +- app/test/test_threads.c | 2 +- devtools/checkpatches.sh | 16 +++ .../prog_guide/env_abstraction_layer.rst | 2 +- doc/guides/rel_notes/deprecation.rst | 5 - doc/guides/rel_notes/release_23_11.rst | 6 + drivers/common/cnxk/roc_dev.c | 16 +-- drivers/common/cnxk/roc_dev_priv.h | 2 +- drivers/common/cnxk/roc_nix_inl_dev.c | 9 +- drivers/common/cnxk/roc_nix_inl_priv.h | 2 +- drivers/common/cnxk/roc_platform.h | 3 +- drivers/common/mlx5/mlx5_common.c | 1 + drivers/common/mlx5/windows/mlx5_win_ext.h | 2 + drivers/dma/skeleton/skeleton_dmadev.c | 8 +- drivers/event/dlb2/pf/base/dlb2_osdep.h | 14 +- drivers/event/dlb2/pf/base/dlb2_resource.c | 39 ++--- drivers/event/dlb2/pf/dlb2_main.h | 1 - drivers/net/ark/ark_ethdev.c | 11 +- drivers/net/ark/ark_pktgen.c | 8 +- drivers/net/ark/ark_pktgen.h | 2 +- drivers/net/bnxt/bnxt.h | 1 + drivers/net/iavf/iavf_vchnl.c | 4 +- drivers/net/ice/ice_dcf_parent.c | 7 +- drivers/net/ipn3ke/ipn3ke_representor.c | 17 ++- drivers/net/ixgbe/ixgbe_ethdev.c | 8 +- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_hws_cnt.c | 42 +++--- drivers/net/qede/base/bcm_osal.h | 1 + drivers/net/sfc/sfc_mae.h | 2 +- drivers/net/sfc/sfc_mae_counter.c | 11 +- drivers/net/txgbe/txgbe_ethdev.c | 6 +- drivers/raw/ifpga/base/opae_osdep.h | 1 + drivers/raw/ifpga/ifpga_rawdev.c | 19 ++- drivers/vdpa/ifc/ifcvf_vdpa.c | 86 ++++++----- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa.h | 10 +- drivers/vdpa/mlx5/mlx5_vdpa_cthread.c | 70 +++------ drivers/vdpa/mlx5/mlx5_vdpa_event.c | 64 +++------ drivers/vdpa/sfc/sfc_vdpa.c | 1 + drivers/vdpa/sfc/sfc_vdpa_ops.c | 15 +- drivers/vdpa/sfc/sfc_vdpa_ops.h | 3 +- examples/vhost/main.c | 9 +- examples/vhost_blk/vhost_blk.c | 21 +-- lib/eal/common/eal_common_options.c | 1 + lib/eal/common/eal_common_proc.c | 15 +- lib/eal/common/eal_common_thread.c | 127 ++++++----------- lib/eal/common/eal_common_trace.c | 1 + lib/eal/common/malloc_mp.c | 1 + lib/eal/freebsd/eal.c | 2 +- lib/eal/freebsd/eal_alarm.c | 1 + lib/eal/freebsd/eal_interrupts.c | 10 +- lib/eal/freebsd/eal_thread.c | 9 +- lib/eal/include/rte_eal.h | 3 - lib/eal/include/rte_lcore.h | 42 ------ lib/eal/include/rte_per_lcore.h | 2 - lib/eal/include/rte_thread.h | 133 +++++++++--------- lib/eal/linux/eal.c | 2 +- lib/eal/linux/eal_alarm.c | 1 + lib/eal/linux/eal_interrupts.c | 10 +- lib/eal/linux/eal_thread.c | 18 +-- lib/eal/linux/eal_timer.c | 11 +- lib/eal/unix/rte_thread.c | 2 +- lib/eal/version.map | 44 +++--- lib/eal/windows/eal.c | 2 +- lib/eal/windows/eal_interrupts.c | 2 +- lib/eal/windows/eal_thread.c | 8 -- lib/eal/windows/rte_thread.c | 2 +- lib/ethdev/ethdev_driver.c | 1 + lib/ethdev/ethdev_driver.h | 2 + lib/ethdev/rte_ethdev_core.h | 2 - lib/ethdev/rte_flow.c | 1 + lib/eventdev/rte_event_eth_rx_adapter.c | 24 ++-- lib/vhost/fd_man.c | 6 +- lib/vhost/fd_man.h | 2 +- lib/vhost/socket.c | 23 ++- lib/vhost/vduse.c | 5 +- lib/vhost/vhost.c | 1 + 81 files changed, 464 insertions(+), 632 deletions(-)