From patchwork Wed Mar 2 16:31:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 12766267 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 425F1C433EF for ; Wed, 2 Mar 2022 16:32:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242189AbiCBQcw (ORCPT ); Wed, 2 Mar 2022 11:32:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242163AbiCBQcn (ORCPT ); Wed, 2 Mar 2022 11:32:43 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2073.outbound.protection.outlook.com [40.107.223.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3445CD5C2 for ; Wed, 2 Mar 2022 08:32:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dKP1+q1avn9Z5UOXTBuPgfARmGVE2lJLxSwbty6zUXwnJcWoRQgC3Qyw9WYfyHTzQVcgiF7ZVZOY+vnOlzv8xcI0cX+lOsYFpwsH1CfFVcuCWgEiG7CEH7ntC1O/dmnUgTWQ1rtNc8Kmw2rp8ldB7q882OyVSRnPAQjEmC6rawENC9OCYJe/jH5PJrdEUUmWHkcaKoB2iTn72Ro4DYsjKxdtAdjb7ZvIlZEcE18Z2qnr93reQEC9SlfMwDDfsIcm2sEoNPXOL/aoTzQvKmrJ3xGiIVvQN8mMDpNncSIMfxS8gvqHj8sphWIXFTgu4sXLW7g0VIEPAeeq1zH6UmAEPQ== 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=ZiGt8fndYh6d19TtG42nSQw2AWXWMYNSHSuyQlhVvXQ=; b=jhMp58RBhL+DlRHUbF3ztpAzf/dMVIheWghPcWFO2O3SId7mr34cv9F1XBw5QWAvIw/RKm/zj8T6FJ2KsgRHHKdmKvAOoUdL1GGEOwMKEUo5Uc9/8g2aDBo7A2qewctF3BIibonBKBxnvufwehHeY5s5iFQ112PA+XjsLQhDuhvT/z5q1UnP83en7JCpE8TOzqV7nR54fZ9EIdmxIPwIKRx4iIlr4wPOe3Q4yIElynFtUzI4jtMd7esHzsng3B4W9WF2+EsNAWElLS9ubhDJE3WHkyU9HLq1t9cwpiS0h093feGqregkWxnR8/VL5E3JO3ed3g9Q6SAUWvUpgM449Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZiGt8fndYh6d19TtG42nSQw2AWXWMYNSHSuyQlhVvXQ=; b=MuQnJvLo3TsqJJvho5Qa5Ujo5+xglUjQTv6P5XSerDqf8JHbihlUQtsuMOUvz/f2rSIULCK4LOxiRjkMFwjwRng2OB6zIZTG7Z7/vnikHL8jzdxnLo2mnCFMgr2316J4PqBkSGLDFRs05nJhIAsPOBE1TBkGG030TPPKLbIea8SWsuWPpsUSt3I2qCUjJ0NLO+bVHnNczs0A29dKDBdhIHtcBFmsWbfTiOsWkVRrf8GFuEspwe0H12z6+MctyWpM1OB1wBb9GVcwyOskRrP1bCEDdkdUH6hW64yRp7mi6cdkRwUO/EiXmHdWbzUd4dEEdks19uzDxrvZBgqqGPm5+A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) by CY4PR12MB1942.namprd12.prod.outlook.com (2603:10b6:903:128::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Wed, 2 Mar 2022 16:31:58 +0000 Received: from DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581]) by DM6PR12MB4337.namprd12.prod.outlook.com ([fe80::95a1:8c7f:10ef:2581%6]) with mapi id 15.20.5038.014; Wed, 2 Mar 2022 16:31:58 +0000 From: Ido Schimmel To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, petrm@nvidia.com, jiri@nvidia.com, roopa@nvidia.com, razor@blackwall.org, dsahern@gmail.com, andrew@lunn.ch, mlxsw@nvidia.com, Ido Schimmel Subject: [PATCH net-next v2 01/14] net: rtnetlink: Namespace functions related to IFLA_OFFLOAD_XSTATS_* Date: Wed, 2 Mar 2022 18:31:15 +0200 Message-Id: <20220302163128.218798-2-idosch@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20220302163128.218798-1-idosch@nvidia.com> References: <20220302163128.218798-1-idosch@nvidia.com> X-ClientProxiedBy: VI1PR06CA0171.eurprd06.prod.outlook.com (2603:10a6:803:c8::28) To DM6PR12MB4337.namprd12.prod.outlook.com (2603:10b6:5:2a9::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0a2c4dd1-660e-4005-c829-08d9fc6a2be4 X-MS-TrafficTypeDiagnostic: CY4PR12MB1942: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: 8fu9PB/DeVXgXzaQ3AL+jSr/1NA/4o4NP7zGZfaganQmiRmXGJu05G2KRCtaDA8MCrvLnEvAqyugjaTfslc+FXnE0n0r58B3tDPJ+lPxrw2ajz4WRVIAe8DcAnkJfnttcsFT1DyEF8/Yqd8yx/nGlylQcNE5HdJzKQPwFO2xZ/9QKzV4TIqWjwHdMEANomaLiJpc1A3TAQX/qbv7u7ptIOqCq1icX1wtfFksvoeGFxCbbDP/J0QkCJ48ja6mAidZxoHwcXR/iiHYatk1z9D9KbOLc3KKWlzlDJrUrIslxLWgkC8EuuIH5MpZu46FMM2zJyXx4e+5J6Z/RUQCjaBCGzJoM4ljnw4a3ZsQNr6H7FLGQcqusm/3Xdv8yo2fuQO+cUdN+NjpqwklcmabYvRHWzLVOXuVvHqDO1yu+0MZWoZf+gwca6GijskOyY7eI1nrtQDQaWHNORI7C/mw2+MoFQN9VFvZPixzifUvbDkhFCNhJxo5Wqm6KAgomENrHtvU4t7sFH2m0f4he15hfMs4Spw5KscW6a1jX68ozGW2wU2zTTbNg+of77YfV8dPOG3xBB0JxYI6/x29D6JZ5iFLipKGg1TehvjNq/s9DYHU8gXDKLDioEkYE0/nl+vzzZISRlZUM+eX/exBd24rVrZ3vQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4337.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(38100700002)(36756003)(2616005)(86362001)(26005)(186003)(1076003)(6916009)(316002)(107886003)(4326008)(6666004)(66476007)(6506007)(66946007)(6512007)(66556008)(8676002)(6486002)(508600001)(2906002)(83380400001)(8936002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vRbQrIckhzd6WWyOXvGDMaaMnqFzwRtI3cz0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ezYAiE9WysS2QblnspdR7EO81yBAKY5RStXzwfYDQwFCAmGTIsEPLjspqs0/RM36YOlQG+27C0y1NjCuF+ks/jhPg9kaeUBup8CkjEZf29RCAGQ7tF7Lx5Ku6SMxfCVN196djHPhRc96MTvxMP6rf5yQ7WHbZ93izcCtd2+RoUenWZcNi0mJe30oLkAoiXT4asClQeZ0q/XLt+Jps7NuV3GebgaILrtVbRRmuxi3T5noQaze2t7QByyvsRgJFUaz7szQyQ0OFt3hH8+avXHMoRtt8bGjJKUC8QNt7vF5WiVk43njHzsY1VtwTYeHNVYZHgyNRwW9hpxZj0cFdZJlbSDHzWo+DkoWeTxcm8lZCoKWioEmza/7kNHh6yH1venioDcZdd/lvleDuuRZYIW3N55m/wo5vfpRJjflU+x1Uw9aF/idtwd83rAdpoSGHwanV0Zwb6cvghpTnET6Y0ggoadlya+MQmti2YECw7jdihE2JeU/5Bz0ZxQOiLm4jBplfe8KTjb85wJ4gEIh4K1+Bw= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a2c4dd1-660e-4005-c829-08d9fc6a2be4 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4337.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2022 16:31:58.4943 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ATebPQHG9ALkvZcZiHELmaqZS6WmvyynF9602OhCyfLtdGxHP3gKAV8bpTAfiIKA3fzsh0+2tCxA+6zT/CFFLw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1942 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Petr Machata The currently used names rtnl_get_offload_stats() and rtnl_get_offload_stats_size() do not clearly show the namespace. The former function additionally seems to have been named this way in accordance with the NDO name, as opposed to the naming used in the rtnetlink.c file (and indeed elsewhere in the netlink handling code). As more and differently-flavored attributes are introduced, a common clear prefix is needed for all related functions. Rename the functions to follow the rtnl_offload_xstats_* naming scheme. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel --- net/core/rtnetlink.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 20a9e1686453..c484bf27f0b4 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -5059,8 +5059,8 @@ static int rtnl_get_offload_stats_attr_size(int attr_id) return 0; } -static int rtnl_get_offload_stats(struct sk_buff *skb, struct net_device *dev, - int *prividx) +static int rtnl_offload_xstats_fill(struct sk_buff *skb, struct net_device *dev, + int *prividx) { struct nlattr *attr = NULL; int attr_id, size; @@ -5109,7 +5109,7 @@ static int rtnl_get_offload_stats(struct sk_buff *skb, struct net_device *dev, return err; } -static int rtnl_get_offload_stats_size(const struct net_device *dev) +static int rtnl_offload_xstats_get_size(const struct net_device *dev) { int nla_size = 0; int attr_id; @@ -5219,7 +5219,7 @@ static int rtnl_fill_statsinfo(struct sk_buff *skb, struct net_device *dev, if (!attr) goto nla_put_failure; - err = rtnl_get_offload_stats(skb, dev, prividx); + err = rtnl_offload_xstats_fill(skb, dev, prividx); if (err == -ENODATA) nla_nest_cancel(skb, attr); else @@ -5323,7 +5323,7 @@ static size_t if_nlmsg_stats_size(const struct net_device *dev, } if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_OFFLOAD_XSTATS, 0)) - size += rtnl_get_offload_stats_size(dev); + size += rtnl_offload_xstats_get_size(dev); if (stats_attr_valid(filter_mask, IFLA_STATS_AF_SPEC, 0)) { struct rtnl_af_ops *af_ops;