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 48FD241EC5; Fri, 17 Mar 2023 23:34:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D6AC242FE8; Fri, 17 Mar 2023 23:34:50 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 5F20C40DF6 for ; Fri, 17 Mar 2023 23:34:49 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id B10E02057BEA; Fri, 17 Mar 2023 15:34:48 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B10E02057BEA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1679092488; bh=bLhM8wHBeWKdRYbKi4pkuzhf4ZsxGYPZRqfwluMKfLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qpgvXZ6uoWb16yPv2LMmK+Xp1J8NwmEi9D1RdXQ1CbdZS3pUbU5eTwP7YoAHYa2en GHjygGyEL5wj1zoKWR7PCLfGxJSYDrGYMRMzIIc2xKtTDk0o/z+2yLkBczAE6OXJOj MtvlycoodkVZJnjCTDlvB3FMAIvpEK2LoMvB5E/4= From: Tyler Retzlaff To: dev@dpdk.org Cc: thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH 2/6] net/ixgbe: use rte thread API Date: Fri, 17 Mar 2023 15:34:16 -0700 Message-Id: <1679092460-9930-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1679092460-9930-1-git-send-email-roretzla@linux.microsoft.com> References: <1679092460-9930-1-git-send-email-roretzla@linux.microsoft.com> 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 Update driver to use rte thread API where available instead of pthread as a prerequisite to removing pthread stubs on Windows. Signed-off-by: Tyler Retzlaff --- drivers/net/ixgbe/ixgbe_ethdev.c | 10 +++++----- drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 88118bc..3abe96e 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -236,7 +236,7 @@ static int ixgbe_dev_rss_reta_query(struct rte_eth_dev *dev, static int ixgbe_dev_interrupt_action(struct rte_eth_dev *dev); static void ixgbe_dev_interrupt_handler(void *param); static void ixgbe_dev_interrupt_delayed_handler(void *param); -static void *ixgbe_dev_setup_link_thread_handler(void *param); +static uint32_t ixgbe_dev_setup_link_thread_handler(void *param); static int ixgbe_dev_wait_setup_link_complete(struct rte_eth_dev *dev, uint32_t timeout_ms); @@ -4203,7 +4203,7 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, return 1; } -static void * +static uint32_t ixgbe_dev_setup_link_thread_handler(void *param) { struct rte_eth_dev *dev = (struct rte_eth_dev *)param; @@ -4214,7 +4214,7 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, u32 speed; bool autoneg = false; - pthread_detach(pthread_self()); + rte_thread_detach(rte_thread_self()); speed = hw->phy.autoneg_advertised; if (!speed) ixgbe_get_link_capabilities(hw, &speed, &autoneg); @@ -4223,7 +4223,7 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, intr->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG; rte_atomic32_clear(&ad->link_thread_running); - return NULL; + return 0; } /* @@ -4323,7 +4323,7 @@ static int ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev *dev, * when there is no link thread running. */ intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG; - if (rte_ctrl_thread_create(&ad->link_thread_tid, + if (rte_thread_create_control(&ad->link_thread_tid, "ixgbe-link-handler", NULL, ixgbe_dev_setup_link_thread_handler, diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h index 48290af..4332b2c 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.h +++ b/drivers/net/ixgbe/ixgbe_ethdev.h @@ -511,7 +511,7 @@ struct ixgbe_adapter { uint8_t pflink_fullchk; uint8_t mac_ctrl_frame_fwd; rte_atomic32_t link_thread_running; - pthread_t link_thread_tid; + rte_thread_t link_thread_tid; }; struct ixgbe_vf_representor { -- 1.8.3.1