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 A6DE9A0C51; Wed, 21 Jul 2021 16:40:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 021C74113C; Wed, 21 Jul 2021 16:39:54 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 888B741139 for ; Wed, 21 Jul 2021 16:39:51 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10052"; a="211446401" X-IronPort-AV: E=Sophos;i="5.84,258,1620716400"; d="scan'208";a="211446401" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2021 07:39:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,258,1620716400"; d="scan'208";a="511814623" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga002.fm.intel.com with ESMTP; 21 Jul 2021 07:39:50 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Wed, 21 Jul 2021 07:39:50 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Wed, 21 Jul 2021 07:39:49 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Wed, 21 Jul 2021 07:39:49 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.173) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Wed, 21 Jul 2021 07:39:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eYTONs/Ns9slGgPPGrkCQJ2PDOT1Vdt1yBh0iRctfRqiE1VczBg0R6B1AnpLwt2kAjTorpnwLQVRZkXowgh16iNqJQbhW3ML0cvlWR0ItvCcf3Sx4u+ElcwQnA1KDjLHC8hVxYkoaGlgGFIUeiXtJfSIhRySiEMJB8DG/IzMpYdDATp5VsdfnJh5c4N0zEuanj54gZsA4Hm9xF/pnDhUj1s8En17VWBmZCp6JDgj4RW88hYA82B95lOP2jnYtHYAGrO22CaNl1VLrI4iUamXpDKlFkne1DSWye4lyIGdQaYMfyJ5pKiNEyDvsOgE0XnKcRBZkd69HmTF+XQH4XO9UA== 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-SenderADCheck; bh=W6wi+0cfCGtwYv6nrA6+IoDaiV8MKkwO65JU0WxZpf0=; b=TBEawSKljFB1HAqTHW7rR1eXb14tDei0EF1nIsBk7kRJk1C5rAK/7D/wgNpn8FbTEw7ptu6p4n+RolE/GytO9vocrP1xtQNGW4+6/TZRn9+fE755xIpZ6dzn3Ha8xXTf7DylohUhvSt+KyDqYbL/qMsvHRbsP0BrY/s+Jx6+gBSWcJahg+bAotseZOZ9nr6CaHMN4QzQlfJCyGf9J+vYF3DkzgA8+98fujl5RnhL+H5bV29A7c/4wz5x30J6lLyObJRzoO9PbfAVLWDtDS0it7F8obBiHJUovXmTj9lInC0m00uZg1vWw33Wa+JwHYDZgbEHm+8I63a/IKGghJq9Tg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W6wi+0cfCGtwYv6nrA6+IoDaiV8MKkwO65JU0WxZpf0=; b=tU8zDlFaBTVUwdRp7VTx7aWntBJzco+grIXpdoQh+vvSAvJHOWKzVgaM+k6V5OTVvau4KyONxrEu0DyEikRcTlCK4FG6D7GSFXm/6K0kQvrxHIRqVPWnLIvzDSjLgwQ3ap92K/Uiun8AF3S8OQGYAy319j2lpUoherGQXxPw3tI= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5047.namprd11.prod.outlook.com (2603:10b6:510:3c::18) by PH0PR11MB5144.namprd11.prod.outlook.com (2603:10b6:510:3e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Wed, 21 Jul 2021 14:39:48 +0000 Received: from PH0PR11MB5047.namprd11.prod.outlook.com ([fe80::513:57f8:360:23fc]) by PH0PR11MB5047.namprd11.prod.outlook.com ([fe80::513:57f8:360:23fc%7]) with mapi id 15.20.4331.034; Wed, 21 Jul 2021 14:39:48 +0000 To: Anatoly Burakov , , "Konstantin Ananyev" CC: References: From: David Hunt Message-ID: <476cb249-9716-5639-1c40-aa92dcd4145e@intel.com> Date: Wed, 21 Jul 2021 15:39:42 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.12.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-ClientProxiedBy: AM0PR03CA0066.eurprd03.prod.outlook.com (2603:10a6:208::43) To PH0PR11MB5047.namprd11.prod.outlook.com (2603:10b6:510:3c::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.4.11.161] (95.45.22.52) by AM0PR03CA0066.eurprd03.prod.outlook.com (2603:10a6:208::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24 via Frontend Transport; Wed, 21 Jul 2021 14:39:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9df12ce5-f1c2-4349-8fb2-08d94c5563f8 X-MS-TrafficTypeDiagnostic: PH0PR11MB5144: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fkhR+e6i091ulzyf34ksKvd63hkNI5oApXhkOwbXHtueKMraKj+CtCP9/MQMqgSku4FUv5K448Ak/ZrEjlrPFJFHDm/CJQ8Xcb0PiMDl8BXgu9ikUvtkflbLgQ0y7Kd38whGw04KZmBBSWlSqEZUwCJXAJgBglNJTZdsrmoE1fsmNnhlFhoRmYYMkuDKwv3go/LMQmAPBdW4j5tTWsSUDLL6U0Q4hTvpUeuwSX696pw88nz69TCilSsQYtKNAhRXV46zX9Ae2s9g3FYyGURJR4TI6N15PyBPB/UKnXXY3yagzXbuUyUkvovDWx1NxPl4fQVZdneeTMuwoRrjnz4nF4q0wXfIH5X7n2bbAG4Gzypvvy81qTe24nE6KT/j2xka9FAXEh4YijuLEWj5I3mHqM2xGLndDPpFp/5p8FUkkxhEKRLTxwiTEcy8pJwFsy850CVqYm3O5qqFl6OQmWp2ahsMWOmywR/GYNjG6RPL67i95rbODH+pKmkhwWs5FVxLjbrAraCmOjsR5sCy5fA0Gr/vn3bs6RjW/0tQEEMezFbizqFYfoYWNxPjsTsS8IhdmOiXFyXRAn1hKVnGS3luHg6saJKtweXHGRZ518mm2RskwrVGM8SwiUxAb0rr3xyBielSwBBdFttHge3rE14NnHeR8Pf5HYsW73fYU6BbwDcCdzSbj7YwIPPSCu1EGXnHBkxS+J3Yq6eLtyc4frfLvmJPbULmIN5659DC8WYXppE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5047.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(5660300002)(4326008)(66946007)(86362001)(8676002)(2906002)(186003)(508600001)(66476007)(2616005)(107886003)(110136005)(16576012)(66556008)(44832011)(316002)(83380400001)(31696002)(53546011)(6486002)(36756003)(38100700002)(8936002)(6666004)(6636002)(26005)(956004)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ODBJYU03YWhESzZtMXhGNm5BQjZIbGgzWW9HZzZ0Z3A5ajZPNW9OakdIZGFo?= =?utf-8?B?dGtkQjdPVW0rQTlPS0dFOXlqdmtGOHVDbWEwS296ZFBGd3EzVGc1OFlmUVRY?= =?utf-8?B?TUdOR251YlY0a0VXQ2RUcUdTQ2Y0M2ZPV1hPdTcvUExhbHNiZ0Y5d0J3Sy9N?= =?utf-8?B?QURyQTh2NHlGN3drRkhhS0RWSzFZOFVhV3hHVEZ1QW9VenAvbTJQdWNVZFlN?= =?utf-8?B?YlFEYXBDWm1rNTcvbzlldWRHR2pPUDJqbm0vY1lRSGhyNkNmd1JPQnRlVDlN?= =?utf-8?B?dmkxMTUwOER6NkowVm1xMVM3cmJkNXRuVTBDNGJmcUFYZTdFbTlzYktmMmMv?= =?utf-8?B?ck9Fa2F0RjY4dWZUeUV6bktaejd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0VLS2U0Tk5vbDdEZllzNXJVVWl1VGJUdEFiOGFUOE5S?= =?utf-8?B?UUxGMDRYd1lWODU1SC83SUoreW9FbkVoZG9VSCtxa1J0TXpwV0NRdWNtWmhT?= =?utf-8?B?NUVMbnJEK291aHpvMDBTTEVvUjlzNjlRUndBaUhkL2RLaEpJcVNJdEZmcTZn?= =?utf-8?B?QTAxN2JRRXFZaGQrRWMzYjJORFRFRDg3WDFlZVdSbjkxeXFTNWFuYlBJdmZp?= =?utf-8?B?VVVxQi9oSUZpTUtTclZsU2tobXZHQktuRzJRKzRFL3ZwYzhUUVN0WTN2VHIz?= =?utf-8?B?VGcxTUYvR3FqVk1rYVlIZDl5ZytOUHR5dGNLOUx1bEhrTWx4c28xNVBRZFZ6?= =?utf-8?B?VmJSa3NlR0F0dWp3dkU0SWZLNm9qMmxWMDNsdnU5RVdlZjQwclVFY1ltTDRL?= =?utf-8?B?NGJQNGFlL2xoVHRUbmNMRFhrNi9ScmlNMWhSc1ZkSzUzK09keklhdktweldx?= =?utf-8?Q?7slBkoV6JTSEW0qO9cARMs+QQwaM2oULpsAuylY?= X-MS-Exchange-CrossTenant-Network-Message-Id: 9df12ce5-f1c2-4349-8fb2-08d94c5563f8 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5047.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2021 14:39:48.5130 (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: xGmptNIy4B/wA2EIPtYbXqc5OrKHG6XEi2r140r4wdQ1R9g9pLJu2lqK1mwC+AnJliVxD/AWqy2KSYzYPmmtiw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5144 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v1 1/1] power: fix multi-queue scale mode for pmd mgmt 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 Sender: "dev" Hi Anatoly, On 21/7/2021 3:26 PM, Anatoly Burakov wrote: > Currently in scale mode, multi-queue initialization will attempt to > initialize and de-initialize the per-lcore power library structures > multiple times. Fix it to only do this whenever we either enabling > first queue or disabling last queue. > > Fixes: 5dff9a72b0ef ("power: support callbacks for multiple Rx queues") > > Signed-off-by: Anatoly Burakov > --- > lib/power/rte_power_pmd_mgmt.c | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) > > diff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c > index 2586204b93..0ce40f0875 100644 > --- a/lib/power/rte_power_pmd_mgmt.c > +++ b/lib/power/rte_power_pmd_mgmt.c > @@ -534,11 +534,15 @@ rte_power_ethdev_pmgmt_queue_enable(unsigned int lcore_id, uint16_t port_id, > clb = get_monitor_callback(); > break; > case RTE_POWER_MGMT_TYPE_SCALE: > - /* check if we can add a new queue */ > - ret = check_scale(lcore_id); > - if (ret < 0) > - goto end; > clb = clb_scale_freq; > + > + /* we only have to check this when enabling first queue */ > + if (lcore_cfg->pwr_mgmt_state != PMD_MGMT_DISABLED) > + break; > + /* check if we can add a new queue */ > + ret = check_scale(lcore_id); > + if (ret < 0) > + goto end; > break; > case RTE_POWER_MGMT_TYPE_PAUSE: > /* figure out various time-to-tsc conversions */ > @@ -633,9 +637,12 @@ rte_power_ethdev_pmgmt_queue_disable(unsigned int lcore_id, > rte_eth_remove_rx_callback(port_id, queue_id, queue_cfg->cb); > break; > case RTE_POWER_MGMT_TYPE_SCALE: > - rte_power_freq_max(lcore_id); > rte_eth_remove_rx_callback(port_id, queue_id, queue_cfg->cb); > - rte_power_exit(lcore_id); > + /* disable power library on this lcore if this was last queue */ > + if (lcore_cfg->pwr_mgmt_state == PMD_MGMT_DISABLED) { > + rte_power_freq_max(lcore_id); > + rte_power_exit(lcore_id); > + } > break; > } > /* Fix looks good. Previous to this patch, was failing on adding second queue to a core, now with this patch, succeeds. Tested-by: David Hunt