From patchwork Tue Jan 17 08:59:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 44589 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1649481wrn; Tue, 17 Jan 2023 01:14:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXuJDQYMeF4vj8DvwFCcH+PRVEENZR/Xb12yszAPel6xCoA2VsgQMXklnSR5Pl2JvdA8Mclp X-Received: by 2002:a17:906:3748:b0:872:69d6:eac with SMTP id e8-20020a170906374800b0087269d60eacmr2211236ejc.74.1673946890700; Tue, 17 Jan 2023 01:14:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673946890; cv=pass; d=google.com; s=arc-20160816; b=Z3E/smBBREV/Ba3V6HdMZlrkCIsGLfcVL3Sr91D09j2TgRoNxU3+txvzOHibnz6e+G rFOX1019tnvYFoDGjutgNdOexSP0c5rQRSr2FKGjKh5wYR+lwjzYXc/WYwtXPpG4U77y pfKCjzODnpjISsSryJTzsyviFXz/VQnlrzdtRBvy/jthW0Ttwc9IXmc/nkpa/R/iyVOz 8Bfrd9PL7aU8ZPPEmh4Kc5P4WmQHE2zbQf5BYCEl/Y1vAhcoK39eq6uGJ+pAeqYsiAJw 90Htv/pdBCzCP6ZKmomRmLV/ax4aqdtQErVrUNSNNtciKryZFE7veCa7MSrsksJgsFWk 02vw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oKksSES58XgQr62Qj6ao5CTuzUuwjhZXivOpP4Hyneo=; b=IBm09mal0JvM3qJCHZqbYJJbOEgNwRJvJbcIjc4pqpum4RSeesfiQ0OxRLUR/dfyHU iikMUhoZU/LwdZALvA46WGKlMoLaZ5lvE3e8XYMit/L2Db4Lw/XCBBKeUdbt7npmbsMs UlydsYXR+wZEwlMaiDhst2ArKKdZXMpDkWdKfAQlenOofeEu65LABgVS+gQ7LJs9mqH7 lqlJB92M0d1JF7GSQTr1SKjRscTvJRWZqmeT+0kgnVDstmQv40LpWdD7RWZidP2d8x7p +yYs7U0L06SRol9sr7gK53vmYFuzKTTfExxoIAU2t6AR0oJkHiRAGos8TiCc6KrI7YsP 0m4g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="Xgwll/oR"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv9-20020a17090760c900b0086ce37e0daasi12165493ejc.789.2023.01.17.01.14.26; Tue, 17 Jan 2023 01:14:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="Xgwll/oR"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236307AbjAQJE2 (ORCPT + 99 others); Tue, 17 Jan 2023 04:04:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235672AbjAQJBo (ORCPT ); Tue, 17 Jan 2023 04:01:44 -0500 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2042.outbound.protection.outlook.com [40.107.8.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10B45302A2; Tue, 17 Jan 2023 01:00:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OdylFrgfZjpJQ7qkh0E9HTCRx/CAJYjwCsgXkJ9fICX7os9qTvnTgDQ26pOJvXKdWY1X/0XIfnGg66wGWrWyrs9RwRw5Ayds+0n7+6nlNthVXTFv6ydUwYb74h2oax43A72hi+LPNgshahAGR+KCf95opWcDvPLOUCOjhuPmRxrCx9U4K58ZqrB+UF8EHE8MYnzOROPVU4VfEQ998mmQKGeGQ1NkaPtroC4ojksQguCsbxekTUm68pMdxZKAXIIyqJC+7wgVK4Jm5RUhVo5NntrEM+iJxQ3zi286llcdxjc/OKycDAzzmw5ieA9m0NOlfe5LojXyhPnGPRbgMw4DKg== 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=oKksSES58XgQr62Qj6ao5CTuzUuwjhZXivOpP4Hyneo=; b=G9OI+eGZMHW9a36SU3MwRCXNEQO4ym7D/QLHEe52BgaQukawos0wwGSCRi2GaZOh0eaIF6QVU4INn11TEExUCYJwGUUX/TVU8s50Xa8xtUrcKpzCFLabl+cgIJmOpz1RiUWST36rTEDru/wqVgM8+8hAhz/GJDNmBhZhD2RSa9vpVMBu462bJb6oJGFM5CoaPhnAdJbhxpsMblSCZBoSAhu43iNCOadGYWt/jwGxE69+UCsbS8AeqTFNs3kSzt28WOeAQqRj3Ot5ME5r5SKY81woCGrtcG3GInG5HGem+iI+o0fyE5Hhy2Lo4i5mRO89CpgF60ie69Zs6tpWmOVC0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oKksSES58XgQr62Qj6ao5CTuzUuwjhZXivOpP4Hyneo=; b=Xgwll/oRW4oeLKpy4RPgPmlF+nWolbqSvhineDQgGTdnTVDEpTA0D4iLeEUK7C89ZszsrB9ucU3NA21/fq37SRpXZf+7FYx+X7fdB2yk2jBaVDL346wlptcSTUfOLXSMdxpLR650TlkkaY6DdOerzMghcxrGyJ9Iig8MTctmmPY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by GV1PR04MB9182.eurprd04.prod.outlook.com (2603:10a6:150:26::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.19; Tue, 17 Jan 2023 09:00:13 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::3cfb:3ae7:1686:a68b%4]) with mapi id 15.20.5986.023; Tue, 17 Jan 2023 09:00:13 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Michal Kubecek , Claudiu Manoil , Vinicius Costa Gomes , Xiaoliang Yang , Kurt Kanzenbach , Rui Sousa , Ferenc Fejes , Pranavi Somisetty , Harini Katakam , Colin Foster , UNGLinuxDriver@microchip.com, Alexandre Belloni , Andrew Lunn , Florian Fainelli Subject: [PATCH v3 net-next 09/12] net: mscc: ocelot: allow ocelot_stat_layout elements with no name Date: Tue, 17 Jan 2023 10:59:44 +0200 Message-Id: <20230117085947.2176464-10-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230117085947.2176464-1-vladimir.oltean@nxp.com> References: <20230117085947.2176464-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: BE1P281CA0115.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:7b::9) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|GV1PR04MB9182:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a008d3a-a64b-43d7-cc1e-08daf8693e84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z50ua2adfBCer5HJZO8dpHejyrZrAjD5VywOnAmEsSMgnSBuMdCvVNvr8LdwMhAly9pD1sE7WTWltmQ/C09CfNpQBO5BuVOm6WxtXk4AIvCIGR31SHKBZTenEoj+r3ccv47dkcmbeNTkZu63H8LnyTF9QkLAfDuBYoCNwTLFvlG+WyW5lNnPditX6UP78T8oPRgO5OrVJ8dqBK8ccmzRmUq6WCA8clWiL3CqLUKHk/FbrXu2l6Z4c/Wc5ccGxZEy+qq3YmE01Mj17fqfboX9bO/y+7qQ1VM29dIWqcyh6uzQLw0LByR9y0T1ExgDBv/Fb5P39ky/+dpr63sNWxgx7ka1srNcFNHL+lUuE0NXl3Ee4izQuYjcyZa3vRiAxS5pObVkXQ/B1vdAFh6uWSzprYvuBGHLu4B+4EznUbvOxmIfidf6Kg/xyxvbWuVMlqxJIsnopMu8qovPCacDMoc2hznxA/dCrL3pY+TURA9fZawIPiIQRZR5ZMCfflGbwAMOYeirJ0T49dF9WMp8r2rzP+KfSfWho9dmLjRROwhCwzTcGg0CaAygAELw/6IpyY37JXw5bPXoGhBwGk5Gy06IMtllVRu4Yw4yikY0TSZhxihXilTG++Tmw1QgjCcu1CAxgD8lMxg3SifKj+zcAdUy3DvmFInRzZpbKvs+lW/KlKkSnxYTUOPKy9HiHeQxmIN5 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(39860400002)(396003)(366004)(346002)(451199015)(52116002)(26005)(6512007)(186003)(478600001)(6486002)(66556008)(66476007)(316002)(1076003)(6666004)(54906003)(66946007)(2616005)(8676002)(6506007)(6916009)(4326008)(38350700002)(8936002)(38100700002)(5660300002)(7416002)(41300700001)(83380400001)(44832011)(86362001)(36756003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IH6ZVRFMEdEEEg2XTQydGiMKpQbGMOF2SA3xe3qPq61YXfSAc4yvcR9Dg/9/CDS2wzdaaosyWr0IXxXTFlHIu8YN1xxyvxjIdd9xiMcgNPNbCNdZhLX++hjERKHef0fCF22Oto+wiCGFGos5jIII4OH4g2LZvGJ5/dw6JbCa75w1dfFC5zGoEsO30EDxMp1hFHGD2MAzxb8U6ZQw6EKXYtlRCJ5vlnkdjPzatqK059sYWzbSeFV8f1xbzCjsv7ELDX0Gj/tXk1K/rmt2azfzG4MUoZQx8Zgm/ZJVejjkZYiURBBBmXeIZHXwe9op6lAnJwrOQH87r4JYHl0M/6b0Iy2++0Iv2QCwBbp2SDrQnICuqG5vV3iysuKc1qGocfg4VamVuqEIvqusZH0+nON4y2vJ//74QNySS6Rxlp0ZOInGkiy4gyMwOOfso6PJ/3MTmCEoR+wctx6BPgSK6r7F012gWQlXx1Q7mzflonK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7oDfXThmhpDAUze4ykaj7vLrJR3W10JbqXOt+As0xUOwCqAOgi5QyMHjyw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a008d3a-a64b-43d7-cc1e-08daf8693e84 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 09:00:13.5022 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WhbVJxiPeAbmm9fQouuHmo8eInvNdKuvs4v/ECiSoQE3T+I74szcoqyWnCQC86MN8mYwX/7pMW2S+zmRKrJi+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB9182 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755260534751600581?= X-GMAIL-MSGID: =?utf-8?q?1755260534751600581?= We will add support for pMAC counters and MAC merge layer counters, which are only reported via the structured stats, and the current ocelot_get_strings() stands in our way, because it expects that the statistics should be placed in the data array at the same index as found in the ocelot_stats_layout array. That is not true. Statistics which don't have a name should not be exported to the unstructured ethtool -S, so we need to have different indices into the ocelot_stats_layout array (i) and into the data array (data itself). Signed-off-by: Vladimir Oltean --- v2->v3: none v1->v2: patch is new (v1 was written for enetc) drivers/net/ethernet/mscc/ocelot_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c index 1478c3b21af1..01306172b7f7 100644 --- a/drivers/net/ethernet/mscc/ocelot_stats.c +++ b/drivers/net/ethernet/mscc/ocelot_stats.c @@ -315,8 +315,8 @@ void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data) if (ocelot_stats_layout[i].name[0] == '\0') continue; - memcpy(data + i * ETH_GSTRING_LEN, ocelot_stats_layout[i].name, - ETH_GSTRING_LEN); + memcpy(data, ocelot_stats_layout[i].name, ETH_GSTRING_LEN); + data += ETH_GSTRING_LEN; } } EXPORT_SYMBOL(ocelot_get_strings);