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 E2F94A0505; Tue, 12 Apr 2022 19:42:39 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3BD54427F1; Tue, 12 Apr 2022 19:42:37 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2102.outbound.protection.outlook.com [40.107.21.102]) by mails.dpdk.org (Postfix) with ESMTP id 9F7E7410DD; Tue, 12 Apr 2022 19:42:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SdzX/ND0qHM4K+bX1u56AwkCpveOWFrZUPkKTrCiJRR///RipdjhYYz/zogqTOkDTdQ8DeQn9pGa6lnjj328bpky7BkKKP3DPRqcDus1SlthluSWk6ngnFciwZ1xvNpvLxnjFsmbk0fK36u/3/og/51zkEM3soMx6k3sI99YEO3gbny7S0YiaXXJ/XkX/4wNeCrcxjwdejqBHke9S4zEuZoncj65QvtPd9hKtvQc/ppWLVJ//HTEgiHgMBvadRLWakN06ejidBaKk3qqqi/czbRc+LxzVRXEbRxoxlv0SSOjg8T86u/aiP85ffGh2MINc4uZ5iJVXMke4H4qptU0/w== 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=dXYvt4DPszXyZUuMT5PvcQIuS2ReCqqdG3lVgPx3Vjw=; b=D+QswvTPWCN3MNu254TXD9fsxmcIE9QyefvKV/fCnDBE4d1sulr2KfETmhGqYoKqzeKT5S3AgKUlcgkeLVS9fBVXQwtK7uFpne81m2UfRfl5SzuG9DopkiMOE4s0BKK3g4GvEqQ/ICs2+nMcimSgfXgtmrNYUC+NCEbBuqoOlGQiN8ocBBMcZVkREyLdo1c3M0V3QDOGy0RJ9l8ctCpKlatZQIHudCkGUZ2fpPIxrYi96zjrLKHzjukaZSRc/Z177Wk42Kz1QrW6Dv6zsDxokUetu7cyJZNmEHTxuM5jKHqtv3jTtzrGv5q1zMdJ9inEvrKrgTfZCrvNy6MkGp4HsA== 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=dXYvt4DPszXyZUuMT5PvcQIuS2ReCqqdG3lVgPx3Vjw=; b=qOYqt4Tfpn+orkLpv6WdfphJOVDCIW38ReS9xYwQ8dc0m2xjugAS+MjAxdohvnWk97oVl4K8J6mIZl/r5gLuE/VYkhYCLKiL8Ej7ISr2ojCi80KTnLxcSOMDcRIrTvBVimgz9oPfzO4DSv602nXm7gOcXRr8Tkxpcv/mSY6GE/U= 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 DB7PR04MB4539.eurprd04.prod.outlook.com (2603:10a6:5:36::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Tue, 12 Apr 2022 17:42:33 +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:42:33 +0000 From: Jeff Daly To: dev@dpdk.org Cc: stable@dpdk.org, Haiyue Wang , Xiaolong Ye , Xiao Zhang , Wei Zhao , Lunyuan Cui Subject: [PATCH v6 1/2] net/ixgbe: Limit SDP3 check of TX_DISABLE to appropriate devices Date: Tue, 12 Apr 2022 13:42:19 -0400 Message-Id: <20220412174220.31195-2-jeffd@silicom-usa.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220412174220.31195-1-jeffd@silicom-usa.com> References: <20220228152937.21247-1-jeffd@silicom-usa.com> <20220412174220.31195-1-jeffd@silicom-usa.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MN2PR08CA0012.namprd08.prod.outlook.com (2603:10b6:208:239::17) 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: 12e60945-364a-44b7-3ccf-08da1cabd334 X-MS-TrafficTypeDiagnostic: DB7PR04MB4539: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: bgods7ka8T80P6B4Ee5WzWnmdXycchuXfJc2QXYDIUo4CbakAWvBVpZZNIc5vp1IO4dJSTaQ5UIjr07kvnQpNnPZm394L6r/0NvuE/zKoexVge1qdTR3zDSLMwtGFicBTbz0YR1w7CUzf76tUenhndVpLPWjT5iW2P0j72oqqEPJMzzASnS5m9dL5ovb8L5/zzRK4qGnX6CtATQf1gvNZu1HoB84zJiuG6vJCALOyC1+Tx3OtjFlNOpfR60vCI7kbJR0paPZKen/jBiLQOTcy/fZy+CtvwwPQIZq29uURsY0Sn/wRdveOzR9vzGHA/UivznzVlHtdEAcOpk7vNbUcE57koVUH8D+/HIc8IzCYrlrvj4Y0uyd2J6D5wbktfV6qUXtxgH/flPL8zt6BfQxXGUYoOw7sDmmAF9mwPsR0HKIMGnJ1fdOmBa9qk2rKOefVgc73/0wFoZjpwv8X8XCZqWTJ82PrT5o6vfEgH/8FPXI5lLmVx2YEom7NzVRJBl0gsI2nz0OUdUsDdNzxz8gpLExOB0a6ML7BOkHVJzetn4cdGxhn6EGr+jR9oon2ENTwFeX2AQUMdjKZPKG8GeeotlNNzecIWRYOvd6DzOFOgr5j1zuOKUNnlpALO1Y05Vkj5jPKId5tUHFfCrWWWnGCPqT0KZcHdlWeJWpKOgYofNi3Hgzm0uZlSEau8BPkd/mTlFPddAv5yfFTM7RqnG//A== 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)(5660300002)(8676002)(6486002)(4326008)(6666004)(52116002)(508600001)(38350700002)(38100700002)(66946007)(8936002)(6512007)(6506007)(66476007)(66556008)(2906002)(86362001)(1076003)(2616005)(6916009)(186003)(26005)(54906003)(36756003)(316002)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?5ApKxeneTgtT6jgNHQZezVY2WeyfkwVgZh7lmcy7pNrl4nHFcdT6XmPqnhq4?= =?us-ascii?Q?mWUs8zRUehIbC9YZxAYiTw0ne0GOfKarJRLPupQkh4jZUw39ZFKJRVBU0V7H?= =?us-ascii?Q?I98PJgHtJcW2ElIpz17IbpVVm/wTsKT4e/DxTy7i2trw4WsgSQs9dVWJUn3n?= =?us-ascii?Q?8R+PQXB2z9mJ72M3ip1Lky9U5RU32rs3pN+hGuretSzumw3bbk6rJx1uF3Gy?= =?us-ascii?Q?wiFXwCvq1fgoETbDv6jQfaaBKd9rAyDwuGtEgu9WawSEhlvqghw1eqY8V1GR?= =?us-ascii?Q?rw1TcyxwserGw7SGWRi6CL1MBSptic67v8c+N18Jg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DATrJuoPW4BI0emtVlraOD4g8wVx59ngBxt1NM1XX3i+RqY4a6tWVpi?= =?us-ascii?Q?G+tDAf5/bnA576Le/VmOMNcsJcIArzeiQXg+MCtF5/yQs+5o8/12X9gJ8emx?= =?us-ascii?Q?ttcbKYg/t5PJ5elvqXKsaRM/D09jg7HiFRHL+T3P0v1wFUJGYb6GfrRWK45Y?= =?us-ascii?Q?jEzpotkAvr2NT51VwdFUVEGD4cLFlmK3ytsyjxBebfkxXmPv8L7EgzNMJx72?= =?us-ascii?Q?bduZeykliv6auzQRElnP7++IVJ6cdfnrJOAIu1qKUbJn7gOOU71y6DVh5S9/?= =?us-ascii?Q?X5sENLQuoh8pFTvUMyVYH178rG+D6zPWBXDK7DCudBh73EfYydYnDI48d4Qv?= =?us-ascii?Q?MjoeqanixJTb6ORgzChFO+toPNxNSpVsSh2W9yufr57/jvGWMmqtHOmWvT1w?= =?us-ascii?Q?HnrgL4H24HPhfmYe2SJ7Zk0d/pNcNHYnkCAPlalQ6va2zsYGBzJAeWnWGqSw?= =?us-ascii?Q?mVGGBVkZiaC0Nw+4Qny5NR/CXuiZ9HinmVv4H0JOuebvmOLC0o5RvW5M/Xh1?= =?us-ascii?Q?uEP8lsdglA=3D=3D?= X-OriginatorOrg: silicom-usa.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12e60945-364a-44b7-3ccf-08da1cabd334 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:42:33.5841 (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: OCHH39FKmKzMC8z9UBuTMsTezUylM/HPo4D5ECJuqd1kj4joTJGSVYofpQJQwIKFtQFs32wrlurEO102+bHMoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4539 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 --- 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..f31bbb7895 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