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 819D3431A0 for ; Thu, 19 Oct 2023 02:00:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7368F40A6F; Thu, 19 Oct 2023 02:00:16 +0200 (CEST) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mails.dpdk.org (Postfix) with ESMTP id 2B28B40291 for ; Thu, 19 Oct 2023 02:00:15 +0200 (CEST) Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4083cd3917eso10071225e9.3 for ; Wed, 18 Oct 2023 17:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697673615; x=1698278415; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MyPbpoTWOw+FiO8ZBuuF+jh6yGCJa9L/embZvS1hGds=; b=kkJuXndllDaajDwcnSak5G1J7V1dVcyOr6diLa71ykbTdIaoz61iJUzmhZNANz2s82 Z0+0/eomH3E3njKhbPU+WH5GNM704y2WtS4Y0TpBEq9y2KRoUOpYlAmowraG7RlCTzsw A2eReb3sXWrBw1FO8FZuc9BtArIXZUpaR3UrA+7PQRxKGSB1JINaK8mfmfRMYAjeR1RQ X88dShYPLq29WICsVFDmnLlEdMkMMIzIFnIGQCOr6KoJk4kIrW5W9gxONx3MVLcbD3Hf hHa8JWsPs2Hoy87HMGL/raZWBY7WNPYfkH5J69i5yLVn7bmrXneo1/s9wSr7sF8qDNw/ TbjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697673615; x=1698278415; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MyPbpoTWOw+FiO8ZBuuF+jh6yGCJa9L/embZvS1hGds=; b=wS/HB0SAeq7M5PC1HsaOl1NsyorGoOX7yV/dR4rL+9W4ebXYkqINEifMvfrf1x9S9r r/QsL3EHTE7S0O6a08/IN4r8BEu4QCCwgHHvsdOo2+FfSzFwpm6WYFSYuNdTg+iNhQ8c YmA0N+5ToJf0y9QKKwn3+3LSgPgeCsBpeUrbZuLgaxAK4H6St2sEVFcCdBwqEt7KjPgR 2d/MR7DEE2ePWWLceXGhpCSlRiKvSEIpJrIeKEeRfEw1eo5BoeykBIAmFZJbphO2j+wS x7AAqRDNjWvPINV97FpjA2t8PWVf/RVo6BU+ryCc67hR8+pcl8DOLwa45CNbzbXGDCEx U5rA== X-Gm-Message-State: AOJu0YyZUvTiTO0GrHVkts/FE8QWpQLMbq1p6gnvsQoNacpVkweJlDjg ra7HsRbRSnZKnz8xNmddjpjiN5QURQ/iGg== X-Google-Smtp-Source: AGHT+IFdf8d7ARlg+/6A3aJ6jdPtjsO/m2QYbO/5U+hj3MUBrRAEbY5xxRngU+8NXNT9sFDS5qPsIQ== X-Received: by 2002:a05:6000:136e:b0:32d:9fe3:6e4c with SMTP id q14-20020a056000136e00b0032d9fe36e4cmr297181wrz.47.1697673614732; Wed, 18 Oct 2023 17:00:14 -0700 (PDT) Received: from localhost ([137.220.119.58]) by smtp.gmail.com with ESMTPSA id t1-20020a5d6a41000000b0032d9efeccd8sm3151165wrw.51.2023.10.18.17.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 17:00:14 -0700 (PDT) From: luca.boccassi@gmail.com To: Jiawen Wu Cc: dpdk stable Subject: patch 'net/txgbe: keep link down after device close' has been queued to stable release 20.11.10 Date: Thu, 19 Oct 2023 00:59:04 +0100 Message-Id: <20231018235930.3144-15-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018235930.3144-1-luca.boccassi@gmail.com> References: <20231018235930.3144-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 20.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 10/21/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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/e63070e90eea6d00e57b4174767da9fe77b586a8 Thanks. Luca Boccassi --- >From e63070e90eea6d00e57b4174767da9fe77b586a8 Mon Sep 17 00:00:00 2001 From: Jiawen Wu Date: Thu, 28 Sep 2023 17:47:54 +0800 Subject: [PATCH] net/txgbe: keep link down after device close [ upstream commit 409a08c34fd20a25dd209438f52cb38ace081b19 ] When the port is closed, hardware is reset to power on. And txgbe_dev_stop() is just returned 0 to avoid secondary calls, so that the link led remains on. Fix this bug by adding to turn off the copper/laser. Fixes: e0d876ef6bbc ("net/txgbe: support device stop and close") Signed-off-by: Jiawen Wu --- drivers/net/txgbe/txgbe_ethdev.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index b4d023aefc..c2f2f5c323 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -1668,7 +1668,7 @@ txgbe_dev_stop(struct rte_eth_dev *dev) int vf; if (hw->adapter_stopped) - return 0; + goto out; PMD_INIT_FUNC_TRACE(); @@ -1687,14 +1687,6 @@ txgbe_dev_stop(struct rte_eth_dev *dev) for (vf = 0; vfinfo != NULL && vf < pci_dev->max_vfs; vf++) vfinfo[vf].clear_to_send = false; - if (hw->phy.media_type == txgbe_media_type_copper) { - /* Turn off the copper */ - hw->phy.set_phy_power(hw, false); - } else { - /* Turn off the laser */ - hw->mac.disable_tx_laser(hw); - } - txgbe_dev_clear_queues(dev); /* Clear stored conf */ @@ -1724,6 +1716,16 @@ txgbe_dev_stop(struct rte_eth_dev *dev) hw->adapter_stopped = true; dev->data->dev_started = 0; +out: + /* close phy to prevent reset in dev_close from restarting physical link */ + if (hw->phy.media_type == txgbe_media_type_copper) { + /* Turn off the copper */ + hw->phy.set_phy_power(hw, false); + } else { + /* Turn off the laser */ + hw->mac.disable_tx_laser(hw); + } + return 0; } -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-10-19 00:28:56.989252585 +0100 +++ 0015-net-txgbe-keep-link-down-after-device-close.patch 2023-10-19 00:28:56.221804627 +0100 @@ -1 +1 @@ -From 409a08c34fd20a25dd209438f52cb38ace081b19 Mon Sep 17 00:00:00 2001 +From e63070e90eea6d00e57b4174767da9fe77b586a8 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 409a08c34fd20a25dd209438f52cb38ace081b19 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index e789e34c01..2dad820cb5 100644 +index b4d023aefc..c2f2f5c323 100644 @@ -23,2 +24,2 @@ -@@ -1929,7 +1929,7 @@ txgbe_dev_stop(struct rte_eth_dev *dev) - struct txgbe_tm_conf *tm_conf = TXGBE_DEV_TM_CONF(dev); +@@ -1668,7 +1668,7 @@ txgbe_dev_stop(struct rte_eth_dev *dev) + int vf; @@ -32 +33 @@ -@@ -1953,14 +1953,6 @@ txgbe_dev_stop(struct rte_eth_dev *dev) +@@ -1687,14 +1687,6 @@ txgbe_dev_stop(struct rte_eth_dev *dev) @@ -47 +48,2 @@ -@@ -1991,6 +1983,16 @@ txgbe_dev_stop(struct rte_eth_dev *dev) +@@ -1724,6 +1716,16 @@ txgbe_dev_stop(struct rte_eth_dev *dev) + hw->adapter_stopped = true; @@ -49 +50,0 @@ - hw->dev_start = false;