From patchwork Wed Mar 10 19:03:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12129061 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82948C43603 for ; Wed, 10 Mar 2021 19:04:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5CFAD64FDD for ; Wed, 10 Mar 2021 19:04:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233823AbhCJTEW (ORCPT ); Wed, 10 Mar 2021 14:04:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:44292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233722AbhCJTDy (ORCPT ); Wed, 10 Mar 2021 14:03:54 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4133964FD2; Wed, 10 Mar 2021 19:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615403034; bh=1t0moZM3TTMU79C0k2FyFpCzeCThM9pHG54AVQfzc8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HzmUrQhMwvtPqtBzz3ti0xSuCRlVWusUqaAt8cv4kLz6V4fHyI4Dk+Dx54RuRuORi RyZChzCiQgq4A4flaev/m/v7NqVZG8v435JXuCOc6cNgq/Z90rzDbk5jLFrjFAwQh+ iRJNj4zIBbiimwXjXvPaMN9w0x+7pWm9agmlxnEZfW+Q8o0+RG3UHcinTmTP+dBDoG RJTfF6Ra0xoP4RmZ/77BUcGibkQW8ePQhNGGRWzlsJiaSFZz9nZ0l5HK6GI9idsjJm utjeel2mk1a0USTn1GLPm6nM5/5hAnKLqtDcIPZ71nR/kkJ53tZhcFnWKqX6yNAad6 8MwEp9AJrzp2Q== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, Aya Levin , Tariq Toukan , Saeed Mahameed Subject: [net 03/18] net/mlx5e: Accumulate port PTP TX stats with other channels stats Date: Wed, 10 Mar 2021 11:03:27 -0800 Message-Id: <20210310190342.238957-4-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210310190342.238957-1-saeed@kernel.org> References: <20210310190342.238957-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Aya Levin In addition to .get_ethtool_stats, add port PTP TX stats to .ndo_get_stats64. Fixes: 145e5637d941 ("net/mlx5e: Add TX PTP port object support") Signed-off-by: Aya Levin Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 831f5495ff39..9e2a30dc5e4f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -3811,6 +3811,15 @@ void mlx5e_fold_sw_stats64(struct mlx5e_priv *priv, struct rtnl_link_stats64 *s) for (j = 0; j < priv->max_opened_tc; j++) { struct mlx5e_sq_stats *sq_stats = &channel_stats->sq[j]; + s->tx_packets += sq_stats->packets; + s->tx_bytes += sq_stats->bytes; + s->tx_dropped += sq_stats->dropped; + } + } + if (priv->port_ptp_opened) { + for (i = 0; i < priv->max_opened_tc; i++) { + struct mlx5e_sq_stats *sq_stats = &priv->port_ptp_stats.sq[i]; + s->tx_packets += sq_stats->packets; s->tx_bytes += sq_stats->bytes; s->tx_dropped += sq_stats->dropped;