[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190206075216.22b66d58@cakuba.netronome.com>
Date: Wed, 6 Feb 2019 07:52:16 -0800
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Jesper Dangaard Brouer <brouer@...hat.com>
Cc: Saeed Mahameed <saeedm@...lanox.com>,
"dsahern@...il.com" <dsahern@...il.com>,
"thoiland@...hat.com" <thoiland@...hat.com>,
"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>,
"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>
Subject: Re: [PATCH net] virtio_net: Account for tx bytes and packets on
sending xdp_frames
On Wed, 6 Feb 2019 14:48:14 +0100, Jesper Dangaard Brouer wrote:
> On Wed, 6 Feb 2019 00:06:33 +0000
> Saeed Mahameed <saeedm@...lanox.com> wrote:
>
> > 3) Unrelated, In non XDP case, if skb allocation fails or driver fails
> > to pass the skb up to the stack for somereason, should the driver
> > increase rx packets ? IMHO the answer should be yes if we want to have
> > similar behavior between XDP and non XDP cases.
>
> I don't think "skb allocation fails" should increase rx packets
> counter. The difference is that these events are outside sysadm/users
> control, and is an error detected inside the driver. The XDP program
> takes a policy choice to XDP_DROP a packet, which can be accounted
> inside the XDP prog (as the samples show) or as we also discuss via a
> more generic XDP-action counters.
FWIW that's my understanding as well. My understanding of Linux stats
is that they are incrementing one counter per packet. I.e. in RX
direction success packets are those given to the stack, and for TX
those given to the hardware. Standards (IETF/IEEE) usually count stats
on the same layer boundary, but I think software generally counts when
it's done with the packet.
I haven't seen it documented anywhere, yet. I have tried to document
it in the docs of the recent RFC:
https://patchwork.ozlabs.org/patch/1032332/
Incidentally XDP_DROP may have been better named XDP_DISCARD from stats
perspective ;)
Powered by blists - more mailing lists