From patchwork Thu Nov 17 15:37:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13046982 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E747EC433FE for ; Thu, 17 Nov 2022 15:38:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234934AbiKQPiY (ORCPT ); Thu, 17 Nov 2022 10:38:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234421AbiKQPiH (ORCPT ); Thu, 17 Nov 2022 10:38:07 -0500 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2094.outbound.protection.outlook.com [40.107.102.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A36F59167 for ; Thu, 17 Nov 2022 07:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U4r87FYv4wjSL2NRvgpV4pcvBwYbCG+ZnhQLie8Z3irOpJdGu3MRwQ44T/t9r6yV+T4rqX8jLK0Sycx7LnFpiHsXSvGw5LufEOUecP3nifZTRYqSwkfhfyKFthnWtRS7OagNmjUeLR1EcT1L54gVdTVxqD+t8EQZUHHq6jLakWRYPQM0PmpKB5e3GNLuKE5OQAokxFWXb1+w6L5+rz6+zMZCNWHKs1NThLl7xHK+ifhXaiL/Rh++fuSnAe9/CrO3qWWRkke0oXxnKVmfa3OaYft5yoKm//B7lGHb4+DpZCJu+XOvDgngCyTGxCzUgARzVX5BSzNJ4/dpAhKhkHPPtA== 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=Z+NDvIkv2ZrZjBfaMRDQPv61ujUAAMfy2wSKhkC99KM=; b=ULuXiwEi71a8L/SbNu+WRUPfK2KXpuQbb9rWWLk+8piZABR6ePpbmwkeN1q21D7iLb+i7kn22r2U9TQpdZ+2DdxYDcuH1Fp+6Zu17IIUwUHNOm9LoB6Pc1ZZURGVmzf2WQ0DcfTs4R7LzxMlEt0QlncnYAvPyNxqs4C20MR3uSleVsa8uww6jvJV7H4voiqcBiboqVxpud6d9PxCy6rD6C/v6aje1LqumvM6Kacppa5ITurtwyIHWkUBCbxmTgIC6xmm0CsrEPvJKtkZVwjjod3RVeMMnpjpsdo5OjNnSgMk4zfHfYo5/OKvnG8fNClhPvKDYd9ktuV9u11TkVDIMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z+NDvIkv2ZrZjBfaMRDQPv61ujUAAMfy2wSKhkC99KM=; b=N0AzWqCPkjVrFj2ACYE0+zaB8Zbxsjq6YGDv3DwKfgJy1qvybSux/4woKgB+WHeEeXSTKxZTnttFC9vPAoqfq0dB/vWyQp4YWVN9ubUwDB2Pa3d2uxJbRvVB0NZvek/4zrLemqC1Rf3J17racqxwG2rWjl3QTrJUa91WvRq/oio= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by BL3PR13MB5242.namprd13.prod.outlook.com (2603:10b6:208:345::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.19; Thu, 17 Nov 2022 15:38:05 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::483b:9e84:fadc:da30]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::483b:9e84:fadc:da30%8]) with mapi id 15.20.5813.018; Thu, 17 Nov 2022 15:38:04 +0000 From: Simon Horman To: David Miller , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Diana Wang , Louis Peens , =?utf-8?q?Niklas_S=C3=B6derlund?= , Simon Horman Subject: [PATCH net 1/2] nfp: fill splittable of devlink_port_attrs correctly Date: Thu, 17 Nov 2022 16:37:43 +0100 Message-Id: <20221117153744.688595-2-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221117153744.688595-1-simon.horman@corigine.com> References: <20221117153744.688595-1-simon.horman@corigine.com> X-ClientProxiedBy: AM4PR05CA0019.eurprd05.prod.outlook.com (2603:10a6:205::32) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|BL3PR13MB5242:EE_ X-MS-Office365-Filtering-Correlation-Id: 1bbecc50-6741-475d-6b46-08dac8b1b668 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M4NY9HeR3MyjCv6tYPNqSSTRoi0VqhsetRJ9aGb9T5xu2Ctky3eT3cOiSrlDcKtKMvEFQqAqVj1b/fLwWtjWs4V7FBkFGJOfDPEOoN3Rz6rnE4h7Y1fFJ6PYEXAKBpDWP1JM0nxMBL29HxEuzRbYEQAEPkdX2n5Fu/E/CufPzMH5vG2T3aJZo9d4Jg20ehbKRSFFer5c7dXHJ7+Bm1X4NvrU+Ksu7gvJ7Q+hsmLgbV4uYk9IZ/B9OSUG8mXMl06G6ZTBspQtsjKnq+nOPQk9PVimRvfqqMR808Vp8nV1rsk9kFoPowgE1ONSlXwXJA7fTjV9IcIMTjrCWcKC6IKrQxQwfh+AtEuSG/7WOsNIkSsX+SNtZzLCHe1bwAZjP/ZndLK9dPmZrI2TO+7r9t5NL3GmpBPkc4FkfMY61EkRw1CCe1dLmUNjx1LPogVa7yFQluApawLS69o/lVwgI+9HG7cgPAReZOxWEyQiJNU1WDo9ms+eO0KiQT6GylIADctMMHlwylTN+rzLcwR0lEpNoR3mobHEkS1V5yw7ZcD1TDtARp5btXmGjG5tfg+dzV6RxwGSjvPAowjqf6xiJGCH2V80K86b5MyMKwSmomZiv5436+uoiCj7wIUYsDjPTJe/Eb1JRgPDizU6glGInINiDVnh+lMC23s8hKV7J4+iDJ9Ycm7n3z+y1QWASygUqi5L X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(136003)(39840400004)(366004)(396003)(451199015)(4326008)(83380400001)(66476007)(86362001)(8676002)(66946007)(66556008)(5660300002)(44832011)(8936002)(41300700001)(38100700002)(2616005)(6506007)(6512007)(6486002)(110136005)(186003)(36756003)(52116002)(478600001)(6666004)(316002)(1076003)(107886003)(66574015)(54906003)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?uIaPJSVL5p6cGDkT++UTCIr1x9bz?= =?utf-8?q?klOQBphiuVSv4kibuq/0YZvblueFOrRUozK8+/AA0LQ82pCrpCdLGKh4PsKXw+XQW?= =?utf-8?q?PTmf2BVN12rQ2bAh5xatjivlrV0RP5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MoY7UJYWa3BP04Or5tYT1G3ZUlZiS?= =?utf-8?q?PB+w+X2BtXAyFUGWYqRqhvEk8gtMfsIVfbu9IXNUtsRTw1ET1fVtXsKzj1v6qQINk?= =?utf-8?q?Qoqn7jHz/SthBi3c0TgsfHOhJlwSoRH/w5uyn1wU1U4AbwS/7fZU6ob2jPXuwG2ji?= =?utf-8?q?Eg3gUzOhcs8fgqM5uPIR3rswOdi0XTtKpkDlT2EMzDgpSHgSUkfMPOsPnKiWLq49c?= =?utf-8?q?ztuUu7vHnGXa96uDWQnoyOnUwZLqpCFLy1XQxx/lLYmvh/s2NB7yJ24f0lygwaBk8?= =?utf-8?q?e4tC0+WCkPrQIxhHpkS1N1tcJbnKUku05QBnrn1oIdjEBtOz3p/FY+Yn3FnZMLOLd?= =?utf-8?q?zhdUGhuOK9scHhAWPZT7Tf+4/VM70T0aHZMBHVi+v5KtdWOuqAG8dfUG/9GCRACKn?= =?utf-8?q?ptT6Ln/0vto7/jXftp85ro0p5iGZJq9KHSWZw1s8QbVauDqDipmepKEt6Yttz3iLY?= =?utf-8?q?OePreXh1zAPohHshbDkOjmEvai7S905OCeXir+YnO5P9Ep4RPSeEuL7+2+4ViQbp3?= =?utf-8?q?GxAa/aSDfFIbRf7pTKeHUzOy6hvZwgPKwb+Pg/75hT4Ed67EEB6m21+QNL3j4dXGQ?= =?utf-8?q?fH9nWlnDDu+5zGrhccfY56mHZ/Hq9NdaA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bbecc50-6741-475d-6b46-08dac8b1b668 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2022 15:38:02.3596 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JEa44CKawNwztO6RX02EomjMoWDEktl8S4167c1cv4SM/eoEayO+YGSmvYwBHQCyBm3Q1HOqv0ydoTQ8K/KcKuHdr1oUWIAhvg62l4crhvg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR13MB5242 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Diana Wang The error is reflected in that it shows wrong splittable status of port when executing "devlink port show". The reason which leads the error is that the assigned operation of splittable is just a simple negation operation of split and it does not consider port lanes quantity. A splittable port should have several lanes that can be split(lanes quantity > 1). If without the judgement, it will show wrong message for some firmware, such as 2x25G, 2x10G. Fixes: a0f49b548652 ("devlink: Add a new devlink port split ability attribute and pass to netlink") Signed-off-by: Diana Wang Reviewed-by: Louis Peens Reviewed-by: Niklas Söderlund Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_devlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_devlink.c b/drivers/net/ethernet/netronome/nfp/nfp_devlink.c index 405786c00334..cb08d7bf9524 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_devlink.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_devlink.c @@ -341,7 +341,7 @@ int nfp_devlink_port_register(struct nfp_app *app, struct nfp_port *port) return ret; attrs.split = eth_port.is_split; - attrs.splittable = !attrs.split; + attrs.splittable = eth_port.port_lanes > 1 && !attrs.split; attrs.lanes = eth_port.port_lanes; attrs.flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL; attrs.phys.port_number = eth_port.label_port; From patchwork Thu Nov 17 15:37:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13046981 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB829C4332F for ; Thu, 17 Nov 2022 15:38:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234866AbiKQPiV (ORCPT ); Thu, 17 Nov 2022 10:38:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234980AbiKQPiI (ORCPT ); Thu, 17 Nov 2022 10:38:08 -0500 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2094.outbound.protection.outlook.com [40.107.102.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C148759177 for ; Thu, 17 Nov 2022 07:38:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DWWJ5IRygQAixTag6d1yi0hT+X9Qx/6T6kPEjhtOeAwGxWdAvVOlgtqgAxHniOJqnq4R0tUcxjqs6Y43Ht9nisgmTFCubHn9EvGyk0nySpTJc+PK3VWNmLH6RX0NFA1czh50r+zeJ+q4htxKrHWPs3+I8lJHoPZRh4/LbHEbEuSIX3MeIE/xOz/XkIx2tfvquyiCZAX6UIAYaCjKLA41k2X478VoorBRylZGe4m3DexGvIHrnyfQ5pL9gjKdC1seVVslapP6rVZbccNXTLaUhYF4rWIG8uci/OCln8+1+dOBdk00kfCm5DFYihbAzSWYOK6YCsEomLfF2juiFKMGoA== 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=OWcc8PNqGfLcnWzwOUi8USAHpRledQBy2ZL/Tg83KRw=; b=fAt8IlXLHYtXhacCMINfFKVbjwLnbTTxJH+0Rs9VAoLLCNGQbQP5ETNMNzrDy4zLOtluZXbT/nA6BNU1/1BKrWbgnk6s9fRd6F+WTUf+MGtvqLMIVZrifnxXcOTOc6bN2/vxAGP9kNmyh0pfLDx2eO7v6FGWQ0TKfx6BUeYUv/RqoT2u/vgRqexyybKxVBioSgjBWEAXRFz7df32HdSYKQjgL+uMXBVDHY9Y7y6i+n3z1RZ1npWpuXTgARt3BSIfhrAz4mjrlcaE6UsTBp0LY4PetJTGGWoH5PWJVPVm11luczYM4pZWDqG87+Cx+Y6qH6AYwrVXWqZTsVMHKqE9WA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OWcc8PNqGfLcnWzwOUi8USAHpRledQBy2ZL/Tg83KRw=; b=mg4OpXeDJFD7EA2RNOqXSDrC+5dcoiZctv/rKHMslEkMAtdbTFvaNd3Kim5+HVPEdDfAI+9ry0UzNkjdnA0tJ77f2I4EJi0d6BbKPuPmAYfwrFahL/3OBOLZIHx1GTURQUEFZ6DIhu1dholkRg6MxsGktyNkAbZh9WTc1nHvN2M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by BL3PR13MB5242.namprd13.prod.outlook.com (2603:10b6:208:345::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5813.19; Thu, 17 Nov 2022 15:38:05 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::483b:9e84:fadc:da30]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::483b:9e84:fadc:da30%8]) with mapi id 15.20.5813.018; Thu, 17 Nov 2022 15:38:05 +0000 From: Simon Horman To: David Miller , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Jaco Coetzee , Louis Peens , Simon Horman Subject: [PATCH net 2/2] nfp: add port from netdev validation for EEPROM access Date: Thu, 17 Nov 2022 16:37:44 +0100 Message-Id: <20221117153744.688595-3-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221117153744.688595-1-simon.horman@corigine.com> References: <20221117153744.688595-1-simon.horman@corigine.com> X-ClientProxiedBy: AM4PR05CA0019.eurprd05.prod.outlook.com (2603:10a6:205::32) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|BL3PR13MB5242:EE_ X-MS-Office365-Filtering-Correlation-Id: 657e1ff9-69e9-431e-3b62-08dac8b1b781 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1JyKfqhqZ0DOEtrbdQsqYfhIQciG7gW0j53+QRsjDZDg4xY0gPnkVBen9nxX8ZpeQEwTOp4/KRgg6lu5SBh6MYyQiucoAL+zcOgwCsIp0uLxNC8h+tFVUh4OoluFZF/XvW4tSeXFLfokLY/fHJMsYbcAYmneizXr+i5Ru3Qak85mmCEG5OXfE+oJqK/YguefZD4VpeZjOeVwVY6V3UgzaZGaRFyhSoGnorCSEbsViVMow5nw85fKl71MLNGf71qYv3ER8tjEfWwLHPgjMNWXIvLUl0jDyaGAf+kApjxGlU2D/DN3SFnS2EWG6j1z2azYefJeoLJ9qCCCBI111V/9kJPQEaM1l7LFTdrBcZAGc9A4lMzeLnn9U9X6AbMOiV6TcB4I53TBj3zbjCPrGUdRB39l/0SAN4E5Yu2OJd9hSgDUcQtGuBF04QcKUN/cO42WK6t4v16lfMfJFMrwlqxvxUblDyJd6M0DFYyH5OWOJVwzf03qebvjT/oAq23vhAn7S022jsvAolYsWJjrAAxAkG9OHiHikQx8MnYhF+BOrf533LLzP2YDp2C+Gy1CtdK3WDUwdAMHBbPoaK+Q7caglYe/O/dG3d4gSvR4LT2RFilufRbPQm/2OrjwzUrLfIG8AYsCqK+elGC5a0Fh8CDsi2mLjhEKP5Kk7/1eSHEx49+lDRhSPKZjQSiOd4jkgNJe X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(346002)(136003)(39840400004)(366004)(396003)(451199015)(4326008)(83380400001)(66476007)(86362001)(8676002)(66946007)(66556008)(5660300002)(44832011)(8936002)(41300700001)(38100700002)(2616005)(6506007)(6512007)(6486002)(110136005)(186003)(36756003)(52116002)(478600001)(6666004)(316002)(1076003)(107886003)(54906003)(2906002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /89WrlcKom/g8DgdTcmhl3el9FvoJG1lFRml2YNGA9t/5DvjSy2Wubqf2oTx0G4a8+EYqqFp1j4B98oPvrQqhF8ayW9+HnMovosRi1V5LIQA2bHrWXwEorIg+21uRwIVcK9EKTXrHfY+SWTHWf3VgG+1N959jfKosqfGMjY/A2Owz7O47qEI8eOAjpmtwt4K4iitGbNoTd8P0HVGj5Df4OwlrhZciU69VR0Q0u5Dnk8N5qvxDI3vjVf6QAvPKLkiq23i/Q83hwCt9aZEx6H+5mzL7/J2UADSWPAXcNNfE3R4eHc10m+viZN7CRuiGREpa3/blfbvBqIXJZMgJgTaPUo6zPB+lzDquGYJ2Jy06x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XGMdO4jcq0vOflshLD5P4ygc9/4XvU2cOrbVKm+4xwtJd4r68vw5+prVFvw5gXHnx+I/9TrN09cb9XmDLr6sP7wkBhknUfuWAJuUK+yYDutm2EsQ8SSsb0562Fuw9wYvWOf9E0fkS8jp9H0z7y4+GHSRiHyRJEtjjacA+sxvaAyRQt7uHEObSkGbXRORTm1IJXqOl6C6+0l+lblLjPKj1UcKpEJco7wPfJJOqntX43SN//y/0bd6rC7nD2vQ1g== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 657e1ff9-69e9-431e-3b62-08dac8b1b781 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2022 15:38:04.3108 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: L2XKt2kNwKzECfQ7BnFwEm93hxZ/kfFjYnnBnDb2r4qkxv4dfg7iICtP5xO1FzGfmKXbtm9fq6cGuO8A4s+VNOjcE6Xo+zwai8TIXObdLsc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR13MB5242 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Jaco Coetzee Setting of the port flag `NFP_PORT_CHANGED`, introduced to ensure the correct reading of EEPROM data, causes a fatal kernel NULL pointer dereference in cases where the target netdev type cannot be determined. Add validation of port struct pointer before attempting to set the `NFP_PORT_CHANGED` flag. Return that operation is not supported if the netdev type cannot be determined. Fixes: 4ae97cae07e1 ("nfp: ethtool: fix the display error of `ethtool -m DEVNAME`") Signed-off-by: Jaco Coetzee Reviewed-by: Louis Peens Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c index 1775997f9c69..991059d6cb32 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c @@ -1432,6 +1432,9 @@ nfp_port_get_module_info(struct net_device *netdev, u8 data; port = nfp_port_from_netdev(netdev); + if (!port) + return -EOPNOTSUPP; + /* update port state to get latest interface */ set_bit(NFP_PORT_CHANGED, &port->flags); eth_port = nfp_port_get_eth_port(port);