Re: [RFC PATCH] virtio_net: XDP support for adjust_head

2017-01-03 Thread John Fastabend
On 17-01-03 08:54 AM, John Fastabend wrote: > On 17-01-02 10:01 PM, Jason Wang wrote: >> >> >> On 2017年01月03日 03:44, John Fastabend wrote: >>> Add support for XDP adjust head by allocating a 256B header region >>> that XDP programs can grow into. This

Re: [net PATCH] net: virtio: cap mtu when XDP programs are running

2017-01-03 Thread John Fastabend
On 17-01-02 10:14 PM, Jason Wang wrote: > > > On 2017年01月03日 06:30, John Fastabend wrote: >> XDP programs can not consume multiple pages so we cap the MTU to >> avoid this case. Virtio-net however only checks the MTU at XDP >> program load and does not block MTU chang

Re: [net PATCH] net: virtio: cap mtu when XDP programs are running

2017-01-03 Thread John Fastabend
On 17-01-02 10:14 PM, Jason Wang wrote: > > > On 2017年01月03日 06:30, John Fastabend wrote: >> XDP programs can not consume multiple pages so we cap the MTU to >> avoid this case. Virtio-net however only checks the MTU at XDP >> program load and does not block MTU chang

Re: [PATCH net 9/9] virtio-net: XDP support for small buffers

2017-01-03 Thread John Fastabend
On 17-01-02 10:16 PM, Jason Wang wrote: > > > On 2017年01月03日 06:43, John Fastabend wrote: >> On 16-12-23 06:37 AM, Jason Wang wrote: >>> Commit f600b6905015 ("virtio_net: Add XDP support") leaves the case of >>> small receive buffer untouched. This wi

Re: [PATCH net-next] net/sched: cls_flower: Add user specified data

2017-01-02 Thread John Fastabend
On 17-01-02 05:22 PM, Jamal Hadi Salim wrote: > On 17-01-02 05:58 PM, John Fastabend wrote: >> On 17-01-02 02:21 PM, Jamal Hadi Salim wrote: > > >> Well having the length value avoids ending up with cookie1, cookie2, ... >> values as folks push more and more data into

Re: [PATCH net-next] net/sched: cls_flower: Add user specified data

2017-01-02 Thread John Fastabend
On 17-01-02 02:21 PM, Jamal Hadi Salim wrote: > On 17-01-02 01:23 PM, John Fastabend wrote: > >> >> Additionally I would like to point out this is an arbitrary length binary >> blob (for undefined use, without even a specified encoding) that gets pushed >> b

Re: [PATCH net 9/9] virtio-net: XDP support for small buffers

2017-01-02 Thread John Fastabend
it work. XDP then can only work at skb->data since > virtio-net create skbs during refill, this is sub optimal which could > be optimized in the future. > > Cc: John Fastabend <john.r.fastab...@intel.com> > Signed-off-by: Jason Wang <jasow...@re

[net PATCH] net: virtio: cap mtu when XDP programs are running

2017-01-02 Thread John Fastabend
XDP programs can not consume multiple pages so we cap the MTU to avoid this case. Virtio-net however only checks the MTU at XDP program load and does not block MTU changes after the program has loaded. This patch sets/clears the max_mtu value at XDP load/unload time. Signed-off-by: John

Re: [RFC PATCH] virtio_net: XDP support for adjust_head

2017-01-02 Thread John Fastabend
On 17-01-02 11:44 AM, John Fastabend wrote: > Add support for XDP adjust head by allocating a 256B header region > that XDP programs can grow into. This is only enabled when a XDP > program is loaded. > > In order to ensure that we do not have to unwind queue headroom push >

[RFC PATCH] virtio_net: XDP support for adjust_head

2017-01-02 Thread John Fastabend
() and virtio_device_ready() or possibly hitting the right set of bits with vp_set_status() but my first attempt just hung the device. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 106 +++--- 1 file chang

Re: [PATCH net-next] net/sched: cls_flower: Add user specified data

2017-01-02 Thread John Fastabend
On 17-01-02 06:59 AM, Jamal Hadi Salim wrote: > > We have been using a cookie as well for actions (which we have been > using but have been too lazy to submit so far). I am going to port > it over to the newer kernels and post it. > In our case that is intended to be opaque to the kernel i.e

Re: [RFC PATCH] virtio_net: XDP support for adjust_head

2016-12-23 Thread John Fastabend
On 16-12-23 10:43 AM, John Fastabend wrote: > Add support for XDP adjust head by allocating a 256B header region > that XDP programs can grow into. This is only enabled when a XDP > program is loaded. > > In order to ensure that we do not have to unwind queue headroom push >

Re: [PATCH net] virtio_net: reject XDP programs using header adjustment

2016-12-23 Thread John Fastabend
On 16-12-20 04:30 AM, Jakub Kicinski wrote: > On Mon, Dec 19, 2016 at 5:50 PM, John Fastabend > <john.fastab...@gmail.com> wrote: >> On 16-12-19 07:05 AM, Jakub Kicinski wrote: >>> commit 17bedab27231 ("bpf: xdp: Allow head adjustment in XDP prog") >>>

[RFC PATCH] virtio_net: XDP support for adjust_head

2016-12-23 Thread John Fastabend
another queue setup call. TBD merge with Jason Wang's fixes, do a bit more testing, note big_packet support is removed by Jason as well. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 53 +++--- 1 file c

Re: [PATCH net 0/9] several fixups for virtio-net XDP

2016-12-23 Thread John Fastabend
On 16-12-23 06:37 AM, Jason Wang wrote: > Merry Xmas and a Happy New year to all: > > This series tries to fixes several issues for virtio-net XDP which > could be categorized into several parts: > > - fix several issues during XDP linearizing > - allow csumed packet to work for XDP_PASS > -

Re: [PATCH net 9/9] virtio-net: XDP support for small buffers

2016-12-23 Thread John Fastabend
it work. XDP then can only work at skb->data since > virtio-net create skbs during refill, this is sub optimal which could > be optimized in the future. > > Cc: John Fastabend <john.r.fastab...@intel.com> > Signed-off-by: Jason Wang <jasow...@redhat.com> > -

Re: [PATCH net 7/9] virtio-net: forbid XDP when VIRTIO_NET_F_GUEST_UFO is support

2016-12-23 Thread John Fastabend
On 16-12-23 08:02 AM, John Fastabend wrote: > On 16-12-23 06:37 AM, Jason Wang wrote: >> When VIRTIO_NET_F_GUEST_UFO is negotiated, host could still send UFO >> packet that exceeds a single page which could not be handled >> correctly by XDP. So this patch forbids setti

Re: [PATCH net 7/9] virtio-net: forbid XDP when VIRTIO_NET_F_GUEST_UFO is support

2016-12-23 Thread John Fastabend
r ECN (which comes only from GRO) > too to prevent user from misconfiguration. > > Cc: John Fastabend <john.r.fastab...@intel.com> > Signed-off-by: Jason Wang <jasow...@redhat.com> > --- > drivers/net/virtio_net.c | 4 +++- > 1 file changed, 3 insertions(+)

Re: [PATCH net 6/9] virtio-net: make rx buf size estimation works for XDP

2016-12-23 Thread John Fastabend
On 16-12-23 06:37 AM, Jason Wang wrote: > We don't update ewma rx buf size in the case of XDP. This will lead > underestimation of rx buf size which causes host to produce more than > one buffers. This will greatly increase the possibility of XDP page > linearization. > >

Re: [PATCH net 5/9] virtio-net: unbreak csumed packets for XDP_PASS

2016-12-23 Thread John Fastabend
On 16-12-23 06:37 AM, Jason Wang wrote: > We drop csumed packet when do XDP for packets. This breaks > XDP_PASS when GUEST_CSUM is supported. Fix this by allowing csum flag > to be set. With this patch, simple TCP works for XDP_PASS. > > Cc: John Fastabend <john.r.fastab...@i

Re: [PATCH net 4/9] virtio-net: correctly handle XDP_PASS for linearized packets

2016-12-23 Thread John Fastabend
on xdp_page. > > With this patch "ping 192.168.100.4 -s 3900 -M do" works for XDP_PASS. > > Cc: John Fastabend <john.r.fastab...@intel.com> > Signed-off-by: Jason Wang <jasow...@redhat.com> > --- > drivers/net/virtio_net.c | 10 -- > 1 file changed, 8 i

Re: [PATCH net 3/9] virtio-net: fix page miscount during XDP linearizing

2016-12-23 Thread John Fastabend
free buffers correctly when packet > exceeds PAGE_SIZE. With this patch, we won't get OOM after linearize > huge number of packets. > > Cc: John Fastabend <john.r.fastab...@intel.com> > Signed-off-by: Jason Wang <jasow...@redhat.com> > --- Thanks! looks good. B

Re: [PATCH net 2/9] virtio-net: correctly xmit linearized page on XDP_TX

2016-12-23 Thread John Fastabend
On 16-12-23 06:37 AM, Jason Wang wrote: > After we linearize page, we should xmit this page instead of the page > of first buffer which may lead unexpected result. With this patch, we > can see correct packet during XDP_TX. > > Cc: John Fastabend <john.r.fastab...@intel

Re: [PATCH net] net, sched: fix soft lockup in tc_classify

2016-12-22 Thread John Fastabend
On 16-12-22 08:53 AM, David Miller wrote: > From: Daniel Borkmann > Date: Wed, 21 Dec 2016 22:07:48 +0100 > >> Ok, you mean for net. In that case I prefer the smaller sized fix to >> be honest. It also covers everything from the point where we fetch >> the chain via

Re: [PATCH net] virtio_net: reject XDP programs using header adjustment

2016-12-19 Thread John Fastabend
just_head) { > + netdev_warn(dev, "Does not support bpf_xdp_adjust_head()\n"); > + return -EOPNOTSUPP; > + } > + > if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO4) || > virtio_has_feature(vi->vdev, VIRTIO_NET_F_GUEST_TSO6)) { >

[net-next PATCH v6 4/5] virtio_net: add XDP_TX support

2016-12-15 Thread John Fastabend
is zeroed. Also XDP is expected to handle checksum correctly so no checksum offload support is provided. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 100 +++--- 1 file changed, 93 insertions(+), 7 del

[net-next PATCH v6 2/5] virtio_net: Add XDP support

2016-12-15 Thread John Fastabend
From: John Fastabend <john.fastab...@gmail.com> This adds XDP support to virtio_net. Some requirements must be met for XDP to be enabled depending on the mode. First it will only be supported with LRO disabled so that data is not pushed across multiple buffers. Second the MTU must be les

[net-next PATCH v6 3/5] virtio_net: add dedicated XDP transmit queues

2016-12-15 Thread John Fastabend
the backend use them. This creates more RX queues visible to the network stack than TX queues which is worth mentioning but does not cause any issues as far as I can tell. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c

[net-next PATCH v6 1/5] net: xdp: add invalid buffer warning

2016-12-15 Thread John Fastabend
This adds a warning for drivers to use when encountering an invalid buffer for XDP. For normal cases this should not happen but to catch this in virtual/qemu setups that I may not have expected from the emulation layer having a standard warning is useful. Signed-off-by: John Fastabend

[net-next PATCH v6 5/5] virtio_net: xdp, add slowpath case for non contiguous buffers

2016-12-15 Thread John Fastabend
Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 75 +- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 1f8300b..ce4ae7f 100644 -

[net-next PATCH v6 0/5] XDP for virtio_net

2016-12-15 Thread John Fastabend
support LRO with XDP at the moment. Please review any comments/feedback welcome as always. Thanks, John --- John Fastabend (5): net: xdp: add invalid buffer warning virtio_net: Add XDP support virtio_net: add dedicated XDP transmit queues virtio_net: add XDP_TX support

Re: [net-next PATCH v5 1/6] net: virtio dynamically disable/enable LRO

2016-12-14 Thread John Fastabend
On 16-12-14 05:31 AM, Michael S. Tsirkin wrote: > On Thu, Dec 08, 2016 at 04:04:58PM -0800, John Fastabend wrote: >> On 16-12-08 01:36 PM, Michael S. Tsirkin wrote: >>> On Wed, Dec 07, 2016 at 12:11:11PM -0800, John Fastabend wrote: >>>> This adds support for dynam

Re: Designing a safe RX-zero-copy Memory Model for Networking

2016-12-14 Thread John Fastabend
On 16-12-14 01:39 AM, Jesper Dangaard Brouer wrote: > On Tue, 13 Dec 2016 12:08:21 -0800 > John Fastabend <john.fastab...@gmail.com> wrote: > >> On 16-12-13 11:53 AM, David Miller wrote: >>> From: John Fastabend <john.fastab...@gmail.com> >>> Date: Tue

Re: Designing a safe RX-zero-copy Memory Model for Networking

2016-12-13 Thread John Fastabend
On 16-12-13 11:53 AM, David Miller wrote: > From: John Fastabend <john.fastab...@gmail.com> > Date: Tue, 13 Dec 2016 09:43:59 -0800 > >> What does "zero-copy send packet-pages to the application/socket that >> requested this" mean? At the moment on x8

Re: Designing a safe RX-zero-copy Memory Model for Networking

2016-12-13 Thread John Fastabend
On 16-12-13 08:10 AM, Jesper Dangaard Brouer wrote: > > On Mon, 12 Dec 2016 12:06:59 -0600 (CST) Christoph Lameter > wrote: >> On Mon, 12 Dec 2016, Jesper Dangaard Brouer wrote: >> >>> Hmmm. If you can rely on hardware setup to give you steering and >>> dedicated access to the

Re: Designing a safe RX-zero-copy Memory Model for Networking

2016-12-12 Thread John Fastabend
On 16-12-12 06:14 AM, Mike Rapoport wrote: > On Mon, Dec 12, 2016 at 10:40:42AM +0100, Jesper Dangaard Brouer wrote: >> >> On Mon, 12 Dec 2016 10:38:13 +0200 Mike Rapoport >> wrote: >> >>> Hello Jesper, >>> >>> On Mon, Dec 05, 2016 at 03:31:32PM +0100, Jesper Dangaard

Re: [net-next PATCH v5 1/6] net: virtio dynamically disable/enable LRO

2016-12-08 Thread John Fastabend
On 16-12-08 01:36 PM, Michael S. Tsirkin wrote: > On Wed, Dec 07, 2016 at 12:11:11PM -0800, John Fastabend wrote: >> This adds support for dynamically setting the LRO feature flag. The >> message to control guest features in the backend uses the >> CTRL_GUEST_OFFLOADS msg t

Re: [net-next PATCH v5 5/6] virtio_net: add XDP_TX support

2016-12-08 Thread John Fastabend
On 16-12-08 01:45 PM, Michael S. Tsirkin wrote: > On Thu, Dec 08, 2016 at 01:25:40PM -0800, John Fastabend wrote: >> On 16-12-08 01:18 PM, Michael S. Tsirkin wrote: >>> On Thu, Dec 08, 2016 at 10:18:22AM -0800, John Fastabend wrote: >>>>> I guess this helps bec

Re: [net-next PATCH v5 5/6] virtio_net: add XDP_TX support

2016-12-08 Thread John Fastabend
On 16-12-08 01:18 PM, Michael S. Tsirkin wrote: > On Thu, Dec 08, 2016 at 10:18:22AM -0800, John Fastabend wrote: >>> I guess this helps because it just slows down the guest. >>> I don't much like it ... >> >> I left it like this copying the pattern in balloon a

Re: [net-next PATCH v5 0/6] XDP for virtio_net

2016-12-08 Thread John Fastabend
On 16-12-08 11:38 AM, Alexei Starovoitov wrote: > On Thu, Dec 08, 2016 at 02:17:02PM -0500, David Miller wrote: >> From: John Fastabend <john.fastab...@gmail.com> >> Date: Wed, 07 Dec 2016 12:10:47 -0800 >> >>> This implements virtio_net for the mergeable buffer

Re: [net-next PATCH v5 5/6] virtio_net: add XDP_TX support

2016-12-08 Thread John Fastabend
On 16-12-07 10:11 PM, Michael S. Tsirkin wrote: > On Wed, Dec 07, 2016 at 12:12:45PM -0800, John Fastabend wrote: >> This adds support for the XDP_TX action to virtio_net. When an XDP >> program is run and returns the XDP_TX action the virtio_net XDP >> implementation wil

Re: [Intel-wired-lan] [PATCH 0/3] i40e: Support for XDP

2016-12-08 Thread John Fastabend
On 16-12-08 09:00 AM, Björn Töpel wrote: > From: Björn Töpel > > This series adds XDP support for i40e-based NICs. > > The first patch adds XDP_RX support, the second XDP_TX support and the > last patch makes it possible to change an XDP program without > rebuilding the

Re: [net-next PATCH v5 4/6] virtio_net: add dedicated XDP transmit queues

2016-12-08 Thread John Fastabend
On 16-12-07 09:59 PM, Michael S. Tsirkin wrote: > On Wed, Dec 07, 2016 at 12:12:23PM -0800, John Fastabend wrote: >> XDP requires using isolated transmit queues to avoid interference >> with normal networking stack (BQL, NETDEV_TX_BUSY, etc). >> This patch >> adds a X

Re: [PATCH v4 net-next 1/4] bpf: xdp: Allow head adjustment in XDP prog

2016-12-08 Thread John Fastabend
in KaFai Lau <ka...@fb.com> >> >> Acked-by: Daniel Borkmann <dan...@iogearbox.net> > > Acked-by: Alexei Starovoitov <a...@kernel.org> > Thanks for fixing up the xdp_buff struct. And for good measure, Acked-by: John Fastabend <john.r.fastab...@intel.com>

Re: [net-next PATCH v5 3/6] virtio_net: Add XDP support

2016-12-07 Thread John Fastabend
On 16-12-07 08:48 PM, Michael S. Tsirkin wrote: > On Wed, Dec 07, 2016 at 12:11:57PM -0800, John Fastabend wrote: >> From: John Fastabend <john.fastab...@gmail.com> >> >> This adds XDP support to virtio_net. Some requirements must be >> met for XDP to be ena

[net-next PATCH v5 6/6] virtio_net: xdp, add slowpath case for non contiguous buffers

2016-12-07 Thread John Fastabend
Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 75 +- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 8e5b13c..20c81bc 100644 -

[net-next PATCH v5 5/6] virtio_net: add XDP_TX support

2016-12-07 Thread John Fastabend
is zeroed. Also XDP is expected to handle checksum correctly so no checksum offload support is provided. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 99 +++--- 1 file changed, 92 insertions(+), 7 del

[net-next PATCH v5 3/6] virtio_net: Add XDP support

2016-12-07 Thread John Fastabend
From: John Fastabend <john.fastab...@gmail.com> This adds XDP support to virtio_net. Some requirements must be met for XDP to be enabled depending on the mode. First it will only be supported with LRO disabled so that data is not pushed across multiple buffers. Second the MTU must be les

[net-next PATCH v5 4/6] virtio_net: add dedicated XDP transmit queues

2016-12-07 Thread John Fastabend
the backend use them. This creates more RX queues visible to the network stack than TX queues which is worth mentioning but does not cause any issues as far as I can tell. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c

[net-next PATCH v5 2/6] net: xdp: add invalid buffer warning

2016-12-07 Thread John Fastabend
This adds a warning for drivers to use when encountering an invalid buffer for XDP. For normal cases this should not happen but to catch this in virtual/qemu setups that I may not have expected from the emulation layer having a standard warning is useful. Signed-off-by: John Fastabend

[net-next PATCH v5 1/6] net: virtio dynamically disable/enable LRO

2016-12-07 Thread John Fastabend
This adds support for dynamically setting the LRO feature flag. The message to control guest features in the backend uses the CTRL_GUEST_OFFLOADS msg type. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 40 +

[net-next PATCH v5 0/6] XDP for virtio_net

2016-12-07 Thread John Fastabend
->userspace_addr + addr - node->start); s += size; Please review any comments/feedback welcome as always. Thanks, John --- John Fastabend (6): net: virtio dynamically disable/enable LRO net: xdp: add invalid buffer warning virtio_net: Add XDP support vi

Re: [PATCH v2 net-next 3/4] mlx4: xdp: Reserve headroom for receiving packet when XDP prog is active

2016-12-06 Thread John Fastabend
On 16-12-06 08:50 AM, Saeed Mahameed wrote: > On Mon, Dec 5, 2016 at 9:55 PM, Martin KaFai Lau wrote: >> On Mon, Dec 05, 2016 at 02:54:06AM +0200, Saeed Mahameed wrote: >>> On Sun, Dec 4, 2016 at 5:17 AM, Martin KaFai Lau wrote: Reserve XDP_PACKET_HEADROOM and

Re: [PATCH v2 net-next 1/4] bpf: xdp: Allow head adjustment in XDP prog

2016-12-06 Thread John Fastabend
On 16-12-03 07:17 PM, Martin KaFai Lau wrote: > This patch allows XDP prog to extend/remove the packet > data at the head (like adding or removing header). It is > done by adding a new XDP helper bpf_xdp_adjust_head(). > > It also renames bpf_helper_changes_skb_data() to >

Re: [net-next PATCH v4 1/6] net: virtio dynamically disable/enable LRO

2016-12-04 Thread John Fastabend
On 16-12-03 09:36 PM, Michael S. Tsirkin wrote: > On Fri, Dec 02, 2016 at 12:49:45PM -0800, John Fastabend wrote: >> This adds support for dynamically setting the LRO feature flag. The >> message to control guest features in the backend uses the >> CTRL_GUEST_OFFLOADS msg t

Re: [flamebait] xdp, well meaning but pointless

2016-12-03 Thread John Fastabend
nce it make a lot more sense to me to provide >>> a). a faster mmap based interface (possibly AF_PACKET based) that allows >>> to map nic directly into userspace, detaching tx/rx queue from kernel. >>> >>> John Fastabend sent something like this last year as a proof

Re: [net-next PATCH v4 5/6] virtio_net: add XDP_TX support

2016-12-02 Thread John Fastabend
On 16-12-02 12:51 PM, John Fastabend wrote: > This adds support for the XDP_TX action to virtio_net. When an XDP > program is run and returns the XDP_TX action the virtio_net XDP > implementation will transmit the packet on a TX queue that aligns > with the current CPU that th

[net-next PATCH v4 6/6] virtio_net: xdp, add slowpath case for non contiguous buffers

2016-12-02 Thread John Fastabend
Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 77 +- 1 file changed, 75 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 137caba..13f463d 100644 -

[net-next PATCH v4 5/6] virtio_net: add XDP_TX support

2016-12-02 Thread John Fastabend
is zeroed. Also XDP is expected to handle checksum correctly so no checksum offload support is provided. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 63 -- 1 file changed, 60 insertions(+), 3 del

[net-next PATCH v4 4/6] virtio_net: add dedicated XDP transmit queues

2016-12-02 Thread John Fastabend
the backend use them. This creates more RX queues visible to the network stack than TX queues which is worth mentioning but does not cause any issues as far as I can tell. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c

[net-next PATCH v4 3/6] virtio_net: Add XDP support

2016-12-02 Thread John Fastabend
From: John Fastabend <john.fastab...@gmail.com> This adds XDP support to virtio_net. Some requirements must be met for XDP to be enabled depending on the mode. First it will only be supported with LRO disabled so that data is not pushed across multiple buffers. Second the MTU must be les

[net-next PATCH v4 2/6] net: xdp: add invalid buffer warning

2016-12-02 Thread John Fastabend
This adds a warning for drivers to use when encountering an invalid buffer for XDP. For normal cases this should not happen but to catch this in virtual/qemu setups that I may not have expected from the emulation layer having a standard warning is useful. Signed-off-by: John Fastabend

[net-next PATCH v4 1/6] net: virtio dynamically disable/enable LRO

2016-12-02 Thread John Fastabend
This adds support for dynamically setting the LRO feature flag. The message to control guest features in the backend uses the CTRL_GUEST_OFFLOADS msg type. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c

[net-next PATCH v4 0/6] XDP for virtio_net

2016-12-02 Thread John Fastabend
gle page Please review any comments/feedback welcome as always. --- John Fastabend (6): net: virtio dynamically disable/enable LRO net: xdp: add invalid buffer warning virtio_net: Add XDP support virtio_net: add dedicated XDP transmit queues virtio_net: add XDP

Re: bpf bounded loops. Was: [flamebait] xdp

2016-12-02 Thread John Fastabend
On 16-12-02 11:25 AM, Hannes Frederic Sowa wrote: > Hi, > > On 02.12.2016 19:39, Alexei Starovoitov wrote: >> On Thu, Dec 01, 2016 at 10:27:12PM +0100, Hannes Frederic Sowa wrote: >>> like") and the problematic of parsing DNS packets in XDP due to string >>> processing and looping inside eBPF. >>

Re: [net-next PATCH v3 0/6] XDP for virtio_net

2016-11-30 Thread John Fastabend
On 16-11-30 10:56 AM, Michael S. Tsirkin wrote: > On Wed, Nov 30, 2016 at 10:41:04AM -0800, John Fastabend wrote: >> On 16-11-30 10:35 AM, Michael S. Tsirkin wrote: >>> On Tue, Nov 29, 2016 at 12:05:20PM -0800, John Fastabend wrote: >>>> This implements virtio

Re: [net-next PATCH v3 3/6] virtio_net: Add XDP support

2016-11-30 Thread John Fastabend
On 16-11-30 10:54 AM, Michael S. Tsirkin wrote: > On Tue, Nov 29, 2016 at 12:10:21PM -0800, John Fastabend wrote: >> From: John Fastabend <john.fastab...@gmail.com> >> >> This adds XDP support to virtio_net. Some requirements must be >> met for XDP to be ena

Re: [net-next PATCH v3 0/6] XDP for virtio_net

2016-11-30 Thread John Fastabend
On 16-11-30 10:35 AM, Michael S. Tsirkin wrote: > On Tue, Nov 29, 2016 at 12:05:20PM -0800, John Fastabend wrote: >> This implements virtio_net for the mergeable buffers and big_packet >> modes. I tested this with vhost_net running on qemu and did not see >> any issues. For

Re: [PATCH net-next v3 3/4] bpf: BPF for lightweight tunnel infrastructure

2016-11-30 Thread John Fastabend
On 16-11-29 09:37 PM, Alexei Starovoitov wrote: > On Tue, Nov 29, 2016 at 06:52:36PM -0800, John Fastabend wrote: >> On 16-11-29 04:15 PM, Alexei Starovoitov wrote: >>> On Tue, Nov 29, 2016 at 02:21:22PM +0100, Thomas Graf wrote: >>>> Registers new BPF program typ

Re: [net-next PATCH v3 6/6] virtio_net: xdp, add slowpath case for non contiguous buffers

2016-11-30 Thread John Fastabend
On 16-11-30 06:30 AM, Jakub Kicinski wrote: > [add MST] > Thanks sorry MST. I did a cut'n'paste of an old list of CC's and missed you were not on the list. [...] >> +memcpy(page_address(page) + page_off, page_address(p) + offset, *len); >> +while (--num_buf) { >> +unsigned

Re: [PATCH net-next 8/8] net/mlx5e: Support adding ingress tc rule when egress device flag is set

2016-11-30 Thread John Fastabend
On 16-11-30 06:41 AM, Hadar Hen Zion wrote: > When ndo_setup_tc is called with an egress_dev flag set, it means that > the ndo call was executed on the mirred action (egress) device and not > on the ingress device. > > In order to support this kind of ndo_setup_tc call, and insert the > correct

Re: [PATCH net-next v3 3/4] bpf: BPF for lightweight tunnel infrastructure

2016-11-29 Thread John Fastabend
On 16-11-29 04:15 PM, Alexei Starovoitov wrote: > On Tue, Nov 29, 2016 at 02:21:22PM +0100, Thomas Graf wrote: >> Registers new BPF program types which correspond to the LWT hooks: >> - BPF_PROG_TYPE_LWT_IN => dst_input() >> - BPF_PROG_TYPE_LWT_OUT => dst_output() >> -

Re: [net-next PATCH v3 6/6] virtio_net: xdp, add slowpath case for non contiguous buffers

2016-11-29 Thread John Fastabend
On 16-11-29 04:37 PM, Alexei Starovoitov wrote: > On Tue, Nov 29, 2016 at 12:11:33PM -0800, John Fastabend wrote: >> virtio_net XDP support expects receive buffers to be contiguous. >> If this is not the case we enable a slowpath to allow connectivity >> to continue but at a s

[net-next PATCH v3 4/6] virtio_net: add dedicated XDP transmit queues

2016-11-29 Thread John Fastabend
the backend use them. This creates more RX queues visible to the network stack than TX queues which is worth mentioning but does not cause any issues as far as I can tell. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c

[net-next PATCH v3 6/6] virtio_net: xdp, add slowpath case for non contiguous buffers

2016-11-29 Thread John Fastabend
. There is no attempt to optimize this path. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 70 +- 1 file changed, 68 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c

[net-next PATCH v3 5/6] virtio_net: add XDP_TX support

2016-11-29 Thread John Fastabend
is zeroed. Also XDP is expected to handle checksum correctly so no checksum offload support is provided. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 59 -- 1 file changed, 56 insertions(+), 3 del

[net-next PATCH v3 1/6] net: virtio dynamically disable/enable LRO

2016-11-29 Thread John Fastabend
This adds support for dynamically setting the LRO feature flag. The message to control guest features in the backend uses the CTRL_GUEST_OFFLOADS msg type. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c

[net-next PATCH v3 2/6] net: xdp: add invalid buffer warning

2016-11-29 Thread John Fastabend
This adds a warning for drivers to use when encountering an invalid buffer for XDP. For normal cases this should not happen but to catch this in virtual/qemu setups that I may not have expected from the emulation layer having a standard warning is useful. Signed-off-by: John Fastabend

[net-next PATCH v3 3/6] virtio_net: Add XDP support

2016-11-29 Thread John Fastabend
From: John Fastabend <john.fastab...@gmail.com> This adds XDP support to virtio_net. Some requirements must be met for XDP to be enabled depending on the mode. First it will only be supported with LRO disabled so that data is not pushed across multiple buffers. Second the MTU must be les

[net-next PATCH v3 0/6] XDP for virtio_net

2016-11-29 Thread John Fastabend
ome as always. v2, fixes rcu usage throughout thanks to Eric and the use of num_online_cpus() usage thanks to Jakub. v3, add slowpath patch to handle num_bufs > 1 Thanks, John --- John Fastabend (6): net: virtio dynamically disable/enable LRO net: xdp: add invalid buffer w

Re: [net-next PATCH v2 3/5] virtio_net: Add XDP support

2016-11-28 Thread John Fastabend
[...] >> Perfect! hacking qemu for testing is no problem this helps a lot thanks >> and saves me time trying to figure out how to get qemu to do this. > > Pls note I didn't try this at all, so might not work, but should > give you the idea. > >>> >>> diff --git a/hw/net/virtio-net.c

Re: [PATCH net-next] virtio-net: enable multiqueue by default

2016-11-28 Thread John Fastabend
On 16-11-28 08:28 AM, David Miller wrote: > From: "Michael S. Tsirkin" > Date: Fri, 25 Nov 2016 06:43:08 +0200 > >> On Fri, Nov 25, 2016 at 12:37:26PM +0800, Jason Wang wrote: >>> We use single queue even if multiqueue is enabled and let admin to >>> enable it through ethtool

Re: [net-next PATCH v2 3/5] virtio_net: Add XDP support

2016-11-27 Thread John Fastabend
On 16-11-27 07:36 PM, Michael S. Tsirkin wrote: > On Fri, Nov 25, 2016 at 01:24:03PM -0800, John Fastabend wrote: >> On 16-11-22 06:58 AM, Michael S. Tsirkin wrote: >>> On Tue, Nov 22, 2016 at 12:27:03AM -0800, John Fastabend wrote: >>>> On 16-11-21 03:20 PM, Michael

Re: [Patch net-next] net_sched: move the empty tp check from ->destroy() to ->delete()

2016-11-27 Thread John Fastabend
ither. > > Fixes: 1e052be69d04 ("net_sched: destroy proto tp when all filters are gone") > Reported-by: Roi Dayan <r...@mellanox.com> > Cc: Daniel Borkmann <dan...@iogearbox.net> > Cc: John Fastabend <john.fastab...@gmail.com> > Signed-off-by: Cong

Re: [PATCH net] net, sched: respect rcu grace period on cls destruction

2016-11-27 Thread John Fastabend
gh the prior ->delete() callback. Both are independant > issues. Once we have that right, we can then clean tp->root up for a number > of classifiers by not making them RCU pointers, which requires a new callback > (->uninit) that is triggered from tp's RCU callback, where we j

Re: [Patch net-next] net_sched: move the empty tp check from ->destroy() to ->delete()

2016-11-27 Thread John Fastabend
On 16-11-27 06:26 PM, John Fastabend wrote: > On 16-11-26 10:29 PM, Roi Dayan wrote: >> >> >> On 27/11/2016 06:47, Roi Dayan wrote: >>> >>> >>> On 27/11/2016 02:33, Daniel Borkmann wrote: >>>> On 11/26/2016 12:09 PM, Daniel B

Re: [Patch net-next] net_sched: move the empty tp check from ->destroy() to ->delete()

2016-11-27 Thread John Fastabend
On 16-11-26 10:29 PM, Roi Dayan wrote: > > > On 27/11/2016 06:47, Roi Dayan wrote: >> >> >> On 27/11/2016 02:33, Daniel Borkmann wrote: >>> On 11/26/2016 12:09 PM, Daniel Borkmann wrote: On 11/26/2016 07:46 AM, Cong Wang wrote: > On Thu, Nov 24, 2016 at 7:20 AM, Daniel Borkmann >

Re: [net-next PATCH v2 3/5] virtio_net: Add XDP support

2016-11-25 Thread John Fastabend
On 16-11-22 06:58 AM, Michael S. Tsirkin wrote: > On Tue, Nov 22, 2016 at 12:27:03AM -0800, John Fastabend wrote: >> On 16-11-21 03:20 PM, Michael S. Tsirkin wrote: >>> On Sat, Nov 19, 2016 at 06:50:33PM -0800, John Fastabend wrote: >>>> From: Shrijeet

Re: [PATCH net-next] net/sched: cls_flower: verify root pointer before dereferncing it

2016-11-22 Thread John Fastabend
On 16-11-22 12:41 PM, Daniel Borkmann wrote: > On 11/22/2016 08:28 PM, Cong Wang wrote: >> On Tue, Nov 22, 2016 at 8:11 AM, Jiri Pirko wrote: >>> Tue, Nov 22, 2016 at 05:04:11PM CET, dan...@iogearbox.net wrote: Hmm, I don't think we want to have such an additional test in

Re: [net-next PATCH v2 3/5] virtio_net: Add XDP support

2016-11-22 Thread John Fastabend
On 16-11-21 03:20 PM, Michael S. Tsirkin wrote: > On Sat, Nov 19, 2016 at 06:50:33PM -0800, John Fastabend wrote: >> From: Shrijeet Mukherjee <shrij...@gmail.com> >> >> This adds XDP support to virtio_net. Some requirements must be >> met for XDP to be ena

Re: [net-next PATCH v2 4/5] virtio_net: add dedicated XDP transmit queues

2016-11-22 Thread John Fastabend
On 16-11-21 03:13 PM, Michael S. Tsirkin wrote: > On Sat, Nov 19, 2016 at 06:51:04PM -0800, John Fastabend wrote: >> XDP requires using isolated transmit queues to avoid interference >> with normal networking stack (BQL, NETDEV_TX_BUSY, etc). This patch >> adds a XDP que

Re: [net-next PATCH v2 1/5] net: virtio dynamically disable/enable LRO

2016-11-22 Thread John Fastabend
On 16-11-21 03:23 PM, Michael S. Tsirkin wrote: > On Sat, Nov 19, 2016 at 06:49:34PM -0800, John Fastabend wrote: >> This adds support for dynamically setting the LRO feature flag. The >> message to control guest features in the backend uses the >> CTRL_GUEST_OFFLOADS msg t

Re: [net-next PATCH v2 4/5] virtio_net: add dedicated XDP transmit queues

2016-11-21 Thread John Fastabend
On 16-11-21 03:45 AM, Daniel Borkmann wrote: > On 11/20/2016 03:51 AM, John Fastabend wrote: >> XDP requires using isolated transmit queues to avoid interference >> with normal networking stack (BQL, NETDEV_TX_BUSY, etc). This patch >> adds a XDP queue per cpu when a XDP progr

Re: [PATCH] VSOCK: add loopback to virtio_transport

2016-11-19 Thread John Fastabend
On 16-11-19 07:08 PM, David Miller wrote: > From: Stefan Hajnoczi > Date: Thu, 17 Nov 2016 15:49:23 + > >> @@ -159,6 +199,10 @@ virtio_transport_send_pkt(struct virtio_vsock_pkt *pkt) >> return -ENODEV; >> } >> >> +if

[net-next PATCH v2 5/5] virtio_net: add XDP_TX support

2016-11-19 Thread John Fastabend
is zeroed. Also XDP is expected to handle checksum correctly so no checksum offload support is provided. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c | 57 -- 1 file changed, 54 insertions(+), 3 del

[net-next PATCH v2 4/5] virtio_net: add dedicated XDP transmit queues

2016-11-19 Thread John Fastabend
the backend use them. This creates more RX queues visible to the network stack than TX queues which is worth mentioning but does not cause any issues as far as I can tell. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c

[net-next PATCH v2 3/5] virtio_net: Add XDP support

2016-11-19 Thread John Fastabend
nd MTU/LRO conditions above are met then XDP is allowed. A follow on patch can be generated to solve the mergeable receive case with num_bufs equal to 2. Buffers greater than two may not be handled has easily. Suggested-by: Shrijeet Mukherjee <shrij...@gmail.com> Signed-off-by: Jo

[net-next PATCH v2 2/5] net: xdp: add invalid buffer warning

2016-11-19 Thread John Fastabend
This adds a warning for drivers to use when encountering an invalid buffer for XDP. For normal cases this should not happen but to catch this in virtual/qemu setups that I may not have expected from the emulation layer having a standard warning is useful. Signed-off-by: John Fastabend

[net-next PATCH v2 0/5] XDP for virtio_net

2016-11-19 Thread John Fastabend
to Jakub. Thanks, John --- John Fastabend (4): net: virtio dynamically disable/enable LRO net: xdp: add invalid buffer warning virtio_net: add dedicated XDP transmit queues virtio_net: add XDP_TX support Shrijeet Mukherjee (1): virtio_net: Add XDP support drivers

[net-next PATCH v2 1/5] net: virtio dynamically disable/enable LRO

2016-11-19 Thread John Fastabend
This adds support for dynamically setting the LRO feature flag. The message to control guest features in the backend uses the CTRL_GUEST_OFFLOADS msg type. Signed-off-by: John Fastabend <john.r.fastab...@intel.com> --- drivers/net/virtio_net.c

<    5   6   7   8   9   10   11   12   13   14   >