From patchwork Tue Mar 21 23:28:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 73109 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2066734wrt; Tue, 21 Mar 2023 16:37:53 -0700 (PDT) X-Google-Smtp-Source: AK7set+aec47zI2CIEGkpLR3ocJITNkmqaB0kEVA13F0lBC63SbKnQ777bLTcvjzG8BNc4Nul/cX X-Received: by 2002:a17:906:aed6:b0:8e9:afb1:65c6 with SMTP id me22-20020a170906aed600b008e9afb165c6mr292502ejb.13.1679441873218; Tue, 21 Mar 2023 16:37:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679441873; cv=pass; d=google.com; s=arc-20160816; b=j0TBsIJ0rW+Q4v7MZ0po9CnuweLfTqQrHSXisrdm3DmGLa7wH+8L7PJQzNilATDeMd 3GJ2qc64/msbhSLcc6dHIrs8ol4t5VusJP8si+tsHPbIi4gLRu9j5PjBsWe+q0JxjmAn RVr3+hpVCN27Zpm/YRTPcoL/0uaBqiybYAOUtD9+SjUQntiIVOfrONuRSBEo0g4nA8/a HtrWBcoHhn/zzriSH5rY4rinMBRD5W6d8MqF9U6fdHcDPMtpJKNlY5ZssT/KFck9tCe+ leuT12o5YQvo78wKpjMjWHEhiVyxhatzEWS1TFMf70KhXSWEN/oflPfUeS6/bLyCT3U+ cHCQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=JIq4o8WHLJHCTRDENDV9BYqFa4sIGoiQxsWS4hucH4A=; b=pvDJCgGnINEwGzKMKuMZARVVAZ6ajXWHtQADhYsnoa1PwUuEM86q62ilWHS4OkZGad QaIqLERcxGb8d4Xtyfg32zWhX42rzLcMNG5afsM8CWAetZfvz/nJxPn5g4+ZiL+zK879 edH3XlMrxw3xuizdnYu2DFxze3v7sySa7OvwlUWW3jh9EKB5+1G1BWBRTtWLF2nkCzMc +F+wtttPQtwafPGp6Cy8FZ8D9qsxxtYeRH11W5WVkOT9Uues0Db7BZQdUnUpVL7PmcbG Xo+8E3E4NF4SKcFgr1+ubuFXdSwi564YYzwTfaB1QhLShHohjxQVitIDalwORHn60mo5 Y4KQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="h6XI/jk2"; 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 zc15-20020a170906988f00b00932835201fesi13525941ejb.635.2023.03.21.16.37.29; Tue, 21 Mar 2023 16:37:53 -0700 (PDT) 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="h6XI/jk2"; 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 S230025AbjCUX27 (ORCPT + 99 others); Tue, 21 Mar 2023 19:28:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbjCUX24 (ORCPT ); Tue, 21 Mar 2023 19:28:56 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2056.outbound.protection.outlook.com [40.107.105.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EEF813538; Tue, 21 Mar 2023 16:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MPfU05B0rGXJiCkq7lwgkdkCMOdyr07qbLBxDtsNMjYYglMjY8Szw7im7Z1kuPRQtGAVtKcbFBUm8CgKzws2tNj8vkG3A//6EqDGH+KySZCPxuA5qCbCkJ7i9G41HvDotcySQlx79Eo0hQ+A3sfZRDVptY9mDTcVQeILFiQFwm9APkoDqZVaaWr/7A4enBvGw5NjsodAY9dEmfwx2OS91HyeCRsrq27ZnLk8U8DgWTuZhpNtTgRsErAdYhf8YKzulBCy1wO4+vZnkAtjoqh+PVv4eafRRBU0X9fYkGAGnX0iOcNpRObtlos5NZg73fHIHQGp8h1CwQh0FKRFeLggjA== 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=JIq4o8WHLJHCTRDENDV9BYqFa4sIGoiQxsWS4hucH4A=; b=ZKa21tD5WcqyDedefu7+IjZBnS/OvLEMswiVG7FkMi4lGG2cB3O3f8H3Fk/Je3mcodCpftKky06HIPbuShr8tQ923yYOW49fpoEKW11etu2BszD2rd59Mikkqjh5rb3/T7+x+x4RQpLv3THtW40KNQzhsmc9VC6rUbbhuamMoz9kMmu6bvqZYTqZTmb7/wXWEzJGfKl6+xQTOE1G1wh5TdBvbIre2qEtONxdLwbZKonBp/0pKVGTGuSzHk/ZqxZTpHnAyc5juOSy9fPs4EvDGf9QwdBjsU5mWdHGQ80YX0DXm/RsdcKtg+jGSPY7VjGdn2Ca+T083q/YHlYzc0KMhQ== 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=JIq4o8WHLJHCTRDENDV9BYqFa4sIGoiQxsWS4hucH4A=; b=h6XI/jk2HsE92inem8yGqZ401AbyS5Cj1ONZUoRuJJISA4+QpG4JdwQ+42ZosRHVRi2+S95CbDoFedq4BVLkCYz0a+L7JqckVGKjes7LySCSdM/vrMv1BoQShlEDvm7KZQEG0us8UJa+Q/qxCUtxIA4nHieoApDRY1Y13D3Xx1w= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by DU2PR04MB9052.eurprd04.prod.outlook.com (2603:10a6:10:2e7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Tue, 21 Mar 2023 23:28:48 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::29a3:120c:7d42:3ca8]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::29a3:120c:7d42:3ca8%7]) with mapi id 15.20.6178.037; Tue, 21 Mar 2023 23:28:48 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , linux-kernel@vger.kernel.org Subject: [PATCH net] net: enetc: fix aggregate RMON counters not showing the ranges Date: Wed, 22 Mar 2023 01:28:31 +0200 Message-Id: <20230321232831.1200905-1-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: VI1PR08CA0168.eurprd08.prod.outlook.com (2603:10a6:800:d1::22) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|DU2PR04MB9052:EE_ X-MS-Office365-Filtering-Correlation-Id: ed56d3a5-28a5-4827-ba6a-08db2a640557 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x6nZIxNGE6mHcmheNBny4k11RAnl7MZ4eckHiNPh/MUgIm5RWe4zGqOHjeUiQ0GUcbgRg9rD/t/9iKrCNfblO9K34YAyNjo8iy/sHpjdbtm/lVsSDlnlQDafFNq/2SY59PjhUpBab8Ab9F7OjhaZ+jlePF62WT+7J8s1NqG48uCimtX3yitCH/W/8Z2EcGRhmJoebHLJs/CaOGPt4rZrV5HA45iMgnCbSjrrdm5ffr37eaMvTeHshesLzifj18+uxt6s9dzLhYIi2nqUXSP2bDxwRGDiej64SiSUSI5TG5EbdYaAs0rz/IW/ba6D3J0XX8LJ+7wg69ycgLgu5afZjNprzH08HeuoWdQlw8yqDSTzNS9FhufHN12hCOQ1iU2aHYIxY7wJAQW1zQU6yyoY2Hyg3ifjwgR31KSdtDD34EsgImwq1XGzJoN2j7TMiBM/Y2flRjkyGrJUBKnD36vbTgIO0ung3LoY5j/EiJYsflETok+dnsM2SCZNmIn2ipahX5oKuhiaXd3FcVp811pDpMacu/7VWsR3Md76SpVRTqFu6AGMqmNZIy6h2y1AldmW/F1QcBSUhee2RNg6pj+dmoWQOyIhABUbpf/MLo1QfledBYhyMzAf4UWLyAV6zK/cLAxCIkWbWE3gp/itOUX/SchUu2EP/1UoOVYccFxyyh0WbHw5tLAyxcjdyp1XZ8ddtFhaUs/6O5zOGwLG/9mWFg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(346002)(39860400002)(376002)(136003)(366004)(451199018)(26005)(6506007)(6512007)(2616005)(1076003)(6666004)(6486002)(316002)(6916009)(83380400001)(4326008)(52116002)(66476007)(66946007)(478600001)(66556008)(8676002)(54906003)(186003)(8936002)(5660300002)(44832011)(41300700001)(2906002)(38350700002)(38100700002)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PRVZMlmBKBQtPbknas8ysfbBc+WUzoYV5+HCB0rhbLx4887Hd48ar30IHVUvO97bbAiLookatNGjWsuxqYparoEYhXb/6ZxtDsgzNsilLvL6wzq77fyeLfKaX+hptUOnN8imfAxoBWsZkY3sS+F4VsAd0kcT8MMJmg7hqMbZVDNzs0wh1DOSZji1lNfFZlZc8Ali+OZIxivqNwQQ3PgB5hZD+kczbXFoahRiqEfxckEl3o77K/DHzq1uhbLzkNyQ9lrS2uYV6YzXsRZGW6RETCThNfc6uz3jxE4P80Nfn5sFLw+YpYOPIv5xDZFXlgRM9yPKlv6tgODkaCNF9fdsT2ZuiXzzhZzkhseo1aTNw994B9M2wkYdohIwapX3WxXInjqyO+6rZ5bNjIDSqLAVdsfqRskC0iKqyD1eEa+JRiYwQr0qhMfCAWd0PTXCiY7msYgPfE9Z9lz8m+xbBd2JGSb0zq1I8uVqYFFg1QlbwQk8Vx3ZQ+TYkhqGYMpmkTLB0A+ComhMp7y/BatBD3kI7sNxB7/PACbFyRnJ2bwU0y1JjgY6ekUb+Z60Bzs0+3TrPF6a0mRIvwWuk/so85N//lXqb9G13+xcekOwreQF9VDCSzrjd2fl0nCYk+UQdV5ksj29ZAHwaNb6enCQu2BDXvNuOh2LIim2XmTROVWa2O5r3ovW8JGiau5S7obPX4lDu1DYIaACewWxJMvtFS29OUgqWV6zbYSOy1+GO+6rgMWJeI0DKd3HDzZCzgurdDzKdaAesRh+MXc71REMe1GYopP1Y7deDoZPLOecd8OtdpjleVBEn3GmdoJUpm2477rSxdIrsW/RB9R/Ip5mZVfcykPGZKx0FRUqe3BYgmg32YqeTJ9vrNQqF7kYRoJJoAOX9y/hEQciGbXpi+2zgSFCNmOh924cbS/MfxXjVd6/WtWkEgjyYVS1bij1NQ99oEhRSFMywi9Q4NE3sOymAjwW2XWwke4nZYzpFw+YxyYDhf3LvUNYtJr5MoWuHXMoy5Ct2BcifOPt0VCjekfgwIjiNxkakE/rAsk5C52m36SqPNRgpBtCsmtilJu+S6lB8nIylE/FdfZiQT37/tcDEQhPRld4qsvJ+qJ7hWyawghLT20y2l+2LOti8fPqUBkXDA/rg8B/cHL+ckzAK7T6cJbSx1HzPCvgaLg995YfBDywDAuI26owOXWQeYrn/GGj4RzMmdffOnYEgp/ZaEBgFhjDXv7g6hTKz90KshdBLJBh4DRCgbohjr6FltpF2bMZVXS+RdyHCEIzVDe/lCPyXp1UOLk28sOHCHEW+JJvQ80Ys64ILRz/B7Tl8GanC6F1twacqq5C+z5p9nTeuKQB46eZtfhK9yTw0u28bxKvMVpKj2eRDSZHYyfWHMIYfPLvbD35SLUmJbvl78bdoX0Mc7Qzfc8arw+VHf+16aBRkxmPY8bUFYsjFS0jpQovsCZujzFXt+9/Qs5ES8iluSx3LdgbV04QQYVYQw6Zk4PWk7aZFKPJX8/KYdgrhOFQ+l35ZHVbYmMzl8xmrrYaCphgo+hKaB8C5FPOJhwDXIQNo5toSFlgAJPUYggZ6HwY+u7mvvvsQ8hAvyOgJCJqr01zcJYUtw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed56d3a5-28a5-4827-ba6a-08db2a640557 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2023 23:28:48.1226 (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: oSOQnuAAIzITe5pgjtKReI8e8lJedcovQhYR4u0UX7mrm/oz1zqX/z+atoO3KTd34D1Tin/p8Edeo2olEJQ6uA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB9052 X-Spam-Status: No, score=1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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?1761022441601132495?= X-GMAIL-MSGID: =?utf-8?q?1761022441601132495?= When running "ethtool -S eno0 --groups rmon" without an explicit "--src emac|pmac" argument, the kernel will not report rx-rmon-etherStatsPkts64to64Octets, rx-rmon-etherStatsPkts65to127Octets, etc. This is because on ETHTOOL_MAC_STATS_SRC_AGGREGATE, we do not populate the "ranges" argument. ocelot_port_get_rmon_stats() does things differently and things work there. I had forgotten to make sure that the code is structured the same way in both drivers, so do that now. Fixes: cf52bd238b75 ("net: enetc: add support for MAC Merge statistics counters") Signed-off-by: Vladimir Oltean Reviewed-by: Simon Horman --- drivers/net/ethernet/freescale/enetc/enetc_ethtool.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c index bca68edfbe9c..da9d4b310fcd 100644 --- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c +++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c @@ -370,8 +370,7 @@ static const struct ethtool_rmon_hist_range enetc_rmon_ranges[] = { }; static void enetc_rmon_stats(struct enetc_hw *hw, int mac, - struct ethtool_rmon_stats *s, - const struct ethtool_rmon_hist_range **ranges) + struct ethtool_rmon_stats *s) { s->undersize_pkts = enetc_port_rd(hw, ENETC_PM_RUND(mac)); s->oversize_pkts = enetc_port_rd(hw, ENETC_PM_ROVR(mac)); @@ -393,8 +392,6 @@ static void enetc_rmon_stats(struct enetc_hw *hw, int mac, s->hist_tx[4] = enetc_port_rd(hw, ENETC_PM_T1023(mac)); s->hist_tx[5] = enetc_port_rd(hw, ENETC_PM_T1522(mac)); s->hist_tx[6] = enetc_port_rd(hw, ENETC_PM_T1523X(mac)); - - *ranges = enetc_rmon_ranges; } static void enetc_get_eth_mac_stats(struct net_device *ndev, @@ -447,13 +444,15 @@ static void enetc_get_rmon_stats(struct net_device *ndev, struct enetc_hw *hw = &priv->si->hw; struct enetc_si *si = priv->si; + *ranges = enetc_rmon_ranges; + switch (rmon_stats->src) { case ETHTOOL_MAC_STATS_SRC_EMAC: - enetc_rmon_stats(hw, 0, rmon_stats, ranges); + enetc_rmon_stats(hw, 0, rmon_stats); break; case ETHTOOL_MAC_STATS_SRC_PMAC: if (si->hw_features & ENETC_SI_F_QBU) - enetc_rmon_stats(hw, 1, rmon_stats, ranges); + enetc_rmon_stats(hw, 1, rmon_stats); break; case ETHTOOL_MAC_STATS_SRC_AGGREGATE: ethtool_aggregate_rmon_stats(ndev, rmon_stats);