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 1E14642A3E; Tue, 2 May 2023 12:43:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A1E6240E2D; Tue, 2 May 2023 12:43:55 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2047.outbound.protection.outlook.com [40.107.220.47]) by mails.dpdk.org (Postfix) with ESMTP id 35E07406A2 for ; Tue, 2 May 2023 12:43:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jod4hKNnIT3sxT7jigY9tC8/Nbzj+PtNkGaVwiPnhAljfWjHFratHYlnb4IEuiNG3ZMa/89hfQT+ZhjX1GcXD0QnhrpXRCnZN33bIAz+PgK/oIpmE4ti28arRYytjA8mdVvsiiS8RlazBxR+MZstE2mxlTFdrkzCxaSM/QrIhizQSYiFBwSFbU2eVyEh9EMwhJvp4XxOkPf83Gu6+4cR5HfUqnQTOXEUugfTcTo5ALg/8qAovQfkbh8lGU+1Pl4h6vtKzU5CLqEN8FlLNxowSYrJSDXlnIxISAy8+Yg6TUEF525DKGnJ8R7s8YKE2smHcjnuwXL08N0lkl2Z4kmCDQ== 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=AxV6PLC3b89+d87/WfmpOdMYzUcILGxo688vPhWdKro=; b=iRuDdlzLHKPu4796o62w7zfPS6n/PpvqitwvXbxvZT1ZsiQ3P2bOysf4YuY5BmKGzIMRc4ElCAlDn1CMeY1HBegEpGV6jXJ6MTPi4XaXtP8ovpmapa8ksHEmsj4gS4CFj88363jVnNEKnK5hgU0tv/ypKraEQOL0k+AlbYvNf5nyhwW0Fu/JJorQ5daV4LqCqphdD3ZiskO2JJH1RmLxchRPGIPT43pjWyps61JWeKTTeB8PU3VTeCLZRMj+WzGbCpmconDu7KJfGqfWjC94xFb265JiUlcUG77TMeMPB2j7F14Q7BUAsGqC5qkia1cW4jxhlTScME4fFLmY0bB03Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AxV6PLC3b89+d87/WfmpOdMYzUcILGxo688vPhWdKro=; b=dAoRo7iviiitbqgcG+u6VAOAwCKwCt3ITT6eOha2cS7H2kklM212opK/hxAv9HPCiRmE+8Ca049WVDFM3n0royQuLG/8Q//IMsYQx9lbpq5ZWGUQq8+6T2RLSqBkjdvePhI17eDOfgVFo9UyEPWMHiRT+ZYHFE6Ax+BHaklsX8g= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by CY8PR12MB7122.namprd12.prod.outlook.com (2603:10b6:930:61::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.31; Tue, 2 May 2023 10:43:50 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::e818:77ea:75b5:f8cc]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::e818:77ea:75b5:f8cc%5]) with mapi id 15.20.6340.031; Tue, 2 May 2023 10:43:50 +0000 Message-ID: Date: Tue, 2 May 2023 11:43:44 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Content-Language: en-US To: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= , Jerin Jacob , Sivaprasad Tummala Cc: "david.hunt@intel.com" , "jerinj@marvell.com" , "harry.van.haaren@intel.com" , "dev@dpdk.org" , Pavan Nikhilesh , "McDaniel, Timothy" , Shijith Thotton , Hemant Agrawal , Sachin Saxena , Peter Mccarthy , Liang Ma References: <20230419095427.563185-1-sivaprasad.tummala@amd.com> <324d5201-da95-f926-5580-f74ca5c09799@amd.com> <85c59de2-d7b1-85d2-fab6-42c145fd9470@ericsson.com> From: Ferruh Yigit Subject: Re: [RFC PATCH 1/5] eventdev: add power monitoring API on event port In-Reply-To: <85c59de2-d7b1-85d2-fab6-42c145fd9470@ericsson.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0160.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:188::21) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CY8PR12MB7122:EE_ X-MS-Office365-Filtering-Correlation-Id: bb365c2d-4b59-4c67-b1dc-08db4afa1d65 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m7twpnfrUX7D6fahGqsh9OTj1W+/xkrkXJy2F+FX+cPor5NBwQZaF3LRHo8+enrxL0DOc72ff3Z8rB4kfh7ZKRMIWdKmCBD2J208VyPoKXai+8r4TcKR7k8It+SSn8jsHS8wnBDgMBzZB1OG9MLQkDUyW1hD/nTa2rWvFp/YYTFvUJWgyU2kiOQRZjLk75rPYjSITIKXAbldCauBgf6kzLV37FTZUDgrOyxOmTxMuMVjWL7BL5MVPkGpwad0B7nSnrRvd7Wqu9vFoeepPO3M2PJWnyRCkxwBRRI8Du3lS0FpbKmdr4LrlFr6BIFXiRMeuYkFNgaDzCA/BlkRI5YKVpjdbij7oM2PFb6ubcYfvV6cqOHWtWg2Fsr/Iq+Kiwejjv29jsocNtdQz30DUrNc7u0i+qbz0yShI/DLWH03cLuhCMBWGf431mQ7U/Kwk7Gety4IqOT7dMI+xbNmuj/uXHooJo4WNXZXtCrbBZZ0nXBjit2EOT8JIx8lYiPQH81vk3reftd55sd75PgItRLofUJdRxrhCeEtOi2hJYD2+9EEcQv+lDYRvJ/eC+X8fOJg1wJU+hKUMJNesBeljsls2OsPzg8i1vks2JqaoHF4CVqBP4TwsHO7GdwgZywtDf3wnOt0rBdKQlTZuSBMQy73kw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(39860400002)(376002)(366004)(396003)(136003)(451199021)(86362001)(7416002)(38100700002)(8676002)(8936002)(4326008)(6636002)(66476007)(66556008)(66946007)(41300700001)(316002)(31696002)(5660300002)(44832011)(2906002)(186003)(53546011)(6512007)(6506007)(26005)(6486002)(6666004)(83380400001)(66574015)(36756003)(2616005)(31686004)(54906003)(110136005)(478600001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?em9UZzZjcFduSWwxQVE5N1lwVUZPbHFtMFp5dnFabXIycWhEclJubzBJSkVV?= =?utf-8?B?TzdMZ3Q5bzA1bjY3d1NUWnBpc0VTWlhPVGZoVFJLQ1NMOFB3eFpxVGhGT3RK?= =?utf-8?B?MFpUc09QS0dpd2czSXI3bjJGZ212eEFBYnJFWnNnR0h5d0hnUk0wK3J4KzR6?= =?utf-8?B?c1FvaVpGbnJ0V0k1OWZsWUY0KzZOU2RMY2pzZkhSSzlEL2lBbUlLbi9kS2Qx?= =?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Ss0Sm84dTB3eHpTdXFqNlF5emJB?= =?utf-8?B?cDZDUFh0SmRNc3hLa3prMG5IUHpTcnM5RDhsTi9QYy9pVnVhazRRM0lxVUJj?= =?utf-8?Q?s1TMbyb/rzIRgnhYTjsX5T2jk?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb365c2d-4b59-4c67-b1dc-08db4afa1d65 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2023 10:43:50.2202 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vYG5k/2UvgmewxElPgqX4tB4kP19Exvs8jgOL0To0pa9aSDjxICH3gyHruy8hxWo X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7122 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 4/25/2023 7:19 AM, Mattias Rönnblom wrote: > On 2023-04-24 18:06, Ferruh Yigit wrote: >> On 4/19/2023 11:15 AM, Jerin Jacob wrote: >>> On Wed, Apr 19, 2023 at 3:24 PM Sivaprasad Tummala >>> wrote: >>>> >>>> A new API to allow power monitoring condition on event port to >>>> optimize power when no events are arriving on an event port for >>>> the worker core to process in an eventdev based pipelined application. >>>> >>>> Signed-off-by: Sivaprasad Tummala >>>> + * >>>> + * @param dev_id >>>> + * Eventdev id >>>> + * @param port_id >>>> + * Eventdev port id >>>> + * @param pmc >>>> + * The pointer to power-optimized monitoring condition structure. >>>> + * >>>> + * @return >>>> + * - 0: Success. >>>> + * -ENOTSUP: Operation not supported. >>>> + * -EINVAL: Invalid parameters. >>>> + * -ENODEV: Invalid device ID. >>>> + */ >>>> +__rte_experimental >>>> +int >>>> +rte_event_port_get_monitor_addr(uint8_t dev_id, uint8_t port_id, >>>> + struct rte_power_monitor_cond *pmc); >>> >>> + eventdev driver maintainers >>> >>> I think, we don't need to expose this application due to applications >>> 1)To make applications to be transparent whether power saving is enabled or not? >>> 2)Some HW and Arch already supports power managent in driver and in HW >>> (Not using CPU architecture directly) >>> >>> If so, that will be translated to following, >>> a) Add rte_event_port_power_saving_ena_dis(uint8_t dev_id, uint8_t >>> port_id, bool ena) for controlling power saving in slowpath. >>> b) Create reusable PMD private function based on the CPU architecture >>> power saving primitive to cover the PMD don't have native power saving >>> support. >>> c)Update rte_event_dequeue_burst() burst of PMD callback to use (b). >>> >>> >> >> Hi Jerin, >> >> ethdev approach seems applied here. >> >> In ethdev, 'rte_event_port_get_monitor_addr()' equivalent is >> 'rte_eth_get_monitor_addr()'. >> >> Although 'rte_eth_get_monitor_addr()' is public API, it is currently >> only called from Rx/Tx callback functions implemented in the power library. >> But I assume intention to make it public is to enable users to implement >> their own callback functions that has custom algorithm for the power >> management. >> >> And probably same is true for the 'rte_event_port_get_monitor_addr()'. >> >> >> Also instead of implementing power features for withing PMDs, isn't it >> better to have a common eventdev layer for it? >> > > To allow that question to be answered, I think you need to be more > specific what are "power features". > > From what it seems to me, the get_monitor_addr() family of functions > address the pretty narrow case of allowing umwait (or the non-x86 > equivalent) to be used to wait for new events. It leaves all the heavy > lifting to the app, which needs to figure out how loaded each CPU core > is, what backlog of work there is, how to shuffle work around to get the > most out of the power, how to translate wall-clock latency requirements > into the equation, what CPU (and/or accelerator/NIC-level) power > features to employ (e.g., DVFS, sleep states, umwait), etc. > > In the context of Eventdev, optimizing for power may include packing > more flows into the same port, in low-load situations. Keeping a few > cores relatively busy, and the rest in some deep sleep state may well be > the best solution for certain (most?) systems. For such a feature to > work, the event device must be in the loop, but the mechanics could (and > should) be generic. Eventdev could also control DVFS. > > A reasonably generic power management mechanism could go into Eventdev a > combination of the event device drivers, and some generic functions). > (Various policies would still need to come from the app.) > > I think keeping this kind of functionality in Eventdev works well > provided the only source of work is Eventdev events (i.e., most or all > fast path lcores are "pure" event-based lcores). No non-eventdev timer > wheels, no non-eventdev lookaside accelerator or I/O device access, no > control plane rings to poll, etc. > > If such a model is too limiting, another option is to put the central > power management function in the service framework (with a lot of help > from Eventdev, RTE timer, and other sources of work as well). > Hi Mattias, The current power management features referred in the scope of this patch is around umwait use case as you mentioned. It has default callbacks that application benefit with minimal involvement from application, but if application wants more sophisticated algorithm, needs to implement its own functions. And I agree to have more comprehensive power management, it has benefit but it has to start somewhere and we can grow it more by time. Also it requires more support from community, not just from some vendors. I think it is a good start to enable some HW features for power management and make existing APIs more HW agnostic. >> For the PMDs benefit from HW event manager, just not implementing >> .get_monitor_addr() dev_ops will make them free from power related APIs. >> >> >> >