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 9EE57A04FF for ; Tue, 12 Apr 2022 19:35:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 98408427FB; Tue, 12 Apr 2022 19:35:03 +0200 (CEST) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130110.outbound.protection.outlook.com [40.107.13.110]) by mails.dpdk.org (Postfix) with ESMTP id 2A71640E09; Tue, 12 Apr 2022 19:35:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lB9M6gdni0uLQVXypH3gSAjxVlNPkB25NVfrkRGaOd0pxqR8/Z9CrzB12ddC+xnRi1oqGfGPY9USh6V8FCDiGjiAS3FlZJGh16KbdMhBTxFYbiU6hFJyFaA0ejopMCLu21sXKfm2l1t9WYUCCsGK2vJRlvajWe5kBUulH+gng/lvKkY+I2pHwtvX4sl39EVDlWTaBNxkOgB0AEGg9yy3/Pjqo2aG+OWOAYiVMbmMRAhGkUOs6StJKQIZ+kZ8d1nr0bKqV+PR+8KgmOCCILCxlEQyMGme1mT7Vekjq32TiEwetkgtanZ3yeuAO2V995Xdnk8tvTUjIXoOtoePc3wpGQ== 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=VVa5uVAkMc7ThMUxUs3T/BvY4z+Hbi7eaLzuGd7/ijQ=; b=SAIkTPWjbhnwycFQkASAUSo3unmmVvAzcr65cQ+cfU74K5FhMgAXzVCfM1pUuFzZdwkMJRaXw+E5xw7TU1qpyLCmwh9e7Hlz4yyeCK7psMqx0oIxmbHdV9qtI3HyWZiaKpfxONfBXu0/CgCO4XZtWEztzrJZQ39XLsF5x39g6JlZu4f9oRqfzXuIM7JUhHr/eIX88fS6h7fn6SJQLgA1Di878nf0aBovGFqK6LHxaxmzx1DR5lmpqcuIt9trSAfcNhdlgVd2Awwnz3KKcw6q81Mo0qM5iq2KRnyo/mziJSM50KACRFaL5GNurXu5tSk4jA0jV3e/C8fXJ9NXszDvTA== 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=VVa5uVAkMc7ThMUxUs3T/BvY4z+Hbi7eaLzuGd7/ijQ=; b=R4UdzH75/7psSLmnDJ0zPsuwylAg9upDAOkt5GZ+fQMQdEPsze3lrnY2C88ddnPIexlxozXB5yFhccswQkFmjHV4kUaAN7IKwUv3Pom1a4FDRe4JwA87s/VZ/1cjLOk0fvcYlyd0lJBKPph54831nx0c6Au2GoagS9QaEJoEM8A= 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 PAXPR04MB8912.eurprd04.prod.outlook.com (2603:10a6:102:20f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.30; Tue, 12 Apr 2022 17:35:00 +0000 Received: from VI1PR0402MB3517.eurprd04.prod.outlook.com ([fe80::5dd5:47e1:1cef:cc4e]) by VI1PR0402MB3517.eurprd04.prod.outlook.com ([fe80::5dd5:47e1:1cef:cc4e%6]) with mapi id 15.20.5144.029; Tue, 12 Apr 2022 17:35:00 +0000 From: Jeff Daly To: dev@dpdk.org Cc: stable@dpdk.org, Haiyue Wang , Wei Zhao , Xiaolong Ye , Xiao Zhang , Lunyuan Cui Subject: [PATCH v5 1/2] net/ixgbe: Limit SDP3 check of TX_DISABLE to appropriate devices Date: Tue, 12 Apr 2022 13:34:44 -0400 Message-Id: <20220412173445.30810-2-jeffd@silicom-usa.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220412173445.30810-1-jeffd@silicom-usa.com> References: <20220228152937.21247-1-jeffd@silicom-usa.com> <20220412173445.30810-1-jeffd@silicom-usa.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BLAP220CA0018.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::23) 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: e7bda4f0-0e0b-4c6e-f981-08da1caac4b2 X-MS-TrafficTypeDiagnostic: PAXPR04MB8912: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: nDWoAa0XRVnct2KQMvkBk6aSom0HlTOVGZz09QD+GvvPNqSJ55EHXJ25VOQ/A1LIZGs3cn+N/9oEGjuuCi9ZjnRtpOft9Z3UpeaaO9FCAOJ70AQetDyGgmXoNHAiSIrmfpA+23NHc314EXzihXp8Bp6yN0iqUZJa9ZqsLpULHNxABzBwyMn4cjvXbHcr45Kj8Rw/4GUckNA5Q9zlpVDAw0xy/imFvF5SuK3cvxQVW5ooayUd9bEi92Oi4yKJTD1E1IBGaUXWMszhYboTHll9/XZ7tUj5rCGRxK+JRBNfpmBAWs9n7thJa8AyVgDLC5I0cIL2uKT02TyqXC58VNWnDQGQH7ghAfBeIWFEtMdZdR5SCLU28ANqqQbSYhOuMQ8Z8Uou6XZ/GPf9PcmKypV0kBZ0R5knjYCGfdkT3cI29gDCpcX9NiYW5ZL+PAnj5EOi2mnxYDCyVPTOssj9BIBHElMcuBzRXieySVRXgNQph07/5ySY96EgwVDj2WVOPRDwocGVP4HZG95/h+N9/0Mwhbz6Y3Wzo/nibb/iViK8CnKXdQi8vRVn8TjMWYrIKeCn7iwzBvoqhgcSA3H3gjqUHqjfMjELtmCxHYwCdH6PUHBE6SX6dj4H1zh9rNhdiU29qJ4LV2g6Y+0OXJai1Q90x141ERH6Tr5I6LSpz3Wb+4KR47R8OTm1Geb4MJBICxTaKRNMgQnLfNBrACyFaqTNzQ== 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)(38100700002)(54906003)(2616005)(5660300002)(6666004)(38350700002)(186003)(26005)(52116002)(36756003)(508600001)(66476007)(66556008)(66946007)(8676002)(6506007)(4326008)(6916009)(83380400001)(8936002)(86362001)(1076003)(316002)(6486002)(2906002)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?r/9BKG13H9qXMt9I2JpF7baKohY8hWA8gHYs6VOoxWmQfCQoJbRHvmspgvQr?= =?us-ascii?Q?aaFBMjsKqrM+sCnUJA68oP3E5W3imBC7H7c88oWWLohGv/geWIP2UQap2dUI?= =?us-ascii?Q?9r6NTPjAWL/Bpjj+TmFtsDHgH0O0WewD9p+3eFQF7Us/y0IYbFWRGhJQeZPE?= =?us-ascii?Q?Yf7hZor9JlhszW7Jq5FKABUgrgft3LrCLXBE8UH8M9NEhHTAQRVVJPru3f6g?= =?us-ascii?Q?eMK9oDwaTQpxMo1ZHdFuFxx5NcfX3YFRDXQejtPezBVpVKfEWoZxxcem7C9W?= =?us-ascii?Q?/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bnaGNWI?= =?us-ascii?Q?IBtqJpuNDcs1FFoJ89vUW+6Q6As/qeg5oLeMRyKJI/27kkRZrKRdO6FtRBBC?= =?us-ascii?Q?owWbXqbyvpIaleuiKdvz54yOQx6oCp8t+sPewxBGlMlDYYZdHr/fit537JXj?= =?us-ascii?Q?X90FVejdAeU8gZkh261CDR/MI70D+e9OUvvpqVPNpG0NK94bJ37v7LlhtOns?= =?us-ascii?Q?JNzN5b8oIn8xzq4iA1YVuuyI+he4dDgA3Ar7F0SEDNDMs8Ptc9mJLfRG1V2E?= =?us-ascii?Q?yWFPr7ycWVqi7/hh+a9DdzVSmXYEziBHaDrNxcUs+BwRIM/XbCjd9+CmnbQP?= =?us-ascii?Q?Wv/oR3IwfRIBaznEuggInCorbO8yjISxy0cACK1W0proJYuLBoUjNTkH2VfX?= =?us-ascii?Q?NyCbnyfUnNrbQKJBK57tMrNfzcfBkYcVsa7lwoUoqqfrSQcERCFuDuiqjqYi?= =?us-ascii?Q?CoNunx1Vuw19a2lCQJSfTNNJZLU3LBVC+KZhLrH4ZdKQCdL6DCrBhgWB/qA/?= =?us-ascii?Q?TbKla6JcQVyh8jEFbGi2jNP2kJyqeS6/LqwSX8myHIHygjx8iuaC3h8at9sU?= =?us-ascii?Q?z58P1t7dxA=3D=3D?= X-OriginatorOrg: silicom-usa.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7bda4f0-0e0b-4c6e-f981-08da1caac4b2 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3517.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2022 17:34:59.7678 (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: ByHunvCcu3iDRsAu80S6RqmZT4Bce/WtktZ3qNfqmy26CuB1VJymZWA47Dn3cCSmL76Tpbo9rjk4eWObi4i9eQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8912 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 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 --- drivers/net/ixgbe/ixgbe_ethdev.c | 39 +++++++++++++++++++++++++++++++- drivers/net/ixgbe/ixgbe_ethdev.h | 3 +++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 2da3f67bbc..596ea769ae 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 69e0e82a5b..cc6049a66a 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