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 DE7F945CE3 for ; Mon, 11 Nov 2024 07:36:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D374E40E27; Mon, 11 Nov 2024 07:36:16 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2070.outbound.protection.outlook.com [40.107.223.70]) by mails.dpdk.org (Postfix) with ESMTP id BDE9740685 for ; Mon, 11 Nov 2024 07:36:15 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hUN7hpzpJIMQzc+3+J+ogGXqkSONH0cmKQ8GARuCfBw1dY3kQcw8jKCbsob7ITdDu6lptrFvctzVJ+rZJPccqxyPco7HljgA//8Hu7fvH8QpA/b6ofDVF4OK0KzftjdVWVVdI49EsuqQfsRtrV46ie1FklPApgqULwbx+p/Yuuj3G3yBf8RIVe33qtZRRdNJARnBoFBm0hXFHp9Qw4WItwe1uatiIsX/ZMQmzLkqHYsbhEsiA9jyTg1qAvLzST6ZPNJHqw5NWuvuR2Q9UfzKpjAHttOoh+JBMshAPPcOdOx3m3zpEVmXudMdrl0Uih0rcJfu0uXXlYBapFadVp9chA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=gzBI24x/0LnjrAAlxb9RZgBGaj9pdsDiuh7AXVDpP6w=; b=VllJfCG6GdGNKgkaTT+Yt9MSYicwwo6Ok7TTk8CYiqbCbQhHZKNK15wWhLnoW8p25iuFHxHTaArVHwPOZWypJ2z0pfrT264e0xuDPX3MX3c9p1cst/3PZuivTiM5QEZQ70Wqu2OREotpXz3xMyp5i2n0rPV7RFIt7uksZhEaPn/6L7sJBj6mCUjat2GFNb6P4Q/57bpaCv7v5B/2+zqHbYWRaNaH5MUv50bixu3coZKKlq33tj48Y/447SYP3rdqPVwc8zJ/LnERqqXDNC6oI1riHaUgssgooqvmgcghWTmyxxgBHh/X4Xg/rohlD6xukeAuzF9G7F6BJmflq99nEg== 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 (0) 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=gzBI24x/0LnjrAAlxb9RZgBGaj9pdsDiuh7AXVDpP6w=; b=p5i5kCNEfsdP2cDfJ5nBi4UswVkQ4o47OhaJtrBvQ96wjzsegIY7Mic7NJtvcGnQWw3UPGFRZ2SkUX1EZuZd74ACd2Vp1m7L3BR6vxCPRxQOl/BnO3DAcyMt+kN7gxF7DjUgD5Mk1+2YL2SlDQzJbU9tNV51+YFBPF9v4qf9U3drSM+p0g8eJXI/x+YeApmbJ3+Z78R6sJ/cu/GGDVVK5kMU9rz3xAvwv3heUeqhF29+d+Qw6dC+3+YzAaHYVR9YaNWJb6bkQ/cepRSzl6sgDLlKLqWWWPRLfawWjDC9HQMsx7rL1oxyfjudtbKi1NmTWSnVCUal8EdLpgPTeIYb0Q== Received: from BN9PR03CA0765.namprd03.prod.outlook.com (2603:10b6:408:13a::20) by PH0PR12MB7982.namprd12.prod.outlook.com (2603:10b6:510:28d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.26; Mon, 11 Nov 2024 06:36:12 +0000 Received: from BL02EPF00021F69.namprd02.prod.outlook.com (2603:10b6:408:13a:cafe::5f) by BN9PR03CA0765.outlook.office365.com (2603:10b6:408:13a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.27 via Frontend Transport; Mon, 11 Nov 2024 06:36:12 +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 BL02EPF00021F69.mail.protection.outlook.com (10.167.249.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.14 via Frontend Transport; Mon, 11 Nov 2024 06:36:12 +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.1544.4; Sun, 10 Nov 2024 22:35:56 -0800 Received: from nvidia.com (10.126.231.35) 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.1544.4; Sun, 10 Nov 2024 22:35:54 -0800 From: Xueming Li To: Bruce Richardson CC: , David Marchand , "Hongbo Li" , dpdk stable Subject: patch 'net/iavf: delay VF reset command' has been queued to stable release 23.11.3 Date: Mon, 11 Nov 2024 14:27:54 +0800 Message-ID: <20241111062847.216344-69-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241111062847.216344-1-xuemingl@nvidia.com> References: <20241111062847.216344-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] 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: BL02EPF00021F69:EE_|PH0PR12MB7982:EE_ X-MS-Office365-Filtering-Correlation-Id: 1820460c-e53b-4090-4185-08dd021b2277 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?nOzMqo5I27ZUGVz9CnshP+vtbRAoM2bBHjYIFRUtqJIM2BJqjJhKTJxojqXk?= =?us-ascii?Q?xRv1rbR0RUv6L2VFFUdaIdue3JjBZOTupi2BD6w1HFKoxYKo0Utw27vQoYb4?= =?us-ascii?Q?vvQiC/4AVH3U3/ElWzI5eeapzRad3P4p93fsWmuQnPDcUELIFHIxnIHqEig9?= =?us-ascii?Q?t4vLwjIIe1QGE5sP3a2zessJvPg9aXwoKJ+K+bZe2RfkvyivlTZIPu1Rz8R9?= =?us-ascii?Q?Mr+FmePCilsebwcSxufM6zy8FloiNouwSGcS7anotWzsCTZkcoYdnRofnhIq?= =?us-ascii?Q?Zsne4nlv94ykxaRrUhP3xBsRF2tewxkveaJbSO1tMtgkpc7SH602fMtHEKKM?= =?us-ascii?Q?m9xICqU8YXI1ej0OCGY8BZoanRh8SAnmOnSyz3/KSY7Rru7g7HHgGfRMKs9J?= =?us-ascii?Q?6hWf0Goqy1n/dPt8y5VgIobnjciphDimlRJF6Llj5aB9u0+/+vwKDrrP9I0I?= =?us-ascii?Q?a1w6GFY49zDmzN598+Jrb/1cxajV0ZZzGKj19oNfKf89ysKlj6M1m1p91KOo?= =?us-ascii?Q?rVskPMPW8ObqSeUSbai63bXru0CqXqju3mpxTqtO2IeO+tCFkQh/RPSvRYTj?= =?us-ascii?Q?Er0cyXys/81ybTtDxOXsm3kQo/y16HPHZY3JgzI926UwdF7wcv8s91QODKPu?= =?us-ascii?Q?QQfMNDKi0iEW6zuJ8xUgdMFwBn7eJqpsOR2WkV1XqWDKhs1kszv9+UEtJ1AH?= =?us-ascii?Q?3g2LYV4xR07rrMECmdzZsHkItpk/4ci31UQ2+VHQ/zLkmpCvfeWrYodh97H/?= =?us-ascii?Q?6No4bn4JdCLWXqS/6oHIia/PVTr2L/disK0G+nQyZ5y2oybnb3CfYb6fhKtj?= =?us-ascii?Q?4QOLS97EmSegR33XH3i8mOj34qDw8XE4wwd/osJgIs0m6s0rn9yYMmWDGgOZ?= =?us-ascii?Q?ki1IEipFfWxqdRbL2rofhhVQ4OJdrSpSBc/zQMWe+VRvXlPB/QPtaGsAMALZ?= =?us-ascii?Q?zGncO7xdVZUBzSTXai5pEJ8TknggDYf5Ede5Tvx1n1qNOtGM+lGHxo0OifcH?= =?us-ascii?Q?Nde9pqfReaZSJZDY0BXoSaFgRynbocX539QgUDkKehtvzPuNGYeBQ51dmbZW?= =?us-ascii?Q?rN3Y/OWc7hK5aNUoSVFctyMoV6azxeHyIp/f/5BYeUtxHjRJkHwrviaxwtuA?= =?us-ascii?Q?SF3Sw06kxRYT0DfRVGzP4cRFaqTyTNq5jov9TsA+6ZvzW1KF2FKy8JwAVZLm?= =?us-ascii?Q?XoqR/CQpZaGjEiglkq5pPhkqVMAjAk99hENqjB55TUIja7wOzGHXy5ad+krG?= =?us-ascii?Q?D447E/zInBQNxjl2zA2hErlrY30NeGNO0rfvfkWVih9jMoxlbCtm2Ll9GHhY?= =?us-ascii?Q?nSiySx8LmnkUPdpZGTbbeBOfbPuGYqBHFMXz8VK8oCFDdZsyf/5PwPXzE9l1?= =?us-ascii?Q?KqyjYm5STOl2J02WW4GFfDQZgp91gMmbPHtpDpaBx3h43FiuvQ=3D=3D?= 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:(13230040)(36860700013)(376014)(82310400026)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2024 06:36:12.0060 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1820460c-e53b-4090-4185-08dd021b2277 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: BL02EPF00021F69.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7982 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 23.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 11/30/24. 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=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=07e76f97817655b73aeebfd3dff698a4a1f5be4d Thanks. Xueming Li --- >From 07e76f97817655b73aeebfd3dff698a4a1f5be4d Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Mon, 9 Sep 2024 12:03:56 +0100 Subject: [PATCH] net/iavf: delay VF reset command Cc: Xueming Li [ upstream commit b34fe66ea893c74f09322dc1109e80e81faa7d4f ] Commit 0f9ec0cbd2a9 ("net/iavf: fix VF reset when using DCF"), introduced a VF-reset adminq call into the reset sequence for iavf. However, that call was very early in the sequence before other adminq commands had been sent. To delay the VF reset, we can put the message sending in the "dev_close" function, right before the adminq is shut down, and thereby guaranteeing that we won't have any subsequent issues with adminq messages. In the process of making this change, we can also use the iavf_vf_reset function from common/iavf, rather than hard-coding the message sending lower-level calls in the net driver. Fixes: e74e1bb6280d ("net/iavf: enable port reset") Fixes: 0f9ec0cbd2a9 ("net/iavf: fix VF reset when using DCF") Signed-off-by: Bruce Richardson Reviewed-by: David Marchand Tested-by: Hongbo Li --- drivers/common/iavf/iavf_prototype.h | 1 + drivers/common/iavf/version.map | 1 + drivers/net/iavf/iavf_ethdev.c | 12 +----------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/common/iavf/iavf_prototype.h b/drivers/common/iavf/iavf_prototype.h index ba78ec5169..7c43a817bb 100644 --- a/drivers/common/iavf/iavf_prototype.h +++ b/drivers/common/iavf/iavf_prototype.h @@ -79,6 +79,7 @@ STATIC INLINE struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype) __rte_internal void iavf_vf_parse_hw_config(struct iavf_hw *hw, struct virtchnl_vf_resource *msg); +__rte_internal enum iavf_status iavf_vf_reset(struct iavf_hw *hw); __rte_internal enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw, diff --git a/drivers/common/iavf/version.map b/drivers/common/iavf/version.map index e0f117197c..6c1427cca4 100644 --- a/drivers/common/iavf/version.map +++ b/drivers/common/iavf/version.map @@ -7,6 +7,7 @@ INTERNAL { iavf_set_mac_type; iavf_shutdown_adminq; iavf_vf_parse_hw_config; + iavf_vf_reset; local: *; }; diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 9087909ec2..1a98c7734c 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -2875,6 +2875,7 @@ iavf_dev_close(struct rte_eth_dev *dev) if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled) iavf_config_promisc(adapter, false, false); + iavf_vf_reset(hw); iavf_shutdown_adminq(hw); if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) { /* disable uio intr before callback unregister */ @@ -2954,17 +2955,6 @@ iavf_dev_reset(struct rte_eth_dev *dev) struct iavf_adapter *adapter = IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private); - struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); - - if (!vf->in_reset_recovery) { - ret = iavf_aq_send_msg_to_pf(hw, VIRTCHNL_OP_RESET_VF, - IAVF_SUCCESS, NULL, 0, NULL); - if (ret) { - PMD_DRV_LOG(ERR, "fail to send cmd VIRTCHNL_OP_RESET_VF"); - return ret; - } - } - /* * Check whether the VF reset has been done and inform application, * to avoid calling the virtual channel command, which may cause -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-11 14:23:08.403242673 +0800 +++ 0068-net-iavf-delay-VF-reset-command.patch 2024-11-11 14:23:05.172192839 +0800 @@ -1 +1 @@ -From b34fe66ea893c74f09322dc1109e80e81faa7d4f Mon Sep 17 00:00:00 2001 +From 07e76f97817655b73aeebfd3dff698a4a1f5be4d Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit b34fe66ea893c74f09322dc1109e80e81faa7d4f ] @@ -21 +23,0 @@ -Cc: stable@dpdk.org @@ -57 +59 @@ -index c56fcfadf0..c200f63b4f 100644 +index 9087909ec2..1a98c7734c 100644 @@ -60 +62 @@ -@@ -2962,6 +2962,7 @@ iavf_dev_close(struct rte_eth_dev *dev) +@@ -2875,6 +2875,7 @@ iavf_dev_close(struct rte_eth_dev *dev) @@ -68 +70 @@ -@@ -3041,17 +3042,6 @@ iavf_dev_reset(struct rte_eth_dev *dev) +@@ -2954,17 +2955,6 @@ iavf_dev_reset(struct rte_eth_dev *dev)