Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9681218rwl; Wed, 11 Jan 2023 08:37:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXvIB+1JwDrTwGS/1twDPD5uc+h0/MT65jdMVroJGEn6JV55uyT2w+JHsrV1PfeJ+UJM1DEV X-Received: by 2002:a17:90a:d306:b0:219:f385:33a9 with SMTP id p6-20020a17090ad30600b00219f38533a9mr75856721pju.27.1673455056697; Wed, 11 Jan 2023 08:37:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1673455056; cv=pass; d=google.com; s=arc-20160816; b=xUehmLyy2eN5RcuxxQsEnbojc6skqUDqiAVFt+9e39slCX/sCFJlZwshG3+3e1epK7 K9brwxAFOcAGxY7rVCVkdA7vUfym2MF2wHR3IYshqEENXFcD1bn8+YpibKDYpch0aNxe uHV6VCQV7V7Wi6RTkJ1MpFdMKeBSFZxoM32DoSnbIj/oHXu6H0TtW8tWFbiClF8Sibpq 4iCpuEmAl5ktRFsYc5JaidW925l10eS+9qICP6kBb7jc6eu1XK5ZOu1NgBS1rnCEeLgY vdW5m+SRbqpE6uXshKTZBnhmuMBIM8yCrY0sm+1UpoodOCkCvKxEN3CnGnAy9ALyTYeH ExUQ== 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=c/kqf8kWcW1zl52Dy0FCWuLDKz4LORY+DybWP+OBPnU=; b=ACy1kyiSmFfotVBL24LNRvLBQJN6BD1ITmAM5HSL8flF6mfW+/nl07V6llwhgy0FfY UjKbl4GyClU6ZUB9BnhJQFYpCXMsm2QkLq+w7/1iaKrNINmWDksCZnozmwctaR5RvaR0 idFkEZsg76/pLGTmt0zoEZAU0OIeT+oBAVNnebL4AHjwrBDrFWt5ejYN+2oXo3UdyEUy HAP53SwVBQ3Q1mHF1D+p8VHQ1iCHOnUvy9McQqi9LIgsemGHAvHbWsSZ73OS9JeKv+Q1 +AAWB4lkcqRIJyP8w2gfEoxs/ilv8plyI1WsLQHRNKCaO4Cd2Ns7DAAGDiJOt59ReiJ0 OK4w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=qHlu24ti; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i8-20020a655b88000000b0049fde0f046bsi15512329pgr.66.2023.01.11.08.37.29; Wed, 11 Jan 2023 08:37:36 -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=qHlu24ti; 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 S238692AbjAKQT1 (ORCPT + 53 others); Wed, 11 Jan 2023 11:19:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236651AbjAKQRw (ORCPT ); Wed, 11 Jan 2023 11:17:52 -0500 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2080.outbound.protection.outlook.com [40.107.247.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BB3F1C42F; Wed, 11 Jan 2023 08:17:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SsIiPm2Jp5ghKaH5Fn94xuTpzq8AgQBEQUC+tBBIRoI/gwSN6TprY8V7msnne1mGmdD3Js+9kZE0txc6gRUQKseyRIuOBQpaLfZ7tobqPvssLS72jBBeGsVRHjHYsspoaghBjL8+pV2NG652UNnijc05FjYfaqNnqjQNLBISVEt99aqq4ZNsEcBsB1CgswVpQJOxFKcrgDyezpbOCkIHe7VKzYQPwWYZnX1JDFU4c3zwcgNiPYJ5SOpuD5Mtn61QBmKl4G/s8rSeXybLcIaOheqs/4TtpK7ooj4+EUAR2KvJKiudJYEtxvhMKlywYDgQWFFHyFKEfy7epvQ1GWIQwQ== 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=c/kqf8kWcW1zl52Dy0FCWuLDKz4LORY+DybWP+OBPnU=; b=dgEe+reW9pzYKN29HpBTfS+Z5Fa7dohzEon24XckndJ4HMb+ijKSljcquwNQ8FdGUw0m7mXu6beToPlIqctiJPE8AEC5AsRnDWZdLmkPdTd7jt630+8VqsLD8Z1+o8AkbYtqrSeKtwVoHzbz27+SuCPPXpuKi3XC2jYp0Xtt7F79cjigY5HEOVFEuqD7FobixHozSRyz/zNMKSVVHhdasNF1Neli4OOK2vOpTbPMA3do/msxZWXTXkuekIJ0fL7ciIKATKgG5K9A87+RK6E4zO9YvierxHv9Xw2fQcMjBen96qYl4/BB5FsGNhdqsrz7wlGHYbxQpDc/h+rWEZNGgg== 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=c/kqf8kWcW1zl52Dy0FCWuLDKz4LORY+DybWP+OBPnU=; b=qHlu24tiaeJIU04J6WL4+YjkpIffkMHrd1acL+qG86PL7IRtL+MxcK/6tvVEWb3zp+PBSnSrc8X9zdP0uRJGJ+6Jkj7/ku/5/t9TipdsZPv3rBLzrz5HCRnWLMnK7YR8CbMJysoZJf4B3Nt1L0e5Q9a+HNfOLe20zjJZEDr6Ego= 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 DB9PR04MB8462.eurprd04.prod.outlook.com (2603:10a6:10:2cd::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Wed, 11 Jan 2023 16:17:30 +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.018; Wed, 11 Jan 2023 16:17:29 +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 v2 net-next 09/12] net: mscc: ocelot: allow ocelot_stat_layout elements with no name Date: Wed, 11 Jan 2023 18:17:03 +0200 Message-Id: <20230111161706.1465242-10-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230111161706.1465242-1-vladimir.oltean@nxp.com> References: <20230111161706.1465242-1-vladimir.oltean@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BE1P281CA0163.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:67::8) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|DB9PR04MB8462:EE_ X-MS-Office365-Filtering-Correlation-Id: 6103b1d3-cb68-46b6-d764-08daf3ef564b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GNSqQPWVuFae2Y1zeFxP5xaoiJBZjadqsnarwEVf9qiyVEGLguBHPp5ACk0FTj64c5wirGI7rO9483DAYx/Kcsy4jC2ld2cmUKwzsGisLJiLX2+K45Omnm5Rx11Z87QvqhnnPLwRRntDo0vz+NIpHuG3pGDk68YFcXUHkqLQZHsSr2/HJ0OH/XrDmpv8/rpZuw1Du/i6z8vfIP0DoFTDiDLDmu84bUoBkXlorsAnmk2EwmNmc1IOFddykNAGf8mBn0e3lc4h8cpvjkSv3O5ULlo5o4U0DQKoJ+y6//7B96bS8t8+eVXUvLHpDD9xvB/OtLA3LIGzq/PEba5AQygq+B7xhFmVKaH6lmrhnlj4JyJIJZ01QQ5Gd/PRFM4TgyhiaYttKkUL50YE0T2//F15fit/pVivdGoAbbqb8nEMVFXj85Ov9MYvOwze0tJr0wDcloGMT8NE3+T5HrPbkSjfvjg1SnpAGSZFp7qu1AKFwRgPqcpPUNhzbC1xuCa+cTvEDwV2nyAkI3TIsQ8bPlUjB1Yks/PSgHgIwP6Inv1CQWe53EoiGJqdzi5yB7zEo88cmLUfuM9C5S3zcRwr3o9YT8bBXKgDlu4H4TtguWKKv2itstPFZP4sdtenAx72oTOCy05FTmHClqvmBtwW0tCDPGxucv6J8ojXxRYR0h1PIMmgnQCx/1CiaKgC2xWfpGec 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)(396003)(136003)(39860400002)(376002)(346002)(366004)(451199015)(36756003)(26005)(186003)(8936002)(6666004)(6512007)(6486002)(6506007)(1076003)(2616005)(66946007)(5660300002)(66476007)(66556008)(52116002)(7416002)(6916009)(316002)(4326008)(86362001)(41300700001)(38100700002)(38350700002)(478600001)(54906003)(8676002)(83380400001)(44832011)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?M8H+Yoz7bQvQEMh+NSzLXF/37kcSxfCN6+CWdvDv6wO4K6eeSd3CnIh5zNOT?= =?us-ascii?Q?QjkU8y6v43TSUGwoVnDVY28GvhzqSEfMbDg/CLUQp/1GKSN+nmXTmLCjZQE3?= =?us-ascii?Q?rTOtncHFpYCwbHLDuqwkC0/zTM4OmcjaDp2GTLyYtEitFhmoAYH9Gwo01MSU?= =?us-ascii?Q?p154mXXQFtrg/L9u+dHZJstPBSadpYudQzLgdC91aKiIO9YQTqgEvBQXX9ej?= =?us-ascii?Q?peYhCkQZcmGbZFIp1gikbGkBlNnOlcGKdtfXLKQHOSNdEEWldBf4QskklQdK?= =?us-ascii?Q?KTUY6OWagYVZghA1N1L4qyMpWsekXF9oi48z310vKQEVi0uWgWUofc7I2vby?= =?us-ascii?Q?C3EJZkhuy9uUv12A9T4KpDcsssG1V/nR7O8vVfwixt64StW4Dk3ZhB7Qk604?= =?us-ascii?Q?1o3SunNSDIYxhQKOKLaBH3nFGkQiKqLKogTLs6DF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uT3OR2VwXMZkMtjB3PTeZMq8KGK8x2h1BHMZnZ6o7CwgrgINiOM?= =?us-ascii?Q?At5wCQIp7tM4MEYthE8qLym01TitYIeTpUL0d3/Mb97Q87N3hIyVx4RqyC1J?= =?us-ascii?Q?Im1B8OYydMCMFoHzr3IejvXwWnQsnM/A669K/y8A1VpQiPondGLCOJIap1eM?= =?us-ascii?Q?6mkw49ODdXxEfK6lpekXlKcQyc11BceBIKk3cmQczo8zmXr4GsmacXaeHM7S?= =?us-ascii?Q?/E79ddYYk7sRSAWX974G4g601RDb8wUan2+GciAbKlQaaqtwDPUp3aBtJOQu?= =?us-ascii?Q?VQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6103b1d3-cb68-46b6-d764-08daf3ef564b X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2023 16:17:29.8921 (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: 1l1BSWzUWz94R3bbKCIELIkXwnqDu6XzI2xKFPzy/iQLlMNCxavTVGAe7VAQPX+qxp4fZeXdp117UljWoeaPow== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8462 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 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 --- 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); -- 2.34.1