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 1FDA6A0540 for ; Thu, 7 Jul 2022 09:57:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1B8C941147; Thu, 7 Jul 2022 09:57:49 +0200 (CEST) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 68DD3406B4 for ; Thu, 7 Jul 2022 09:57:48 +0200 (CEST) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id F19DB3F04C for ; Thu, 7 Jul 2022 07:57:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1657180667; bh=1QhK0c9l0OwNf0ZvMg06SXR1QuefoiyDfOkjhbIF91w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZSoYSMyzBgH5UM2VIIVyxmhrKCqqegv7SgmtUu4qiPQFe8JoxW4YKOwptQVr4nHuE uIPAu6+np67hyztX5eRQDtwnNXX+9n7DPGInz11rdMCDNcsQcoz2dU7+3SaZKGEmSx rC53gydUlI2kelM+hlCwJT5OYL4LL6sPqVp574lsjyZx7cTIv2P3QdhEhGVsICjvh2 jtQZQ4FHuQLlmffOn3+RPDaSVpkTfM70P3TP2i7366Hqa2T1a5n3vMoyj8THUGVNQl 5+ZIUahdn6ShhDt8++5uqkn6cM9JEf968HYGkEQc2PfJsnnzWDUkSpDG2h02TxGn48 SkkZ7Ppphmx+Q== Received: by mail-ed1-f69.google.com with SMTP id y5-20020a056402358500b0043592ac3961so13165093edc.6 for ; Thu, 07 Jul 2022 00:57:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1QhK0c9l0OwNf0ZvMg06SXR1QuefoiyDfOkjhbIF91w=; b=ZTQR9dhaLhZ0pj4y/ZjfMATfg8H0ZVe/Eej/MXGWP2ikzQnfeXlihMsMr1/f82yDSM FYExav0SQB3ViFrxo1lqL96I0BgvXnJmcYeBzmXk13fi025RWCU+vMUyhXskKR5cDVrj pPqK858Sh/2bSKMBV/yexLQaST4+2XEETWZqtcRkV9ifMtOZsGbnnoZIKBODZWfKyp+K gajnKrNBzHhT19ffFzIAU9UZXetqLu4mdV/ZAn4gOsJHtW8bfqWik3Rv1Ikpc1t1kZ8s 7+By0F1LjylLzH98gBWcjI+M8vOoIufkY1DYACauSokWy6iBUYkb38sy5D3uNfICZAEb 0T2A== X-Gm-Message-State: AJIora99J8fMHSXHOFP+1C1a5XQhOmpmkDA00Iy30EKfqe+wACAbIaiu Y6zd3R4ivXECfb7HLY1rMcYxucdWrY/LktmkXgfOA2PW9JD5t5OAHrhapMzE3NZSkbFgO+YAZlc IBKTCqlyTTSSSGgw9Y9hDcnbR X-Received: by 2002:a17:907:2716:b0:72a:9098:e4c9 with SMTP id w22-20020a170907271600b0072a9098e4c9mr32069310ejk.324.1657180667724; Thu, 07 Jul 2022 00:57:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uzCKFw/y+yzuH1veHZ4LZUzcnyQvB45iQQiqGEagI3SSvU5eHfJTZu5JrEJ7DNeyEouOwS1A== X-Received: by 2002:a17:907:2716:b0:72a:9098:e4c9 with SMTP id w22-20020a170907271600b0072a9098e4c9mr32069296ejk.324.1657180667463; Thu, 07 Jul 2022 00:57:47 -0700 (PDT) Received: from Keschdeichel.fritz.box ([2a02:6d40:3a4f:7b00:c19b:938e:7c97:afe2]) by smtp.gmail.com with ESMTPSA id d1-20020a056402516100b0043a09f6fc24sm11385793ede.47.2022.07.07.00.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Jul 2022 00:57:47 -0700 (PDT) From: christian.ehrhardt@canonical.com To: Jeff Daly Cc: Qi Zhang , dpdk stable Subject: patch 'net/ixgbe: add option for link up check on pin SDP3' has been queued to stable release 19.11.13 Date: Thu, 7 Jul 2022 09:54:41 +0200 Message-Id: <20220707075522.194223-46-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220707075522.194223-1-christian.ehrhardt@canonical.com> References: <20220707075522.194223-1-christian.ehrhardt@canonical.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 19.11.13 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/09/22. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/2ed9b68967bc8e8ec3e0af4aa046ffac911ab8d7 Thanks. Christian Ehrhardt --- >From 2ed9b68967bc8e8ec3e0af4aa046ffac911ab8d7 Mon Sep 17 00:00:00 2001 From: Jeff Daly Date: Tue, 10 May 2022 14:57:25 -0400 Subject: [PATCH] net/ixgbe: add option for link up check on pin SDP3 [ upstream commit 0f9fb100f6c6ed1dcadaf76352f4b4f2bd5501f6 ] 1ca05831b9b added a check that SDP3 (used as a TX_DISABLE output to the SFP cage on these cards) is not asserted to avoid incorrectly reporting link up when the SFP's laser is turned off. ff8162cb957 limited this workaround to fiber ports This patch: * Adds devarg 'fiber_sdp3_no_tx_disable' not all fiber ixgbe devs use SDP3 as TX_DISABLE Fixes: 1ca05831b9b ("net/ixgbe: fix link status") Fixes: ff8162cb957 ("net/ixgbe: fix link status") Signed-off-by: Jeff Daly Acked-by: Qi Zhang --- doc/guides/nics/ixgbe.rst | 17 ++++++++++++++ drivers/net/ixgbe/ixgbe_ethdev.c | 39 +++++++++++++++++++++++++++++++- drivers/net/ixgbe/ixgbe_ethdev.h | 3 +++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/doc/guides/nics/ixgbe.rst b/doc/guides/nics/ixgbe.rst index 6ca2a33f09..8305bf0dbb 100644 --- a/doc/guides/nics/ixgbe.rst +++ b/doc/guides/nics/ixgbe.rst @@ -82,6 +82,23 @@ To guarantee the constraint, capabilities in dev_conf.rxmode.offloads will be ch fdir_conf->mode will also be checked. +Disable SDP3 TX_DISABLE for Fiber Links +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The following ``devargs`` option can be enabled at runtime. It must +be passed as part of EAL arguments. For example, + +.. code-block:: console + + dpdk-testpmd -a fiber_sdp3_no_tx_disable=1 -- -i + +- ``fiber_sdp3_no_tx_disable`` (default **0**) + + Not all IXGBE implementations with SFP cages use the SDP3 signal as + TX_DISABLE as a means to disable the laser on fiber SFP modules. + This option informs the driver that in this case, SDP3 is not to be + used as a check for link up by testing for laser on/off. + VF Runtime Options ^^^^^^^^^^^^^^^^^^ diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index b06ff64faa..65d81c6cec 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -128,6 +128,13 @@ #define IXGBE_EXVET_VET_EXT_SHIFT 16 #define IXGBE_DMATXCTL_VT_MASK 0xFFFF0000 +#define IXGBE_DEVARG_FIBER_SDP3_NOT_TX_DISABLE "fiber_sdp3_no_tx_disable" + +static const char * const ixgbe_valid_arguments[] = { + IXGBE_DEVARG_FIBER_SDP3_NOT_TX_DISABLE, + NULL +}; + #define IXGBEVF_DEVARG_PFLINK_FULLCHK "pflink_fullchk" static const char * const ixgbevf_valid_arguments[] = { @@ -381,6 +388,8 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, static int ixgbe_filter_restore(struct rte_eth_dev *dev); static void ixgbe_l2_tunnel_conf(struct rte_eth_dev *dev); static int ixgbe_wait_for_link_up(struct ixgbe_hw *hw); +static int devarg_handle_int(__rte_unused const char *key, const char *value, + void *extra_args); /* * Define VF Stats MACRO for Non "cleared on read" register @@ -1085,6 +1094,29 @@ ixgbe_swfw_lock_reset(struct ixgbe_hw *hw) ixgbe_release_swfw_semaphore(hw, mask); } +static void +ixgbe_parse_devargs(struct ixgbe_adapter *adapter, + struct rte_devargs *devargs) +{ + struct rte_kvargs *kvlist; + uint16_t sdp3_no_tx_disable; + + if (devargs == NULL) + return; + + kvlist = rte_kvargs_parse(devargs->args, ixgbe_valid_arguments); + if (kvlist == NULL) + return; + + if (rte_kvargs_count(kvlist, IXGBE_DEVARG_FIBER_SDP3_NOT_TX_DISABLE) == 1 && + rte_kvargs_process(kvlist, IXGBE_DEVARG_FIBER_SDP3_NOT_TX_DISABLE, + devarg_handle_int, &sdp3_no_tx_disable) == 0 && + sdp3_no_tx_disable == 1) + adapter->sdp3_no_tx_disable = 1; + + rte_kvargs_free(kvlist); +} + /* * This function is based on code in ixgbe_attach() in base/ixgbe.c. * It returns 0 on success. @@ -1145,6 +1177,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) } rte_atomic32_clear(&ad->link_thread_running); + ixgbe_parse_devargs(eth_dev->data->dev_private, + pci_dev->device.devargs); rte_eth_copy_pci_info(eth_dev, pci_dev); /* Vendor and Device ID need to be set before init of shared code */ @@ -4321,7 +4355,8 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, return rte_eth_linkstatus_set(dev, &link); } - if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) { + if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber && + !ad->sdp3_no_tx_disable) { esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); if ((esdp_reg & IXGBE_ESDP_SDP3)) link_up = 0; @@ -9183,6 +9218,8 @@ ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev) RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe, pci_id_ixgbe_map); RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe, "* igb_uio | uio_pci_generic | vfio-pci"); +RTE_PMD_REGISTER_PARAM_STRING(net_ixgbe, + IXGBE_DEVARG_FIBER_SDP3_NOT_TX_DISABLE "=<0|1>"); RTE_PMD_REGISTER_PCI(net_ixgbe_vf, rte_ixgbevf_pmd); RTE_PMD_REGISTER_PCI_TABLE(net_ixgbe_vf, pci_id_ixgbevf_map); RTE_PMD_REGISTER_KMOD_DEP(net_ixgbe_vf, "* igb_uio | vfio-pci"); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h index e406b754e8..77ed07cf4c 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.h +++ b/drivers/net/ixgbe/ixgbe_ethdev.h @@ -509,6 +509,9 @@ struct ixgbe_adapter { /* For RSS reta table update */ uint8_t rss_reta_updated; + /* Used for limiting SDP3 TX_DISABLE checks */ + uint8_t sdp3_no_tx_disable; + /* Used for VF link sync with PF's physical and logical (by checking * mailbox status) link status. */ -- 2.37.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-07 09:54:13.118996628 +0200 +++ 0046-net-ixgbe-add-option-for-link-up-check-on-pin-SDP3.patch 2022-07-07 09:54:10.929824395 +0200 @@ -1 +1 @@ -From 0f9fb100f6c6ed1dcadaf76352f4b4f2bd5501f6 Mon Sep 17 00:00:00 2001 +From 2ed9b68967bc8e8ec3e0af4aa046ffac911ab8d7 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0f9fb100f6c6ed1dcadaf76352f4b4f2bd5501f6 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -29 +30 @@ -index 82fa453fa2..ad1a3da610 100644 +index 6ca2a33f09..8305bf0dbb 100644 @@ -32 +33 @@ -@@ -101,6 +101,23 @@ To guarantee the constraint, capabilities in dev_conf.rxmode.offloads will be ch +@@ -82,6 +82,23 @@ To guarantee the constraint, capabilities in dev_conf.rxmode.offloads will be ch @@ -57 +58 @@ -index 2da3f67bbc..f31bbb7895 100644 +index b06ff64faa..65d81c6cec 100644 @@ -74 +75 @@ -@@ -348,6 +355,8 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, +@@ -381,6 +388,8 @@ static int ixgbe_dev_udp_tunnel_port_del(struct rte_eth_dev *dev, @@ -83 +84 @@ -@@ -1032,6 +1041,29 @@ ixgbe_swfw_lock_reset(struct ixgbe_hw *hw) +@@ -1085,6 +1094,29 @@ ixgbe_swfw_lock_reset(struct ixgbe_hw *hw) @@ -113 +114 @@ -@@ -1095,6 +1127,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) +@@ -1145,6 +1177,8 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) @@ -120 +120,0 @@ - eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; @@ -122 +122,2 @@ -@@ -4261,7 +4295,8 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, + /* Vendor and Device ID need to be set before init of shared code */ +@@ -4321,7 +4355,8 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, @@ -132 +133 @@ -@@ -8250,6 +8285,8 @@ ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev) +@@ -9183,6 +9218,8 @@ ixgbe_dev_macsec_register_disable(struct rte_eth_dev *dev) @@ -142 +143 @@ -index 69e0e82a5b..cc6049a66a 100644 +index e406b754e8..77ed07cf4c 100644 @@ -145 +146 @@ -@@ -501,6 +501,9 @@ struct ixgbe_adapter { +@@ -509,6 +509,9 @@ struct ixgbe_adapter {