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 917A8A034E for ; Mon, 20 Dec 2021 22:32:30 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 819D94003C; Mon, 20 Dec 2021 22:32:29 +0100 (CET) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20092.outbound.protection.outlook.com [40.107.2.92]) by mails.dpdk.org (Postfix) with ESMTP id D25AC4003C; Mon, 20 Dec 2021 22:32:28 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H2a8zS5R/QqYmYoiQECkenGHWH1v8SkhJQ2LGZU2kK85zm5+qR3OclKLhoj9qh9vlYk7t9xKkjGOsdobJogZJR2VYqXHyEZSBKUdZtIfdBQq/oE2DwJ0kyZeCU+apGjhR2EZOBsrMaB610qeXXDHL7PXZ95W+86zYSkdBtEtfyRSpRxCMffsPsyKgLjXiPU41BWbKgZp87Grr27tAWbaVPm/Cs/yWYqZ0gtmicRf6K/R3FG/vPy/VKdSn4eubs9f1U1fI38EfMzB0rqrVNT7J15SL/Is4xvcBuivhLplsk1cEBIgcU4+E0J3IxRIzxIvhtYKu7XDqebAg19IxNZBTg== 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=QgV4YhRlWjb/AO3cBI7PMMUhBIzgXY/YX8IE8EIB5XA=; b=EseRJwh8ZAG+Tz0S8ZFzb5clHSlToyMB+H8yyXOWBbTR12S8PnW4GzSHPq9qwfqMUjTOl5fZ/UFTeeY0DP92X3bP105X94NSOhYc2s2OXG6+msLoRMltw4tGSlXw2st8ROhYCVpJXLtgin3z50Xjx7lx/tamy7GQvoN+CvDzrHkbWKM+zNye3hdgVi3P2Ga4R5A5/GgndDLi+anc7furqQw++9pT4DPGaa8TSllCDV2ssfVnlwKmUbYDpowxu/1tjeqXU7w8eFORMAi7KnQhJsJZIMjMo1bXPW5OjsodW90YlfMcVUbB4sPWLdKhd3uz7bMdQbnTMzlzRlXm6gNJkA== 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=QgV4YhRlWjb/AO3cBI7PMMUhBIzgXY/YX8IE8EIB5XA=; b=rYbSoH2Qv4TRHpO9awaoysjOVmYFIvt3xZjNhARKSE+EnRJMAwm6p20zgho38o0ddtYUkrNpIdaJyIfwpvX1eYpJUb4RQfg7uPgW6yNS6/oHcoAXgwCaT6u6C1DV+jIGaB7PtCIjEsIPrUMdVpD/4dZiUH2BSd/o2g/roK3VUrg= 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 AM9PR04MB7537.eurprd04.prod.outlook.com (2603:10a6:20b:282::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Mon, 20 Dec 2021 21:32:27 +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.4801.020; Mon, 20 Dec 2021 21:32:27 +0000 Message-ID: Date: Mon, 20 Dec 2021 16:32:17 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH v2 1/7] net/ixgbe: Fix ixgbe_is_sfp() to return valid result for X550EM_a devs Content-Language: en-US To: "Wang, Haiyue" , "Lu, Wenzhuo" Cc: "dev@dpdk.org" , "Wang, Wen" , "stable@dpdk.org" References: <20211206221922.644187-1-stephend@silicom-usa.com> <20211206221922.644187-2-stephend@silicom-usa.com> From: Stephen Douthit Organization: Silicom, Ltd. In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BL1P221CA0015.NAMP221.PROD.OUTLOOK.COM (2603:10b6:208:2c5::34) To AM0PR04MB4083.eurprd04.prod.outlook.com (2603:10a6:208:64::29) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6d612ef6-ecbe-480c-1200-08d9c400380d X-MS-TrafficTypeDiagnostic: AM9PR04MB7537:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b//iDzeiPglqAOAB+lDB5EZhvm5ZqRrMhuTpWgvdX8OU5wuO0515ZKAN2idAGcN/iXfDOK7GYzE2SaaPHYHphfqw6gsXziWbSffGqsdsi1EUL6qKuvXrqWhzrHrN3ihAkNcUQ0A6B2Q5YhoOlSoBn6naERr1YUj8h87ua8q3ySo/zjbHa9oG9NUhBFl/e2WOGlJQOlo+orZFt3roNgav+id+lST2yQhT4rl4CQ2henOfkaCLWyyGXEOUI2Bbms3gW3WmnhRIfckb8bINIwLN7G6JQY2Z2YkVjXJJe8shPVFiYdN+giuC4GTZ3nj3ckthUBg1H3x/yshwnGzzQsz/R5TpNo7sj8qYut1vyTfg01M778TW5Y+i8Fixz2J0a+dUAAUN1stOfIrtiTriLtr+aUHcJN1OITCigdddJuGpYHJz1RNa3BnRh6wF5rtmx4wkKbQ8Fux4k0C1LENZhaTT1tUmLC6vQbPUtATJMUASMJBB/5HCC1JPgCAmJahK1ktK28G6Z9MwDU6Xu2jqHDAPNdMJK3P54Vi+djUBsvO7dLoqcDCyrwnqy0lT/RvjQBmmbB9FqEMkvwuuTIiaHJ744pC38XziYVatNTwx6aWebjtSH0e3+r+jQfrqJTXYocoVnyXBfDjubDR/HcxFPG2X4IbQoK6K4dpW1hqyBFjOQQXtbRIzUwqcbrNVKZihtWdkMwlVH8cTBs29M9xFOnkkVbpDxBZyPKJAxHeCl2gA8aJy7hj1AnWC6uULHiJtQDwLqmVatPtsdQQxxjIGhRBrSQ== 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)(66476007)(66556008)(66946007)(186003)(31696002)(54906003)(26005)(83380400001)(6506007)(8676002)(38350700002)(110136005)(2616005)(508600001)(53546011)(4326008)(36916002)(316002)(5660300002)(52116002)(38100700002)(8936002)(6486002)(86362001)(6666004)(2906002)(3450700001)(36756003)(6512007)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dlVhTTJ2Qm8ySGt1N3FVc0s2R0l4ako2UEdpY0dNWmlpdEpSaVZ1ZG1abjFV?= =?utf-8?B?dEpaSk0yVXViZlJpanFFc0VLaG04cXF4MXhSR2RiOTh3bTRaZGNvMXhHQTlJ?= =?utf-8?B?MHpUZFFrbTVycVQ1L3NWSE9MSHpydnZVeWY5YTlDRkxhLzlSa2VKbW1YVC8v?= =?utf-8?B?Ky9YVXNIOFBFSGxvVjhVR29yMHVmY2pGV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?utf-8?B?YmJoUWVMc1ZvT3o3QkxaUHZLTlhlOG80bmlvelArWUdlWksxKyswa2hKempH?= =?utf-8?B?U2hZMXFlL0VuTGxxY1dzbVd3V0htbThJSmVvT2RaN0xKdVowa01xeVRVVnJB?= =?utf-8?B?UWtsb0pBczh6eEo5MlJpZ041VUhQcmJDbm51KzVUVVQ4bG9GbCt4L0wxZmxT?= =?utf-8?B?VW1hNHE5ZjlzL2gzaHo1Z2R2SGRsODJHYzg1UHFXR3BZSzNaMU9CUjFWbEtz?= =?utf-8?Q?k3rwHnQVcaxAZ0HkLIR1iKNVORLwWeaI7muZtNh+sg=3D?= X-OriginatorOrg: silicom-usa.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d612ef6-ecbe-480c-1200-08d9c400380d X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB4083.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2021 21:32:27.1039 (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: LQ5V/Ia1SmO78V2TVlx+qFNxYKxehcrQc/rj4EaKhZQ7mU1QXNdGF+KLtQ31l3Mmgvot1lRSCs5wq/deBpoo3sOuGZp+2aPqEnWn3x/3r20= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB7537 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: , Reply-To: stephend@silicom-usa.com Errors-To: stable-bounces@dpdk.org On 12/20/21 02:45, Wang, Haiyue wrote: >> -----Original Message----- >> From: Stephen Douthit >> Sent: Tuesday, December 7, 2021 06:19 >> To: Wang, Haiyue ; Lu, Wenzhuo >> Cc: dev@dpdk.org; Wen Wang ; Stephen Douthit ; >> stable@dpdk.org >> Subject: [PATCH v2 1/7] net/ixgbe: Fix ixgbe_is_sfp() to return valid result for X550EM_a devs >> >> 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)) { > > Use the API 'ixgbe_get_media_type' to avoid ops null ? Ok, I can change it. Note that there's already a mix of calls with and without the null check wrapper in the file already though, so maybe worth future cleanup. $ grep get_media_type drivers/net/ixgbe/ixgbe_ethdev.c if (diag && (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper)) { if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) { if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) { if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) { if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) { if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) { if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) { >> + case ixgbe_media_type_fiber: >> + case ixgbe_media_type_fiber_qsfp: >> + return 1; >> + default: >> + return 0; > > Since we care 'return 1' only, then the two defaults just "break;" ? > >> + } >> + default: >> + return 0; > > Just 'break;' > >> + } >> return 0; > > Then this default '0' will be used. Ok, will change. Thanks, Steve >> } >> } >> -- >> 2.31.1 >