From patchwork Fri Dec 3 22:55:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Douthit X-Patchwork-Id: 104859 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 08D65A0C41; Fri, 3 Dec 2021 23:56:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8B43F42719; Fri, 3 Dec 2021 23:56:01 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2111.outbound.protection.outlook.com [40.107.21.111]) by mails.dpdk.org (Postfix) with ESMTP id 232894014F; Fri, 3 Dec 2021 23:55:59 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CelTMhXbWsYR7AX9d+Lz+msWbZXFsssX3oAUkJX3lMCIS/5q3SM8Uqpcwd2DI4dLdqBMW5gXHfYio/7A2xedzviM3kR80dVUqmffsLF7wU+ybRLHM9qKKdCUxKlaK8KbuVU+giq65Jd1twOAXy/yU8wWDsvAhKO9bUtkPk4LSxrYRnEs1CzPt0M7ozoog9OvLBnIzUkcJkooV9Mqqc1Acv5DdddF532BPLXT/3/Kc2WvUicX6YVBngtWF3M2DyxKZzEKrne4t/IVoW5HTYCuHD4MbHSnvZSOUyHvx0QMg/0TIzBI+Ct6vl+yeUWfKnlAsR8NNwX5AfmZxIIWy81cXg== 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=PRuATptSwonVXkKArDFsft/Uw79V6p0fKdX4cOWIM2Q=; b=RL9OTXhH5J7z5t1hTNezim2tVvffuIVQt1H7GQ0AWa8bOwbuSN4GQx9GPGjbeYFYNH7P7DYpJ+TX3Onm9scSD9t4gZs0unw8e3+NjRby1thk6NCEDUBAT/ywyN1QNg/80wwqU5dduXwqv7RMB9oZMRjS4jDvONFDGeryu6ls/ya4fsujZq5RbsjKc/POAJTx4FchDJadvNoxZE41qwT/YDjYyaTUvtPwJDSJt9Yunfy0mWOr1etX20MxsisSEdKB7G7+fADrkEX2fQ6inhAJeLhuRIAe1wLNcA/HqkrlEKHAvPwMGwAzMDepe67Ued0ouvrfByQTKx4B5g+2PkqDIQ== 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=PRuATptSwonVXkKArDFsft/Uw79V6p0fKdX4cOWIM2Q=; b=QeeuVTm7gpiL21kLAUEUTHFQiVcjIvRB3gA60OPHIuSxgExaAt2/gHlOlU5QDpP6VACorZk1PlyhIrkW4XVzVFv49PPZmZnxJ69Sc0ph5VFwpkxCwPxGJBBKaNSHfx1a6SqKWEn4uSF3keRiFpwTc7pMa5+fQ7KPhfOGVrt04Jw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=silicom-usa.com; Received: from AM0PR04MB4083.eurprd04.prod.outlook.com (2603:10a6:208:64::29) by AM0PR04MB6404.eurprd04.prod.outlook.com (2603:10a6:208:178::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.23; Fri, 3 Dec 2021 22:55:53 +0000 Received: from AM0PR04MB4083.eurprd04.prod.outlook.com ([fe80::f4db:d40d:a746:7bfc]) by AM0PR04MB4083.eurprd04.prod.outlook.com ([fe80::f4db:d40d:a746:7bfc%7]) with mapi id 15.20.4755.019; Fri, 3 Dec 2021 22:55:53 +0000 From: Stephen Douthit To: dev@dpdk.org Cc: wenw@silicom-usa.com, Stephen Douthit , stable@dpdk.org, Haiyue Wang , Wenzhuo Lu Subject: [PATCH 1/7] net/ixgbe: Fix ixgbe_is_sfp() to return valid result for X550EM_a devs Date: Fri, 3 Dec 2021 17:55:10 -0500 Message-Id: <20211203225516.571368-2-stephend@silicom-usa.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211203225516.571368-1-stephend@silicom-usa.com> References: <20211203225516.571368-1-stephend@silicom-usa.com> X-ClientProxiedBy: BL1PR13CA0431.namprd13.prod.outlook.com (2603:10b6:208:2c3::16) To AM0PR04MB4083.eurprd04.prod.outlook.com (2603:10a6:208:64::29) MIME-Version: 1.0 Received: from lappy.adi.eng (173.14.114.227) by BL1PR13CA0431.namprd13.prod.outlook.com (2603:10b6:208:2c3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.10 via Frontend Transport; Fri, 3 Dec 2021 22:55:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0e6e6040-35b6-45f6-1ed0-08d9b6b00f29 X-MS-TrafficTypeDiagnostic: AM0PR04MB6404: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1388; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tAq1K5PH9YXAStnF7/1MWyQDgDSXv5I9ckugqkZACH42u0hWVkm0niqrGJ71fi49jUdOHWCMYaZfuUmrhtm+Mx2lnEBnzryqN/wi8bTwvbXHsWyjR39nu4DRNqljkGt2xRHkY5vKPnt3GZA4OXQDNqLUUYHjI3vjPeWFFLv1+D3MtgMJ3pjBfkusrggBHbvkdI37f2YS60ObbBkiAilucYxnFFQAwWjJBOX1U+VDkjWXj2LpLWFmSDHrKi56y08TEmynNg9917HdRwdyj2otPUqbycb3btYZUYizNjQf35Ku3og84PZu3lWTSXC00kHMFFHyNwgiL8bEWkvf90AivMES1PWCJAV7Fso7934AvXiYAwtYertz4/9YfrcnWLTZKvm513eWammf1Ske0fyZ/YGH+RSl+0lhxEVvMEx5t//ewiU1y/nk1KagidFr3O2v6w/grHl1csKGsCHqbwrAj3+DlCSbAJJaybXHHfgVPqWN9CyU9Klv1oVCEfaJFiCM8zOLR6X8c+ORqdVyjPlpQf8ejEUR/+3jYEdg5Wy/bOxzy/3L63jq4Rvsse/bCKBfQ4d+51GC4YQgb94IQNr4cTcYM5+H+vgAq+IvjIyODNF791MEKQQbg0klFTU7FnTTxxWqK+bHG77Ozdrx0sHrSzpqnQwGgcqK+x9nhpbp7qIv+CybLwIqVY114zWdG3+p4k7j+TaL4Bv0FqoT+9nThw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR04MB4083.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(8936002)(2906002)(508600001)(6916009)(8676002)(6486002)(26005)(956004)(316002)(1076003)(36756003)(5660300002)(86362001)(186003)(4326008)(66946007)(2616005)(38100700002)(38350700002)(6506007)(66556008)(52116002)(66476007)(6666004)(6512007)(54906003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uKRxLmfvsYQO0yCHOYdicCvYFW+Y1BYGt8X5sB9WSRwBTzxwVgqzfd1y3Wxgb1bFYDcKx4CHX5yQHNsr5rJTtFvUfZyvfBYIKaH55uiGHHOPvwWGtNCxrQNDFfW2AvRN4G+aEyXlHDN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SLhiNStmEcPF1psmwJQdqSyclCclT6sNIAiPYnkkhCTiu567Ub7Wr/DsT6TR7kEOH0Ne5F7yzSXO3/c7un7x33uMkqTYbgKYFb0iCUvK/kSKu5Ct/Z48u8uswnJiRfr+KDBCb8jlnSH+Qz+H4l83Ewj7beykpaIHzVGnHkaikWUREBes9i9a0BjnP7MkGGEaCHc5BelDPZA4WZ2c6R/0w/YQZo4kX5FHyaF3fefPra80UrKD9Zrz+Hr1rm9MPpdXUMMpQ3Wk7rsPpHK75qhmCD48kF5oGKuy80FgAyhgBCdXX/kBVoj41UrfWqLq9A7Jrrkft5ZORsLVW+ElSFNWO+hZrrKVHoshdL2/X8SovmLKZkkKHlvA2wjyd1hojoqOL+G6OyK/FcRivs5RVkKeZ0vrief0MVlebN5agaSKk9ltiSSn9YcV8ZfIgzd1G3tqAqqex7XVlLWZ7JwHiW2KnziYjbs= X-OriginatorOrg: silicom-usa.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e6e6040-35b6-45f6-1ed0-08d9b6b00f29 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB4083.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2021 22:55:53.6826 (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: 06ZGybW7rviFJOTx3o9dypWzacwaOZqx6RNVovIhHvCe+jloVGaYnSHy6FNNo/PkzHOVZqlH85fBEdB9rpwqyxNQ43sBM3uEtN7H38L3k/E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6404 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 Currently all X500EM* MAC types fallthrough to the default case and get reported as non-SFP regardless of media type, which isn't correct. Fixes: 0790adeb567 ("ixgbe/base: support X550em_a device") Cc: stable@dpdk.org Signed-off-by: Stephen Douthit --- drivers/net/ixgbe/ixgbe_ethdev.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index fe61dba81d..66f7af95de 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -781,6 +781,20 @@ ixgbe_is_sfp(struct ixgbe_hw *hw) case ixgbe_phy_sfp_passive_unknown: return 1; default: + /* x550em devices may be SFP, check media type */ + switch (hw->mac.type) { + case ixgbe_mac_X550EM_x: + case ixgbe_mac_X550EM_a: + switch (hw->mac.ops.get_media_type(hw)) { + case ixgbe_media_type_fiber: + case ixgbe_media_type_fiber_qsfp: + return 1; + default: + return 0; + } + default: + return 0; + } return 0; } }