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 C8E8141EC5; Fri, 17 Mar 2023 23:35:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 04BA34300E; Fri, 17 Mar 2023 23:34:53 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 6534742FF8 for ; Fri, 17 Mar 2023 23:34:49 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id BD1912057BEB; Fri, 17 Mar 2023 15:34:48 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BD1912057BEB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1679092488; bh=QQRnSbMdBGFVSbuZNticjgUYqzzR39/jjHlWnkC8eYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dvyrxataFm8scP0xVeouuCPD++eFjEiuNHtOdFzzxvPLCEpkkK05zqVPwwRC0lzHq Y2PYq/WLWX4LE7I1kBgnW86WgwJHQQAFPq6DqoinviprrwHuILffCPmhf09TAOvbNa wWqE9xQ0/UGps5pRMYbPfMosmdeRxLs1UWlquOs8= From: Tyler Retzlaff To: dev@dpdk.org Cc: thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH 3/6] net/ice: use rte thread API Date: Fri, 17 Mar 2023 15:34:17 -0700 Message-Id: <1679092460-9930-4-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/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 #include #include -#include #include #include @@ -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