Re: [PATCH net-next 4/5] net: mvneta: introduce xdp counters to ethtool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 16 Feb 2020 22:07:32 +0100
Lorenzo Bianconi <lorenzo@xxxxxxxxxx> wrote:

> @@ -2033,6 +2050,7 @@ 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++;
>  	u64_stats_update_end(&stats->syncp);

I find it confusing that this ethtool stats is named "xdp_tx".
Because you use it as an "xmit" counter and not for the action XDP_TX.

Both XDP_TX and XDP_REDIRECT out this device will increment this
"xdp_tx" counter.  I don't think end-users will comprehend this...

What about naming it "xdp_xmit" ?


>  	mvneta_txq_inc_put(txq);
> @@ -2114,6 +2132,7 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq,
>  
>  	switch (act) {
>  	case XDP_PASS:
> +		stats->xdp_pass++;
>  		return MVNETA_XDP_PASS;
>  	case XDP_REDIRECT: {
>  		int err;
> @@ -2126,6 +2145,7 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq,
>  					     len, true);
>  		} else {
>  			ret = MVNETA_XDP_REDIR;
> +			stats->xdp_redirect++;
>  		}
>  		break;
>  	}
> @@ -2147,6 +2167,7 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq,
>  				     virt_to_head_page(xdp->data),
>  				     len, true);
>  		ret = MVNETA_XDP_DROPPED;
> +		stats->xdp_drop++;
>  		break;
>  	}


-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  LinkedIn: http://www.linkedin.com/in/brouer




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux