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 20EC6A0555 for ; Thu, 9 Jun 2022 13:38:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 11FC740220; Thu, 9 Jun 2022 13:38:31 +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 9D80940220 for ; Thu, 9 Jun 2022 13:38:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654774708; 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=OOtU6lqlr2d3gxKRb8CGrrGmTh0ZAGyDiUzAvez5K4s=; b=GYmWV4NxbL3ufD8QGGZxaPdK08hL0ZoxTWXGH3phmNPzRS+Gl4YmRcJ2XN9DZWywt99knm 5i6VPBbamXR3YTryi8dl13DWzmOPZYc5nrF92FInNdva8I62SZT5M0bwb39kJBm1KxrTMi 6ZucJrdPVB+SXJQjjdLsmTJk9hJZqs8= 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-493-IgP59eF8NnWVF2AUZ-QnXQ-1; Thu, 09 Jun 2022 07:38:27 -0400 X-MC-Unique: IgP59eF8NnWVF2AUZ-QnXQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A19680B70B; Thu, 9 Jun 2022 11:38:27 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.195.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEC8618EA4; Thu, 9 Jun 2022 11:38:26 +0000 (UTC) From: Kevin Traynor 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 21.11.2 Date: Thu, 9 Jun 2022 12:36:43 +0100 Message-Id: <20220609113701.386938-56-ktraynor@redhat.com> In-Reply-To: <20220609113701.386938-1-ktraynor@redhat.com> References: <20220609113701.386938-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com 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.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/13/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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/5115fe4013c28b14ad576660ce8f66aa1151aa5b Thanks. Kevin --- >From 5115fe4013c28b14ad576660ce8f66aa1151aa5b 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 82fa453fa2..ad1a3da610 100644 --- a/doc/guides/nics/ixgbe.rst +++ b/doc/guides/nics/ixgbe.rst @@ -102,4 +102,21 @@ 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 052fdb9639..31d06b6110 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -129,4 +129,11 @@ #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" @@ -349,4 +356,6 @@ 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); /* @@ -1033,4 +1042,27 @@ ixgbe_swfw_lock_reset(struct ixgbe_hw *hw) } +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. @@ -1096,4 +1128,6 @@ 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); eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; @@ -4266,5 +4300,6 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, } - 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)) @@ -8255,4 +8290,6 @@ 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); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h index 69e0e82a5b..cc6049a66a 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.h +++ b/drivers/net/ixgbe/ixgbe_ethdev.h @@ -502,4 +502,7 @@ struct ixgbe_adapter { 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.34.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-09 12:34:31.047793437 +0100 +++ 0056-net-ixgbe-add-option-for-link-up-check-on-pin-SDP3.patch 2022-06-09 12:34:29.778980697 +0100 @@ -1 +1 @@ -From 0f9fb100f6c6ed1dcadaf76352f4b4f2bd5501f6 Mon Sep 17 00:00:00 2001 +From 5115fe4013c28b14ad576660ce8f66aa1151aa5b Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 0f9fb100f6c6ed1dcadaf76352f4b4f2bd5501f6 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -55 +56 @@ -index 2da3f67bbc..f31bbb7895 100644 +index 052fdb9639..31d06b6110 100644 @@ -112 +113 @@ -@@ -4262,5 +4296,6 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, +@@ -4266,5 +4300,6 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, @@ -120 +121 @@ -@@ -8251,4 +8286,6 @@ RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd); +@@ -8255,4 +8290,6 @@ RTE_PMD_REGISTER_PCI(net_ixgbe, rte_ixgbe_pmd);