From patchwork Thu Jan 19 12:27:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 45728 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp298716wrn; Thu, 19 Jan 2023 04:30:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXtYDpqtBaRo+GVV8chVY/kGcAjibp2bu+cZAaSknsQrFiAw0P/H9qezsNxjxxmiBkNd+J2u X-Received: by 2002:a17:90a:4a95:b0:225:c3ab:3137 with SMTP id f21-20020a17090a4a9500b00225c3ab3137mr11006514pjh.44.1674131455195; Thu, 19 Jan 2023 04:30:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674131455; cv=pass; d=google.com; s=arc-20160816; b=zFJYoaGGZhdAs/ZiV83B6f22iq/dndH/f08K5ek67XZrre7vQphRNTc5W9f4uRPnm/ dMFKg49v/jJqApProGZABwa/oXPdr2wkxyPBTJ/M+vQmxt7hbRNo44inmxb7/LSNtIyB XoTjB0yX2Vx3GvUnfkfzZms05sJcalRB5SR+IVo5fLNfx3htfckNrbTia0XhMe+wIj4I qTFAjsJVMlFur8sxWe7g7Z6kW5VEbD7jpcDJ5t/cRtc/JTXNBfx+Vfl2p1d3DPo2ppqp 3onOsWKYwA3BvoZ23VNchLP3sV0M7Du9z1qfY/f40tSpVL3rXBACqitirPR1yZGBneM8 RTUg== 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=9ezRlgl6x3LiQifZBXNjx6U4npuVgQCVw+Eq+mc5ovk=; b=xV+A1YrmV0Pw9K5RCFgc8RevYhs54fDJ6DjGssTXBO3BSLmBklZGACavN5a3AP3RwW aDWUSOwbsefJJGr8ReBIq3fKDNVNKjee0Wt80H4ijVhXC3YsXr6dROPeio2UpcWg6iAb osZ/snMwSMgJS9ExFYJUQ57htBzl6LU8bVODipLXuFzYio47yzBqkK5M+OQsOVHdcFA6 Hhlz611rOn9nycTgu+EYvm+YdOqR0CLI/VcK/AL9hukz4NbnMIqB9OxIL6mINHkx33fZ uzLt84fT5x4Mt5hazqqrhO2OGuQ01uBDmqClEvtwx1hepRjxQwXyKNscACKCzv9wwNNY lUHg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="Rl/JSHrn"; 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 a9-20020a17090ad80900b002268e9e9b97si1022342pjv.31.2023.01.19.04.30.42; Thu, 19 Jan 2023 04:30:55 -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="Rl/JSHrn"; 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 S230079AbjASMaG (ORCPT + 99 others); Thu, 19 Jan 2023 07:30:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbjASM2D (ORCPT ); Thu, 19 Jan 2023 07:28:03 -0500 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2079.outbound.protection.outlook.com [40.107.14.79]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F4D26923A; Thu, 19 Jan 2023 04:28:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rc22ycshFMhvoxwxpSEwUf2t0RRMMJYOTaNqHwmKoCfkAf4LZ3qCkohd7JNVfc59Pa9xQRPCiPUUg2qbqyLOm622+uoc5lVlzfwtLrUma7Vtjpl6NX2LhCi8lPQujJXkuVij4/CzGbDlRE87pf3xHXpPnJ0ut1D1CtAqJGQNnI3KFFFji+Kdgmm3yhpM6ZPkK8tlxjsjO2CzIbhBs6ATkXdVeuvpR5vmgBsTA6Prt9AgG/XIdDTNhl5F5xtS1HOgkKj+L7d9LXdCP4slrX+f6WpbSTTDN5SlxNqPQrczvEQJCrvXyMQwe3IQTM/f/TCCsSjhRLhIwXFYu8JxF+sgBg== 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=9ezRlgl6x3LiQifZBXNjx6U4npuVgQCVw+Eq+mc5ovk=; b=hmynbfj065WiMruluB6nVHbXjLyibKefCGjQzybHZPlY27PF9yrF5DkVUNKMKagdQJ5RW+Vz/NEDODrVVayuD6IsNJX9Kwe5f+ZxSVueKrSl3paxouDGTuehCQ2OR3wxXwTGLx8QijY1Z1pRtUI9KJTEhebUvjOLdpMcvUFLWrT6Bqdhlc+dw2YabXbbjUuTBSCxQQ9Xj/XvxQBbSDxXrlfrdWJvzJh2EPtpfQeC/mcLNLl2w5rVtvcpYZpG6fGSIb/GGMzlsQ3bUUe8hvNN4M1wZlbBaIf+AMA6d1OjtBYPVoerunAs1NMKq15i6kuPv5LfHZse9RVwOjxWL+u8gQ== 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=9ezRlgl6x3LiQifZBXNjx6U4npuVgQCVw+Eq+mc5ovk=; b=Rl/JSHrntxSMdpuIYJyHwcmwGH1XcQS3Mp0TtUNghOXQg1bDpBdrYWxekWZNnIcdRn5y0XqNJGDLZ+yIFB2s/bJEBCNNiRHqsjBJqC/zn8kxeQeP8ERnFJyqME9X+TEbpFK94iH+vQSfQfUmhS+3in/dn8DZd7tkKKrffkEsnlc= 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 PAXPR04MB9376.eurprd04.prod.outlook.com (2603:10a6:102:2b2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.24; Thu, 19 Jan 2023 12:27:57 +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.6002.024; Thu, 19 Jan 2023 12:27:57 +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 v4 net-next 09/12] net: mscc: ocelot: allow ocelot_stat_layout elements with no name Date: Thu, 19 Jan 2023 14:27:01 +0200 Message-Id: <20230119122705.73054-10-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230119122705.73054-1-vladimir.oltean@nxp.com> References: <20230119122705.73054-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AM8P189CA0020.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:218::25) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB5136:EE_|PAXPR04MB9376:EE_ X-MS-Office365-Filtering-Correlation-Id: e6105401-86f8-4a5d-1878-08dafa1898bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zSFHQcNgwcOCJ0mPoPDE+vwnsFxnqiucuclxOjxTE77iMtTqLj6lbqcZ9uqZU0T+5PGCYutuYDzzAnzwjYogh8bmOqbTpf9368k2krCBx9nZD4hOlej2dGToIJAXRB9DdwoCAoigVi31oSYHj98n8c5UOdl/KldLh1T4DlQwjIS6fUQxJhmwbpMnWKhDg3Dye+uD/IwXpBNfUaNMV4Aj2hujQ02gjyopysb8lBOybL/praBFNhtVsJR1FZ5O5bQ7zEAvC1liRvBI4U96CCaCBMGGGJHrTZ/v9P+riyWWprUF90f8VbMQ2KXZjikP2o+sWB4c1+8vn2KS9eDHN4auVCQyrnjODJudVRON4IKQ4qh2x7q8tSvFxAwUpGVOr647Z/N/8BozE9djanTjkoPTf2xRnQNc6jRuMFhruBnrTNiEya8qk62UK6xAeV/YeRUwP0I116NGpK96l3wUivxvLw63ctx34vbMG2TfThndhm6fVWpjqvIcKvngUCe1QMi6R2lxHIoG8U0RAZiGsHDJ6RLBFJFRpnLQEWxxIux/f87C3sHPsMouwBdDI+Du0SkO3g8e8ci0CeLAY51CLjUV3ZfMzn/v5qDKuXX1pKVvfU1kePIgQ9J516Q2UoK+1iktNnRkUHy6dSA1R+FGGNTsHm32OdB8gxMPgaBT8WEffwTzou0AFAECQcHnYD83f54kT9w+z7WmiOJzSshf5DkoLQ== 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)(39860400002)(376002)(136003)(346002)(366004)(451199015)(6506007)(66946007)(66476007)(44832011)(66556008)(7416002)(8936002)(5660300002)(2906002)(38350700002)(38100700002)(316002)(6666004)(54906003)(52116002)(86362001)(36756003)(4326008)(6486002)(478600001)(6916009)(41300700001)(8676002)(26005)(1076003)(6512007)(186003)(83380400001)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: px9LiMhy9FgDNUWT8r91TRSSboiqmx5eyvs2S/VcmXlWE5rX6yccK5yxljWH9RdjMs0VycHP6f6pMcxXMLFYMY6a5NP39tJPzGi82/e7isforgTmEA7R1g8e2dJee3bTzsXhztAElnjvWd1YGDrdVdM0KNY2TwCox52fEFVHaqNXDEmpnAwhPY/aPILXs6VZDv0JyhhXVZGpZpif5cvxpR+/RcLhqYtUie+EvpxMs+26CAndANqZbyOeAGpneYJAdeYM4LMuJwt5ixQ8NuiOwHOdlLm926H/q+jyCm8+5itaZg7yYhGpVgY+O56+OlrrV+78xtpaAywzanz51tYNNpUgXSiEWpEDdVzmjFmIdE04MNbfOEf3Co+CrYMHKoiMOQhgr727Obh0NS47AFhX+S4CN01SqNsGR6l3ZAmoRfZEFEVqu0ElhNcvWBQ1FPNaRzsCL5Bnx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eIjHwhTsL+S7EtO+OamGW9Bcik4Rmi8Gu+kR2yOhteixlkxS+InMfedqQUN2PxuEHi/dmhXmFbIsV3Ntktcw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6105401-86f8-4a5d-1878-08dafa1898bc X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2023 12:27:57.7938 (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: zb22irZWNVWYN0wxhFBP8+pXg5dyIo8KRMaXjGvSUXF4DCAaZnyHebvNJdTM1byGt030VOEiRnk8V3mQp+cZvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9376 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?1755454064738805954?= X-GMAIL-MSGID: =?utf-8?q?1755454064738805954?= 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->v4: 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);