Re: Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames)

2019-02-09 Thread Toke Høiland-Jørgensen
Jakub Kicinski writes: > On Sat, 9 Feb 2019 00:18:31 +, Saeed Mahameed wrote: >> On Fri, 2019-02-08 at 15:17 -0800, Saeed Mahameed wrote: >> > On Thu, 2019-02-07 at 19:08 +, Saeed Mahameed wrote: >> > > >> > > So >> > > 1) on dev_map_update_elem() we will call >> > > dev->dev->ndo_bpf

Re: Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames)

2019-02-09 Thread Toke Høiland-Jørgensen
Saeed Mahameed writes: > On Fri, 2019-02-08 at 15:17 -0800, Saeed Mahameed wrote: >> On Thu, 2019-02-07 at 19:08 +, Saeed Mahameed wrote: >> > >> > So >> > 1) on dev_map_update_elem() we will call >> > dev->dev->ndo_bpf() to notify the device on the intention to >> > start/stop >> > redirec

Re: Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames)

2019-02-08 Thread Jakub Kicinski
On Sat, 9 Feb 2019 00:18:31 +, Saeed Mahameed wrote: > On Fri, 2019-02-08 at 15:17 -0800, Saeed Mahameed wrote: > > On Thu, 2019-02-07 at 19:08 +, Saeed Mahameed wrote: > > > > > > So > > > 1) on dev_map_update_elem() we will call > > > dev->dev->ndo_bpf() to notify the device on the in

Re: Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames)

2019-02-08 Thread Saeed Mahameed
On Fri, 2019-02-08 at 15:17 -0800, Saeed Mahameed wrote: > On Thu, 2019-02-07 at 19:08 +, Saeed Mahameed wrote: > > > > So > > 1) on dev_map_update_elem() we will call > > dev->dev->ndo_bpf() to notify the device on the intention to > > start/stop > > redirect, and wait for it to create/destr

Re: Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames)

2019-02-08 Thread Saeed Mahameed
On Thu, 2019-02-07 at 19:08 +, Saeed Mahameed wrote: > On Thu, 2019-02-07 at 08:48 +0100, Jesper Dangaard Brouer wrote: > > On Wed, 6 Feb 2019 00:06:33 + Saeed Mahameed < > > sae...@mellanox.com > > > wrote: > > > On Mon, 2019-02-04 at 19:13 -0800, David Ahern wrote: > > [...] > > > > mlx5

Re: Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames)

2019-02-08 Thread Saeed Mahameed
On Fri, 2019-02-08 at 17:55 +0100, Toke Høiland-Jørgensen wrote: > Saeed Mahameed writes: > > > But: > > 2) this won't totally solve our problem, since sometimes the driver > > can > > decide to recreate (change of configuration) hw resources on the > > fly > > while redirect/devmap is already ha

Re: Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames)

2019-02-08 Thread Toke Høiland-Jørgensen
Saeed Mahameed writes: > But: > 2) this won't totally solve our problem, since sometimes the driver can > decide to recreate (change of configuration) hw resources on the fly > while redirect/devmap is already happening, so we need some kind of a > dev_map_notification or a flag with rcu synch, f

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-02-08 Thread Jesper Dangaard Brouer
On Wed, 6 Feb 2019 00:06:33 + Saeed Mahameed 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 t

Re: Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames)

2019-02-07 Thread Saeed Mahameed
On Thu, 2019-02-07 at 08:48 +0100, Jesper Dangaard Brouer wrote: > On Wed, 6 Feb 2019 00:06:33 + Saeed Mahameed > wrote: > > > On Mon, 2019-02-04 at 19:13 -0800, David Ahern wrote: > [...] > > > mlx5 needs some work. As I recall it still has the bug/panic > > > removing xdp programs - at leas

Resource management for ndo_xdp_xmit (Was: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames)

2019-02-06 Thread Jesper Dangaard Brouer
On Wed, 6 Feb 2019 00:06:33 + Saeed Mahameed wrote: > On Mon, 2019-02-04 at 19:13 -0800, David Ahern wrote: [...] > > > > 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. > > Only when xdp_redirec

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-02-06 Thread Jakub Kicinski
On Wed, 6 Feb 2019 14:48:14 +0100, Jesper Dangaard Brouer wrote: > On Wed, 6 Feb 2019 00:06:33 + > Saeed Mahameed 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 ?

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-02-06 Thread Jesper Dangaard Brouer
On Wed, 6 Feb 2019 00:06:33 + Saeed Mahameed 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

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-02-05 Thread Saeed Mahameed
On Mon, 2019-02-04 at 19:13 -0800, David Ahern wrote: > On 2/4/19 3:53 AM, Jesper Dangaard Brouer wrote: > > On Sat, 2 Feb 2019 14:27:26 -0700 > > David Ahern wrote: > > > > > On 1/31/19 1:15 PM, Jesper Dangaard Brouer wrote: > > > > > David, Jesper, care to chime in where we ended up in that > >

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-02-04 Thread David Ahern
On 2/4/19 3:53 AM, Jesper Dangaard Brouer wrote: > On Sat, 2 Feb 2019 14:27:26 -0700 > David Ahern 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 o

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-02-04 Thread Jesper Dangaard Brouer
On Sat, 2 Feb 2019 14:27:26 -0700 David Ahern 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 > > counte

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-02-03 Thread David Miller
From: Toshiaki Makita Date: Thu, 31 Jan 2019 20:40:30 +0900 > Previously virtnet_xdp_xmit() did not account for device tx counters, > which caused confusions. > To be consistent with SKBs, account them on freeing xdp_frames. > > Reported-by: David Ahern > Signed-off-by: Toshiaki Makita Applie

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-02-02 Thread David Ahern
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, > regar

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-01-31 Thread Toshiaki Makita
On 2019/02/01 5:15, Jesper Dangaard Brouer wrote: > On Thu, 31 Jan 2019 09:45:23 -0800 (PST) > David Miller wrote: > >> From: "Michael S. Tsirkin" >> Date: Thu, 31 Jan 2019 10:25:17 -0500 >> >>> On Thu, Jan 31, 2019 at 08:40:30PM +0900, Toshiaki Makita wrote: Previously virtnet_xdp_xmit()

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-01-31 Thread Jesper Dangaard Brouer
On Thu, 31 Jan 2019 09:45:23 -0800 (PST) David Miller wrote: > From: "Michael S. Tsirkin" > Date: Thu, 31 Jan 2019 10:25:17 -0500 > > > On Thu, Jan 31, 2019 at 08:40:30PM +0900, Toshiaki Makita wrote: > >> Previously virtnet_xdp_xmit() did not account for device tx counters, > >> which caused

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-01-31 Thread David Miller
From: "Michael S. Tsirkin" Date: Thu, 31 Jan 2019 10:25:17 -0500 > On Thu, Jan 31, 2019 at 08:40:30PM +0900, Toshiaki Makita wrote: >> Previously virtnet_xdp_xmit() did not account for device tx counters, >> which caused confusions. >> To be consistent with SKBs, account them on freeing xdp_frame

Re: [PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-01-31 Thread Michael S. Tsirkin
On Thu, Jan 31, 2019 at 08:40:30PM +0900, Toshiaki Makita wrote: > Previously virtnet_xdp_xmit() did not account for device tx counters, > which caused confusions. > To be consistent with SKBs, account them on freeing xdp_frames. > > Reported-by: David Ahern > Signed-off-by: Toshiaki Makita Wel

[PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames

2019-01-31 Thread Toshiaki Makita
Previously virtnet_xdp_xmit() did not account for device tx counters, which caused confusions. To be consistent with SKBs, account them on freeing xdp_frames. Reported-by: David Ahern Signed-off-by: Toshiaki Makita --- drivers/net/virtio_net.c | 20 1 file changed, 16 inser