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 C2EC54301E for ; Thu, 10 Aug 2023 01:53:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC96440DD8; Thu, 10 Aug 2023 01:53:44 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2052.outbound.protection.outlook.com [40.107.237.52]) by mails.dpdk.org (Postfix) with ESMTP id 4131C406B6 for ; Thu, 10 Aug 2023 01:53:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VvLcovu3MQV6TttaAMEyNoqEkFrJSJqQy2J+uveGYQsHZVF8ZpguBt6cwr1uQCb9r70ix5yXKSpxQmjJPibTfVdQ3piVzTh1qgNyBEYQrRn16mXp9DD+PpPGyG4KnaIx55BxOATsv3oQqg8yLBnO7m9521QaQFvS9b+DOqW5kjh5505X+SceK+0NRV5+4yotOViO2R2uIqqpodvexOjJBJvxYJvhyYtHQCrexEJHQ+KXLQSJqkTmGUwLKzhaPMF90cvB6zAkSkMaY/apiL7idWknVNKhc2bTdHRL1X163YvARoW4S0EopGmuui4UsBP4ubFqPSOzYi5uBvYhGUCXeg== 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=2NgGO9B6ZtwJdJoZYHfb9gvCkoh9C7+HsjjCtMHYMx8=; b=FaYv4DRrvMP1eukVTsOlj8/KCIi1MgS5u6Nf7sHTiXPxGOr6FV5PkPpnKoB3vlnJ3qNjsGv33yiFiKRHtjDBHrf0jVzrNMZ8TiKfwLF6eKf8MPIj477ucM7jFLP2uUjkfJC3D4oZjXfmmCv+PxySamsOY9WE05qrEt0CW+PNAUbWU/RmndSOnD7HgNXWZ9ssHTH3YT8BCU+PpoUw1HsDauJ6ey8F9OPG/WnRDc1RlKJbtnZE6hl8SOWv22PaauO2REPnUBC5Z73Pelkgo5d8WzoOJxujw1sNoQykK9ym8k50Bh5Q7+EioVPYnoOwH7ksyWVYM7IBsmLme8k9P5tbNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=2NgGO9B6ZtwJdJoZYHfb9gvCkoh9C7+HsjjCtMHYMx8=; b=OB0rVDcA51qQU5PksqtqX1ICo94VN68u20bWHHwvc8Rg5BwP1ghRRYdpzkfPUjKIYQS+cbMQp8+QXBGM7WRvDuZt04VjLwuk/bY4lZbKodeYuQunbVqHH3JXF7dZgaFT8P0hBk/RVr0/X7Nkj22TW2dZEKKfk0LatCJ1MGin0hMiCWO6ZneGDVZbpPwcU8ejTzqWqoEeAyq2zLnRXGq6LnCOcEwBr2E2qBVaxE9Zy/PbTt2wFc5k1yWjorMjUsaeGiqsX+nd7VeYHv7R6D9ek/VTjcWubwJuaDjgw0rPX4TfKdMj8WONM9NX3uwdWbUBT8Nhym7qYjcBmy3zLvF9zw== Received: from SA0PR11CA0105.namprd11.prod.outlook.com (2603:10b6:806:d1::20) by CY5PR12MB6383.namprd12.prod.outlook.com (2603:10b6:930:3d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.28; Wed, 9 Aug 2023 23:53:41 +0000 Received: from SA2PEPF000015C7.namprd03.prod.outlook.com (2603:10b6:806:d1:cafe::ab) by SA0PR11CA0105.outlook.office365.com (2603:10b6:806:d1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.28 via Frontend Transport; Wed, 9 Aug 2023 23:53:41 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by SA2PEPF000015C7.mail.protection.outlook.com (10.167.241.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.19 via Frontend Transport; Wed, 9 Aug 2023 23:53:41 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Wed, 9 Aug 2023 16:53:25 -0700 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Wed, 9 Aug 2023 16:53:23 -0700 From: Xueming Li To: Mingjin Ye CC: Qi Zhang , dpdk stable Subject: patch 'net/iavf: fix abnormal disable HW interrupt' has been queued to stable release 22.11.3 Date: Thu, 10 Aug 2023 07:48:01 +0800 Message-ID: <20230809234930.32424-40-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230809234930.32424-1-xuemingl@nvidia.com> References: <20230625063544.11183-1-xuemingl@nvidia.com> <20230809234930.32424-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015C7:EE_|CY5PR12MB6383:EE_ X-MS-Office365-Filtering-Correlation-Id: e62ddb47-e74f-49a2-52ef-08db9933dbee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BJyVnJ0zxChcF4zvwhPkZMWoaregIrZCcc7l8+RgggU1GT/AAcXgLGyyQ4n9Gk1GVVoS/qmrACf+R6GedqOeYY5wBPmMH/MMVCdS9z2xuesKQ+pfFrC2nMdmO96u85djk68lTrZpjA+nLyEN24jg/Usm4cAncYQ44rTOio258/lKKYbd1oh4SvfcCt74KnKYWwW69/fEXSEaS9qDt0y0HKq3btfsSxle5JZgElVrMv03638gNCTQI8PLMHjz9BzBsToy4ulxbuv981tQyIx4cROlYwhND9sF1nLdDwHtb6NsoadUefiMilWy1Cx6Sy/iPJNnKyM1nXMXSuT0QgLH48pahxhvfjibruAvhmVrjtCxxa6kStr4rPjVG3mf8IweJpOK3160drlFOLi848lhKeZlmD9Nnmg1k5Xxjj6aCb7QIndUrq/xP3zyrNEt0OW4ctaBUL0AEQ6jJA21HASkX+TM/eAzOMYz6Mm6IObI6ZHigSs2KjJwh/NiFPI0paTqKoouiCPCwrwsfygmk67zYUCCz0WwlnAzqKchUUJSiax/4z/cE18q23tTcnforNXp/9WAM7xzQ5pMdf1kCwmDTIVGj4sR6nlCb8qS3z6Rbq+Qa/uwkHWd2aj1jQse+75oEMINcyU9gtsEbcnnhQEZRiKSc+rpAu7FbIHeaBi7CBHkF4heQzjy8eiTf0Qs2+YtVRRnq7CPtaO1pbB3XxX1xGEbYoqTNlLDg1a1H2ohj5hsHKL3KYo6VQyq610F2pmuZNvUlg+2j8Nzmx0ZzjzuZQ== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(136003)(376002)(396003)(346002)(1800799006)(186006)(82310400008)(451199021)(36840700001)(46966006)(40470700004)(40140700001)(36756003)(6666004)(478600001)(336012)(70206006)(53546011)(16526019)(1076003)(26005)(6286002)(54906003)(70586007)(6916009)(7696005)(966005)(4326008)(41300700001)(2906002)(316002)(8676002)(5660300002)(356005)(86362001)(82740400003)(8936002)(7636003)(47076005)(83380400001)(426003)(2616005)(36860700001)(40480700001)(40460700003)(55016003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2023 23:53:41.3705 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e62ddb47-e74f-49a2-52ef-08db9933dbee X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015C7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6383 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 Hi, FYI, your patch has been queued to stable release 22.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/11/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=2bdeeb53da0dda4e36a022553d3403c1217d677e Thanks. Xueming Li --- >From 2bdeeb53da0dda4e36a022553d3403c1217d677e Mon Sep 17 00:00:00 2001 From: Mingjin Ye Date: Wed, 14 Jun 2023 09:53:03 +0000 Subject: [PATCH] net/iavf: fix abnormal disable HW interrupt Cc: Xueming Li [ upstream commit 675a104e2e940ec476e8b469725e8465d01c0098 ] For command VIRTCHNL_OP_REQUEST_QUEUES, polling access to the admin queue has the issue of access overruns after disabling interrupt. That results in FW disabling HW interrupt for protection purposes. The updates/changes in this patch: 1. Remove the polling admin queue processing and use the generic interrupt processing instead. 2. Release redundant queue resource before stopping processing interrupt events. Fixes: 22b123a36d07 ("net/avf: initialize PMD") Fixes: ef807926e148 ("net/iavf: support requesting additional queues from PF") Fixes: 84108425054a ("net/iavf: support asynchronous virtual channel message") Signed-off-by: Mingjin Ye Acked-by: Qi Zhang --- drivers/net/iavf/iavf_ethdev.c | 25 +++++++++--------- drivers/net/iavf/iavf_vchnl.c | 48 +++++++--------------------------- 2 files changed, 23 insertions(+), 50 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 3cc4b40712..9b3cbee7d4 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -2720,6 +2720,19 @@ iavf_dev_close(struct rte_eth_dev *dev) } ret = iavf_dev_stop(dev); + + /* + * Release redundant queue resource when close the dev + * so that other vfs can re-use the queues. + */ + if (vf->lv_enabled) { + ret = iavf_request_queues(dev, IAVF_MAX_NUM_QUEUES_DFLT); + if (ret) + PMD_DRV_LOG(ERR, "Reset the num of queues failed"); + + vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT; + } + adapter->closed = true; /* free iAVF security device context all related resources */ @@ -2736,18 +2749,6 @@ iavf_dev_close(struct rte_eth_dev *dev) if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled) iavf_config_promisc(adapter, false, false); - /* - * Release redundant queue resource when close the dev - * so that other vfs can re-use the queues. - */ - if (vf->lv_enabled) { - ret = iavf_request_queues(dev, IAVF_MAX_NUM_QUEUES_DFLT); - if (ret) - PMD_DRV_LOG(ERR, "Reset the num of queues failed"); - - vf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT; - } - iavf_shutdown_adminq(hw); if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) { /* disable uio intr before callback unregister */ diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index aeffb07cca..c2f6b617d6 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -318,6 +318,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args, switch (args->ops) { case VIRTCHNL_OP_RESET_VF: + case VIRTCHNL_OP_REQUEST_QUEUES: /*no need to wait for response */ _clear_cmd(vf); break; @@ -341,33 +342,6 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args, } _clear_cmd(vf); break; - case VIRTCHNL_OP_REQUEST_QUEUES: - /* - * ignore async reply, only wait for system message, - * vf_reset = true if get VIRTCHNL_EVENT_RESET_IMPENDING, - * if not, means request queues failed. - */ - do { - result = iavf_read_msg_from_pf(adapter, args->out_size, - args->out_buffer); - if (result == IAVF_MSG_SYS && vf->vf_reset) { - break; - } else if (result == IAVF_MSG_CMD || - result == IAVF_MSG_ERR) { - err = -1; - break; - } - 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 || - vf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) { - err = -1; - PMD_DRV_LOG(ERR, "No response or return failure (%d)" - " for cmd %d", vf->cmd_retval, args->ops); - } - _clear_cmd(vf); - break; default: if (rte_thread_is_intr()) { /* For virtchnl ops were executed in eal_intr_thread, @@ -2067,11 +2041,11 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num) struct iavf_adapter *adapter = IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); - struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); struct virtchnl_vf_res_request vfres; struct iavf_cmd_info args; uint16_t num_queue_pairs; int err; + int i = 0; if (!(vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_REQ_QUEUES)) { @@ -2092,16 +2066,7 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num) args.out_size = IAVF_AQ_BUF_SZ; if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) { - /* disable interrupt to avoid the admin queue message to be read - * before iavf_read_msg_from_pf. - * - * don't disable interrupt handler until ready to execute vf cmd. - */ - rte_spinlock_lock(&vf->aq_lock); - rte_intr_disable(pci_dev->intr_handle); - err = iavf_execute_vf_cmd(adapter, &args, 0); - rte_intr_enable(pci_dev->intr_handle); - rte_spinlock_unlock(&vf->aq_lock); + err = iavf_execute_vf_cmd_safe(adapter, &args, 0); } else { rte_eal_alarm_cancel(iavf_dev_alarm_handler, dev); err = iavf_execute_vf_cmd_safe(adapter, &args, 0); @@ -2114,6 +2079,13 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num) return err; } + /* wait for interrupt notification vf is resetting */ + while (i++ < MAX_TRY_TIMES) { + if (vf->vf_reset) + break; + iavf_msec_delay(ASQ_DELAY_MS); + } + /* request queues succeeded, vf is resetting */ if (vf->vf_reset) { PMD_DRV_LOG(INFO, "vf is resetting"); -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-08-09 21:51:19.253367800 +0800 +++ 0039-net-iavf-fix-abnormal-disable-HW-interrupt.patch 2023-08-09 21:51:18.174352000 +0800 @@ -1 +1 @@ -From 675a104e2e940ec476e8b469725e8465d01c0098 Mon Sep 17 00:00:00 2001 +From 2bdeeb53da0dda4e36a022553d3403c1217d677e Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 675a104e2e940ec476e8b469725e8465d01c0098 ] @@ -19 +21,0 @@ -Cc: stable@dpdk.org @@ -29 +31 @@ -index b72dbc8ceb..00b963128b 100644 +index 3cc4b40712..9b3cbee7d4 100644 @@ -32 +34 @@ -@@ -2757,6 +2757,19 @@ iavf_dev_close(struct rte_eth_dev *dev) +@@ -2720,6 +2720,19 @@ iavf_dev_close(struct rte_eth_dev *dev) @@ -52 +54 @@ -@@ -2773,18 +2786,6 @@ iavf_dev_close(struct rte_eth_dev *dev) +@@ -2736,18 +2749,6 @@ iavf_dev_close(struct rte_eth_dev *dev) @@ -72 +74 @@ -index 07eb358824..524732f67d 100644 +index aeffb07cca..c2f6b617d6 100644 @@ -75 +77 @@ -@@ -324,6 +324,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args, +@@ -318,6 +318,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args, @@ -83 +85 @@ -@@ -347,33 +348,6 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args, +@@ -341,33 +342,6 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args, @@ -117 +119 @@ -@@ -2082,11 +2056,11 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num) +@@ -2067,11 +2041,11 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num) @@ -130 +132 @@ -@@ -2107,16 +2081,7 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num) +@@ -2092,16 +2066,7 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num) @@ -148 +150 @@ -@@ -2129,6 +2094,13 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num) +@@ -2114,6 +2079,13 @@ iavf_request_queues(struct rte_eth_dev *dev, uint16_t num)