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;