From patchwork Tue Aug 3 16:36:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 12416797 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 5BB98C4320A for ; Tue, 3 Aug 2021 16:38:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 42C2361102 for ; Tue, 3 Aug 2021 16:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236526AbhHCQjB (ORCPT ); Tue, 3 Aug 2021 12:39:01 -0400 Received: from mga17.intel.com ([192.55.52.151]:62885 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234647AbhHCQiV (ORCPT ); Tue, 3 Aug 2021 12:38:21 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10065"; a="194013707" X-IronPort-AV: E=Sophos;i="5.84,292,1620716400"; d="scan'208";a="194013707" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2021 09:37:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,292,1620716400"; d="scan'208";a="636665324" Received: from irvmail001.ir.intel.com ([10.43.11.63]) by orsmga005.jf.intel.com with ESMTP; 03 Aug 2021 09:37:33 -0700 Received: from alobakin-mobl.ger.corp.intel.com (eflejszm-mobl2.ger.corp.intel.com [10.213.26.164]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 173GahF1029968; Tue, 3 Aug 2021 17:37:28 +0100 From: Alexander Lobakin To: "David S. Miller" , Jakub Kicinski Cc: Alexander Lobakin , Jesse Brandeburg , Lukasz Czapnik , Marcin Kubiak , Michal Kubiak , Michal Swiatkowski , Jonathan Corbet , Netanel Belgazal , Arthur Kiyanovski , Guy Tzalik , Saeed Bishara , Ioana Ciornei , Claudiu Manoil , Thomas Petazzoni , Marcin Wojtas , Russell King , Edward Cree , Martin Habets , "Michael S. Tsirkin" , Jason Wang , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Shay Agroskin , Sameeh Jubran , Alexander Duyck , Danielle Ratson , Ido Schimmel , Andrew Lunn , Vladyslav Tarasiuk , Arnd Bergmann , Andrew Morton , Jian Shen , Petr Vorel , Dan Murphy , Yangbo Lu , Michal Kubecek , Zheng Yongjun , Heiner Kallweit , YueHaibing , Johannes Berg , netdev@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, bpf@vger.kernel.org Subject: [PATCH net-next 11/21] ethernet, mvpp2: rename xdp_xmit_err to xdp_xmit_drops Date: Tue, 3 Aug 2021 18:36:31 +0200 Message-Id: <20210803163641.3743-12-alexandr.lobakin@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210803163641.3743-1-alexandr.lobakin@intel.com> References: <20210803163641.3743-1-alexandr.lobakin@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org xdp_xmit_err stat is defined as num_frames - nxmit in .ndo_xdp_xmit() callback implementation, and regarding that the frames which weren't transmitted are treated as drops by BPF core, give it a more fitting name in preparation for switching to standard XDP stats. Signed-off-by: Alexander Lobakin Reviewed-by: Jesse Brandeburg --- drivers/net/ethernet/marvell/mvpp2/mvpp2.h | 2 +- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h index b9fbc9f000f2..2be6123be6f3 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h @@ -1121,7 +1121,7 @@ struct mvpp2_pcpu_stats { u64 xdp_pass; u64 xdp_drop; u64 xdp_xmit; - u64 xdp_xmit_err; + u64 xdp_xmit_drops; u64 xdp_tx; u64 xdp_tx_err; }; diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index 99bd8b8aa0e2..a3aee1a6d760 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -1831,7 +1831,7 @@ enum { ETHTOOL_XDP_TX, ETHTOOL_XDP_TX_ERR, ETHTOOL_XDP_XMIT, - ETHTOOL_XDP_XMIT_ERR, + ETHTOOL_XDP_XMIT_DROPS, }; struct mvpp2_ethtool_counter { @@ -1933,7 +1933,7 @@ static const struct mvpp2_ethtool_counter mvpp2_ethtool_xdp[] = { { ETHTOOL_XDP_TX, "rx_xdp_tx", }, { ETHTOOL_XDP_TX_ERR, "rx_xdp_tx_errors", }, { ETHTOOL_XDP_XMIT, "tx_xdp_xmit", }, - { ETHTOOL_XDP_XMIT_ERR, "tx_xdp_xmit_errors", }, + { ETHTOOL_XDP_XMIT_DROPS, "tx_xdp_xmit_drops", }, }; #define MVPP2_N_ETHTOOL_STATS(ntxqs, nrxqs) (ARRAY_SIZE(mvpp2_ethtool_mib_regs) + \ @@ -2000,7 +2000,7 @@ mvpp2_get_xdp_stats(struct mvpp2_port *port, struct mvpp2_pcpu_stats *xdp_stats) u64 xdp_pass; u64 xdp_drop; u64 xdp_xmit; - u64 xdp_xmit_err; + u64 xdp_xmit_drops; u64 xdp_tx; u64 xdp_tx_err; @@ -2011,7 +2011,7 @@ mvpp2_get_xdp_stats(struct mvpp2_port *port, struct mvpp2_pcpu_stats *xdp_stats) xdp_pass = cpu_stats->xdp_pass; xdp_drop = cpu_stats->xdp_drop; xdp_xmit = cpu_stats->xdp_xmit; - xdp_xmit_err = cpu_stats->xdp_xmit_err; + xdp_xmit_drops = cpu_stats->xdp_xmit_drops; xdp_tx = cpu_stats->xdp_tx; xdp_tx_err = cpu_stats->xdp_tx_err; } while (u64_stats_fetch_retry_irq(&cpu_stats->syncp, start)); @@ -2020,7 +2020,7 @@ mvpp2_get_xdp_stats(struct mvpp2_port *port, struct mvpp2_pcpu_stats *xdp_stats) xdp_stats->xdp_pass += xdp_pass; xdp_stats->xdp_drop += xdp_drop; xdp_stats->xdp_xmit += xdp_xmit; - xdp_stats->xdp_xmit_err += xdp_xmit_err; + xdp_stats->xdp_xmit_drops += xdp_xmit_drops; xdp_stats->xdp_tx += xdp_tx; xdp_stats->xdp_tx_err += xdp_tx_err; } @@ -2083,8 +2083,8 @@ static void mvpp2_read_stats(struct mvpp2_port *port) case ETHTOOL_XDP_XMIT: *pstats++ = xdp_stats.xdp_xmit; break; - case ETHTOOL_XDP_XMIT_ERR: - *pstats++ = xdp_stats.xdp_xmit_err; + case ETHTOOL_XDP_XMIT_DROPS: + *pstats++ = xdp_stats.xdp_xmit_drops; break; } } @@ -3773,7 +3773,7 @@ mvpp2_xdp_xmit(struct net_device *dev, int num_frame, stats->tx_bytes += nxmit_byte; stats->tx_packets += nxmit; stats->xdp_xmit += nxmit; - stats->xdp_xmit_err += num_frame - nxmit; + stats->xdp_xmit_drops += num_frame - nxmit; u64_stats_update_end(&stats->syncp); return nxmit;