From patchwork Wed May 11 11:39:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 12846075 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 24182C433EF for ; Wed, 11 May 2022 11:39:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231280AbiEKLjs (ORCPT ); Wed, 11 May 2022 07:39:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229899AbiEKLjr (ORCPT ); Wed, 11 May 2022 07:39:47 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2100.outbound.protection.outlook.com [40.107.244.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CF3A67D04 for ; Wed, 11 May 2022 04:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bPysoJ73wy3IsK8r93X5PgxFfU2HgUCtPvnxULDLBJDakZNQoY9qgiuNoij0N0Cpp7nwMs7a9LsW/h7okDcOvX13UIi1yZgyM6mhW9M03SLZYBL1I4UkbuTnBAHOPZ1/NXbXyCbZEqpK8DLmbaLtVp1MzpHjPMWL+C69UXZo9Jaq62Whkj9bIuManM4neNqjXlN4y7G5o3WWQWnUI3XZtVKg7vUQ+8GQlwotIkS9LuZSTynenGZHS80LtNIVzRhNEZoFLoZSNUPOxsf7jKtj5N7/biCY2IfgvAIbme7+dVbZrHgGZAqWYgtSo6LMYu6rdGTyZNWdVj8Qj2awxjMl8A== 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=ZeRRTKuoG9wS/i9jimd56B0NMYsqqrpUcep+RsS6stw=; b=Nz50tWQ9s1OGlyGRKnZ+enMly2ung54PZit15u+1JvcU/PfdvCVObRMFNL3rlu0X04ZetqQtRLbf8HD5CnWBmfDsCgajLh4n2d/VwmmwXcCJnNl0e/GXqcRy8EgdznvMxcZq4CHRmF2W+WXHiBROBrMt8euB1XBQlStmHP6g0JBCq+yZuol4RgaGPPNfkN3MVJZZO+d50jtRm7BLOdX7rGOZAnZqf4zlxPfDI9t88+Ft8bX0KlxuCcy5DNO6IabHtp7UB3dB8z4ElVaupgEdbpP9bT8ZDWGoRo7X0iJh1FMcMI4yzODdx04+I08ekDL4QsjPvYlq0TPZdilaBPWQFA== 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=ZeRRTKuoG9wS/i9jimd56B0NMYsqqrpUcep+RsS6stw=; b=SuYAbKkOS7Ft6Lj0JCfrgbK1TUNS07zy7BiNUvd0aOJvOxWveygG4B/4mwMKmkmrEYchm1gQsZf0lMkiurrYL0jpxGNPe05Cigpp6s7PKDTOL309I3hGcToHkxt0/PaxKxUjtW9Zalht+K7jXkvQeeKbTHwhXtGMkZCWM6URwqo= 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 DM6PR13MB2972.namprd13.prod.outlook.com (2603:10b6:5:19a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.12; Wed, 11 May 2022 11:39:45 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::8808:1c60:e9cb:1f94]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::8808:1c60:e9cb:1f94%3]) with mapi id 15.20.5250.012; Wed, 11 May 2022 11:39:44 +0000 From: Simon Horman To: David Miller , Jakub Kicinski Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Bin Chen Subject: [PATCH v2 net-next 0/2] *nfp: VF rate limit support Date: Wed, 11 May 2022 13:39:30 +0200 Message-Id: <20220511113932.92114-1-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: AM0PR10CA0054.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:150::34) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae92cf59-185a-45d7-2846-08da3342f1dd X-MS-TrafficTypeDiagnostic: DM6PR13MB2972:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IJvhvY0uq5ZiMumFWvaw2uKXoW9H9fV/VJCJ+R6bF8OU6d65MsMU5vyPEtnoSiDAAPOr7XWMHECpRiRnKwirjaBuEYXeaPZ1MZzhDA4eeb3+6DEeiD9Z2ZWHHMQRBAmc00FCK+KTy/Tt6ECSZlLakezC/wXK69qHs2P+loshPO1BKz8ygA73IXyyWHYcA8KiRV1dFQbvzpYxKMn7rm+2r+z6ekszTFoBnrcG4KBmGqFlCJXeE3W0eFmr7QEHtx/dNPTqZdFivFcrNZJvVHEMpouzjbPT6OMlI8F7pBWKoixHJv6y7PLjsLbU9SODmaBKTmsJwDz842zrDmYQ2yuiLyQ8x0eeeBt04XwpxV0PTkngqzt03e224U4ofISogZpB0QYuI9M8h2afPlui60rCH9k9DI0U/oHP07/SWo/mGsuBvn+h+CpANXyWRlZ1DDRmPyjMH8000XCafWlkE4jqjCI61t7OoBULk87lCM7V08bj7YOavINiPec7Uk5UaSd/7iiRGFyGFU33bCzJyGF6osi+MmzKjXjrKDWbVnSm/vRbSqGgq/YEjnaoLQrIi8gvGaKEmEXN0HbtBR3VnCHeyr2H3BYmSAKcb7xAfi9NLecnN5kHi9rM6hozId1d7LUnNJai6WaDDIoBn9WMzNw9GQ== 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:(13230001)(376002)(346002)(366004)(136003)(396003)(39840400004)(38100700002)(1076003)(508600001)(107886003)(6486002)(83380400001)(110136005)(316002)(186003)(8676002)(52116002)(6666004)(6506007)(36756003)(2906002)(6512007)(4743002)(66556008)(66476007)(44832011)(66946007)(4744005)(2616005)(5660300002)(86362001)(8936002)(4326008);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: de5Rsy3Qm49paGd/kLhMFTBhrPW7OlbUktN0N45tsNGkVmHdDQmE948IDi4cquq4ob7PSa9zN0Sa9aa7zppu6jZUZCa9CylXdrdAHJfFBRR6QOmpwO+kjnfJIimQpdE44qrTvBd547YQl5JHDDrY+9zdqKja9F5Yve08leUulsy9ZsBE4ModAS9WAaXu7KXG1JoSQG01ugZXSYnBN0TXJQSAA3XFrw3CSZNUEPr9oRQ08Wr/V3IAAF+Y4+tURGQfyPxJ4aN4y+hFqDF0Lkc0khRwavygxKZugyfXVVeZ+JWU4nt+aoa4JQsXvp8k+mFhO1q8wM2mtOCBxV98H6+nWu/irJrMB0KFhQ/IJqkVB0g86vFz3OkSnQfaHbX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RQREwHSb/y7qFqpflCf6ehICzW0nbfNL/1VDsGZlvM9kJkgmiw2DF1E/hvunx37s5wLlN0t3sNWP23413is2SMaLXPyVTLQongz812YAvgOU73kQhdp5BIA3I6EWwDIlmHu9n1PTegnS2sJQ9+G3D+NH9cAH+UhUmPIvS9hTUNrRhvBkmGpmSKfHNpsIKAhTl8hdnFGn7hIdluRFghKgm40WSoBYGW/pRom5rvgoS+6RNxmOzZmcOnXHuxe/mUA9Hwj2zGV2zpSjWOcmfPg0BQXte+5bBhx73t5PqVVZg/pqKME0zm8HDY7u01bEzwlYGQ5LbGxeEp8ouq8JwgF3fjOoL X-MS-Exchange-AntiSpam-MessageData-1: 93jkaeU624VlPSJmqJYgdqKAEc3FE4wyy60= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae92cf59-185a-45d7-2846-08da3342f1dd X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2022 11:39:44.8744 (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: apJd5A0ozbcsiiA52RO7+PKO/IJ8oXjcINm/Lm8quAVv/yz+u//C5wAsjoxssHeNhSsvdl6VZqkYAcWtmE+LyMx7hs71mQyFQFXqhkXi+Pc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB2972 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Hi, this short series adds VF rate limiting to the NFP driver. The first patch, as suggested by Jakub Kicinski, adds a helper to check that ndo_set_vf_rate() rate parameters are sane. It also provides a place for further parameter checking to live, if needed in future. The second patch adds VF rate limit support to the NFP driver. It addresses several comments made on v1, including removing the parameter check that is now provided by the helper added in the first patch. Bin Chen (2): rtnetlink: verify rate parameters for calls to ndo_set_vf_rate nfp: VF rate limit support .../ethernet/netronome/nfp/nfp_net_common.c | 1 + .../ethernet/netronome/nfp/nfp_net_sriov.c | 48 ++++++++++++++++++- .../ethernet/netronome/nfp/nfp_net_sriov.h | 9 ++++ net/core/rtnetlink.c | 28 +++++++---- 4 files changed, 74 insertions(+), 12 deletions(-) Reviewed-by: Jakub Kicinski