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 CF068A00BE; Tue, 19 Apr 2022 13:26:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC695427EE; Tue, 19 Apr 2022 13:26:00 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id EBBC941109 for ; Tue, 19 Apr 2022 13:25:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650367559; x=1681903559; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=Xp/xfbabTD1inAUW35cYNqdxcGa5LA8o5fbMPOluXoA=; b=HygcCyZDz2yEIndWgga6CSc5Rjj1sKnRkpYItnu6HMIFsXuU41z2k2Kr xB/08jvYGlegOGv//883cVgNIfoHzZh3s8Pbm7D8HIz0HAeHVlkY052/w jFO/wo0PO++T9R1zVSjYSXvXwKmPK7Zv1OyYJkd1/udFFkpbK4fkoG2QA xBqHzXiMbmc/AQZKHtsSM9W450lZJl6L/as7GRngnxlWYXBzhk0tQ9RIQ 8E5RX8ym5DzbqXKxMDKOX4JLID6JXoHyoQhGP7woEJ35VHzAtHx8cEq/C n5pQXsDKHWHkvAltnfy1kcV2peSQ+kt0wjiLo5IL6L1VUbeOXSSVxP4pG A==; X-IronPort-AV: E=McAfee;i="6400,9594,10321"; a="245633593" X-IronPort-AV: E=Sophos;i="5.90,272,1643702400"; d="scan'208";a="245633593" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Apr 2022 04:25:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,272,1643702400"; d="scan'208";a="657609393" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga002.fm.intel.com with ESMTP; 19 Apr 2022 04:25:57 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 19 Apr 2022 04:25:57 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 19 Apr 2022 04:25:55 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 19 Apr 2022 04:25:55 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 19 Apr 2022 04:25:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S9LAot+D+PGhOOQJe3kJiM3FaJxcfjlrPXnVFx2GEOtJ6Tz6VsviNMxWBA4FEVfjAczrysiYalfqBZkvQOAZh39s0/pdEX8BXtxMjSTp8vD36ibn10DG4EPxPXs0kh1t+OcNbPRgcESVNLwPH7tQbjAoprGTyAc6sdjPTjKRQ1wo25rMmQKhqAdSGzwi2DYSSPJXEIedh8lP2EJjqbA4czRkH9igBebuOyQrsbmDEjMZlzGQWtzRdzebo+0xtak6Gg0PGKeMaVkkytt5mpy1K4JUp2FQdHO8fufOaCnYA5jqTLxW7Nfks+cROuTnKhMfCpoH4qnmvaaZKofbz0U64Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vLwKyFA4rJsQQQeu+jUp8w9cAjwx2u+7KIGX0udk4jQ=; b=hijDCI1LAGMS/xAwCV3RnBKTJC7u7kbo7ONVuh4TM/tEozPyFm+ANDrRvmwQa9lufQMDvFajFOuUYXN+LpHy7jGkDSEEHVn1Bx3yREMtGXJA7bLk4uvwCo/xDc/NsPznx3XVKB8Ig3FgtHcFQSwlTpJbbhQwMfhwEMKZdQVmRFfKL3Z9GHga13xWFDTl40fh+20+bC1MpTxbqIwXXFfMPYyvQ8ZIokTlyuQcY5cdhAdfaJKu5n1pafaBk9CRI3f9wPlI9MMHHva80QnXu7jWMMRLqkGo2RkwxnzeHrGJ3zTS2olQGB9nQLmVz0YhmTJSAB3puXS0unHxJ4DHBS5hbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by CY4PR11MB1831.namprd11.prod.outlook.com (2603:10b6:903:11d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.13; Tue, 19 Apr 2022 11:25:53 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::d55d:28c1:bfab:3dd]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::d55d:28c1:bfab:3dd%5]) with mapi id 15.20.5186.013; Tue, 19 Apr 2022 11:25:53 +0000 Message-ID: <44bea883-c6e3-0e4b-f993-b1cbc3d16b81@intel.com> Date: Tue, 19 Apr 2022 12:25:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 1/4] lib/power: add get and set API for emptypoll max To: Ray Kinsella CC: , David Hunt References: <20220408140847.1319312-1-kevin.laatz@intel.com> <20220408140847.1319312-2-kevin.laatz@intel.com> <875ynapftf.fsf@mdr78.vserver.site> From: Kevin Laatz In-Reply-To: <875ynapftf.fsf@mdr78.vserver.site> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0455.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::10) To MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 07959779-049b-4025-e5d6-08da21f75d43 X-MS-TrafficTypeDiagnostic: CY4PR11MB1831:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: criyKlt+OmTXX5GaJOWMPfU4JUIOvhaOGiavBjQxGvvRnOy9XiqHhdlhatk6FZ4R8rP4710WPkQThYA71wTeOdQ7nKpqmemjPG/KqvMYXjh89H3M91eMtlMmjRj3vYHelsOFLU8UUg2ch6ClBbrEG/T+9sZuOr2hiXLJfIA2uFzcdFPSu4/PvfWgFNEDivz8GZSOzuf9tz19s09fdMDa3gShNgwvQ5utNHAC6UUQLZVbPFrnHPh14BYme5GT0xhvIXBRJxcbDIjz4mDy+Q/N5ikSo39Rmr/miqngn8/n+WXPBKGI3+4Z+FRfe6MYLNcS6Q3IiKOB8xIUvHoD3DZv0vBYBSMLKdaG68RE5iA6CBCvyPVnCoDtEX/mWYLBkkQpijba69CW2UVVTmNWK9SJJpByBEUt+yPYH5fdpmDw5zaV1lOtszkZ7LoBt3C+aQSrHgJgwLz5my50Bzd6o+pIaBKN8K+71fhYaAhK2R23Q83sTaKT10NZnE9gbUVZCw8oE5dT2Ad73aXTropUMTxgL/++NI0Itd5YChIPWBaPIFD6GocIRCQwR3BFWQccBMj2QiCYvCvI289ST83notbTJBCQ0HAO5V/NcgsSNxYbU6wIAd0ZMvv450l4bDqFjjglhlsm2wHdr+PReYNcb7a3nN3HD8klDlFBROBjMFKp54Tq9jgytRWL/iPAqBig+031seZFpzoku+RTtl7GPUugSI53uRWr0ZFUGfpnlZBJYig= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR11MB5872.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(6512007)(38100700002)(6486002)(36756003)(86362001)(83380400001)(31686004)(2906002)(53546011)(6506007)(82960400001)(508600001)(8936002)(5660300002)(6666004)(66946007)(66556008)(66476007)(2616005)(44832011)(4326008)(8676002)(6916009)(316002)(31696002)(107886003)(186003)(26005)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?R3ZxczNxZ1ZGaGhJdGR0bVR0Q3dRaVNUK01MVXY2ZTcrdWZaRm1SYnBPS3Zr?= =?utf-8?B?S0JOWXNPSnA1a1JaS3FJczR6M1BVaG8rcGFPQ1ZDMVo2bnEwdUQzY1RQWFNP?= =?utf-8?B?OUNVS2gxZCtiSmZ0S2R1a2IrWEdVdDlQdDRvU1h6c2JmcFE5R3ZKaVFlMUlN?= =?utf-8?B?QmU1N2hXeVdwMzFvT0N4NWlnM2l5eXZDcDlINExrVHlvbEdwYlZxMW9NOUJX?= =?utf-8?B?bE4rK29pbzlaQkFmM2ZPMWU2bm1EbGFZcktWSnptRERScEgwZ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FMytRQWdmaW9hVjduQWhuUDJJWmhQYkdUbzN1bm1SL05Rb0N6?= =?utf-8?B?WHRpdzEzdjVzOW9Yb2gxM3Nyc1ZWb1BhV3hrTlpkR0ZTSGkvMDFUTWswMHFx?= =?utf-8?B?TGVRdjFmVXg5cTVlb2VPOEZHMk95ZXVVYWFaYXcrVnN5a2FLRnk4dVV0MjIz?= =?utf-8?B?Y0taa2cwbGpvdlZyT0owTzNQWVVQTHpBVXZKejcxeW15YW5maWVaU3NqWkFo?= =?utf-8?B?cDdaWUZ3OWVtWktvQldoQ1dnVUxsMjM2clBhSG5QeEdUcHlnNVNmZz09?= X-MS-Exchange-CrossTenant-Network-Message-Id: 07959779-049b-4025-e5d6-08da21f75d43 X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2022 11:25:53.4226 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XmMEt/VEV/VJCSGhvZQBgLtndXGmyQ7dfGWbJ14SydYGruWmhjR/L6octG2MyUGQ8q6xCh3+xyNA41NgvJpNbw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1831 X-OriginatorOrg: intel.com 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 15/04/2022 15:43, Ray Kinsella wrote: > 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. > Re-ordered in v2, thanks.