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 AB201A034C; Sat, 9 Apr 2022 10:56:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4E07E4067E; Sat, 9 Apr 2022 10:56:34 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 84FAD4067C for ; Sat, 9 Apr 2022 10:56:32 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id B0FF420444AF; Sat, 9 Apr 2022 01:56:31 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B0FF420444AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1649494591; bh=0Loqm+J2lyc6TWHLZ3mJ5DnMjLtarZF5tgTHGP9IHrQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HNEORIiLk1aQasAH8Sq0u7Zx46qpLe+0LgPVcnbyuzGsk6jF6Kbl0b5WvfVgeVo8Q B23mHtacv9AifDFK3jlr3c9CdLeA9S7Vi2IHgcP16UHMyCYEyfuXxi+PYuXmHRcm+A WGxgRTLBIcLsxIiQq3KV/L9T/+ASL0tm8bNOCRjU= Date: Sat, 9 Apr 2022 01:56:31 -0700 From: Tyler Retzlaff To: Dmitry Kozlyuk Cc: dev@dpdk.org, thomas@monjalon.net, anatoly.burakov@intel.com, Narcisa Vasile Subject: Re: [PATCH 3/3] test/threads: add unit test for thread API Message-ID: <20220409085631.GB4153@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1648819793-18948-1-git-send-email-roretzla@linux.microsoft.com> <1648819793-18948-4-git-send-email-roretzla@linux.microsoft.com> <20220408170145.3b1c1025@sovereign> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220408170145.3b1c1025@sovereign> 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 Fri, Apr 08, 2022 at 05:01:45PM +0300, Dmitry Kozlyuk wrote: > 2022-04-01 06:29 (UTC-0700), Tyler Retzlaff: > [...] > > +static int > > +test_thread_affinity(void) > > +{ > > + pthread_t id; > > + rte_thread_t thread_id; > > + > > + RTE_TEST_ASSERT(pthread_create(&id, NULL, thread_main, NULL) == 0, > > + "Failed to create thread"); > > + thread_id.opaque_id = id; > > The need for this hack means that the new API is unusable in practice. > I think functions to get the current thread ID and to compare IDs > must be the part of this series to accept this unit test patch. are you proposing adding rte_thread_self and rte_thread_equals to this series? i'm not sure i understand how that helps? while maybe the unit test could be re-written in some fashion to use rte_thread_self it still wouldn't do much for practically using the api outside of the test. keep in mind i have no intention of combining api introduction and integration into the same series so the hack is limited to the unit test for now. it is my expectation that as subsequent series are merged the hacks will be replaced with new api additions. i'm also not entertaining the idea of growing this series further as we will just end up back where we started with a series that is too large and nobody will properly review or be bold enough to ack. the quickest path to eliminate the hack is to improve the velocity of getting the smaller series reviewed and merged. this is where i would prefer to focus our effort. if there is an absolute need to start using the api introduced in this series outside of the unit test we could as a part of the __experimental apis offer a function that formalizes the conversion to rte_thread_t from pthread_t. the function would only be kept as long as needed and removed when no longer necessary. thanks