Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-06 Thread Michael S. Tsirkin
On Fri, Nov 04, 2016 at 04:05:51PM -0700, John Fastabend wrote: > On 16-11-03 05:34 PM, Michael S. Tsirkin wrote: > > On Thu, Nov 03, 2016 at 04:29:22PM -0700, John Fastabend wrote: > >> [...] > >> > > - when XDP is attached disable all LRO using > > VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET >

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-04 Thread John Fastabend
On 16-11-03 05:34 PM, Michael S. Tsirkin wrote: > On Thu, Nov 03, 2016 at 04:29:22PM -0700, John Fastabend wrote: >> [...] >> > - when XDP is attached disable all LRO using > VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET > (not used by driver so far, designed to allow dynamic LRO control with

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-03 Thread Michael S. Tsirkin
On Thu, Nov 03, 2016 at 04:29:22PM -0700, John Fastabend wrote: > [...] > > >>> - when XDP is attached disable all LRO using > >>> VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET > >>> (not used by driver so far, designed to allow dynamic LRO control with > >>>ethtool) > >> > >> I see there is a UAPI

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-03 Thread John Fastabend
[...] >>> - when XDP is attached disable all LRO using >>> VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET >>> (not used by driver so far, designed to allow dynamic LRO control with >>>ethtool) >> >> I see there is a UAPI bit for this but I guess we also need to add >> support to vhost as well? Seems

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-03 Thread Michael S. Tsirkin
Kicinski <kubak...@wp.pl>; John > >>> Fastabend <john.fastab...@gmail.com>; David Miller > >>> <da...@davemloft.net>; alexander.du...@gmail.com; m...@redhat.com; > >>> shrij...@gmail.com; t...@herbertland.com; netdev@vger.kernel.org; > >>> R

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-03 Thread John Fastabend
t;; John >>>> Fastabend <john.fastab...@gmail.com>; David Miller >>>> <da...@davemloft.net>; alexander.du...@gmail.com; m...@redhat.com; >>>> shrij...@gmail.com; t...@herbertland.com; netdev@vger.kernel.org; >>>> Roopa Prabhu <ro...@cumulusnetw

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-03 Thread John Fastabend
>>> <da...@davemloft.net>; alexander.du...@gmail.com; m...@redhat.com; >>> shrij...@gmail.com; t...@herbertland.com; netdev@vger.kernel.org; >>> Roopa Prabhu <ro...@cumulusnetworks.com>; Nikolay Aleksandrov >>> <niko...@cumulusnetworks.com>; bro...@redha

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-02 Thread Michael S. Tsirkin
com; > > shrij...@gmail.com; t...@herbertland.com; netdev@vger.kernel.org; > > Roopa Prabhu <ro...@cumulusnetworks.com>; Nikolay Aleksandrov > > <niko...@cumulusnetworks.com>; bro...@redhat.com > > Subject: Re: [PATCH net-next RFC WIP] Patch for XDP support for &g

RE: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-02 Thread Shrijeet Mukherjee
ulusnetworks.com>; Nikolay Aleksandrov > <niko...@cumulusnetworks.com>; bro...@redhat.com > Subject: Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net > > On Sat, 29 Oct 2016 13:25:14 +0200 > Thomas Graf <tg...@suug.ch> wrote: > > > On 10/28/16

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-02 Thread Alexander Duyck
On Wed, Nov 2, 2016 at 7:01 AM, Jesper Dangaard Brouer wrote: > On Fri, 28 Oct 2016 13:11:01 -0400 (EDT) > David Miller wrote: > >> From: John Fastabend >> Date: Fri, 28 Oct 2016 08:56:35 -0700 >> >> > On 16-10-27 07:10 PM, David

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-02 Thread Jesper Dangaard Brouer
On Sat, 29 Oct 2016 13:25:14 +0200 Thomas Graf wrote: > On 10/28/16 at 08:51pm, Shrijeet Mukherjee wrote: > > Generally agree, but SRIOV nics with multiple queues can end up in a bad > > spot if each buffer was 4K right ? I see a specific page pool to be used > > by queues which

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-11-02 Thread Jesper Dangaard Brouer
On Fri, 28 Oct 2016 13:11:01 -0400 (EDT) David Miller wrote: > From: John Fastabend > Date: Fri, 28 Oct 2016 08:56:35 -0700 > > > On 16-10-27 07:10 PM, David Miller wrote: > >> From: Alexander Duyck > >> Date: Thu, 27

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-30 Thread Michael S. Tsirkin
On Fri, Oct 28, 2016 at 01:11:01PM -0400, David Miller wrote: > From: John Fastabend > Date: Fri, 28 Oct 2016 08:56:35 -0700 > > > On 16-10-27 07:10 PM, David Miller wrote: > >> From: Alexander Duyck > >> Date: Thu, 27 Oct 2016 18:43:59 -0700

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-29 Thread Thomas Graf
On 10/28/16 at 08:51pm, Shrijeet Mukherjee wrote: > Generally agree, but SRIOV nics with multiple queues can end up in a bad > spot if each buffer was 4K right ? I see a specific page pool to be used > by queues which are enabled for XDP as the easiest to swing solution that > way the memory

RE: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-28 Thread Shrijeet Mukherjee
et>; alexander.du...@gmail.com; m...@redhat.com; > bro...@redhat.com; shrij...@gmail.com; t...@herbertland.com; > netdev@vger.kernel.org; s...@cumulusnetworks.com; > ro...@cumulusnetworks.com; niko...@cumulusnetworks.com > Subject: Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-28 Thread Jakub Kicinski
On Fri, 28 Oct 2016 13:35:02 -0700, Alexander Duyck wrote: > > At the same time XDP doesn't require to use 4k buffer in something like > > Netronome. > > If xdp bpf program can be offloaded into HW with 1800 byte buffers, great! > > So are you saying this is only really meant to be used with a

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-28 Thread Jakub Kicinski
On Fri, 28 Oct 2016 11:22:25 -0700, Alexei Starovoitov wrote: > On Fri, Oct 28, 2016 at 05:18:12PM +0100, Jakub Kicinski wrote: > > On Fri, 28 Oct 2016 08:56:35 -0700, John Fastabend wrote: > > > On 16-10-27 07:10 PM, David Miller wrote: > > > > From: Alexander Duyck

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-28 Thread Alexander Duyck
On Fri, Oct 28, 2016 at 11:22 AM, Alexei Starovoitov wrote: > On Fri, Oct 28, 2016 at 05:18:12PM +0100, Jakub Kicinski wrote: >> On Fri, 28 Oct 2016 08:56:35 -0700, John Fastabend wrote: >> > On 16-10-27 07:10 PM, David Miller wrote: >> > > From: Alexander Duyck

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-28 Thread Alexei Starovoitov
On Fri, Oct 28, 2016 at 05:18:12PM +0100, Jakub Kicinski wrote: > On Fri, 28 Oct 2016 08:56:35 -0700, John Fastabend wrote: > > On 16-10-27 07:10 PM, David Miller wrote: > > > From: Alexander Duyck > > > Date: Thu, 27 Oct 2016 18:43:59 -0700 > > > > > >> On Thu, Oct

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-28 Thread David Miller
From: John Fastabend Date: Fri, 28 Oct 2016 08:56:35 -0700 > On 16-10-27 07:10 PM, David Miller wrote: >> From: Alexander Duyck >> Date: Thu, 27 Oct 2016 18:43:59 -0700 >> >>> On Thu, Oct 27, 2016 at 6:35 PM, David Miller

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-28 Thread Jakub Kicinski
On Fri, 28 Oct 2016 08:56:35 -0700, John Fastabend wrote: > On 16-10-27 07:10 PM, David Miller wrote: > > From: Alexander Duyck > > Date: Thu, 27 Oct 2016 18:43:59 -0700 > > > >> On Thu, Oct 27, 2016 at 6:35 PM, David Miller wrote: > >> > >>>

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-28 Thread John Fastabend
On 16-10-27 07:10 PM, David Miller wrote: > From: Alexander Duyck > Date: Thu, 27 Oct 2016 18:43:59 -0700 > >> On Thu, Oct 27, 2016 at 6:35 PM, David Miller wrote: >>> From: "Michael S. Tsirkin" >>> Date: Fri, 28 Oct 2016

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-27 Thread David Miller
From: Alexander Duyck Date: Thu, 27 Oct 2016 18:43:59 -0700 > On Thu, Oct 27, 2016 at 6:35 PM, David Miller wrote: >> From: "Michael S. Tsirkin" >> Date: Fri, 28 Oct 2016 01:25:48 +0300 >> >>> On Thu, Oct 27, 2016 at 05:42:18PM

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-27 Thread Alexander Duyck
On Thu, Oct 27, 2016 at 6:35 PM, David Miller wrote: > From: "Michael S. Tsirkin" > Date: Fri, 28 Oct 2016 01:25:48 +0300 > >> On Thu, Oct 27, 2016 at 05:42:18PM -0400, David Miller wrote: >>> From: "Michael S. Tsirkin" >>> Date: Fri, 28

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-27 Thread David Miller
From: "Michael S. Tsirkin" Date: Fri, 28 Oct 2016 01:25:48 +0300 > On Thu, Oct 27, 2016 at 05:42:18PM -0400, David Miller wrote: >> From: "Michael S. Tsirkin" >> Date: Fri, 28 Oct 2016 00:30:35 +0300 >> >> > Something I'd like to understand is how does XDP

RE: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-27 Thread Shrijeet Mukherjee
> > Cc: m...@redhat.com; shrij...@gmail.com; t...@herbertland.com; > netdev@vger.kernel.org; Roopa Prabhu <ro...@cumulusnetworks.com>; > Nikolay Aleksandrov <niko...@cumulusnetworks.com> > Subject: RE: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net > >

RE: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-27 Thread Shrijeet Mukherjee
> > > > Looking at the virtio_net.c code, the function call receive_big() > > might actually be okay for XDP, unless the incoming packet is larger > > than PAGE_SIZE and thus uses several pages (via a linked list in page- > >private). > > > > The receive_mergeable() does not look compatible with

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-27 Thread Michael S. Tsirkin
On Thu, Oct 27, 2016 at 05:42:18PM -0400, David Miller wrote: > From: "Michael S. Tsirkin" > Date: Fri, 28 Oct 2016 00:30:35 +0300 > > > Something I'd like to understand is how does XDP address the > > problem that 100Byte packets are consuming 4K of memory now. > > Via page

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-27 Thread David Miller
From: "Michael S. Tsirkin" Date: Fri, 28 Oct 2016 00:30:35 +0300 > Something I'd like to understand is how does XDP address the > problem that 100Byte packets are consuming 4K of memory now. Via page pools. We're going to make a generic one, but right now each and every driver

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-27 Thread Michael S. Tsirkin
On Thu, Oct 27, 2016 at 02:09:08PM -0700, John Fastabend wrote: > On 16-10-27 01:55 AM, Jesper Dangaard Brouer wrote: > > On Wed, 26 Oct 2016 13:11:22 -0400 (EDT) > > David Miller wrote: > > > >> From: "Michael S. Tsirkin" > >> Date: Wed, 26 Oct 2016

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-27 Thread John Fastabend
On 16-10-27 01:55 AM, Jesper Dangaard Brouer wrote: > On Wed, 26 Oct 2016 13:11:22 -0400 (EDT) > David Miller wrote: > >> From: "Michael S. Tsirkin" >> Date: Wed, 26 Oct 2016 20:07:19 +0300 >> >>> On Wed, Oct 26, 2016 at 12:52:45PM -0400, David Miller

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-27 Thread Jesper Dangaard Brouer
On Wed, 26 Oct 2016 13:11:22 -0400 (EDT) David Miller wrote: > From: "Michael S. Tsirkin" > Date: Wed, 26 Oct 2016 20:07:19 +0300 > > > On Wed, Oct 26, 2016 at 12:52:45PM -0400, David Miller wrote: > >> From: "Michael S. Tsirkin" > >>

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-26 Thread David Miller
From: "Michael S. Tsirkin" Date: Wed, 26 Oct 2016 20:07:19 +0300 > On Wed, Oct 26, 2016 at 12:52:45PM -0400, David Miller wrote: >> From: "Michael S. Tsirkin" >> Date: Wed, 26 Oct 2016 19:36:45 +0300 >> >> > On Wed, Oct 26, 2016 at 03:52:02PM +0200, Jesper

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-26 Thread Michael S. Tsirkin
On Wed, Oct 26, 2016 at 12:52:45PM -0400, David Miller wrote: > From: "Michael S. Tsirkin" > Date: Wed, 26 Oct 2016 19:36:45 +0300 > > > On Wed, Oct 26, 2016 at 03:52:02PM +0200, Jesper Dangaard Brouer wrote: > >> On Sat, 22 Oct 2016 04:07:23 + > >> Shrijeet Mukherjee

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-26 Thread David Miller
From: "Michael S. Tsirkin" Date: Wed, 26 Oct 2016 19:36:45 +0300 > On Wed, Oct 26, 2016 at 03:52:02PM +0200, Jesper Dangaard Brouer wrote: >> On Sat, 22 Oct 2016 04:07:23 + >> Shrijeet Mukherjee wrote: >> >> > This patch adds support for xdp ndo and

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-26 Thread Michael S. Tsirkin
On Wed, Oct 26, 2016 at 03:52:02PM +0200, Jesper Dangaard Brouer wrote: > On Sat, 22 Oct 2016 04:07:23 + > Shrijeet Mukherjee wrote: > > > This patch adds support for xdp ndo and also inserts the xdp program > > call into the merged RX buffers and big buffers paths > > I

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-26 Thread Jesper Dangaard Brouer
On Sat, 22 Oct 2016 04:07:23 + Shrijeet Mukherjee wrote: > This patch adds support for xdp ndo and also inserts the xdp program > call into the merged RX buffers and big buffers paths I really appreciate you are doing this for virtio_net. My first question is: Is the

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-25 Thread Jakub Kicinski
On Sat, 22 Oct 2016 04:07:23 +, Shrijeet Mukherjee wrote: > + act = bpf_prog_run_xdp(xdp_prog, ); > + switch (act) { > + case XDP_PASS: > + return XDP_PASS; > + case XDP_TX: > + case XDP_ABORTED: > +

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-24 Thread Alexei Starovoitov
On Sun, Oct 23, 2016 at 06:51:53PM -0700, Shrijeet Mukherjee wrote: > > The main goal of this patch was to start that discussion. My v2 patch > rejects the ndo op if neither of rx_mergeable or big_buffers are set. > Does that sound like a good tradeoff ? Don't know enough about who > turns these

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-23 Thread Shrijeet Mukherjee
On Sun, Oct 23, 2016 at 9:38 AM, Stephen Hemminger wrote: > Overall, I am glad to see XDP support more widely available. Minor stuff > in implementation. > >> >> +/* this function is not called from the receive_buf path directly as >> + * we want to use the page model

Re: [PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-23 Thread Stephen Hemminger
Overall, I am glad to see XDP support more widely available. Minor stuff in implementation. > > +/* this function is not called from the receive_buf path directly as > + * we want to use the page model for rx merge buffer and big buffers > + * and not use the fast path for driving skb's around

[PATCH net-next RFC WIP] Patch for XDP support for virtio_net

2016-10-21 Thread Shrijeet Mukherjee
This patch adds support for xdp ndo and also inserts the xdp program call into the merged RX buffers and big buffers paths * The small packet skb receive is skipped for now * No TX for now Signed-off-by: Shrijeet Mukherjee --- drivers/net/virtio_net.c | 133