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 F2D77A0093; Tue, 10 May 2022 20:57:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4F40841156; Tue, 10 May 2022 20:57:44 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2137.outbound.protection.outlook.com [40.107.22.137]) by mails.dpdk.org (Postfix) with ESMTP id 6BDB7406B4; Tue, 10 May 2022 20:57:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Eq/vg74bSOf9ZxRVpHIlBDvfSv/rTP0lnOgNdaroxIDSrgQPAHwf2wuVxSqnnpUBMTrtJ8wcWMqaRaaQoP81mKoBWKzoFkPIgzfapw9/E2RK2QOpdY9MukcS02mFPuz56CRiJeEP39dBxiplAaa8afAdBb44j7S3IcOlRtB9Qo4IFdIlAups64b+4AT9y9TiDqKfaUMRQ8k0/5LEWSaPuHVYLFile6V0PZYTaJSSNCkTwdjzJrc0W9mQ12UjXfommHnRvrO5LTkm+Qzk0vFeLFgaHPYglP/mEJIbA3f0bd+/4tCp2LbLpGwWpTDQnL8dPz1szQFa+6UwpiCr/zpHeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=gvTqSpChygxmsrJ9FAOlGQlMPbk7YEzkO5YiZ5F5Y/c=; b=Y39+H7Tdv7IyfdJ7fw5mGZRWnalD31TVy85P4j9X815QvWCRe7H+hfcXPjkwaEiBxc6k9xVepcqymFKzCtLVxz64qqTSMfRT86t9ou70ykR7vexsbYAKir+OQr+ZpfksK/sStX7NaEZ7lYSqBkr0I9roKX2NBEDrKAtY5FKJBhmYEniZUVIv7cnlNToBp61xAUbsklK6oSQ3dFrALql9kr0j9p3ttIViMopWnmrNbmji8xuglTKfQlfb+ZV6JXS1miBtJGcgUgFSMageLo07nH2I3ZoO/KpVlQY3mx4DKKOi1gemey+xZtsgScrrH/tSijNlok6IPIxHXjn0/n+hIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silicom-usa.com; dmarc=pass action=none header.from=silicom-usa.com; dkim=pass header.d=silicom-usa.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SILICOMLTD.onmicrosoft.com; s=selector2-SILICOMLTD-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gvTqSpChygxmsrJ9FAOlGQlMPbk7YEzkO5YiZ5F5Y/c=; b=UPpwhUInYGNOo1Z9wqyIP9fYlxXmmxfYV08yMy5/x+3M11UwDX6a4qnpAz7xxWCEUqcGHL0OX0jj9zfdp4EHShtIhSKDs1GUaN1xUP/H7NwbX9Se7jsKqhRXC93Olq2bzf9Wxuzlj0MJmaAQDTOHhDgFZEs/SgV/Xlz1o4hIXE0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silicom-usa.com; Received: from VI1PR0402MB3517.eurprd04.prod.outlook.com (2603:10a6:803:b::16) by VE1PR04MB7310.eurprd04.prod.outlook.com (2603:10a6:800:1a2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23; Tue, 10 May 2022 18:57:41 +0000 Received: from VI1PR0402MB3517.eurprd04.prod.outlook.com ([fe80::71c2:8a66:2a97:a0b9]) by VI1PR0402MB3517.eurprd04.prod.outlook.com ([fe80::71c2:8a66:2a97:a0b9%5]) with mapi id 15.20.5227.023; Tue, 10 May 2022 18:57:40 +0000 From: Jeff Daly To: Qiming Yang , Wenjun Wu , Wei Zhao , Xiao Zhang , Xiaolong Ye , Lunyuan Cui Cc: dev@dpdk.org, stable@dpdk.org Subject: [PATCH] net/ixgbe: Limit SDP3 check of TX_DISABLE to appropriate devices Date: Tue, 10 May 2022 14:57:25 -0400 Message-Id: <20220510185725.27001-1-jeffd@silicom-usa.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BL1PR13CA0319.namprd13.prod.outlook.com (2603:10b6:208:2c1::24) To VI1PR0402MB3517.eurprd04.prod.outlook.com (2603:10a6:803:b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7db9f659-dce3-49a4-f96a-08da32b6f52b X-MS-TrafficTypeDiagnostic: VE1PR04MB7310:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ETtAV7CzJZpIlVI5xdGUbJIWAG1ACHVQkMBhY+5xg5a47r3l6WCB5cDryxE55mE4tHm6TbnGnEXfM+jXNK0Fyf8NM7f/1bYnKpNIKwmnt0sBqEf4O0hcZyTynkdY+skzf4BsyLimlWy1CKt42XS3BqVwvxYrhBhAxeqlL1EesE84xP9BVT1g9Xdb2Zdo4bED7sKWA7PZZukj/CSfINXGZPKV+HzU59idBKzJgvOZeH4GBTYGXHGD0uZDJOAphILSEcFcpN6Lg9i51/uK0dqDY/uwt3vOq+3yNFN4WWDreXBquZvXIBoOq5nBZhNZqkc/phEhK5ULcg5aY0DEuUCflLEpJQ0PV2V0FzV8o2tIrQCFbevJ19/WjhyglNWkP+HLqWUSHMCGlqbY4HX567gmbqiDwS8RvLoP83Fal7AkKY+hiK21Lim2UVtanb6SC4PCGsbZtupuk7NCVo5mYney9+d5NwjXImiffNdTWvuaVK667O9dhYPzFZKxdi4HaU4BQMm82kr/HF+VAq1j/261oaEzhKnuyCRukGKCcvA6/zJllwN51tMCi7e4gHU+Lx3P7bdIylsg9/NXZjLKeN64h29h69aA4EwlWRkiCvCsQs+0CKowbtbY9ckA/rMWBrvCUwDDnIcCdLXJoKeR907PxSvV8hFLbyibYdNtAerbuWrTinQnwhawFvtUWqHXsNZZ80XyRy7zJhQyNmtun5XYHQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3517.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(1076003)(186003)(6512007)(86362001)(5660300002)(26005)(8936002)(4326008)(8676002)(66476007)(38100700002)(2906002)(66946007)(66556008)(83380400001)(2616005)(6486002)(6506007)(52116002)(508600001)(36756003)(6666004)(316002)(38350700002)(110136005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?4W6NZM2o4+0RsJFeX9I+g3+jFh45AgEyQ8BtTWHgTwJHbN37/vaUB0TQVstL?= =?us-ascii?Q?92StzAnsUghmoUvTHxJnA2nWqFdS+ZklTH0bCF3uJcmhuSqgl4vFjsWc9TTg?= =?us-ascii?Q?Y1LuTFYQxisINo83B/3C2gXVPWwVve/3takp3uhPFDW4dpp4VRyKwoVpJhRt?= =?us-ascii?Q?mn6atxUjQJ0QJAahg9KBKTnI73omQNcHbwigWKi5e39QqdFO2vhxcug68zAm?= =?us-ascii?Q?YogfDDaH7eDS/l1AepEKpNFPG8pIKmdbgCqSrGxz0epF53JsscVJgFPFjtSI?= =?us-ascii?Q?hjYRCeXkL1kS9nkdnnd/67xbBv4G+ADUc+29/qThNZ6O3JZVn2/6abg6ipIC?= =?us-ascii?Q?yvzW0oqOE9BvwI8SI6L4K3G3gECPesEILOJ4ULP9NeHG12C64bE1f6CNWWLm?= =?us-ascii?Q?SMuL9h3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uiz54WpBK?= =?us-ascii?Q?ehjib5HzQp7hHhEkEJVsnIDCOizEG/guRfIbX665S+AVqOEvEFzYyEt3kJI7?= =?us-ascii?Q?Kqhj25nyTRoDiiC6cxCVQf/5O9IjZ1ONNvSnpQeChvojjdU1/tl3s72jeg81?= =?us-ascii?Q?jYYuC5k2B17jH86JithMueZAI2MieFrFzq9ioRzEePEG3KgOHIZcFDHMn+oA?= =?us-ascii?Q?0vFxqBgu8bUOQ4jr8lqK2wkMbn6yn4Z5woCRqXi8vkvZ5EhTitq/9BVyLXPb?= =?us-ascii?Q?6w5qbuSQjzLXle16Sec05MfpPlT54zZM3MkoUdOb69RXiHFotaDCcWBeJpnw?= =?us-ascii?Q?mg+Z0e8J3J7oeoMIjHHHcSxo9KXY5j34TjTabIhssNrEWyckLCuEeGBLKBoL?= =?us-ascii?Q?vbe/7T/DmKAm/jcOxjA00yn+ANSKnpT+v9tjK9gJjpuz3rC5DQ9cJzR7YrA1?= =?us-ascii?Q?zZMpAXSR7Q=3D=3D?= X-OriginatorOrg: silicom-usa.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7db9f659-dce3-49a4-f96a-08da32b6f52b X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3517.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2022 18:57:40.7270 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c9e326d8-ce47-4930-8612-cc99d3c87ad1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: X8hA/C1CIoP/0vJm/28dAG27KhLvx0bx6tzDLKzr5O0WNZ3SJglDx5xbnwDJGM7DhJttG5DBETO2lexeirXNSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7310 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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") Cc: stable@dpdk.org Signed-off-by: Jeff Daly --- 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 82fa453fa28e..ad1a3da6101e 100644 --- a/doc/guides/nics/ixgbe.rst +++ b/doc/guides/nics/ixgbe.rst @@ -101,6 +101,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 2da3f67bbc78..f31bbb78956d 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[] = { @@ -348,6 +355,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 @@ -1032,6 +1041,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. @@ -1095,6 +1127,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); eth_dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; @@ -4261,7 +4295,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; @@ -8250,6 +8285,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 69e0e82a5b1a..cc6049a66ad1 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.h +++ b/drivers/net/ixgbe/ixgbe_ethdev.h @@ -501,6 +501,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.25.1