From patchwork Mon Mar 22 20:25:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 406498 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=ham 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 0F4C9C433E1 for ; Mon, 22 Mar 2021 20:26:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DEAB161993 for ; Mon, 22 Mar 2021 20:26:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231650AbhCVU0A (ORCPT ); Mon, 22 Mar 2021 16:26:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:58372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230520AbhCVUZd (ORCPT ); Mon, 22 Mar 2021 16:25:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 551F061998; Mon, 22 Mar 2021 20:25:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616444733; bh=D6kU/bXdanr7vPIp3scHPdlB37G5TMijaUE2ssBPKKo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sKCmVbKccsfkk/3bFz+NZuDQptTQs0eF045z310JJgGjTQtrchC4ESf4Bw1cH4v8T M2Sc/S/fB2OXY3mXcitNgEil6Lp/GqlMIZ2W3SIqVohPeCQxukU0kxnkpuoJeEfthy 6bHqUJRCxHS0h3kOVda9te081FSZR/DzRM2osMAneNFKhQSUz/I3wydsKaPeOtWKDB Wt7v5PROkqS5pvRFdKbzYfBYAOoZZw0hBuu7IG9kFlaHocSMMp5ikaeaGzioqvqAE7 Km9Hf1IBCKrwbm07wWHFlEGEFP1lr/Sa9QH3siuRNOzeSDR4te3JYZu4tZzw4lg6zf LbjhGcKO3Egyw== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Huy Nguyen , Daniel Jurgens , Saeed Mahameed Subject: [net 1/6] net/mlx5: Add back multicast stats for uplink representor Date: Mon, 22 Mar 2021 13:25:19 -0700 Message-Id: <20210322202524.68886-2-saeed@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210322202524.68886-1-saeed@kernel.org> References: <20210322202524.68886-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Huy Nguyen The multicast counter got removed from uplink representor due to the cited patch. Fixes: 47c97e6b10a1 ("net/mlx5e: Fix multicast counter not up-to-date in "ip -s"") Signed-off-by: Huy Nguyen Reviewed-by: Daniel Jurgens Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 33b418796e43..c8b8249846a9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -3846,10 +3846,17 @@ mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats) } if (mlx5e_is_uplink_rep(priv)) { + struct mlx5e_vport_stats *vstats = &priv->stats.vport; + stats->rx_packets = PPORT_802_3_GET(pstats, a_frames_received_ok); stats->rx_bytes = PPORT_802_3_GET(pstats, a_octets_received_ok); stats->tx_packets = PPORT_802_3_GET(pstats, a_frames_transmitted_ok); stats->tx_bytes = PPORT_802_3_GET(pstats, a_octets_transmitted_ok); + + /* vport multicast also counts packets that are dropped due to steering + * or rx out of buffer + */ + stats->multicast = VPORT_COUNTER_GET(vstats, received_eth_multicast.packets); } else { mlx5e_fold_sw_stats64(priv, stats); }