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 321E14625C for ; Tue, 18 Feb 2025 13:43:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 289ED402A0; Tue, 18 Feb 2025 13:43:03 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2073.outbound.protection.outlook.com [40.107.92.73]) by mails.dpdk.org (Postfix) with ESMTP id 30DE1402A0 for ; Tue, 18 Feb 2025 13:43:02 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mi3FHkNtm7YpfLX4xk0jZTRUpZCReIOBoN+17V7V8ddSYyuIZmul4Dv/GZeey3dkXmVF861LaHwNuFsC6CMPcP6A7WEND6rapqblml028G6G2kA70qMO7+YKN0SCLPLYP8O6ER8KTL+3mY98jU9HYZUNgK+Gpef9IEXjRQ2LsGUkU2A5o+s6FaCGd7csuoOIuRFVF24Yz/m6QnTTcSFPlR9BCc2gOsGWMReBUlMHingdtAY75A/fnlDrvNrrmORl+tJjqwMfZPo9oHUVxRubzjTp5vtRsfE3URar+AoGWWx3YHfBLhvQUkn/A+TzebQBDAQXJ3r3jfu4P2urn7ipQg== 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=VRrHsNBus3qNXxYKucgSQ1pwjBRqbgBn3eBpImSPZCw=; b=jCbIYgN4TWvJIZ+vBlPkg9wNwxX773KysPTBUQyX0fMx/QXbrThfCnY3IJJAXOPEc2D3vKScbdyFdrvh1guw7MXN4q7RswEm0+D4V9hQZuKjSVBvwF5SapYcyt1dWP51PWW1lZS+wYNcIwRoklbkxJBfPP4Vsfz7P9M7APe1QAoxgwF9xu6s9P8+j5tx54f1KSa2IwfdRgOtEmjmKCiaRP5vB9EKWIyLxKYFNa4/HsAdsuenO8sY3U82wLvGsb0TpPJ5Oviamr6JTl/h3xNZMIi98hELHCkCxOnJD0RUqoUsgFOlrZQXs4l2uc754szFLDhqZVv+igOACvt7zl1cUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=huawei.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=VRrHsNBus3qNXxYKucgSQ1pwjBRqbgBn3eBpImSPZCw=; b=CYLvOTfKHF5InVVrmuU+pr2x1Y+J/W7gDPcMU6YwSaA4KspoJ5372zuXTeuC2kqkuBubZblmrb7mXTzifoAArepkY1EqScAZCQFOuz9kv6UD4gd7kFMWS3QPinkZ4o4xgDYUy0NzrTv9QdM5PPfj338BLCtAcAzMWmoNHsGyFqKljlBDVTVIkvsaXHza6oAfen2WRgbInNazs6zmb8jr6W7iascK2KT2M9kKnmeY7YmCMeY6GlZFMG25gcXNmtDcjyPgmzdtpe/IsnESzeYIB/fNgG9LFIoVT7C5ph8o62FiqrqI1skAt3Au190GJ/OIiiHZKwr4WCRtdeznIQJpXg== Received: from MW4PR04CA0363.namprd04.prod.outlook.com (2603:10b6:303:81::8) by SA5PPFAB8DFE4E8.namprd12.prod.outlook.com (2603:10b6:80f:fc04::8db) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8445.19; Tue, 18 Feb 2025 12:42:59 +0000 Received: from SJ1PEPF00002325.namprd03.prod.outlook.com (2603:10b6:303:81:cafe::9f) by MW4PR04CA0363.outlook.office365.com (2603:10b6:303:81::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8445.17 via Frontend Transport; Tue, 18 Feb 2025 12:42:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by SJ1PEPF00002325.mail.protection.outlook.com (10.167.242.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8466.11 via Frontend Transport; Tue, 18 Feb 2025 12:42:58 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 18 Feb 2025 04:42:54 -0800 Received: from nvidia.com (10.126.230.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.14; Tue, 18 Feb 2025 04:42:52 -0800 From: Xueming Li To: Dengdui Huang CC: , dpdk stable Subject: patch 'net/hns3: fix copper port initialization' has been queued to stable release 23.11.4 Date: Tue, 18 Feb 2025 20:35:07 +0800 Message-ID: <20250218123523.36836-73-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250218123523.36836-1-xuemingl@nvidia.com> References: <20250218123523.36836-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00002325:EE_|SA5PPFAB8DFE4E8:EE_ X-MS-Office365-Filtering-Correlation-Id: bf35dbff-7c4d-4050-6653-08dd5019c665 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|1800799024|82310400026|376014|13003099007|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?rEJbJlrgUtAsB2oK7y/M9KkZfJp5+C5fUjBy6DSWQL2Z3//TryUi/QH4MLPo?= =?us-ascii?Q?tb+A2EC+JYVWXXvwyqMY/1l1gUhzuEcNWJLVxsxW5FlQcyzk5GjCocPdHV5H?= =?us-ascii?Q?NUSWu5snhwma0q7RRtCbbrTqqQi+yFsensj67Dk9t+vn5IJ/OocLI4J2igK8?= =?us-ascii?Q?7byoqQyWOLKRygDKtnSpz2fLbWdPkFxCDL1im++BEcoXHTZr/DaD7LXvvXtu?= =?us-ascii?Q?HCnWpJU2pSvvlO3K/uBKVhZdi8tDpfJuokfW5fQHYuWsqU78URImJEBxPgj2?= =?us-ascii?Q?Mqi9zlPZ0uzaODl2U7d/1XhKCDRE8IED6aaAANSwxGkK7cPCLJowQcTGiFiv?= =?us-ascii?Q?xOAePrC7mS6b7uwv+HDRHYaX4PVfIeV+uanE/hHHN8fWXwp4pHuzypSUssbt?= =?us-ascii?Q?EQ2fqt27aZW64tiwbBvixh9C+kHFJju72/XcmAFs6+D1MlD3IdR7oODfKTE1?= =?us-ascii?Q?BuGtl5yU2Qeqn0e8aZQmHPn5yXf6IxO68d4aFOrhvtfP3mZKGAe3Yn62lk5w?= =?us-ascii?Q?rOnnrfdoW6IH+YhQKUN1gJYMyVUKnen7Fb+wGFI8Sn5Cj1QsvTekwfGfGsaQ?= =?us-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dnnVGXozCl5SyOoQ4WpGgt5eX65SNbkR9t5j?= =?us-ascii?Q?17ndTTjBQbEkC08=3D?= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014)(13003099007)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2025 12:42:58.9104 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf35dbff-7c4d-4050-6653-08dd5019c665 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF00002325.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA5PPFAB8DFE4E8 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.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. 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=e0999f779484a90d6622ffc2644f029329d6185a Thanks. Xueming Li --- >From e0999f779484a90d6622ffc2644f029329d6185a Mon Sep 17 00:00:00 2001 From: Dengdui Huang Date: Mon, 10 Feb 2025 11:01:12 +0800 Subject: [PATCH] net/hns3: fix copper port initialization Cc: Xueming Li [ upstream commit 763546c33ea9600e76790c470d2921808068eb3d ] The initialization of copper port contains the following two steps. 1. Configure firmware takeover the PHY. The firmware will start an asynchronous task to initialize the PHY chip. 2. Configure work speed and duplex. In earlier versions of the firmware, when the asynchronous task is not finished, the firmware will return -ENOTBLK in the second step. And this will lead to driver failed to initialize. Here add retry for this case. Fixes: 2e4859f3b362 ("net/hns3: support PF device with copper PHYs") Signed-off-by: Dengdui Huang --- drivers/net/hns3/hns3_ethdev.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index dde27715c0..dd450cddaa 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -4852,7 +4852,7 @@ hns3_get_link_duplex(uint32_t link_speeds) } static int -hns3_set_copper_port_link_speed(struct hns3_hw *hw, +hns3_copper_port_link_speed_cfg(struct hns3_hw *hw, struct hns3_set_link_speed_cfg *cfg) { struct hns3_cmd_desc desc[HNS3_PHY_PARAM_CFG_BD_NUM]; @@ -4886,6 +4886,33 @@ hns3_set_copper_port_link_speed(struct hns3_hw *hw, return hns3_cmd_send(hw, desc, HNS3_PHY_PARAM_CFG_BD_NUM); } +static int +hns3_set_copper_port_link_speed(struct hns3_hw *hw, + struct hns3_set_link_speed_cfg *cfg) +{ +#define HNS3_PHY_PARAM_CFG_RETRY_TIMES 10 +#define HNS3_PHY_PARAM_CFG_RETRY_DELAY_MS 100 + uint32_t retry_cnt = 0; + int ret; + + /* + * The initialization of copper port contains the following two steps. + * 1. Configure firmware takeover the PHY. The firmware will start an + * asynchronous task to initialize the PHY chip. + * 2. Configure work speed and duplex. + * In earlier versions of the firmware, when the asynchronous task is not + * finished, the firmware will return -ENOTBLK in the second step. And this + * will lead to driver failed to initialize. Here add retry for this case. + */ + ret = hns3_copper_port_link_speed_cfg(hw, cfg); + while (ret == -ENOTBLK && retry_cnt++ < HNS3_PHY_PARAM_CFG_RETRY_TIMES) { + rte_delay_ms(HNS3_PHY_PARAM_CFG_RETRY_DELAY_MS); + ret = hns3_copper_port_link_speed_cfg(hw, cfg); + } + + return ret; +} + static int hns3_set_autoneg(struct hns3_hw *hw, bool enable) { -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-02-18 19:39:03.217410402 +0800 +++ 0072-net-hns3-fix-copper-port-initialization.patch 2025-02-18 19:39:00.698244036 +0800 @@ -1 +1 @@ -From 763546c33ea9600e76790c470d2921808068eb3d Mon Sep 17 00:00:00 2001 +From e0999f779484a90d6622ffc2644f029329d6185a Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 763546c33ea9600e76790c470d2921808068eb3d ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index 72d1c30a7b..9f7119b734 100644 +index dde27715c0..dd450cddaa 100644