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 2875A42ECF for ; Thu, 20 Jul 2023 17:32:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 244F942C54; Thu, 20 Jul 2023 17:32:37 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 4770C400D6 for ; Thu, 20 Jul 2023 17:32:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689867154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=shkxUgDtXOB8dx2nu4OlleEfclqq8Mvd0l7XV0WpOGo=; b=Bh7XEiMBaNAx4xFCe33l87Evvd94Ta+6pLUDvg72VUKqI/i13NDn0VgkE8lzjhB9OaStaa 8vrL1RfanN8F7r4+L/3IY5WUs+4hTfPVCptuCELJNfOk+Eab+uBQ0XZBK6vm2c4MHwIjxr Tcfy7kMYiX6PKromJF0IrhrLjM0snt0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-66-uwxoscN9OB68mWQmeWt4Iw-1; Thu, 20 Jul 2023 11:22:26 -0400 X-MC-Unique: uwxoscN9OB68mWQmeWt4Iw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2DAD7936D46; Thu, 20 Jul 2023 15:22:19 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56F2F492C13; Thu, 20 Jul 2023 15:22:18 +0000 (UTC) From: Kevin Traynor To: Jiawen Wu Cc: dpdk stable Subject: patch 'net/txgbe: fix to set autoneg for 1G speed' has been queued to stable release 21.11.5 Date: Thu, 20 Jul 2023 16:18:43 +0100 Message-ID: <20230720151942.262154-92-ktraynor@redhat.com> In-Reply-To: <20230720151942.262154-1-ktraynor@redhat.com> References: <20230720151942.262154-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 21.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/25/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://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/1077232f46444c970e8a87a4b39535b669ca4744 Thanks. Kevin --- >From 1077232f46444c970e8a87a4b39535b669ca4744 Mon Sep 17 00:00:00 2001 From: Jiawen Wu Date: Wed, 14 Jun 2023 10:34:24 +0800 Subject: [PATCH] net/txgbe: fix to set autoneg for 1G speed [ upstream commit 658dbfa6360fcda0a5798669f6eac8293e4a2d73 ] Autoneg was always on for 1G speed, fix to set autoneg off. Fixes: 01c3cf5c85a7 ("net/txgbe: add autoneg control read and write") Fixes: e4c515a7bc7e ("net/txgbe: add multi-speed link setup") Signed-off-by: Jiawen Wu --- drivers/net/txgbe/base/txgbe_hw.c | 14 ++++++++++++++ drivers/net/txgbe/base/txgbe_phy.c | 4 +++- drivers/net/txgbe/base/txgbe_type.h | 1 + drivers/net/txgbe/txgbe_ethdev.c | 2 ++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/net/txgbe/base/txgbe_hw.c b/drivers/net/txgbe/base/txgbe_hw.c index 776891ee7e..1083431055 100644 --- a/drivers/net/txgbe/base/txgbe_hw.c +++ b/drivers/net/txgbe/base/txgbe_hw.c @@ -2280,8 +2280,22 @@ s32 txgbe_setup_mac_link_multispeed_fiber(struct txgbe_hw *hw, if (speed & TXGBE_LINK_SPEED_1GB_FULL) { + u32 curr_autoneg; + speedcnt++; if (highest_link_speed == TXGBE_LINK_SPEED_UNKNOWN) highest_link_speed = TXGBE_LINK_SPEED_1GB_FULL; + status = hw->mac.check_link(hw, &link_speed, &link_up, false); + if (status != 0) + return status; + + /* If we already have link at this speed, just jump out */ + if (link_speed == TXGBE_LINK_SPEED_1GB_FULL) { + curr_autoneg = rd32_epcs(hw, SR_MII_MMD_CTL); + if (link_up && (hw->autoneg == + !!(curr_autoneg & SR_MII_MMD_CTL_AN_EN))) + goto out; + } + /* Set the module link speed */ switch (hw->phy.media_type) { diff --git a/drivers/net/txgbe/base/txgbe_phy.c b/drivers/net/txgbe/base/txgbe_phy.c index 6bbb2a5e71..a7c11c50df 100644 --- a/drivers/net/txgbe/base/txgbe_phy.c +++ b/drivers/net/txgbe/base/txgbe_phy.c @@ -1381,5 +1381,7 @@ txgbe_set_sgmii_an37_ability(struct txgbe_hw *hw) wr32_epcs(hw, SR_MII_MMD_DIGI_CTL, 0x0200); value = rd32_epcs(hw, SR_MII_MMD_CTL); - value = (value & ~0x1200) | (0x1 << 12) | (0x1 << 9); + value = (value & ~0x1200) | (0x1 << 9); + if (hw->autoneg) + value |= SR_MII_MMD_CTL_AN_EN; wr32_epcs(hw, SR_MII_MMD_CTL, value); } diff --git a/drivers/net/txgbe/base/txgbe_type.h b/drivers/net/txgbe/base/txgbe_type.h index 7010372119..e7971ccf1d 100644 --- a/drivers/net/txgbe/base/txgbe_type.h +++ b/drivers/net/txgbe/base/txgbe_type.h @@ -783,4 +783,5 @@ struct txgbe_hw { bool need_crosstalk_fix; bool dev_start; + bool autoneg; struct txgbe_devargs devarg; diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index c5793e21b5..c017c733fb 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -1777,4 +1777,5 @@ txgbe_dev_start(struct rte_eth_dev *dev) TXGBE_LINK_SPEED_1GB_FULL | TXGBE_LINK_SPEED_10GB_FULL); + hw->autoneg = true; } else { if (*link_speeds & RTE_ETH_LINK_SPEED_10G) @@ -1788,4 +1789,5 @@ txgbe_dev_start(struct rte_eth_dev *dev) if (*link_speeds & RTE_ETH_LINK_SPEED_100M) speed |= TXGBE_LINK_SPEED_100M_FULL; + hw->autoneg = false; } -- 2.41.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-07-20 16:18:06.136248400 +0100 +++ 0092-net-txgbe-fix-to-set-autoneg-for-1G-speed.patch 2023-07-20 16:17:54.999751888 +0100 @@ -1 +1 @@ -From 658dbfa6360fcda0a5798669f6eac8293e4a2d73 Mon Sep 17 00:00:00 2001 +From 1077232f46444c970e8a87a4b39535b669ca4744 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 658dbfa6360fcda0a5798669f6eac8293e4a2d73 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 2952c408fd..d19fd0065d 100644 +index 776891ee7e..1083431055 100644 @@ -24 +25 @@ -@@ -2274,8 +2274,22 @@ s32 txgbe_setup_mac_link_multispeed_fiber(struct txgbe_hw *hw, +@@ -2280,8 +2280,22 @@ s32 txgbe_setup_mac_link_multispeed_fiber(struct txgbe_hw *hw, @@ -48 +49 @@ -index 1eb45b068a..d87af656d5 100644 +index 6bbb2a5e71..a7c11c50df 100644 @@ -51 +52 @@ -@@ -1403,5 +1403,7 @@ txgbe_set_sgmii_an37_ability(struct txgbe_hw *hw) +@@ -1381,5 +1381,7 @@ txgbe_set_sgmii_an37_ability(struct txgbe_hw *hw) @@ -61 +62 @@ -index c3486b472f..75e839b7de 100644 +index 7010372119..e7971ccf1d 100644 @@ -64 +65 @@ -@@ -784,4 +784,5 @@ struct txgbe_hw { +@@ -783,4 +783,5 @@ struct txgbe_hw { @@ -71 +72 @@ -index 36c74d353d..962667acdc 100644 +index c5793e21b5..c017c733fb 100644 @@ -74 +75 @@ -@@ -1822,4 +1822,5 @@ txgbe_dev_start(struct rte_eth_dev *dev) +@@ -1777,4 +1777,5 @@ txgbe_dev_start(struct rte_eth_dev *dev) @@ -80 +81 @@ -@@ -1833,4 +1834,5 @@ txgbe_dev_start(struct rte_eth_dev *dev) +@@ -1788,4 +1789,5 @@ txgbe_dev_start(struct rte_eth_dev *dev)