From patchwork Wed Aug 8 10:53:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10559753 X-Patchwork-Delegate: idosch@idosch.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4FED81390 for ; Wed, 8 Aug 2018 10:53:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D3BF29F3D for ; Wed, 8 Aug 2018 10:53:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30DFB29F44; Wed, 8 Aug 2018 10:53:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6874129F3D for ; Wed, 8 Aug 2018 10:53:51 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41lpCd2bjgzDrWq for ; Wed, 8 Aug 2018 20:53:49 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="azaRtyX3"; dkim-atps=neutral X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=40.107.0.70; helo=eur02-am5-obe.outbound.protection.outlook.com; envelope-from=petrm@mellanox.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="azaRtyX3"; dkim-atps=neutral Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00070.outbound.protection.outlook.com [40.107.0.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41lpCS6LKxzDqhV for ; Wed, 8 Aug 2018 20:53:39 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=re4S62aQRHSgGJBTqD/uni62JJyMdCG5P3XV6X87K20=; b=azaRtyX35lZoyQuqmGrZvy6NTguZq9qTd9gKADzDKKfVl8QvzAcO6/PvZUXpXclwop4P7FvDO682QoL0uIZzackv2ZWTcLN9KfdH0p6v8pUXwYRR3Mnc0m7lB7Jub+FtFbvCZsoEHclHJxwvSX64LE014MIURraa1cqS5Ez3I4A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.17; Wed, 8 Aug 2018 10:53:33 +0000 From: Petr Machata To: Subject: [PATCH net-next mlxsw] mlxsw: spectrum: Expose counter for all 16 TCs Message-Id: <69c1b57bb5b2fc633484e08c4b957afbcc9f7917.1533725365.git.petrm@mellanox.com> Date: Wed, 08 Aug 2018 12:53:29 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [78.45.160.211] X-ClientProxiedBy: VI1PR08CA0209.eurprd08.prod.outlook.com (2603:10a6:802:15::18) To VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15d27ac4-6e2f-49f9-e838-08d5fd1d2f42 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4191; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 3:6ARJEWzNLGOPKlelJ6d2AXephygJ/SDLx1mS8ffEfTUUdtkg0r9FFol5fDDLgtD8IvCPODgbQSnX1w0BnuaUlQxrBwLCtpds79BeiAcn9a4Lu1aLxc4Q/HxSowNPXKNy6LYsJYKT4w3yEYdfR4F+QkvABZBRvFOj+D3pJq1/xhDFtcv5An1yGVYlnbjcyryYHlwNireu/NzRHviRbKodwste+LG1xNsrR/q8IqFpy+L7tlsbMnaNyLAcio6Y0w9e; 25:SOmsIBiqZ+/RGhCHcPad5zgXoYPZjGYazh0oZ/78TTmDynIsDQu+seFDIkRCL2UFpQTdd+gy/v97AklqdanFaPJj0qcF/vIgB0AuNpWNvf9QAFcvejA055aWleeK7eBSjE8cBsrIY5TcCSYAlROL5eM4e5w2bXzM4fj8oaCv1Hm1SUHHBzMqLki3XdjMt2DFl41PnzvZiCAo3iV9hgN+bA50Pl4FtcbmqSpdvP3aPKshmOVDerqW3NgR2Pw7ffdwLzhTtb444MO3nzNjy8+z70eTQwjsMdefxa8Co1rL3nk6HRq/RJnV9blEuwLosx0QGiFHlA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y8EAoc+vNK7IUbNVewC7a46T5adWa61qOGve7zwg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:VI1PR05MB4191; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4191; X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(136003)(39860400002)(396003)(199004)(189003)(316002)(47776003)(58126008)(7736002)(37006003)(81156014)(81166006)(66066001)(8676002)(386003)(6862004)(16586007)(105586002)(25786009)(52116002)(51416003)(305945005)(2351001)(3846002)(68736007)(97736004)(6116002)(106356001)(118296001)(50466002)(26005)(478600001)(14444005)(8936002)(53936002)(6666003)(6636002)(36756003)(956004)(476003)(48376002)(16526019)(86362001)(6486002)(2616005)(186003)(6496006)(5660300001)(486006)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4191; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB4191; 23:QXfX9jYMUplW0d4R47+980buTP1vZ8nWZqX57LlpP?= BZbKddbrJW+NdDxrZR5B/p1LfcwctuujsO8lYBuKDJK9/PzZqmlIdXVWI5ZveQY6v9JzYv05em723+6c6v/qqsUNlD5vUsKjsyDovfF6vrwfWlf8pUVbFSg5nEC8P4rogneqNf3h6QNERAHHOYd+JYn7V68hxCNIkXKfM+IahxMwRzKw7S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ldzqVXV7WtI3P8W4nNeEFnZufciDNumRh39901nO4HBAl5I+HFv+GpF2s001gHZHZi6VmvtYaJI36G9/brhIqjfhb1GF1fnggf6a0AB/pyya4hDlVNeVkzH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 10:53:33.0685 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15d27ac4-6e2f-49f9-e838-08d5fd1d2f42 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4191 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: mlxsw driver development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org X-Virus-Scanned: ClamAV using ClamSMTP Before MC-aware mode was enabled in commit 7b8195306694 ("mlxsw: spectrum: Configure MC-aware mode on mlxsw ports"), only 8 traffic classes were used. Under MC-aware regime, however, besides using TCs 0-7 for UC traffic, it additionally uses TCs 8-15 for BUM traffic. It is therefore desirable to show counters for these TCs as well. Update ethtool stats pool length, mlxsw_sp_port_get_strings() and mlxsw_sp_port_get_stats() to include artifacts for all 16 TCs. For consistency and simplicity, expose tc_no_buffer_discard_uc_tc for BUM TCs as well, even though it ought to stay at 0 all the time. Signed-off-by: Petr Machata --- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 264e3aa805da..6070d1591d1e 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -1972,9 +1972,10 @@ static struct mlxsw_sp_port_hw_stats mlxsw_sp_port_hw_tc_stats[] = { #define MLXSW_SP_PORT_ETHTOOL_STATS_LEN (MLXSW_SP_PORT_HW_STATS_LEN + \ MLXSW_SP_PORT_HW_RFC_2819_STATS_LEN + \ - (MLXSW_SP_PORT_HW_PRIO_STATS_LEN + \ - MLXSW_SP_PORT_HW_TC_STATS_LEN) * \ - IEEE_8021QAZ_MAX_TCS) + (MLXSW_SP_PORT_HW_PRIO_STATS_LEN * \ + IEEE_8021QAZ_MAX_TCS) + \ + (MLXSW_SP_PORT_HW_TC_STATS_LEN * \ + TC_MAX_QUEUE)) static void mlxsw_sp_port_get_prio_strings(u8 **p, int prio) { @@ -2020,7 +2021,7 @@ static void mlxsw_sp_port_get_strings(struct net_device *dev, for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) mlxsw_sp_port_get_prio_strings(&p, i); - for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) + for (i = 0; i < TC_MAX_QUEUE; i++) mlxsw_sp_port_get_tc_strings(&p, i); break; @@ -2125,7 +2126,7 @@ static void mlxsw_sp_port_get_stats(struct net_device *dev, } /* Per-TC Counters */ - for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { + for (i = 0; i < TC_MAX_QUEUE; i++) { __mlxsw_sp_port_get_stats(dev, MLXSW_REG_PPCNT_TC_CNT, i, data, data_index); data_index += MLXSW_SP_PORT_HW_TC_STATS_LEN;