netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: "David Miller" <davem@davemloft.net>,
	mst@redhat.com, makita.toshiaki@lab.ntt.co.jp,
	jasowang@redhat.com, netdev@vger.kernel.org,
	virtualization@lists.linux-foundation.org, hawk@kernel.org,
	"Toke Høiland-Jørgensen" <thoiland@redhat.com>,
	"Jakub Kicinski" <jakub.kicinski@netronome.com>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Daniel Borkmann" <borkmann@iogearbox.net>,
	"Saeed Mahameed" <saeedm@mellanox.com>,
	"Tariq Toukan" <tariqt@mellanox.com>
Subject: Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames
Date: Mon, 4 Feb 2019 19:13:18 -0800	[thread overview]
Message-ID: <bdcfedd6-465d-4485-e268-25c4ce6b9fcf@gmail.com> (raw)
In-Reply-To: <20190204125307.08492005@redhat.com>

On 2/4/19 3:53 AM, Jesper Dangaard Brouer wrote:
> On Sat, 2 Feb 2019 14:27:26 -0700
> David Ahern <dsahern@gmail.com> wrote:
> 
>> On 1/31/19 1:15 PM, Jesper Dangaard Brouer wrote:
>>>>
>>>> David, Jesper, care to chime in where we ended up in that last thread
>>>> discussion this?  
>>>
>>> IHMO packets RX and TX on a device need to be accounted, in standard
>>> counters, regardless of XDP.  For XDP RX the packet is counted as RX,
>>> regardless if XDP choose to XDP_DROP.  On XDP TX which is via
>>> XDP_REDIRECT or XDP_TX, the driver that transmit the packet need to
>>> account the packet in a TX counter (this if often delayed to DMA TX
>>> completion handling).  We cannot break the expectation that RX and TX
>>> counter are visible to userspace stats tools. XDP should not make these
>>> packets invisible.  
>>
>> Agreed. What I was pushing on that last thread was Rx, Tx and dropped
>> are all accounted by the driver in standard stats. Basically if the
>> driver touched it, the driver's counters should indicate that.
> 
> Sound like we all agree (except with the dropped counter, see below).
> 
> Do notice that mlx5 driver doesn't do this.  It is actually rather
> confusing to use XDP on mlx5, as when XDP "consume" which include
> XDP_DROP, XDP_REDIRECT or XDP_TX, then the driver standard stats are
> not incremented... the packet is invisible to "ifconfig" stat based
> tools.

mlx5 needs some work. As I recall it still has the bug/panic removing
xdp programs - at least I don't recall seeing a patch for it.

> 
> 
>> The push back was on dropped packets and whether that counter should be
>> bumped on XDP_DROP.
> 
> My opinion is the XDP_DROP action should NOT increment the drivers drop
> counter.  First of all the "dropped" counter is also use for other
> stuff, which will confuse that this counter express.  Second, choosing
> XDP_DROP is a policy choice, it still means it was RX-ed at the driver
> level.
> 

Understood. Hopefully in March I will get some time to come back to this
and propose an idea on what I would like to see - namely, the admin has
a config option at load time to enable driver counters versus custom map
counters. (meaning the operator of the node chooses standard stats over
strict performance.) But of course that means the drivers have the code
to collect those stats.

  reply	other threads:[~2019-02-05  3:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 11:40 [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames Toshiaki Makita
2019-01-31 15:25 ` Michael S. Tsirkin
2019-01-31 17:45   ` David Miller
2019-01-31 20:15     ` Jesper Dangaard Brouer
2019-02-01  1:53       ` Toshiaki Makita
2019-02-02 21:27       ` David Ahern
2019-02-04 11:53         ` Jesper Dangaard Brouer
2019-02-05  3:13           ` David Ahern [this message]
2019-02-06  0:06             ` Saeed Mahameed
2019-02-06 13:48               ` Jesper Dangaard Brouer
2019-02-06 15:52                 ` Jakub Kicinski
2019-02-07  7:48               ` Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames) Jesper Dangaard Brouer
2019-02-07 19:08                 ` Saeed Mahameed
2019-02-08 16:55                   ` Toke Høiland-Jørgensen
2019-02-08 22:49                     ` Saeed Mahameed
2019-02-08 23:17                   ` Saeed Mahameed
2019-02-09  0:18                     ` Saeed Mahameed
2019-02-09  2:05                       ` Jakub Kicinski
2019-02-09 16:56                         ` Toke Høiland-Jørgensen
2019-02-09 16:56                       ` Toke Høiland-Jørgensen
2019-02-08 16:02               ` [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames Jesper Dangaard Brouer
2019-04-18 14:24             ` Stats for XDP actions (was: Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames) Toke Høiland-Jørgensen
2019-04-21  0:16               ` Stats for XDP actions David Ahern
2019-06-20 20:42                 ` Toke Høiland-Jørgensen
2019-06-21  0:42                   ` David Ahern
2019-06-21 13:57                     ` Toke Høiland-Jørgensen
2019-02-04  4:18 ` [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bdcfedd6-465d-4485-e268-25c4ce6b9fcf@gmail.com \
    --to=dsahern@gmail.com \
    --cc=borkmann@iogearbox.net \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=jakub.kicinski@netronome.com \
    --cc=jasowang@redhat.com \
    --cc=john.fastabend@gmail.com \
    --cc=makita.toshiaki@lab.ntt.co.jp \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=tariqt@mellanox.com \
    --cc=thoiland@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).