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 A0CE2A04FF; Tue, 24 May 2022 16:51:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1665A40140; Tue, 24 May 2022 16:51:12 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id F21A1400D6 for ; Tue, 24 May 2022 16:51:09 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id w3so9430908plp.13 for ; Tue, 24 May 2022 07:51:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ELzJIvl067P27NViHjMDLYEXCfyttJsDr3NBN/0hajA=; b=W+5jnmehnRF+R7DQ34gpORartm/vPnjo0B2meWZ3//W3esRmUpkgNz9uy9tkWRfeq1 PrhS/CTXIVv7Z2cV5vWFSzWMhytUAPrhNAmutDU6SKojbvtyl4TjqG5s8qTC/2F3jNFb HYVbsGVVTefZN4U46isTJ/02mm1re8elItpFhSdFDIgQv+xbSzHD7GAD4Cs0eDJI/i4d dNacKtV2yt08cg/lvwLt5XZzJav7CKxEyQl58O4c9o6KvQQ0VS9VMlFnDoq3agx4jT9L VTJd0myufweEBU8AA7cwhtOoDZhby9S1g35O5qROyobyVEvzBof8ZR+OzMegG8AciJbu mAHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ELzJIvl067P27NViHjMDLYEXCfyttJsDr3NBN/0hajA=; b=2bdV0FXbSiiL64Nzc36XkbeVASwIZCOnGS+1Bo8KYbKrAzynR1xpxxp1uTb7itkHO/ X9KriDrGfqjyuUWv564mDPopg3CfK/h92SKTyYuh8rq4lvWOMRfE5e/V21GNs5jthEr7 V8fmLWMzuyTqbxy/iMznwci7ojcEsJcWLUGrUQQVjvoPvelGQ3JdjhLrr9Vfq9NbV6KQ BBMK4GUF8yTs4C33RwNQCZMvNpXVTW0Pw/cDqUV4TQXqjqelWGHW4q1ocItbvV84uDIb mxnoUH+EIc6FR1h4r9Asu+DNztuaPd64+rjDo7irLxlWIpoPJL/mxoxCGJhFOQ9Nsb1i IL6g== X-Gm-Message-State: AOAM532DHVZl7eE6joOMmtrqYknMFZ7o8WqW2yjRTaAJH1/HtKubwO6/ iZvauJee4/eSgGGyq98uff0Y2Q== X-Google-Smtp-Source: ABdhPJzW2OkEKYnhTzW6wlXm15wc66/Vn/pl74MhlTngucH1+YyBW5c2z1bkz29aym/uR4PfQK8FpQ== X-Received: by 2002:a17:90b:4c84:b0:1e0:663b:f6c with SMTP id my4-20020a17090b4c8400b001e0663b0f6cmr4937681pjb.231.1653403869155; Tue, 24 May 2022 07:51:09 -0700 (PDT) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id k9-20020a17090a910900b001dd01a5be02sm1813714pjo.41.2022.05.24.07.51.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 07:51:08 -0700 (PDT) Date: Tue, 24 May 2022 07:51:05 -0700 From: Stephen Hemminger To: Tyler Retzlaff Cc: dev@dpdk.org, thomas@monjalon.net, dmitry.kozliuk@gmail.com, anatoly.burakov@intel.com, Narcisa Vasile Subject: Re: [PATCH v3 1/2] eal: get/set thread priority per thread identifier Message-ID: <20220524075105.01713e7d@hermes.local> In-Reply-To: <1653390517-4033-2-git-send-email-roretzla@linux.microsoft.com> References: <1653302773-11043-1-git-send-email-roretzla@linux.microsoft.com> <1653390517-4033-1-git-send-email-roretzla@linux.microsoft.com> <1653390517-4033-2-git-send-email-roretzla@linux.microsoft.com> 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, 24 May 2022 04:08:36 -0700 Tyler Retzlaff wrote: > +static int > +thread_map_priority_to_os_value(enum rte_thread_priority eal_pri, > + int *os_pri, int *pol) > +{ > + /* Clear the output parameters */ > + *os_pri = sched_get_priority_min(SCHED_OTHER) - 1; > + *pol = -1; > + > + switch (eal_pri) { > + case RTE_THREAD_PRIORITY_NORMAL: > + *pol = SCHED_OTHER; > + > + /* > + * Choose the middle of the range to represent > + * the priority 'normal'. > + * On Linux, this should be 0, since both > + * sched_get_priority_min/_max return 0 for SCHED_OTHER. > + */ > + *os_pri = (sched_get_priority_min(SCHED_OTHER) + > + sched_get_priority_max(SCHED_OTHER))/2; > + break; > + case RTE_THREAD_PRIORITY_REALTIME_CRITICAL: > + *pol = SCHED_RR; > + *os_pri = sched_get_priority_max(SCHED_RR); > + break; Many people have experimented with realtime priorities with DPDK and Linux, and have never heard of any one not having problems. Recommend that this either be an error add a warning log message that "Setting real time priority may break" > + default: > + RTE_LOG(DEBUG, EAL, "The requested priority value is invalid.\n"); > + return EINVAL; > + } > + return 0; > +}