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 E817FA0510; Fri, 15 Apr 2022 16:44:02 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 90CBA4067E; Fri, 15 Apr 2022 16:44:02 +0200 (CEST) Received: from mail-108-mta53.mxroute.com (mail-108-mta53.mxroute.com [136.175.108.53]) by mails.dpdk.org (Postfix) with ESMTP id C3CA64067C for ; Fri, 15 Apr 2022 16:44:00 +0200 (CEST) Received: from filter006.mxroute.com ([140.82.40.27] 140.82.40.27.vultrusercontent.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta53.mxroute.com (ZoneMTA) with ESMTPSA id 1802dae4c3a000fe85.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Fri, 15 Apr 2022 14:43:59 +0000 X-Zone-Loop: 2c878e6b98f109b61ee7ae63ac49a87b561b792da4cf X-Originating-IP: [140.82.40.27] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ashroe.eu; s=x; h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to:Subject:Cc:To: From:References:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=D/mDwHJwXO9NdzKUuFtDRPaPwOH96gWQ5CaYGM8O8G8=; b=q8rstKHnFEZOV/vzgKV+VNbdbl QhDC+V0PvHTQzNaCNqHwaCJyiT2mHq8nuSsUHWQacZiyGNnQyVfT0pvzhLD3AG5sFgx7sJjK+xkvx WveZV5nQLzWxc1FI/0WBu8nYlp4uhtd7H0pUvqny2Z0F5k6kYOe8+TfASc7D3qehmR3pCt9YllZRp oN7hrd6OwHqms4EuMVkdKxfxnAIT80BLujEtST1ZpL5P4y2sHdn6nWqxPb6G5Kf0a+V0wDDJCIFRY 5uPM3QDUIfEyDkf682fIqzvNxNoVgmclEU/aAUtAmpXu9QUmUgZJQ9VZG9/Zo2lNMlwTF/DeXmAUF aMocpn9A==; References: <20220408140847.1319312-1-kevin.laatz@intel.com> <20220408140847.1319312-2-kevin.laatz@intel.com> User-agent: mu4e 1.4.15; emacs 27.1 From: Ray Kinsella To: Kevin Laatz Cc: dev@dpdk.org, David Hunt Subject: Re: [PATCH 1/4] lib/power: add get and set API for emptypoll max In-reply-to: <20220408140847.1319312-2-kevin.laatz@intel.com> Date: Fri, 15 Apr 2022 10:43:56 -0400 Message-ID: <875ynapftf.fsf@mdr78.vserver.site> MIME-Version: 1.0 Content-Type: text/plain X-AuthUser: mdr@ashroe.eu 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 Kevin Laatz writes: > Add new get/set APIs to configure emptypoll max which is used to > determine when a queue can go into sleep state. > > Signed-off-by: Kevin Laatz > --- > lib/power/rte_power_pmd_mgmt.c | 21 ++++++++++++++++++--- > lib/power/rte_power_pmd_mgmt.h | 27 +++++++++++++++++++++++++++ > lib/power/version.map | 4 ++++ > 3 files changed, 49 insertions(+), 3 deletions(-) > > diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c > index 39a2b4cd23..dfb7ca9187 100644 > --- a/lib/power/rte_power_pmd_mgmt.c > +++ b/lib/power/rte_power_pmd_mgmt.c > @@ -11,7 +11,7 @@ > > #include "rte_power_pmd_mgmt.h" > > -#define EMPTYPOLL_MAX 512 > +unsigned int emptypoll_max; > > /* store some internal state */ > static struct pmd_conf_data { > @@ -206,7 +206,7 @@ queue_can_sleep(struct pmd_core_cfg *cfg, struct queue_list_entry *qcfg) > qcfg->n_empty_polls++; > > /* if we haven't reached threshold for empty polls, we can't sleep */ > - if (qcfg->n_empty_polls <= EMPTYPOLL_MAX) > + if (qcfg->n_empty_polls <= emptypoll_max) > return false; > > /* > @@ -290,7 +290,7 @@ clb_umwait(uint16_t port_id, uint16_t qidx, struct rte_mbuf **pkts __rte_unused, > /* this callback can't do more than one queue, omit multiqueue logic */ > if (unlikely(nb_rx == 0)) { > queue_conf->n_empty_polls++; > - if (unlikely(queue_conf->n_empty_polls > EMPTYPOLL_MAX)) { > + if (unlikely(queue_conf->n_empty_polls > emptypoll_max)) { > struct rte_power_monitor_cond pmc; > int ret; > > @@ -661,6 +661,18 @@ rte_power_ethdev_pmgmt_queue_disable(unsigned int lcore_id, > return 0; > } > > +void > +rte_power_pmd_mgmt_set_emptypoll_max(unsigned int max) > +{ > + emptypoll_max = max; > +} > + > +unsigned int > +rte_power_pmd_mgmt_get_emptypoll_max(void) > +{ > + return emptypoll_max; > +} > + > RTE_INIT(rte_power_ethdev_pmgmt_init) { > size_t i; > > @@ -669,4 +681,7 @@ RTE_INIT(rte_power_ethdev_pmgmt_init) { > struct pmd_core_cfg *cfg = &lcore_cfgs[i]; > TAILQ_INIT(&cfg->head); > } > + > + /* initialize config defaults */ > + emptypoll_max = 512; > } > diff --git a/lib/power/rte_power_pmd_mgmt.h b/lib/power/rte_power_pmd_mgmt.h > index 444e7b8a66..d5a94f8187 100644 > --- a/lib/power/rte_power_pmd_mgmt.h > +++ b/lib/power/rte_power_pmd_mgmt.h > @@ -90,6 +90,33 @@ int > rte_power_ethdev_pmgmt_queue_disable(unsigned int lcore_id, > uint16_t port_id, uint16_t queue_id); > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice. > + * > + * Set a emptypoll_max to specified value. Used to specify the number of empty > + * polls to wait before entering sleep state. > + * > + * @param max > + * The value to set emptypoll_max to. > + */ > +__rte_experimental > +void > +rte_power_pmd_mgmt_set_emptypoll_max(unsigned int max); > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice. > + * > + * Get the current value of emptypoll_max. > + * > + * @return > + * The current emptypoll_max value > + */ > +__rte_experimental > +unsigned int > +rte_power_pmd_mgmt_get_emptypoll_max(void); > + > #ifdef __cplusplus > } > #endif > diff --git a/lib/power/version.map b/lib/power/version.map > index 6ec6d5d96d..8bcd497e06 100644 > --- a/lib/power/version.map > +++ b/lib/power/version.map > @@ -38,4 +38,8 @@ EXPERIMENTAL { > # added in 21.02 > rte_power_ethdev_pmgmt_queue_disable; > rte_power_ethdev_pmgmt_queue_enable; > + > + # added in 22.07 > + rte_power_pmd_mgmt_set_emptypoll_max; > + rte_power_pmd_mgmt_get_emptypoll_max; minor niggle, get then set. > }; -- Regards, Ray K