[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190208170241.2fa28dff@carbon>
Date: Fri, 8 Feb 2019 17:02:41 +0100
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: Saeed Mahameed <saeedm@...lanox.com>
Cc: "dsahern@...il.com" <dsahern@...il.com>,
"thoiland@...hat.com" <thoiland@...hat.com>,
"hawk@...nel.org" <hawk@...nel.org>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
"borkmann@...earbox.net" <borkmann@...earbox.net>,
Tariq Toukan <tariqt@...lanox.com>,
"john.fastabend@...il.com" <john.fastabend@...il.com>,
"mst@...hat.com" <mst@...hat.com>,
"jakub.kicinski@...ronome.com" <jakub.kicinski@...ronome.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"makita.toshiaki@....ntt.co.jp" <makita.toshiaki@....ntt.co.jp>,
brouer@...hat.com
Subject: Re: [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@...lanox.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 stats
I'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
Powered by blists - more mailing lists