From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: [PATCH 3/6] net/ice: use rte thread API
Date: Fri, 17 Mar 2023 15:34:17 -0700 [thread overview]
Message-ID: <1679092460-9930-4-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/ice/ice_dcf_parent.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index 01e390d..3175d18 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -4,7 +4,6 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <pthread.h>
#include <unistd.h>
#include <rte_spinlock.h>
@@ -115,7 +114,7 @@ struct ice_dcf_reset_event_param {
pf_vsi_idx, vsi_ctx->vsi_num);
}
-static void*
+static uint32_t
ice_dcf_vsi_update_service_handler(void *param)
{
struct ice_dcf_reset_event_param *reset_param = param;
@@ -124,7 +123,7 @@ struct ice_dcf_reset_event_param {
container_of(hw, struct ice_dcf_adapter, real_hw);
struct ice_adapter *parent_adapter = &adapter->parent;
- pthread_detach(pthread_self());
+ rte_thread_detach(rte_thread_self());
rte_delay_us(ICE_DCF_VSI_UPDATE_SERVICE_INTERVAL);
@@ -154,7 +153,7 @@ struct ice_dcf_reset_event_param {
free(param);
- return NULL;
+ return 0;
}
static void
@@ -163,7 +162,7 @@ struct ice_dcf_reset_event_param {
#define THREAD_NAME_LEN 16
struct ice_dcf_reset_event_param *param;
char name[THREAD_NAME_LEN];
- pthread_t thread;
+ rte_thread_t thread;
int ret;
param = malloc(sizeof(*param));
@@ -177,7 +176,7 @@ struct ice_dcf_reset_event_param {
param->vf_id = vf_id;
snprintf(name, sizeof(name), "ice-reset-%u", vf_id);
- ret = rte_ctrl_thread_create(&thread, name, NULL,
+ ret = rte_thread_create_control(&thread, name, NULL,
ice_dcf_vsi_update_service_handler, param);
if (ret != 0) {
PMD_DRV_LOG(ERR, "Failed to start the thread for reset handling");
--
1.8.3.1
next prev parent reply other threads:[~2023-03-17 22:35 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 ` [PATCH 2/6] net/ixgbe: " Tyler Retzlaff
2023-03-17 22:34 ` Tyler Retzlaff [this message]
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-4-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).