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 C390442529; Wed, 6 Sep 2023 18:24:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B0318402F1; Wed, 6 Sep 2023 18:23:58 +0200 (CEST) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id A5246402E3 for ; Wed, 6 Sep 2023 18:23:56 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 54A8832004AE; Wed, 6 Sep 2023 12:23:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 06 Sep 2023 12:23:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding: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=fm1; t=1694017434; x= 1694103834; bh=1ju67lAKKDS00A0PCUGCUdDu8iEiMW6LIw6MSEQb598=; b=W tQzKuewq5eylAGeWVB8NmS831BAn8QC+Nj6AVEPxVzeosI8ztkPPAsh+X/uBP8qf cIyZ3cvY3hJpVMsPs5uG3C5crWlO8pGS8zHAslOzSqXDaDc0RdwnhsWAfhbx2trL Q23IyvdB1f+kPG/7djg7wxdfDhuaWJLFXEeajK5eQCDD+gLSIrCiNnhUYNyG7ZlH Gzsey/T6tEW6p8GUME66V8mZYBl6jjtzLziB1IsumQuoopOXwtQS5guCRiIsbz+x hchHiGMU3u6cZxOgc9/X1ekWlBUxny4oMAwHzyfLYDtVoSeJ0yb5vVUaQGONoNWJ Wj04uI3eEJDUPIJJt9kYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=fm1; t=1694017434; x= 1694103834; bh=1ju67lAKKDS00A0PCUGCUdDu8iEiMW6LIw6MSEQb598=; b=L GrkQY8LSH3LmHzY5gXP19Uwt1guU3NWxrNFW3PcKYhWTRQA6Ii5EB+br+T6ghy+e m8ynhhR/7hKC8SJFK/rYD0+s797LQpIlo1jUjVwlhbHdcPulzgvKBWae2yz8Krcc haAiuac8eqK/2yMEr/Dchld8A3ivQXexiOnbv2/7bkXKx8KKsSJmeJT7KncgHWjx 4p5sJ6OqU0Ab7OdDup8ZmpZ2guH6dpc1u2a5gb6AU0LsSiftFhcaA5lqKPkbRvDo FiDUrSOUJ9Jj/bKa56SbNqO8JPw+xQ2fH9AtVY0mh4PzBnbW82YiFwuJQBJPf8g6 UB0u98GxkHl1g3nYq2/Jg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehfedguddttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhho mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne cuggftrfgrthhtvghrnhepvdejhfdugeehvddtieejieegteeuudfgjeeukeeiledthfet veekhefhieelhfdtnecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Sep 2023 12:23:53 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Tyler Retzlaff , David Marchand , Ferruh Yigit , Reshma Pattan , Stephen Hemminger Subject: [PATCH 09/11] test: convert threads creation Date: Wed, 6 Sep 2023 18:12:26 +0200 Message-ID: <20230906162226.1618088-10-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 Content-Transfer-Encoding: 8bit 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 Calls to pthread for thread creation are replaced with the rte_thread API. Signed-off-by: Thomas Monjalon --- app/test/process.h | 10 +++++----- app/test/test_lcores.c | 9 ++++----- app/test/test_pdump.c | 6 +++--- app/test/test_pdump.h | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/app/test/process.h b/app/test/process.h index 1f073b9c5c..af7bc3e0de 100644 --- a/app/test/process.h +++ b/app/test/process.h @@ -28,8 +28,8 @@ #ifdef RTE_LIB_PDUMP #ifdef RTE_NET_RING -#include -extern void *send_pkts(void *empty); +#include +extern uint32_t send_pkts(void *empty); extern uint16_t flag_for_send_pkts; #endif #endif @@ -49,7 +49,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value) char path[32]; #ifdef RTE_LIB_PDUMP #ifdef RTE_NET_RING - pthread_t thread; + rte_thread_t thread; int rc; #endif #endif @@ -136,7 +136,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value) #ifdef RTE_LIB_PDUMP #ifdef RTE_NET_RING if ((strcmp(env_value, "run_pdump_server_tests") == 0)) { - rc = pthread_create(&thread, NULL, &send_pkts, NULL); + rc = rte_thread_create(&thread, NULL, send_pkts, NULL); if (rc != 0) { rte_panic("Cannot start send pkts thread: %s\n", strerror(rc)); @@ -151,7 +151,7 @@ process_dup(const char *const argv[], int numargs, const char *env_value) #ifdef RTE_NET_RING if ((strcmp(env_value, "run_pdump_server_tests") == 0)) { flag_for_send_pkts = 0; - pthread_join(thread, NULL); + rte_thread_join(thread, NULL); } #endif #endif diff --git a/app/test/test_lcores.c b/app/test/test_lcores.c index 0c96faa4cb..22225a9fd3 100644 --- a/app/test/test_lcores.c +++ b/app/test/test_lcores.c @@ -2,7 +2,6 @@ * Copyright (c) 2020 Red Hat, Inc. */ -#include #include #include @@ -341,7 +340,7 @@ test_non_eal_lcores_callback(unsigned int eal_threads_count) return -1; } -static void *ctrl_thread_loop(void *arg) +static uint32_t ctrl_thread_loop(void *arg) { struct thread_context *t = arg; @@ -350,7 +349,7 @@ static void *ctrl_thread_loop(void *arg) /* Set the thread state to DONE */ t->state = Thread_DONE; - return NULL; + return 0; } static int @@ -362,8 +361,8 @@ test_ctrl_thread(void) /* Create one control thread */ t = &ctrl_thread_context; t->state = Thread_INIT; - if (rte_ctrl_thread_create((pthread_t *)&t->id, "dpdk-test-ctrlt", - NULL, ctrl_thread_loop, t) != 0) + if (rte_thread_create_control(&t->id, "dpdk-test-ctrlt", + ctrl_thread_loop, t) != 0) return -1; /* Wait till the control thread exits. diff --git a/app/test/test_pdump.c b/app/test/test_pdump.c index ea03056b47..adf49f0b54 100644 --- a/app/test/test_pdump.c +++ b/app/test/test_pdump.c @@ -136,8 +136,8 @@ test_pdump_uninit(void) return ret; } -void * -send_pkts(void *empty) +uint32_t +send_pkts(void *empty __rte_unused) { int ret = 0; struct rte_mbuf *pbuf[NUM_PACKETS] = { }; @@ -161,7 +161,7 @@ send_pkts(void *empty) rte_eth_dev_stop(portid); test_put_mbuf_to_pool(mp, pbuf); - return empty; + return 0; } /* diff --git a/app/test/test_pdump.h b/app/test/test_pdump.h index abef9a85ec..8746d61269 100644 --- a/app/test/test_pdump.h +++ b/app/test/test_pdump.h @@ -9,7 +9,7 @@ #define NUM_ITR 3 /* sample test to send packets to the pdump client recursively */ -void *send_pkts(void *port); +uint32_t send_pkts(void *empty); /* Sample test to create setup for the pdump server tests */ int test_pdump_init(void); -- 2.42.0