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 3418DA034F; Mon, 6 Dec 2021 23:19:55 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 081F641169; Mon, 6 Dec 2021 23:19:52 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130125.outbound.protection.outlook.com [40.107.13.125]) by mails.dpdk.org (Postfix) with ESMTP id 5BECC41160; Mon, 6 Dec 2021 23:19:50 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bLbI1Jb/8DzFIQizfigbCy6y6jYEX7C/awbSeHoXdh9QpuPkb5TMOqNsriCPSmqZdbOAWNfIwdc/Y0/HRoqu7gwCIyNIZ1gu7P8DLsA+nS6sENbLeFZNo6hYe60U/8hmXdP+kSV4FVIpsW04gEL370znBjdsmyZ7nczoPaoSYQZUmp4RiuxJyCmmErKasq6YarItF1wYscJgo+x5i6/ZUmkRDT9PrsNVMydk1vNNl67oBTe6O0P8NFuDlQQImnWu93/KjPC4JD0M71uJqvrENB8AP0OMOwBrXCZOFJhYO7OVHT+jfp0SUPriAPWZx5tP+8uYDsvtSzv87fC8416WJg== 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=FTxaMUs4Qtrqle1a9JVGNKBVyRyVMiAbtjNddBjrohHtKCGYohBMAwRebQuvsgkl3nKToqL8A4zJnklCHdWzltwg2utGU3Pm8S7E3EpJzPcHZEtjm6uRaL1iMY+qifo5XlIxY6iaYm8oc8e+i709vkgsG5YforEuKGi7L1JNrGgOJRbGvUNUCIYceBIePuwdvMQia0MrWKo075kjxyHjGE1tblyF23WGLcCnw7jdyztZWqz/L2/Tb7bPoOhjJ3SIBBHGS5rqf1HY1cZhHfWQyHUKAYRWZNe4DDpA0GxRalWnSmqMI9eCUP8N7GQKRTEiaQc7Z9HWFrrYSqMj0Qacyg== 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=BIFWYVrFIeGVfEWoQooKjUd+xfi0ox74ZCstjeuTzcjvaJEAtsvVhhgWXSNR8Cmca4h4j4p85Psq6OL036hWcRhFjX/XZDgelPvKQkwnXWH6TzHKZ72otZvSdZnpGG4qazdg34x+sst9z0bolY0ljK1lRzgdxeZsGXwaXgIsp4I= 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 AM0PR04MB6724.eurprd04.prod.outlook.com (2603:10a6:208:17a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.11; Mon, 6 Dec 2021 22:19:48 +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.022; Mon, 6 Dec 2021 22:19:48 +0000 From: Stephen Douthit To: Haiyue Wang , Wenzhuo Lu Cc: dev@dpdk.org, wenw@silicom-usa.com, Stephen Douthit , stable@dpdk.org Subject: [PATCH v2 1/7] net/ixgbe: Fix ixgbe_is_sfp() to return valid result for X550EM_a devs Date: Mon, 6 Dec 2021 17:19:15 -0500 Message-Id: <20211206221922.644187-2-stephend@silicom-usa.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211206221922.644187-1-stephend@silicom-usa.com> References: <20211206221922.644187-1-stephend@silicom-usa.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MN2PR20CA0031.namprd20.prod.outlook.com (2603:10b6:208:e8::44) 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 MN2PR20CA0031.namprd20.prod.outlook.com (2603:10b6:208:e8::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4755.19 via Frontend Transport; Mon, 6 Dec 2021 22:19:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8090ed35-6acd-4d72-81a2-08d9b9068391 X-MS-TrafficTypeDiagnostic: AM0PR04MB6724:EE_ 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: 96eNXqC2AIB+MeOLT9taCZi1jRsfC/FS3pwjl7gqNFCeLGJWPxeOv1Zx3oM9JJVDY8fxTZdceFdF/KEEAjI0S+mMJp0YKMrDCTUU5hS+UjnznFsX+dH2YkdifPJQdcJmTcqfJ4yxPXX3R/ZNAEU3/FVmf4oJNglgAKXjspH4e0SbKOTP7AnTF7TDLfLZp1xoJ1sb3uobuc13Ay/sIkk/BaWQhmvmCciTINH7VQ2B7gJIOf9R2bD4P+jDf9eyzqVK2JCUinaDAqhR/v0q+c9geES3vZmWEzlebnRZL46qDlMa8jAbKSuL1iwy/PrOcnrIJ48+SfQo9IX91WUlZmZOdFRJW+1Mts4bOeCayZImvfospwD5GDpW9UwH1lPUy/UTydW+/u4M50GUf+EGPBqDp0ZlfVGzy/VTATOkXj2gwGnixI6FInXY/ZzAGCdYodDfvtVFTpfmvq0f0N4ASHo+rrmnAVg1fIx4/EzDt13nTovfNxOf8ImYxv3w7xaYWomOjzoQvxh+ulK4GnKkdlMWtaehdSjbTh9lcL5of6Bd+0iBOdmSd0G94oHs2P9I0WioX6Yq1GHEz2LyaW/zquYp3Jeto0tfoCklykzYDEFGtO0rgdf80r+g994eD5xNtzXNPLXjEoCc4cNUEPuWzOiRZEEbrDx5j2UBafXRcjK/DhyH7+r6H4ZD8fOFBLaQTQoMmFamll6hsEiXkkdEJQkKnA== 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)(4326008)(5660300002)(2906002)(508600001)(38100700002)(38350700002)(956004)(6512007)(6486002)(316002)(36756003)(110136005)(8936002)(26005)(1076003)(52116002)(2616005)(186003)(66476007)(6666004)(6506007)(66556008)(66946007)(8676002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?U5YxSy0xURY0SD0EAEgrIyTAGRZv+oLA+r81YN7sinlXvAKQRbCLWOxXlgYn?= =?us-ascii?Q?oOi8igns7juh0zfjKvYK9zGuSgCwwDekZ1HHwvTuGqHNGluU0xkxVbqHvG+q?= =?us-ascii?Q?jOb2VZjxhVR2cjliOjeNyBE5Ii5PfyOyGEVhFW52mkg7nMly3QEKR2vtqBU4?= =?us-ascii?Q?9vQxQffwLbTsUmEbw5lU3LrqRj5wDYU5baTd4Z/EXkT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y0NVyydJXjMoUnS0Vayf2XL8836B5ioS0GCKxljEsX2QwJPVz?= =?us-ascii?Q?0fgyeV8Z/qYiNBuJt1B9Df1s0OqkFjlbvXoYMM+sbVIEV3QdMnIULFEFcI+F?= =?us-ascii?Q?g3xNqXVvaMEvjwgdUbYpc04mM2TSZZmZC20oTBKSYLE8gJ/m1YnQc9Uqz87a?= =?us-ascii?Q?ilpNZ+/KXP9qwEIkY+S64T5qiHi+IltSwbzUttklfUv48lCbyi+zsd0YaGtE?= =?us-ascii?Q?pr35/ZeaXvuJaMcunGvs5u5h2XJwG6q/Ui0drZ2yCCDeiZG0GnjjN4ofR0GW?= =?us-ascii?Q?6p3BcibW2konZauBG40Zdwd9GqociQma0PFTmXyW3F51T1uN87ZIUCV2mCft?= =?us-ascii?Q?2AesCI6E9MiboAo/rIEng4p0JCgEyo5pKr6jgYIF5R7QAoOe+8V1FNNPGI7q?= =?us-ascii?Q?v57qjlhGwv6BTgXXH86M5c2jb1Mc7QjdFREwBNdlXywWING/BPaJ7AtgWeil?= =?us-ascii?Q?k9HaHmRH+QIs7mWqRJylAHXJQaF5fGDDtg+hwKgfZdq0c7hAerWWmE8dHDK8?= =?us-ascii?Q?jonTZC+Ww7OI4s6NNSna1o9JtS6T15NoQpRandmZAcjWMQjyJP1u+9um/CIK?= =?us-ascii?Q?X86YEQ=3D=3D?= X-OriginatorOrg: silicom-usa.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8090ed35-6acd-4d72-81a2-08d9b9068391 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB4083.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Dec 2021 22:19:48.0447 (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: QAgBRMwKiRatmIymybQ9CNhk3ZaLxHPbOoEynxRprmOXZeRImj8bjvFYGi1gmrIRDgGtfM0RaWdqcKDQwmd+FuqSgbbkQzjhkfCofwiCygg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6724 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; } } -- 2.31.1