Jesper Dangaard Brouer
2019-Feb-08 16:02 UTC
[PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames
On Wed, 6 Feb 2019 00:06:33 +0000 Saeed Mahameed <saeedm at mellanox.com> wrote:> 2) Driver should keep track of XDP decisions statistics, report them in > ethtool and in the new API suggested by David. track even (XDP_PASS) ? > > Maybe instead of having all drivers track the statistics on their own, > we should move the responsibility to upper layer. > > Idea: since we already have rxq_info structure per XDP ring (no false > sharing) and available per xdp_buff we can do: > > +++ b/include/linux/filter.h > @@ -651,7 +651,9 @@ static __always_inline u32 bpf_prog_run_xdp(const > struct bpf_prog *prog, > * already takes rcu_read_lock() when fetching the program, so > * it's not necessary here anymore. > */ > - return BPF_PROG_RUN(prog, xdp); > + u32 ret = BPF_PROG_RUN(prog, xdp); > + xdp->xdp_rxq_info.stats[ret]++ > + return ret; > } > > still we need a way (API) to report the rxq_info to whoever needs to > read current XDP statsI'm capturing this as tasks under the XDP-project github page: https://github.com/xdp-project/xdp-project/pull/13/files -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer
Seemingly Similar Threads
- [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames
- Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames)
- [bpf-next V4 PATCH 11/14] virtio_net: setup xdp_rxq_info
- [bpf-next V2 PATCH 11/14] virtio_net: setup xdp_rxq_info
- [bpf-next V3 PATCH 11/14] virtio_net: setup xdp_rxq_info