From patchwork Mon Feb 6 15:36:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13130185 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 32DCBC05027 for ; Mon, 6 Feb 2023 15:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230409AbjBFPjV (ORCPT ); Mon, 6 Feb 2023 10:39:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231455AbjBFPjE (ORCPT ); Mon, 6 Feb 2023 10:39:04 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2071c.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eab::71c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F36A23D81 for ; Mon, 6 Feb 2023 07:38:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PbOZz3VmvFBWO6XqZi6pSj+zpZud8Akkmpsg5lvm6W31sJyvpa+y9f31E4Kheek7/LP7BxBWmS5UhOcyTyGzeUHYc0TFO24JKPk87UZUvborxP0FCBxtaTqCRvTuuVgRZz0F0DjhaypH/mEJX+OvsOw0bEGIEEXKZ0GuMfxNzRhFR1i0eySx7o6ZSqTsSFmjmq2z4f9TipcLJEBkO/3TCs6DJS0AoMSpe5aqsXVZshihofghePI1qf8lZYMAXn3QVvqgj+B6E7IY6K6S3ZYq2H6S1Ab7lvKU6r/dGymX5cId1Ul+/R2krDRtmYgqUtQtBO9A3Na2rnVZw+2XvY+2VA== 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=I8m9MxdkdLUdV38JNktbGMEP/LGOKlMubuoZF76WbqQ=; b=Wb9W9wK5L/YJw4DWp5Fa0sBPPJDX0IqwQVgTZza+yzzncAHZHJjfwwQOFatqMrMBilLm+QvU0H2Zers2jsk7mIwXkLw8abAli8UVE9SVjdZMPojC4vfRRxPa11amA76tbVxUuEz+FDrisIeL8NbL1Rf0bEN5A3In9AWxcZvxFfqIqsZQAfi+e1NdJqy5YX9Bp8ql3ulQdIRYei/W1NSkTGZqlF0eaRrYm23WmgoICj15zR750BpBBVYvuKfTkhH+B4vpsy+3gNS2jGXBj1VQsryBBvBa2SkBm5YM7u7IfPhZwP46P8bicM8q81iR15p/VYOIzO7ciWAmPXYJgviDLg== 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=I8m9MxdkdLUdV38JNktbGMEP/LGOKlMubuoZF76WbqQ=; b=LTgdc0BLNt2pbV6YGuQvfyCMNS/f31qryXgE3Ugl3GvEYr1wCmjGbTvMsLc/2GS/ydeQ8H/p5rSx565Ak2J1gYSfVJnH2stjR4d945Tp4CnwOiNzUzfllLFTm2hlv7W1DXlcqojZjD4zN7lKAWWVMA1UbgLvCSQK7m3boGgOWNI= 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 BY3PR13MB5009.namprd13.prod.outlook.com (2603:10b6:a03:363::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Mon, 6 Feb 2023 15:36:44 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::85f5:bdb:fb9e:294c]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::85f5:bdb:fb9e:294c%3]) with mapi id 15.20.6064.034; Mon, 6 Feb 2023 15:36:44 +0000 From: Simon Horman To: David Miller , Jakub Kicinski , Paolo Abeni Cc: Michael Chan , Andy Gospodarek , Gal Pressman , Saeed Mahameed , Jesse Brandeburg , Tony Nguyen , Edward Cree , Vladimir Oltean , Andrew Lunn , Fei Qin , netdev@vger.kernel.org, oss-drivers@corigine.com Subject: [PATCH/RFC net-next 0/2] devlink: expose port function commands to assign VFs to multiple devlink Date: Mon, 6 Feb 2023 16:36:01 +0100 Message-Id: <20230206153603.2801791-1-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: AM4PR0202CA0013.eurprd02.prod.outlook.com (2603:10a6:200:89::23) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|BY3PR13MB5009:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b3e993a-f4d8-4f34-0b9f-08db0857f306 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cbL3MDLkjvIfLVcH2J277gDK5v9Tj+noaZ4MX0c1MYCfcMvnQ49joB03b3h9KyRe801hgLBSxb34VU/qHBmFLMh5hU8JhF5p64SrO/7GGMKM3k/GgbOTOZZhVP22l5nyanP6KGimulvgo/AehFAhAMIFuIYgtt8TtrQ8cpuaWaSTJ+srPPDKzlO8jyYlghItILgQLb3BTdcOnKVFKyeye9qRnW61HjxZqhXO7yRgOZiXajb4kdyg7RFw1VtcSC8VUl4NffR5lgmGlmk9oIDZyaR7KvZoIqV4U7vZgnrlg6ovUKsJvetlOIHygUnRVrJuJh4kYr+0g+/9TaXdwB/K/j95aAYEqz2NM9+p8ZMqyWwS40Uc68oxXoPVTGSGcRYp4bNKE8vkVXE8hT8DMeugXKCVXVeo7E56ZRgX+hKT2bUDNvxoNQTXOeR8bIGLNE401dnLdU4g084sWc7M3doDG5lN/RGVYUQhFKKxW3zMvSsti38pr4XeTtz4AbwdOjRBvQyI5AS2eg0sumMZNuXG8H9a98Ci7uUdAE4AkK9dvRL8DxmtMGuDyQnDJ17eBhP1xP0tnA2CjI8zqnK5IPevPDgG8aBh2wz8PEbP67/BpXEbMWOIZ8WEjNYpIZbvNL/oUZswkleuXfcqzDyjQDm+w9NvnWpRtGsFoN99ron2qJksGHSJIMZX56LZVIkPFJEg 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:(13230025)(4636009)(136003)(39840400004)(346002)(376002)(396003)(366004)(451199018)(52116002)(36756003)(54906003)(66946007)(6666004)(110136005)(8676002)(6506007)(1076003)(4744005)(478600001)(4326008)(7416002)(5660300002)(66556008)(44832011)(2906002)(66476007)(8936002)(316002)(38100700002)(86362001)(186003)(41300700001)(6486002)(107886003)(6512007)(83380400001)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?svZJrDnWaxIkUahyVRNO5htLea4+?= =?utf-8?q?jZEwthEHbhzXGw6WZUKbQgRnYVvCqzvPVmXLjAxOkOT+L5tskpUhSSHczKMWYJ56Z?= =?utf-8?q?Burv/UGuonQWBMiviABFnbiBnyMGkWKJMmlYZCSbddva+XQw98//T9rFrYTtOPgs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iRCU?= =?utf-8?q?bTLFYIKYS+SWB+GZJMPbbOsAzlpA2FGAztVITM3zVoy44va0WpeEvekuP4O6GTr38?= =?utf-8?q?W0q7vOQNyFBdArIMaANUygStbNOO60SxO7tIAmPGM3LY+PhzU/Unu86fQjtMgCZzD?= =?utf-8?q?bcQhdXCF0i15ArNgIBaHRvfjtOrYd8CGy+7FjIDsLjx3asQ87z2DxyqOgbsh9Tyw8?= =?utf-8?q?9HhV7CpCX94j3mkK/HnZeEKav7R8KMT8pqgVCRyPLVx0TkFxFvnykAJl88dsPfsOX?= =?utf-8?q?Z0RvBErJ8Kx84KIyx0FKIP28pWenDbgzYiTM3ZNOzUNvDOqoL0eRUhSXVM4RdRTmG?= =?utf-8?q?1Gi93caDbt85zCv0CImu3D6NBQyJIln35dXVATK3ZmmuiyrHyxIFlfoaQuhTOw4o6?= =?utf-8?q?QHdJzA4MX1V1mBJKmfSe1IyLZJ6nRs/tGnCB29PdRBtVRx16UIlFFNWlmn84E+QEU?= =?utf-8?q?CAtsex/ugOXleqMgLvVmba1SQx0qKtFb/AmsVpZ9NotTF77Jg5CaGH0jQgkZ7JS6r?= =?utf-8?q?Dc17Pr76SfYwWtJC8axBwSt+Ge1SxSIvJ28/I8nhlzjD+cKp3PJbMZUbRC3Z/xSj8?= =?utf-8?q?izWqZExzTLWU2rJumvwutG6P3XA8qQ8fg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b3e993a-f4d8-4f34-0b9f-08db0857f306 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2023 15:36:43.9086 (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: o2PMF8+0qJWPc6EPp0EQH2je4+U8z3qrqOmH6OcbBtOzmRFANjES0A3BlbXhoN1v4g2hFGInX5OZJuWcFun1U4lY0atC3UHt0+fCGJOly5o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR13MB5009 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Hi, this series proposed a new devlink port function to allow control over how many VFs are associated with each physical port of a multi-port NIC. This is to facilitate such configuration on NICs where this can be supported. Patch 1/2: Implements this new devlink feature Patch 2/2: Uses it in the nfp driver Fei Qin (2): devlink: expose port function commands to assign VFs to multiple netdevs nfp: add support for assigning VFs to different physical ports .../networking/devlink/devlink-port.rst | 24 +++ .../net/ethernet/netronome/nfp/nfp_devlink.c | 71 +++++++++ drivers/net/ethernet/netronome/nfp/nfp_main.c | 5 + drivers/net/ethernet/netronome/nfp/nfp_main.h | 4 + .../ethernet/netronome/nfp/nfp_net_sriov.c | 147 +++++++++++++++++- .../ethernet/netronome/nfp/nfp_net_sriov.h | 6 + include/net/devlink.h | 21 +++ include/uapi/linux/devlink.h | 1 + net/devlink/leftover.c | 65 ++++++++ 9 files changed, 336 insertions(+), 8 deletions(-)