All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ioana Ciocoi Radulescu <ruxandra.radulescu@nxp.com>
To: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>
Cc: Ioana Ciornei <ioana.ciornei@nxp.com>,
	"dsahern@gmail.com" <dsahern@gmail.com>,
	Camelia Alexandra Groza <camelia.groza@nxp.com>
Subject: [PATCH v2 net-next 8/8] dpaa2-eth: Add xdp counters
Date: Mon, 26 Nov 2018 16:27:34 +0000	[thread overview]
Message-ID: <1543249591-14563-9-git-send-email-ruxandra.radulescu@nxp.com> (raw)
In-Reply-To: <1543249591-14563-1-git-send-email-ruxandra.radulescu@nxp.com>

Add counters for xdp processed frames to the channel statistics.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
---
v2: no changes

 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c     | 3 +++
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h     | 4 ++++
 drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c | 3 +++
 3 files changed, 10 insertions(+)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index d2bc5da..be84171 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -313,9 +313,11 @@ static u32 run_xdp(struct dpaa2_eth_priv *priv,
 		if (err) {
 			xdp_release_buf(priv, ch, addr);
 			percpu_stats->tx_errors++;
+			ch->stats.xdp_tx_err++;
 		} else {
 			percpu_stats->tx_packets++;
 			percpu_stats->tx_bytes += dpaa2_fd_get_len(fd);
+			ch->stats.xdp_tx++;
 		}
 		break;
 	default:
@@ -324,6 +326,7 @@ static u32 run_xdp(struct dpaa2_eth_priv *priv,
 		trace_xdp_exception(priv->net_dev, xdp_prog, xdp_act);
 	case XDP_DROP:
 		xdp_release_buf(priv, ch, addr);
+		ch->stats.xdp_drop++;
 		break;
 	}
 
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
index 41a2a0d..69c965d 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h
@@ -249,6 +249,10 @@ struct dpaa2_eth_ch_stats {
 	__u64 pull_err;
 	/* Number of CDANs; useful to estimate avg NAPI len */
 	__u64 cdan;
+	/* XDP counters */
+	__u64 xdp_drop;
+	__u64 xdp_tx;
+	__u64 xdp_tx_err;
 };
 
 /* Maximum number of queues associated with a DPNI */
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
index 79eeebe..0c831bf 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c
@@ -45,6 +45,9 @@ static char dpaa2_ethtool_extras[][ETH_GSTRING_LEN] = {
 	"[drv] dequeue portal busy",
 	"[drv] channel pull errors",
 	"[drv] cdan",
+	"[drv] xdp drop",
+	"[drv] xdp tx",
+	"[drv] xdp tx errors",
 };
 
 #define DPAA2_ETH_NUM_EXTRA_STATS	ARRAY_SIZE(dpaa2_ethtool_extras)
-- 
2.7.4

  parent reply	other threads:[~2018-11-27  3:22 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26 16:27 [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support Ioana Ciocoi Radulescu
2018-11-26 16:27 ` [PATCH v2 net-next 1/8] dpaa2-eth: Add basic " Ioana Ciocoi Radulescu
2018-11-27 15:45   ` Camelia Alexandra Groza
2018-11-28 16:11   ` David Ahern
2018-11-26 16:27 ` [PATCH v2 net-next 2/8] dpaa2-eth: Allow XDP header adjustments Ioana Ciocoi Radulescu
2018-11-26 16:27 ` [PATCH v2 net-next 4/8] dpaa2-eth: Release buffers back to pool on XDP_DROP Ioana Ciocoi Radulescu
2018-11-26 16:27 ` [PATCH v2 net-next 3/8] dpaa2-eth: Move function Ioana Ciocoi Radulescu
2018-11-26 16:27 ` [PATCH v2 net-next 5/8] dpaa2-eth: Map Rx buffers as bidirectional Ioana Ciocoi Radulescu
2018-11-26 16:27 ` [PATCH v2 net-next 6/8] dpaa2-eth: Add support for XDP_TX Ioana Ciocoi Radulescu
2018-11-26 16:27 ` [PATCH v2 net-next 7/8] dpaa2-eth: Cleanup channel stats Ioana Ciocoi Radulescu
2018-11-26 16:27 ` Ioana Ciocoi Radulescu [this message]
2018-11-28 16:11   ` [PATCH v2 net-next 8/8] dpaa2-eth: Add xdp counters David Ahern
2018-11-28  0:24 ` [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support David Miller
2018-11-28  9:18   ` Ioana Ciocoi Radulescu
2018-11-28 16:10     ` David Ahern
2018-11-28 18:57     ` David Miller
2018-12-05 15:45 ` Jesper Dangaard Brouer
2018-12-07 16:54   ` Ioana Ciocoi Radulescu
2018-12-07 17:20     ` Ilias Apalodimas
2018-12-07 17:42       ` Ioana Ciocoi Radulescu
2018-12-07 17:51         ` Ilias Apalodimas
2018-12-07 18:07           ` Ioana Ciocoi Radulescu
2018-12-13 17:43             ` Ioana Ciocoi Radulescu
2018-12-13 18:47               ` Ilias Apalodimas
2018-12-21 15:31             ` Explaining the XDP page-requirement (Was: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support) Jesper Dangaard Brouer
2019-01-07 10:34               ` Ioana Ciocoi Radulescu
2019-01-07 10:45                 ` Ilias Apalodimas
2019-01-07 10:49                   ` Ioana Ciocoi Radulescu
2019-01-07 10:53                     ` Ilias Apalodimas
2019-01-09 14:22               ` Madalin-cristian Bucur
2019-01-09 14:25                 ` Ilias Apalodimas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1543249591-14563-9-git-send-email-ruxandra.radulescu@nxp.com \
    --to=ruxandra.radulescu@nxp.com \
    --cc=camelia.groza@nxp.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.