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 53EBFA0545; Tue, 21 Jun 2022 18:24:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EFD3C4069C; Tue, 21 Jun 2022 18:24:36 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 61A2B40151 for ; Tue, 21 Jun 2022 18:24:35 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 808F120BE6BA; Tue, 21 Jun 2022 09:24:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 808F120BE6BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1655828674; bh=NngcWNLeE8ZnWNsTODnWmFQiO3BwVIief9HS5pmsaaY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mHCt6/Xs2MSU1TI3xiA2piJIKzI7iQgsapCtMMobVCkzaZ0k9qbPYbGKg8tXvNQ+h 4e9cIDRA/vhrF/s1o26LmWVRgswXDrJEaSqFIv055rT81O90OBvnRhpgHfg2WDeklv NGIdTBVmrX/97bVZB3UDVuDaetuRDb4jETLyFQrM= Date: Tue, 21 Jun 2022 09:24:34 -0700 From: Tyler Retzlaff To: Dmitry Kozlyuk Cc: dev@dpdk.org, thomas@monjalon.net, anatoly.burakov@intel.com, Narcisa Vasile Subject: Re: [PATCH v2 2/6] eal: add thread lifetime management Message-ID: <20220621162434.GB18214@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1654783134-13303-1-git-send-email-roretzla@linux.microsoft.com> <1655250438-18044-1-git-send-email-roretzla@linux.microsoft.com> <1655250438-18044-3-git-send-email-roretzla@linux.microsoft.com> <20220618155908.70e822af@sovereign> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220618155908.70e822af@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 Sat, Jun 18, 2022 at 03:59:08PM +0300, Dmitry Kozlyuk wrote: > 2022-06-14 16:47 (UTC-0700), Tyler Retzlaff: > > > +int > > +rte_thread_create(rte_thread_t *thread_id, > > + const rte_thread_attr_t *thread_attr, > > + rte_thread_func thread_func, void *args) > > +{ > > [...] > > + if (thread_attr->priority == > > + RTE_THREAD_PRIORITY_REALTIME_CRITICAL) { > > + ret = ENOTSUP; > > + goto cleanup; > > + } > > + ret = thread_map_priority_to_os_value(thread_attr->priority, > > + ¶m.sched_priority, &policy); > > + if (ret != 0) > > + goto cleanup; > > thread_map_priority_to_os_value() already checks for unsupported values, > why not let it do this particular check? okay, so i looked at this more closely. * thread_map_priority_to_os_value() just does mapping and RTE_THREAD_PRIORITY_REALTIME_CRITICAL is a valid mapping so it does not fail. by design it does one thing and one thing only perform the value mapping. admittedly it does not map every valid value right now, maybe it should? for consistency in the behavior of the function i'd suggest we don't make it have special cases in case we later decide to expand for additional valid mappings. * rte_thread_set_priority() does fail with ENOTSUP on non-windows if provided RTE_THREAD_PRIORITY_REALTIME_CRITICAL however it cannot be used at this point since the thread has not been created. if no further follow up on this i'm going to leave it as is. thanks