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 57E8AA00C3; Wed, 7 Dec 2022 01:49:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC1CC410D7; Wed, 7 Dec 2022 01:49:10 +0100 (CET) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id CD39440C35 for ; Wed, 7 Dec 2022 01:49:09 +0100 (CET) Received: by mail-pj1-f51.google.com with SMTP id hd14-20020a17090b458e00b0021909875bccso2407812pjb.1 for ; Tue, 06 Dec 2022 16:49:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=TVGLmJFBkOzSyV6q3AeUfDOmT6glxU1APebLjLAZ8Ow=; b=khaR002DmnErIxn9ATaXCIr/bJSjvEgBloS7xFsawn4/nGSMqpFDQ48pPbTFY7B8xe Goi1DgGKxVPuyYirppUc9j2eAyEA8+XQDSzVCUMwNapJDPNzaFkVzRLqu0OKDW3Hroch qTlKRbtwEqoQEJALUNi5WcKPLN5Nvfgk3TuDKFuFwPjV4aTgBD85hVPZXpKbJj6EE98e l9cUvFGCqOyp9YV7W8035JRW7AYxKLJ/q6pyYj+f2UKRlFuQVZO2oVo15MVBL7lwz8+u ivftj+TB9KuCqRX5t7EAj/BKxs0J+rDQA5mm3iUxZ6Ls3l/gNv1QTY+lZu2QP8eHqE8G Cq5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TVGLmJFBkOzSyV6q3AeUfDOmT6glxU1APebLjLAZ8Ow=; b=5pDJBjWas+gRj4R12GpYHm9nha54NWlJC3Y946uqXSjEmsLAM6kBzvh/E91u5N2o/D yfUm/31EKfejdbwJhwROEROttOifZVr4uk+lBm/02uxjJGNNzug0PJcPio+fyVBIOJ1U /pmO4AAa8uTt4e/QU8l7htTZ9C4l5B8CdU6UQTKajGTyrBVh3CEajVsfo6B0ehumHcaz 9y+I3Y5HbS9pm8gV6UIpKKd6pztFvWCO9f4jVB6zHkZ3tE0lb2hF9oz4RRQivS0y5OkL sCH0CvT/9uah5pt+PQhAF/nrkyo8C3rNxWCrIB2Pkosi/N2nxmBmY+O93wtHGYRqrNvI isPQ== X-Gm-Message-State: ANoB5pni8euctNi2zOILkG7FvsLSg+EEdRkO94goUkcJMCs8rckmPw4u AJj0nLaav6ph8UJr0c28bFwKOQ== X-Google-Smtp-Source: AA0mqf710pxOF7YMXl8n+4Gu5H9RiBdvfH06XRytZ0UGTdOHDkM2cuKjtT0WJCk80og53xllgnVF0A== X-Received: by 2002:a17:902:dc83:b0:189:b4ed:5699 with SMTP id n3-20020a170902dc8300b00189b4ed5699mr26222793pld.56.1670374148778; Tue, 06 Dec 2022 16:49:08 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id r16-20020a63fc50000000b00477bdc1d5d5sm10435722pgk.6.2022.12.06.16.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 16:49:08 -0800 (PST) Date: Tue, 6 Dec 2022 16:49:06 -0800 From: Stephen Hemminger To: Tyler Retzlaff 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: <20221206164906.08e35133@hermes.local> In-Reply-To: <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> <20221206173514.GB6888@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Tue, 6 Dec 2022 09:35:14 -0800 Tyler Retzlaff wrote: > 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. Is it possible to do it without union or casting. Aliasing function pointers is something that leads to long term issues. The Linux kernel developers are actively fixing up all the casting there; would like DPDK to adopt the same hygiene.