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 34E58A04FD; Mon, 23 May 2022 18:54:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4F9B4067B; Mon, 23 May 2022 18:54:12 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 9648A40156 for ; Mon, 23 May 2022 18:54:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653324851; x=1684860851; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=HQpo6BvUSyWprqaSi+owqUYqPWm7+5Eu5i9zwXmX3FQ=; b=O3JQBvDh9GSe33dfOVozaaZu/RQOcJu6qSmMw5WhYMaAhhOH8lopRIfl erXjgsIxCTcjv+XEbhYAS+Lp8kCLvlrcOCbUKSm7XcKproUewKAbD+fUK RXWyBivwzoUSbKVZ8xUXFy148g3+coofTWRH1P/bUqru3Qz/9OmHEZ6X+ L9NfU32IufW4Ic75Qno84dOS4Nopyt+Ey+c73lX01ygdiVnNiefBZV70u F/t7v9b0KoYST4Q4+qeTiBzH9Tkli1LiEhdJbHh3Tz7RYvho4reHMP1qg Zgks0eWkxtJ0QKdBxfAvEDqQSYi9Z9BC4561lY1Zc2mOsriouTSgrh64h g==; X-IronPort-AV: E=McAfee;i="6400,9594,10356"; a="270856588" X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="270856588" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 09:54:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="703097644" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga004.jf.intel.com with ESMTP; 23 May 2022 09:54:10 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Mon, 23 May 2022 09:54:09 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) 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; Mon, 23 May 2022 09:54:09 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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; Mon, 23 May 2022 09:54:09 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.41) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Mon, 23 May 2022 09:54:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h//r/UK0dJGpbrqhUowSOY0ZOHcysmT3SPLnDzKoW//oJ+AcLgC3oQjLaKdvYEuYvGFZVB0MQEXxYUY6argKl4xIAVU1kgV/koBCDyBM+0FBa2+wKa05qIyyQVDYygLR+IO8KfsBJDsV2fjxzL7PAlbZCYsLvIbrm7FenBoM9T32RuzMs6cUwaG2ReDC4bU+ALfp/MPSrJExEhHYdCZ5lrmfUhPCNv4JbYIDdmEdkEsGjDWBFG0tc2j5lJfemyER3jLEGP59hGnr4jVX2eA2lzZzC3Jnt5QdyBB2fGmi5Or+zcCCF9q8d9kBrQJIYcnpAq//lqpsnaeS1SYDV18lPg== 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=EsDTPQCgJ7ji2f5UgPqVy9mDz1FTcxhxiYOdrfCkdD0=; b=mRj0i20rTOmKyVfYXGT5w//ABqMA+PHQbepjeNe2SlDpqCk+vspXtrJUKVDo/JRKyna6LB6+mBgPZNo/vBFq2isvH2d3jGa7ZEfhrXKt+SDfR0p8uHZQC9KmBFup+PSp8ajGShrR0qgHHvxK6pODOxCraxLCHUPM07WfwGWmMJvlGbTVvpDTHVO4Lq2JZVp0IGHG103ELgM0evpI3itu/Hfw9CAVwUgNYvBv2wE1vEFY0XoaVea1CVQgMk9+LF4CeUTr/62zwoY9m077QkwsYYFaOIktCYMR3Mcz/mmKiKbkhT5rU4r23noccrmxqO4VOYvSiZBO98QgPVehRcFFyQ== 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 BN6PR11MB1636.namprd11.prod.outlook.com (2603:10b6:405:10::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.19; Mon, 23 May 2022 16:54:06 +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.5273.022; Mon, 23 May 2022 16:54:06 +0000 Message-ID: <12ce9bb7-a87a-c1d9-16cd-201ea7ad5113@intel.com> Date: Mon, 23 May 2022 17:54:01 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH v2 4/4] examples/l3fwd_power: add cli for configurable options To: "Burakov, Anatoly" , CC: David Hunt References: <20220408140847.1319312-1-kevin.laatz@intel.com> <20220419112501.1835458-1-kevin.laatz@intel.com> <20220419112501.1835458-5-kevin.laatz@intel.com> From: Kevin Laatz In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0029.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:151::16) 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: fe74e77e-4d76-4eb5-565f-08da3cdcd97c X-MS-TrafficTypeDiagnostic: BN6PR11MB1636: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: DukX+w22gaomOywvSW4isw8K646vgsnG49wS9EkSpYOWjN4ZhsndPZoFrb2oUQUoaWHjCNQEABXiM6CugJc8M96QQ6C3G7EGqt2/1nB9lfQ9JtSUslgT6OJWBmsK8QaND1lpQtSON76PIwqYFDFlQ3gOvXjHh84/WzIyCYePHI6S36WnHyP1oqA6FpL/jWS8B7bEhOy0rnLfbj1C9wyQEicuZAB0U3hFcItZs/TRQNc58qq18n/kSzqSZo1LXbsrscX6gHm++cPtwRKwWlf6tnYRDASe59ZslqVCyz2zZL3rHTso+LREDCUROfnyvldgDw8WfcYs+LbLs7QzxH6NfpNnIXVE0DgZzfF4MYBexJhlzBAtm8wddnm7qOL8h07PxKQmENLPqkN9gANL6s052F3RHGHcLFbL9vDZ7n+La+7rlM94mV400NJxJRHx9V+Da9PP1cjnSOSSqcu5HeWEF5Uk7bix/cz5T6ZmSAflHgycy2C9JMcnUBXjYzGDmMSl3Fs5ziC4PAA1vpyDUD+VIpK8mgcVWaP7qQPDkZl+dbYmYt77YGAHZGDay/jVQva440xTyI2NBM7vt/L05BZf8ZxnTRkyk5QEbRqFzXOuICI9wTpS9y7imoxMHDzmbMDB4WbIKyFLKh2nXNoKwgvuVEAOLEuSuQHRumX2CVkP1IyMk6uNFgWk/lJLpgSMboCOzFc01sSJUqfHhnFAOlGm6yVsvLPjSXz2Eu04bUKEYrwRnJ9O8bIyuN65k2a3WpWu 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)(2616005)(6506007)(53546011)(107886003)(44832011)(38100700002)(36756003)(83380400001)(6486002)(186003)(316002)(26005)(31686004)(6512007)(508600001)(6666004)(2906002)(86362001)(31696002)(66946007)(4326008)(66556008)(8676002)(66476007)(5660300002)(8936002)(82960400001)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QkFhWDR3T003Z1gwYVFHbzVmeXRrT2NzWFZlUWU0dmovc090VFgxUG1xUndW?= =?utf-8?B?NE1iODlyOHNNTnV4R1ZDSTY3MElSUkpjTFNqV3lRRW13eTdVemMzVVg5NHNm?= =?utf-8?B?RDlBN05Lc1J2NnB2elhRYWhtQmpGbXo5TDF3WWlRWnhVZU95NW9vK3IyWkMw?= =?utf-8?B?S0QwcWhvbFVoQ0RQN1BrWDNteGZ4RmNGL0lIQjNmTUF5MCs3WnR1VU9VRnQ3?= =?utf-8?B?WW1qQ1J1dDdZWHB2NTRzRmVsWVFqOFBiTXZHNzBWalNsYVp3V05iUU1Vd1BS?= =?utf-8?B?K2h1aGk4VXJ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BV0NycFI5Wk5CSGhiaXdqVFNy?= =?utf-8?B?eUZDNy9LNTgwZnk3c0NDcnQwQnBRTHhSR1Y3SUVuYkszd0xPUGRYRE0vb2RF?= =?utf-8?B?alZHdUxRdnZhSGc1MUJqamwrTmVqditLZ010L0tybVFUSmE1U08rZ051VlVD?= =?utf-8?B?ZmN6Zjl0Qzd5OU9DMU5nZE1tWHdsQzNrWnFOa3ZYKytWMXZVZEZZS0xRRGNU?= =?utf-8?B?N0tnVXBJWFJhaSs0VmsyTWlmTnI5ZGYzZUFicHp2MnJYbGpVdHpmZWJkdUpM?= =?utf-8?Q?HW8BDpwryJk9tMeg=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: fe74e77e-4d76-4eb5-565f-08da3cdcd97c X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2022 16:54:06.8134 (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: T1GNU1L/rkbwWnU9RZ2Cta2gpsCChqBCfaycApbTpCRd54dCQLmOr+zyz/7FcFmCOYhJVFwXdDBRLzriz2oyTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1636 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 18/05/2022 10:11, Burakov, Anatoly wrote: > On 19-Apr-22 12:25 PM, Kevin Laatz wrote: >> Add CLI options to l3fwd_power to utilize the new power APIs >> introduced in >> this patchset. These CLI options allow the user to configure the >> heuritstics made available through the new API via the l3fwd_power >> application options. >> >> Signed-off-by: Kevin Laatz >> >> --- >> v2: add doc update for l3fwd-power >> --- > > This is a bit confusing. There are other scaling modes in l3fwd-power, > but the --scale-freq-min only applies to the PMD power management mode. > >> .../sample_app_ug/l3_forward_power_man.rst    |  8 ++ >>   examples/l3fwd-power/main.c                   | 75 ++++++++++++++++++- >>   2 files changed, 82 insertions(+), 1 deletion(-) >> >> diff --git a/doc/guides/sample_app_ug/l3_forward_power_man.rst >> b/doc/guides/sample_app_ug/l3_forward_power_man.rst >> index 2e350c45f1..b26f11a220 100644 >> --- a/doc/guides/sample_app_ug/l3_forward_power_man.rst >> +++ b/doc/guides/sample_app_ug/l3_forward_power_man.rst >> @@ -109,6 +109,14 @@ where, >>     *   --pmd-mgmt: PMD power management mode. >>   +*   --max-empty-polls : Number of empty polls to wait before >> entering sleep state. >> + >> +*   --pause-duration: Set the duration of the pause callback >> (microseconds). >> + >> +*   --scale-freq-min: Set minimum frequency for scaling. >> + >> +*   --scale-freq-max: Set maximum frequency for scaling. >> + > > Maybe make a note that these only apply to --pmd-mgmt mode? Fair point, I'll add a note. > >>   See :doc:`l3_forward` for details. >>   The L3fwd-power example reuses the L3fwd command line options. >>   diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c >> index 20e5b59af9..ec2a71f02f 100644 >> --- a/examples/l3fwd-power/main.c >> +++ b/examples/l3fwd-power/main.c >> @@ -265,6 +265,10 @@ static struct rte_eth_conf port_conf = { >>   }; >>     static uint32_t max_pkt_len; >> +static uint32_t max_empty_polls; >> +static uint32_t pause_duration; >> +static uint32_t scale_freq_min; >> +static uint32_t scale_freq_max; >>     static struct rte_mempool * pktmbuf_pool[NB_SOCKETS]; >>   @@ -1626,10 +1630,32 @@ print_usage(const char *prgname) >>           " empty polls, full polls, and core busyness to telemetry\n" >>           " --interrupt-only: enable interrupt-only mode\n" >>           " --pmd-mgmt MODE: enable PMD power management mode. " >> -        "Currently supported modes: baseline, monitor, pause, scale\n", >> +        "Currently supported modes: baseline, monitor, pause, scale\n" >> +        "  --max-empty-polls MAX_EMPTY_POLLS: number of empty polls to" >> +        " wait before entering sleep state\n" >> +        "  --pause_duration DURATION: set the duration, in >> microseconds," >> +        " of the pause callback\n" >> +        "  --scale-freq-min FREQ_MIN: set minimum frequency for >> scaling" >> +        " mode for all application lcores\n" >> +        "  --scale_freq_max FREQ_MAX: set maximum frequency for >> scaling" >> +        " mode for all application lcores\n", > > It would be useful to note which units are used here :) This is > increments in 100MHz, correct? Ack > >>           prgname); >>   } >>   +static int >> +parse_int(const char *opt) >> +{ >> +    char *end = NULL; >> +    unsigned long val; >> + >> +    /* parse integer string */ >> +    val = strtoul(opt, &end, 10); >> +    if ((opt[0] == '\0') || (end == NULL) || (*end != '\0')) >> +        return -1; >> + >> +    return val; >> +} >> + >>   static int parse_max_pkt_len(const char *pktlen) >>   { >>       char *end = NULL; >> @@ -1803,6 +1829,10 @@ parse_ep_config(const char *q_arg) >>   #define CMD_LINE_OPT_TELEMETRY "telemetry" >>   #define CMD_LINE_OPT_PMD_MGMT "pmd-mgmt" >>   #define CMD_LINE_OPT_MAX_PKT_LEN "max-pkt-len" >> +#define CMD_LINE_OPT_MAX_EMPTY_POLLS "max-empty-poll" >> +#define CMD_LINE_OPT_PAUSE_DURATION "pause-duration" >> +#define CMD_LINE_OPT_SCALE_FREQ_MIN "scale-freq-min" >> +#define CMD_LINE_OPT_SCALE_FREQ_MAX "scale-freq-max" >>     /* Parse the argument given in the command line of the >> application */ >>   static int >> @@ -1812,6 +1842,7 @@ parse_args(int argc, char **argv) >>       char **argvopt; >>       int option_index; >>       uint32_t limit; >> +    int i; >>       char *prgname = argv[0]; >>       static struct option lgopts[] = { >>           {"config", 1, 0, 0}, >> @@ -1825,6 +1856,10 @@ parse_args(int argc, char **argv) >>           {CMD_LINE_OPT_TELEMETRY, 0, 0, 0}, >>           {CMD_LINE_OPT_INTERRUPT_ONLY, 0, 0, 0}, >>           {CMD_LINE_OPT_PMD_MGMT, 1, 0, 0}, >> +        {CMD_LINE_OPT_MAX_EMPTY_POLLS, 1, 0, 0}, >> +        {CMD_LINE_OPT_PAUSE_DURATION, 1, 0, 0}, >> +        {CMD_LINE_OPT_SCALE_FREQ_MIN, 1, 0, 0}, >> +        {CMD_LINE_OPT_SCALE_FREQ_MAX, 1, 0, 0}, >>           {NULL, 0, 0, 0} >>       }; >>   @@ -1975,6 +2010,44 @@ parse_args(int argc, char **argv) >>                   parse_ptype = 1; >>               } >>   +            if (!strncmp(lgopts[option_index].name, >> +                    CMD_LINE_OPT_MAX_EMPTY_POLLS, >> +                    sizeof(CMD_LINE_OPT_MAX_EMPTY_POLLS))) { >> +                printf("Maximum empty polls configured\n"); >> +                max_empty_polls = parse_int(optarg); >> + rte_power_pmd_mgmt_set_emptypoll_max(max_empty_polls); > > If you have global variables anyway, why are you setting this here? :) > You could call these API's under PMD mgmt mode init only, and this > would also give you a chance of checking return values of any of these > API's - for example, AFAIR set_pause_duration() can return an error if > the value supplied is invalid (0). > > Plus, I still feel uneasy about having DPDK API calls right inside arg > parsing code. I'll look into this and move the API calls out of the parsing for v3. Thanks for reviewing! > >> +            } >> + >> +            if (!strncmp(lgopts[option_index].name, >> +                    CMD_LINE_OPT_PAUSE_DURATION, >> +                    sizeof(CMD_LINE_OPT_PAUSE_DURATION))) { >> +                printf("Pause duration configured\n"); >> +                pause_duration = parse_int(optarg); >> + rte_power_pmd_mgmt_set_pause_duration(pause_duration); >> +            } >> + >> +            if (!strncmp(lgopts[option_index].name, >> +                    CMD_LINE_OPT_SCALE_FREQ_MIN, >> +                    sizeof(CMD_LINE_OPT_SCALE_FREQ_MIN))) { >> +                printf("Scaling frequency minimum configured\n"); >> +                scale_freq_min = parse_int(optarg); >> +                for (i = 0; i < RTE_MAX_LCORE; i++) >> +                    if (rte_lcore_is_enabled(i)) >> + rte_power_pmd_mgmt_set_scaling_freq_min(i, >> +                                scale_freq_min); >> +            } >> + >> +            if (!strncmp(lgopts[option_index].name, >> +                    CMD_LINE_OPT_SCALE_FREQ_MAX, >> +                    sizeof(CMD_LINE_OPT_SCALE_FREQ_MAX))) { >> +                printf("Scaling frequency maximum configured\n"); >> +                scale_freq_max = parse_int(optarg); >> +                for (i = 0; i < RTE_MAX_LCORE; i++) >> +                    if (rte_lcore_is_enabled(i)) >> + rte_power_pmd_mgmt_set_scaling_freq_max(i, >> +                                scale_freq_max); >> +            } >> + >>               break; >>             default: > >