DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: [PATCH 2/6] net/ixgbe: use rte thread API
Date: Fri, 17 Mar 2023 15:34:16 -0700	[thread overview]
Message-ID: <1679092460-9930-3-git-send-email-roretzla@linux.microsoft.com> (raw)
In-Reply-To: <1679092460-9930-1-git-send-email-roretzla@linux.microsoft.com>

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 <roretzla@linux.microsoft.com>
---
 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


  parent reply	other threads:[~2023-03-17 22:34 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-17 22:34 [PATCH 0/6] windows: remove most pthread lifetime shim functions Tyler Retzlaff
2023-03-17 22:34 ` [PATCH 1/6] dma/skeleton: use rte thread API Tyler Retzlaff
2023-04-18  9:19   ` Bruce Richardson
2023-04-18 15:04     ` Tyler Retzlaff
2023-03-17 22:34 ` Tyler Retzlaff [this message]
2023-03-17 22:34 ` [PATCH 3/6] net/ice: " Tyler Retzlaff
2023-03-17 22:34 ` [PATCH 4/6] net/iavf: " Tyler Retzlaff
2023-03-17 22:34 ` [PATCH 5/6] eal: " Tyler Retzlaff
2023-03-17 22:34 ` [PATCH 6/6] windows: remove most pthread lifetime shim functions Tyler Retzlaff
2023-04-03  5:34 ` [PATCH 0/6] " Tyler Retzlaff
2023-04-18  9:21   ` Bruce Richardson
2023-06-01  8:49     ` David Marchand
2023-06-01 12:23       ` Zhang, Qi Z
2023-06-02 16:22         ` Tyler Retzlaff
2023-06-09 12:38           ` David Marchand
2023-04-17 16:46 ` Tyler Retzlaff
2023-06-09 12:39 ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1679092460-9930-3-git-send-email-roretzla@linux.microsoft.com \
    --to=roretzla@linux.microsoft.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).