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 C4236A034F for ; Wed, 10 Nov 2021 07:42:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BDC94410E0; Wed, 10 Nov 2021 07:42:39 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2079.outbound.protection.outlook.com [40.107.93.79]) by mails.dpdk.org (Postfix) with ESMTP id 7443F40E03 for ; Wed, 10 Nov 2021 07:42:38 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ULPFJsTbIjj00mtq4rCv5XsJxLOfmeJDXt72IznrS60wdYTS3KUXDBEqxOeB3s215A7TTJRYcmTqh0n8pqXm+KDfDjiDWE5W21tAH8AHC290TOz6Io5UPLdwCbM9tP/DQQNoKsKbDTSde9X7LNxsKvoY0JtxPU5b+4sPiHILBVR4NPYANCaZpj/ca32/Das0nPq5uUY+tb2PQnbkkUJ3UBKTiNepkzs164PdNAFW0EmWaz7hkErrq7hpTV3n/H/p7yJJWzqxvsheyD/+njIruTtVkuh/U/vUvjh/Ntv6XEBL287+GTsp4Jv4qRVejOueyDdkKaJdBlJ/n3waNI6Cxw== 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=jQkwwMNONe1r7R6dbYU6xzbPtVh0gChLBdYEeoMU6pE=; b=DPfGQ51kzDwSTWrbdrjD4JwiBZSoY+H9bad35D0jc1WAhYKcNxu8pe7xVDgtba7aErXwgod6Qf2YEhOyL+rECtFWxFpQunxAT1oCmpPEwE4i9XtuJuNZW5++Tph49WJiOiMOA7/52gzR3X56hnP207uNlw+gnKqOQ59QTtn/XhKdWAPmyx2E+zYcDBvOzK0Ka1OF0uoylSDoPzQtDkuUYWohKh1aKBKOYYhfWW8zgR2VwqCKFni6UXCzmPr6My7g9HXJMkNUoakKJD7MNSjpYFnst8/2ez6Cty8Extr5G/hgiB6hp850CU1fTQdTbEm10lgvE/ZKBaOYa7snaAnXmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jQkwwMNONe1r7R6dbYU6xzbPtVh0gChLBdYEeoMU6pE=; b=jEUKzx3E/LXdHKPwBgcVDzd43jkeX/IljL9zUE3FvijiFR+K5rtMS1Ze/VPji3h5V/1wD/79WuAolGi/k3hpXBM/ePmZs4pgpJ/NMDuf5cRqQMdn/lydHv6zQDnoJWMjX3vwXu9qe6DOtCu6ylg7XqG1iE4wT6qBpEiau1wBmm1EmD+z1xdG+NYmEut6GGkahEM/SWJkEAt1nzPG/PWB5+XQXblh+KmH4pJdEUMtjnpYouV6iiKECsViu6Y+FzT+R4lMwwUPHm9kMb1XSY+8WhRGvvC/fxvXJItG9OwqG1o75KlbzT9hxzslo49caK6GxTXywiTs+HkssJ0+1Z4fPg== Received: from DM6PR06CA0081.namprd06.prod.outlook.com (2603:10b6:5:336::14) by BL1PR12MB5061.namprd12.prod.outlook.com (2603:10b6:208:310::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 06:42:36 +0000 Received: from DM6NAM11FT004.eop-nam11.prod.protection.outlook.com (2603:10b6:5:336:cafe::aa) by DM6PR06CA0081.outlook.office365.com (2603:10b6:5:336::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 06:42:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT004.mail.protection.outlook.com (10.13.172.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:42:36 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:42:33 +0000 From: Xueming Li To: Qiming Chen CC: Luca Boccassi , Qi Zhang , dpdk stable Date: Wed, 10 Nov 2021 14:29:36 +0800 Message-ID: <20211110063216.2744012-93-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca686942-0401-47ae-ef85-08d9a415483e X-MS-TrafficTypeDiagnostic: BL1PR12MB5061: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gZGQASjcRlskUD504BF5WU71qUGRICaid49WntEk58Ul6GFc4j8B8OFtU+FKrIhgS7oZaddAzw1L4ayWUybyVPwmhawjuUjOQwsb21DCviBfIKscZgrAiXsqDg7pvKY1U/IeN9GGlP4Ohcswz7/V+kUVqC68rK+9bzbb5IaSlTy3DMw+gy3HiV7DZ2FkNFCPFZaYdznOc13rDXBf62fwRjhI0XGvOGdnbDFB/HQKg/OKzRw9MHZ7kgIHFmfmHQz836zh7S2Fo35oKbD/j3F3Fo66UtYW2LHQy0wzerjrZ/RCIs+VkfV8YHjGqUD4jXHe+YpMWNnGW9Qu+fNvIaE8rzUqPU3CCAKJX4AIcC9+hVG/acWE1IJVCPeikEAWTgxGA3OvcxvPNtG196ZxMx2lhSYa+Dr0G5nfrGxnK4o8RNLTHIa1wvyZI6+8A8gHHOmmXU0gfs8AHOajj08CHl2IcQ79bYo3r354xXDlELR4GEM9iOjEdKbyEhK19qzdDUzhJjF316PW6/lCdxzNAjaRQRBxQbJMScsmmGfErgYAIdNNk87kO9lxIE3rBwwYldw92IVkkDbwSxeh3ZL+p86V00ou2dHM1L00hPanps7rdczvQkLXrqKENBP/U2FuuUJs7/9MFNbagPgRcwK5Ost7k0oETvrC9yjmgK8jMwZ3yrqfLNvAsv+9vQd3wQl97QenB10OPCFckQUX++Tzi5IgNOVKLtpBn/x5JpGKiuyGGlXjcUm5burrPUKli7Kt3F5xngHKWQkRIQb3F4BJvGxQKkaEIepfhccHi5k/4kJKhyueL2lJk/MMSvdYfFLYPe+eTiH1yw+zuiinKBGeXXa5Tg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(8936002)(4001150100001)(426003)(2616005)(8676002)(36756003)(70586007)(26005)(4326008)(2906002)(82310400003)(83380400001)(5660300002)(6286002)(36860700001)(86362001)(6916009)(53546011)(966005)(7696005)(508600001)(70206006)(47076005)(186003)(55016002)(356005)(336012)(16526019)(1076003)(316002)(7636003)(54906003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:42:36.1809 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca686942-0401-47ae-ef85-08d9a415483e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT004.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5061 Subject: [dpdk-stable] patch 'net/iavf: fix high CPU usage on frequent command' has been queued to stable release 20.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/1900a185181403d1c08a72ef25cd80ea97df139c Thanks. Xueming Li --- >From 1900a185181403d1c08a72ef25cd80ea97df139c Mon Sep 17 00:00:00 2001 From: Qiming Chen Date: Sat, 11 Sep 2021 12:02:21 +0800 Subject: [PATCH] net/iavf: fix high CPU usage on frequent command Cc: Xueming Li [ upstream commit de5bef335eeac3a0b1e29eb2c5fabbcadb9549eb ] There is currently a scenario test, which will continuously obtain port statistics, causing the CPU usage to soar, which does not meet the demand. After positioning analysis, it is found that the VF and PF command interaction is completed through the iavf_execute_vf_cmd function. After the message is sent, it needs to wait for the interrupt thread to obtain the response from the PF. For the data, the rte_delay_ms interface is used here to wait, but the CPU will not be released during the waiting period of this interface, which will cause the statistics to keep occupying the CPU. This is also the root cause of the soaring CPU. The command interaction should belong to the control plane, and there will not be too high requirements for performance. It is recommended to wait for the interface iavf_msec_delay to complete without taking up the CPU time. Fixes: 22b123a36d07 ("net/avf: initialize PMD") Signed-off-by: Qiming Chen Acked-by: Qi Zhang --- drivers/net/iavf/iavf_vchnl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 1021108ff5..00f868b3c7 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -180,7 +180,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) args->out_buffer); if (result == IAVF_MSG_CMD) break; - rte_delay_ms(ASQ_DELAY_MS); + iavf_msec_delay(ASQ_DELAY_MS); } while (i++ < MAX_TRY_TIMES); if (i >= MAX_TRY_TIMES || vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) { @@ -206,7 +206,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) err = -1; break; } - rte_delay_ms(ASQ_DELAY_MS); + iavf_msec_delay(ASQ_DELAY_MS); /* If don't read msg or read sys event, continue */ } while (i++ < MAX_TRY_TIMES); if (i >= MAX_TRY_TIMES || @@ -224,7 +224,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) do { if (vf->pend_cmd == VIRTCHNL_OP_UNKNOWN) break; - rte_delay_ms(ASQ_DELAY_MS); + iavf_msec_delay(ASQ_DELAY_MS); /* If don't read msg or read sys event, continue */ } while (i++ < MAX_TRY_TIMES); -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:06.117468053 +0800 +++ 0092-net-iavf-fix-high-CPU-usage-on-frequent-command.patch 2021-11-10 14:17:01.850746254 +0800 @@ -1 +1 @@ -From de5bef335eeac3a0b1e29eb2c5fabbcadb9549eb Mon Sep 17 00:00:00 2001 +From 1900a185181403d1c08a72ef25cd80ea97df139c Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit de5bef335eeac3a0b1e29eb2c5fabbcadb9549eb ] @@ -23 +25,0 @@ -Cc: stable@dpdk.org @@ -32 +34 @@ -index 050e5f7232..3275687927 100644 +index 1021108ff5..00f868b3c7 100644 @@ -35 +37 @@ -@@ -182,7 +182,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) +@@ -180,7 +180,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) @@ -44 +46 @@ -@@ -208,7 +208,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) +@@ -206,7 +206,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) @@ -53 +55 @@ -@@ -226,7 +226,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args) +@@ -224,7 +224,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)