Introduce "rx" prefix in the name scheme for xdp counters on rx path. Differentiate between XDP_TX and ndo_xdp_xmit counters Signed-off-by: Lorenzo Bianconi <lorenzo@xxxxxxxxxx> --- drivers/net/ethernet/marvell/mvneta.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index b7045b6a15c2..6223700dc3df 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -344,6 +344,7 @@ enum { ETHTOOL_XDP_REDIRECT, ETHTOOL_XDP_PASS, ETHTOOL_XDP_DROP, + ETHTOOL_XDP_XMIT, ETHTOOL_XDP_TX, ETHTOOL_MAX_STATS, }; @@ -399,10 +400,11 @@ static const struct mvneta_statistic mvneta_statistics[] = { { ETHTOOL_STAT_EEE_WAKEUP, T_SW, "eee_wakeup_errors", }, { ETHTOOL_STAT_SKB_ALLOC_ERR, T_SW, "skb_alloc_errors", }, { ETHTOOL_STAT_REFILL_ERR, T_SW, "refill_errors", }, - { ETHTOOL_XDP_REDIRECT, T_SW, "xdp_redirect", }, - { ETHTOOL_XDP_PASS, T_SW, "xdp_pass", }, - { ETHTOOL_XDP_DROP, T_SW, "xdp_drop", }, - { ETHTOOL_XDP_TX, T_SW, "xdp_tx", }, + { ETHTOOL_XDP_REDIRECT, T_SW, "rx_xdp_redirect", }, + { ETHTOOL_XDP_PASS, T_SW, "rx_xdp_pass", }, + { ETHTOOL_XDP_DROP, T_SW, "rx_xdp_drop", }, + { ETHTOOL_XDP_TX, T_SW, "rx_xdp_tx_xmit", }, + { ETHTOOL_XDP_XMIT, T_SW, "tx_xdp_xmit", }, }; struct mvneta_stats { @@ -414,6 +416,7 @@ struct mvneta_stats { u64 xdp_redirect; u64 xdp_pass; u64 xdp_drop; + u64 xdp_xmit; u64 xdp_tx; }; @@ -2050,7 +2053,10 @@ mvneta_xdp_submit_frame(struct mvneta_port *pp, struct mvneta_tx_queue *txq, u64_stats_update_begin(&stats->syncp); stats->es.ps.tx_bytes += xdpf->len; stats->es.ps.tx_packets++; - stats->es.ps.xdp_tx++; + if (buf->type == MVNETA_TYPE_XDP_NDO) + stats->es.ps.xdp_xmit++; + else + stats->es.ps.xdp_tx++; u64_stats_update_end(&stats->syncp); mvneta_txq_inc_put(txq); @@ -4484,6 +4490,7 @@ mvneta_ethtool_update_pcpu_stats(struct mvneta_port *pp, u64 xdp_redirect; u64 xdp_pass; u64 xdp_drop; + u64 xdp_xmit; u64 xdp_tx; stats = per_cpu_ptr(pp->stats, cpu); @@ -4494,6 +4501,7 @@ mvneta_ethtool_update_pcpu_stats(struct mvneta_port *pp, xdp_redirect = stats->es.ps.xdp_redirect; xdp_pass = stats->es.ps.xdp_pass; xdp_drop = stats->es.ps.xdp_drop; + xdp_xmit = stats->es.ps.xdp_xmit; xdp_tx = stats->es.ps.xdp_tx; } while (u64_stats_fetch_retry_irq(&stats->syncp, start)); @@ -4502,6 +4510,7 @@ mvneta_ethtool_update_pcpu_stats(struct mvneta_port *pp, es->ps.xdp_redirect += xdp_redirect; es->ps.xdp_pass += xdp_pass; es->ps.xdp_drop += xdp_drop; + es->ps.xdp_xmit += xdp_xmit; es->ps.xdp_tx += xdp_tx; } } @@ -4555,6 +4564,9 @@ static void mvneta_ethtool_update_stats(struct mvneta_port *pp) case ETHTOOL_XDP_TX: pp->ethtool_stats[i] = stats.ps.xdp_tx; break; + case ETHTOOL_XDP_XMIT: + pp->ethtool_stats[i] = stats.ps.xdp_xmit; + break; } break; } -- 2.24.1