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 9572AA054A; Tue, 6 Dec 2022 18:35:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39E9240395; Tue, 6 Dec 2022 18:35:17 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 8B45140151 for ; Tue, 6 Dec 2022 18:35:15 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id C09BB20B6C40; Tue, 6 Dec 2022 09:35:14 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C09BB20B6C40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1670348114; bh=/gTFYelCyWjRVPZbUkdJamosclGCCtRW/jSem+yfwFg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qJ0MTQ7BZGDiC4Kf5kpd7gdbI8RE2x7fhAmGxyaVvCTMjfaOOEcnP0vVJ8AMfs+zi 8pbjork3qaOn+JOm64ldV41vTmA8q4a25SDzOOEYYkL6kfMxu5H1HoF25eLuI2oWAt vKg3b+lzyO4NOZmyEh5zH8drwaHN2AOTzgjdKQqc= Date: Tue, 6 Dec 2022 09:35:14 -0800 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com, olivier.matz@6wind.com Subject: Re: [PATCH 1/3] eal: add rte control thread create API Message-ID: <20221206173514.GB6888@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1670271868-11364-1-git-send-email-roretzla@linux.microsoft.com> <1670271868-11364-2-git-send-email-roretzla@linux.microsoft.com> <20221205131116.3c75a337@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221205131116.3c75a337@hermes.local> User-Agent: Mutt/1.5.21 (2010-09-15) 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 On Mon, Dec 05, 2022 at 01:11:16PM -0800, Stephen Hemminger wrote: > On Mon, 5 Dec 2022 12:24:26 -0800 > Tyler Retzlaff wrote: > > > Signed-off-by: Tyler Retzlaff > > --- > > lib/eal/common/eal_common_thread.c | 93 ++++++++++++++++++++++++++++++++++---- > > lib/eal/include/rte_thread.h | 29 ++++++++++++ > > lib/eal/version.map | 3 ++ > > 3 files changed, 117 insertions(+), 8 deletions(-) > > > > diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c > > index c5d8b43..ca85c51 100644 > > --- a/lib/eal/common/eal_common_thread.c > > +++ b/lib/eal/common/eal_common_thread.c > > @@ -234,7 +234,10 @@ enum __rte_ctrl_thread_status { > > }; > > > > struct rte_thread_ctrl_params { > > - void *(*start_routine)(void *); > > + union { > > + void * (*start_routine)(void *); > > + rte_thread_func thread_func; > > + } u; > > Why not just use rte_thread_func, this in internal. I'm not sure i completely understand your comment here. The main reason for using a union is to avoid dealing with casting. Later when the rte_ctrl_thread_create is deprecated the union will be discarded. No change was made in v2 but if you still think this should be addressed let me know.