[PATCH net] virtio-net: restore VIRTIO_HDR_F_DATA_VALID on receiving

2017-01-19 Thread Jason Wang
Commit 501db511397f ("virtio: don't set VIRTIO_NET_HDR_F_DATA_VALID on xmit") in fact disables VIRTIO_HDR_F_DATA_VALID on receiving path too, fixing this by adding a hint (has_data_valid) and set it only on the receiving path. Cc: Rolf Neugebauer <rolf.neugeba...@docker.com> Sign

Re: [PATCH] virtio: don't set VIRTIO_NET_HDR_F_DATA_VALID on xmit

2017-01-19 Thread Jason Wang
On 2017年01月20日 06:30, Michael S. Tsirkin wrote: On Thu, Jan 19, 2017 at 11:06:59AM +0800, Jason Wang wrote: On 2017年01月18日 23:18, Michael S. Tsirkin wrote: On Wed, Jan 18, 2017 at 11:54:21AM +0800, Jason Wang wrote: On 2017年01月18日 02:27, Michael S. Tsirkin wrote: On Tue, Jan 17, 2017

Re: [net PATCH v5 6/6] virtio_net: XDP support for adjust_head

2017-01-19 Thread Jason Wang
On 2017年01月20日 05:11, Michael S. Tsirkin wrote: On Thu, Jan 19, 2017 at 11:05:40AM +0800, Jason Wang wrote: On 2017年01月18日 23:15, Michael S. Tsirkin wrote: On Tue, Jan 17, 2017 at 02:22:59PM -0800, John Fastabend wrote: Add support for XDP adjust head by allocating a 256B header region

Re: [net PATCH v5 6/6] virtio_net: XDP support for adjust_head

2017-01-18 Thread Jason Wang
On 2017年01月18日 23:15, Michael S. Tsirkin wrote: On Tue, Jan 17, 2017 at 02:22:59PM -0800, 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

Re: [PATCH] virtio: don't set VIRTIO_NET_HDR_F_DATA_VALID on xmit

2017-01-18 Thread Jason Wang
On 2017年01月18日 23:18, Michael S. Tsirkin wrote: On Wed, Jan 18, 2017 at 11:54:21AM +0800, Jason Wang wrote: On 2017年01月18日 02:27, Michael S. Tsirkin wrote: On Tue, Jan 17, 2017 at 06:13:51PM +, Rolf Neugebauer wrote: This patch part reverts fd2a0437dc33 and e858fae2b0b8 which introduced

[PATCH net-next V5 3/3] tun: rx batching

2017-01-17 Thread Jason Wang
to change per device batched packets through ethtool -C rx-frames. NAPI_POLL_WEIGHT were used as upper limitation to prevent bh from being disabled too long. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/net/tun.c | 76 ++- 1 file c

[PATCH net-next V5 2/3] vhost_net: tx batching

2017-01-17 Thread Jason Wang
This patch tries to utilize tuntap rx batching by peeking the tx virtqueue during transmission, if there's more available buffers in the virtqueue, set MSG_MORE flag for a hint for backend (e.g tuntap) to batch the packets. Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by:

[PATCH net-next V5 1/3] vhost: better detection of available buffers

2017-01-17 Thread Jason Wang
tep. This patch is need for batching supports which needs to peek whether or not there's still available buffers in the ring. Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 8 ++-- 1 file changed, 6 i

[PATCH net-next V5 0/3] vhost_net tx batching

2017-01-17 Thread Jason Wang
since we don't use NAPI now - fix the issues that may exceeds max pending of zerocopy - more improvement on available buffer detection - move the limitation of batched pacekts from vhost to tuntap Please review. Thanks Jason Wang (3): vhost: better detection of available buffers vhost_net

Re: [PATCH] virtio: don't set VIRTIO_NET_HDR_F_DATA_VALID on xmit

2017-01-17 Thread Jason Wang
On 2017年01月18日 02:27, Michael S. Tsirkin wrote: On Tue, Jan 17, 2017 at 06:13:51PM +, Rolf Neugebauer wrote: This patch part reverts fd2a0437dc33 and e858fae2b0b8 which introduced a subtle change in how the virtio_net flags are derived from the SKBs ip_summed field. With the above

Re: [net PATCH v5 6/6] virtio_net: XDP support for adjust_head

2017-01-17 Thread Jason Wang
On 2017年01月18日 06:22, John Fastabend wrote: +static int virtnet_reset(struct virtnet_info *vi) +{ + struct virtio_device *dev = vi->vdev; + int ret; + + virtio_config_disable(dev); + dev->failed = dev->config->get_status(dev) & VIRTIO_CONFIG_S_FAILED; +

Re: [net PATCH v4 0/6] virtio_net XDP fixes and adjust_header support

2017-01-15 Thread Jason Wang
On 2017年01月16日 07:59, John Fastabend wrote: This has a fix to handle small buffer free logic correctly and then also adds adjust head support. I pushed adjust head at net (even though its rc3) to avoid having to push another exception case into virtio_net to catch if the program uses

Re: [net PATCH v4 6/6] virtio_net: XDP support for adjust_head

2017-01-15 Thread Jason Wang
On 2017年01月16日 08:01, 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 queue setup below

Re: [net PATCH v4 5/6] virtio: add pci_down/pci_up configuration

2017-01-15 Thread Jason Wang
On 2017年01月16日 08:01, John Fastabend wrote: In virtio_net we need to do a full reset of the device to support queue reconfiguration and also we can trigger this via ethtool commands. So instead of open coding this in net driver push this into generic code in virtio. This also avoid exporting a

Re: [net PATCH v3 3/5] virtio_net: factor out xdp handler for readability

2017-01-12 Thread Jason Wang
On 2017年01月13日 10:51, John Fastabend wrote: At this point the do_xdp_prog is mostly if/else branches handling the different modes of virtio_net. So remove it and handle running the program in the per mode handlers. Signed-off-by: John Fastabend ---

Re: [net PATCH v3 5/5] virtio_net: XDP support for adjust_head

2017-01-12 Thread Jason Wang
On 2017年01月13日 10:52, 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 queue setup below

Re: [net PATCH v3 1/5] virtio_net: use dev_kfree_skb for small buffer XDP receive

2017-01-12 Thread Jason Wang
if (!is_xdp_queue(vi, i)) + if (!is_xdp_raw_buffer_queue(vi, i)) dev_kfree_skb(buf); else put_page(virt_to_head_page(buf)); Acked-by: Jason Wang <jasow...@redhat.com>

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

2017-01-10 Thread Jason Wang
, 2017 at 10:29:39AM +0800, Jason Wang wrote: On 2017年01月10日 07:58, Michael S. Tsirkin wrote: On Mon, Jan 09, 2017 at 03:49:27PM -0800, John Fastabend wrote: On 17-01-09 03:24 PM, Michael S. Tsirkin wrote: On Mon, Jan 09, 2017 at 03:13:15PM -0800, John Fastabend wrote: On 17-01-09 03:05 PM, Michael

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

2017-01-09 Thread Jason Wang
On 2017年01月10日 10:51, Michael S. Tsirkin wrote: On Tue, Jan 10, 2017 at 10:29:39AM +0800, Jason Wang wrote: On 2017年01月10日 07:58, Michael S. Tsirkin wrote: On Mon, Jan 09, 2017 at 03:49:27PM -0800, John Fastabend wrote: On 17-01-09 03:24 PM, Michael S. Tsirkin wrote: On Mon, Jan 09, 2017

Re: [PATCH] vhost: scsi: constify target_core_fabric_ops structures

2017-01-09 Thread Jason Wang
ic_ops vhost_scsi_ops = { +static const struct target_core_fabric_ops vhost_scsi_ops = { .module = THIS_MODULE, .name = "vhost", .get_fabric_name= vhost_scsi_get_fabric_name, Acked-by: Jason Wang <jasow...@redhat.com>

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

2017-01-09 Thread Jason Wang
, 2017 at 11:09:14AM +0800, Jason Wang wrote: On 2017年01月05日 02:57, John Fastabend wrote: [...] On 2017年01月04日 00:48, John Fastabend wrote: 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

Re: [PATCH V4 net-next 3/3] tun: rx batching

2017-01-09 Thread Jason Wang
On 2017年01月10日 07:12, Michael S. Tsirkin wrote: On Mon, Jan 09, 2017 at 10:39:55AM +0800, Jason Wang wrote: On 2017年01月07日 03:47, Michael S. Tsirkin wrote: +static int tun_get_coalesce(struct net_device *dev, + struct ethtool_coalesce *ec) +{ + struct

Re: [PATCH V4 net-next 1/3] vhost: better detection of available buffers

2017-01-09 Thread Jason Wang
On 2017年01月10日 07:10, Michael S. Tsirkin wrote: On Mon, Jan 09, 2017 at 10:59:16AM +0800, Jason Wang wrote: On 2017年01月07日 03:55, Michael S. Tsirkin wrote: On Fri, Jan 06, 2017 at 10:13:15AM +0800, Jason Wang wrote: This patch tries to do several tweaks on vhost_vq_avail_empty

Re: [PATCH V4 net-next 1/3] vhost: better detection of available buffers

2017-01-08 Thread Jason Wang
On 2017年01月07日 03:55, Michael S. Tsirkin wrote: On Fri, Jan 06, 2017 at 10:13:15AM +0800, Jason Wang wrote: This patch tries to do several tweaks on vhost_vq_avail_empty() for a better performance: - check cached avail index first which could avoid userspace memory access. - using unlikely

Re: [PATCH V4 net-next 3/3] tun: rx batching

2017-01-08 Thread Jason Wang
On 2017年01月07日 03:47, Michael S. Tsirkin wrote: +static int tun_get_coalesce(struct net_device *dev, + struct ethtool_coalesce *ec) +{ + struct tun_struct *tun = netdev_priv(dev); + + ec->rx_max_coalesced_frames = tun->rx_batched; + + return 0; +} +

[PATCH V4 net-next 3/3] tun: rx batching

2017-01-05 Thread Jason Wang
to change per device batched packets through ethtool -C rx-frames. NAPI_POLL_WEIGHT were used as upper limitation to prevent bh from being disabled too long. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/net/tun.c | 76 ++- 1 file c

[PATCH V4 net-next 1/3] vhost: better detection of available buffers

2017-01-05 Thread Jason Wang
tep. This patch is need for batching supports which needs to peek whether or not there's still available buffers in the ring. Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 8 ++-- 1 file changed, 6 i

[PATCH V4 net-next 0/3] vhost_net tx batching

2017-01-05 Thread Jason Wang
improvement on available buffer detection - move the limitation of batched pacekts from vhost to tuntap Please review. Thanks Jason Wang (3): vhost: better detection of available buffers vhost_net: tx batching tun: rx batching drivers/net/tun.c | 76

[PATCH V4 net-next 2/3] vhost_net: tx batching

2017-01-05 Thread Jason Wang
This patch tries to utilize tuntap rx batching by peeking the tx virtqueue during transmission, if there's more available buffers in the virtqueue, set MSG_MORE flag for a hint for backend (e.g tuntap) to batch the packets. Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by:

Re: [net PATCH 1/2] virtio_net: cap mtu when XDP programs are running

2017-01-05 Thread Jason Wang
On 2017年01月05日 11:18, Michael S. Tsirkin wrote: On Wed, Jan 04, 2017 at 07:11:18PM -0800, 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 changes after the

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

2017-01-04 Thread Jason Wang
On 2017年01月05日 02:58, John Fastabend wrote: [...] @@ -393,34 +397,39 @@ static u32 do_xdp_prog(struct virtnet_info *vi, struct bpf_prog *xdp_prog, void *data, int len) { -int hdr_padded_len; struct xdp_buff xdp; -void *buf;

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

2017-01-04 Thread Jason Wang
On 2017年01月05日 02:57, John Fastabend wrote: [...] On 2017年01月04日 00:48, John Fastabend wrote: 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

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

2017-01-03 Thread Jason Wang
On 2017年01月04日 00:57, John Fastabend wrote: +/* Changing the headroom in buffers is a disruptive operation because + * existing buffers must be flushed and reallocated. This will happen + * when a xdp program is initially added or xdp is disabled by removing + * the xdp

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

2017-01-03 Thread Jason Wang
On 2017年01月04日 00:54, John Fastabend wrote: +/* Changing the headroom in buffers is a disruptive operation because + * existing buffers must be flushed and reallocated. This will happen + * when a xdp program is initially added or xdp is disabled by removing + * the xdp

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

2017-01-03 Thread Jason Wang
case. On 2017年01月04日 00:48, John Fastabend wrote: 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

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

2017-01-03 Thread Jason Wang
On 2017年01月04日 00:40, John Fastabend wrote: 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 V2 3/3] tun: rx batching

2017-01-03 Thread Jason Wang
On 2017年01月03日 21:33, Stefan Hajnoczi wrote: On Wed, Dec 28, 2016 at 04:09:31PM +0800, Jason Wang wrote: +static int tun_rx_batched(struct tun_file *tfile, struct sk_buff *skb, + int more) +{ + struct sk_buff_head *queue = >sk.sk_write_queue; + str

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

2017-01-02 Thread Jason Wang
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 will confuse the user who want to set XDP but use small buffers. Other than forbid XD

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

2017-01-02 Thread Jason Wang
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 changes after the program has loaded. This patch sets/clears the max_mtu value at XDP

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

2017-01-02 Thread Jason Wang
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 is only enabled when a XDP program is loaded. In order to ensure that we do not have to unwind queue headroom push queue setup below

Re: [PATCH net-next V3 3/3] tun: rx batching

2017-01-02 Thread Jason Wang
On 2017年01月01日 05:03, Stephen Hemminger wrote: On Fri, 30 Dec 2016 13:20:51 +0800 Jason Wang <jasow...@redhat.com> wrote: diff --git a/drivers/net/tun.c b/drivers/net/tun.c index cd8e02c..a268ed9 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -75,6 +75,10 @@ #i

Re: [PATCH net-next V3 3/3] tun: rx batching

2017-01-02 Thread Jason Wang
On 2017年01月01日 01:31, David Miller wrote: From: Jason Wang <jasow...@redhat.com> Date: Fri, 30 Dec 2016 13:20:51 +0800 @@ -1283,10 +1314,15 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, skb_probe_transport_header(skb, 0); rxhash = skb_ge

[PATCH net-next V3 2/3] vhost_net: tx batching

2016-12-29 Thread Jason Wang
This patch tries to utilize tuntap rx batching by peeking the tx virtqueue during transmission, if there's more available buffers in the virtqueue, set MSG_MORE flag for a hint for backend (e.g tuntap) to batch the packets. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost

[PATCH net-next V3 0/3] vhost_net tx batching

2016-12-29 Thread Jason Wang
the limitation of batched pacekts from vhost to tuntap Please review. Thanks Jason Wang (3): vhost: better detection of available buffers vhost_net: tx batching tun: rx batching drivers/net/tun.c | 50 -- drivers/vhost/net.c | 23

[PATCH net-next V3 3/3] tun: rx batching

2016-12-29 Thread Jason Wang
% rx_batched=16 0.98 +8.9% rx_batched=32 1.03 +14.4% rx_batched=48 1.09 +21.1% rx_batched=64 1.02 +13.3% The maximum number of batched packets were specified through a module parameter. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/net/tun.

[PATCH net-next V3 1/3] vhost: better detection of available buffers

2016-12-29 Thread Jason Wang
tep. This patch is need for batching supports which needs to peek whether or not there's still available buffers in the ring. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/

Re: [PATCH net-next V2 3/3] tun: rx batching

2016-12-29 Thread Jason Wang
On 2016年12月30日 00:35, David Miller wrote: From: Jason Wang <jasow...@redhat.com> Date: Wed, 28 Dec 2016 16:09:31 +0800 + spin_lock(>lock); + qlen = skb_queue_len(queue); + if (qlen > rx_batched) + goto drop; + __skb_queue_tai

[PATCH net-next V2 3/3] tun: rx batching

2016-12-28 Thread Jason Wang
% rx_batched=16 0.98 +8.9% rx_batched=32 1.03 +14.4% rx_batched=48 1.09 +21.1% rx_batched=64 1.02 +13.3% The maximum number of batched packets were specified through a module parameter. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/net/tun.

[PATCH net-next V2 0/3] vhost net tx batching

2016-12-28 Thread Jason Wang
% rx_batched=64 1.02 +13.3% Changes from V1: - drop NAPI handler since we don't use NAPI now - fix the issues that may exceeds max pending of zerocopy - more improvement on available buffer detection - move the limitation of batched pacekts from vhost to tuntap Please review. Thanks Jason Wang (3

[PATCH net-next V2 2/3] vhost_net: tx batching

2016-12-28 Thread Jason Wang
This patch tries to utilize tuntap rx batching by peeking the tx virtqueue during transmission, if there's more available buffers in the virtqueue, set MSG_MORE flag for a hint for backend (e.g tuntap) to batch the packets. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost

[PATCH net-next V2 1/3] vhost: better detection of available buffers

2016-12-28 Thread Jason Wang
tep. This patch is need for batching supports which needs to peek whether or not there's still available buffers in the ring. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/

Re: [PATCH net 1/9] virtio-net: remove the warning before XDP linearizing

2016-12-26 Thread Jason Wang
On 2016年12月24日 03:31, Daniel Borkmann wrote: Hi Jason, On 12/23/2016 03:37 PM, Jason Wang wrote: Since we use EWMA to estimate the size of rx buffer. When rx buffer size is underestimated, it's usual to have a packet with more than one buffers. Consider this is not a bug, remove the warning

[PATCH net] net: xdp: remove unused bfp_warn_invalid_xdp_buffer()

2016-12-26 Thread Jason Wang
arbox.net> Cc: John Fastabend <john.r.fastab...@intel.com> Signed-off-by: Jason Wang <jasow...@redhat.com> --- include/linux/filter.h | 1 - net/core/filter.c | 6 -- 2 files changed, 7 deletions(-) diff --git a/include/linux/filter.h b/include/linux/filter.h index 7023142..

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

2016-12-25 Thread Jason Wang
On 2016年12月24日 01:10, John Fastabend wrote: 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

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

2016-12-25 Thread Jason Wang
On 2016年12月24日 00:10, John Fastabend wrote: 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

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

2016-12-25 Thread Jason Wang
On 2016年12月23日 23:57, John Fastabend wrote: On 16-12-23 06:37 AM, Jason Wang wrote: When XDP_PASS were determined for linearized packets, we try to get new buffers in the virtqueue and build skbs from them. This is wrong, we should create skbs based on existed buffers instead. Fixing them

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

2016-12-25 Thread Jason Wang
On 2016年12月23日 23:54, John Fastabend wrote: On 16-12-23 06:37 AM, Jason Wang wrote: We don't put page during linearizing, the would cause leaking when xmit through XDP_TX or the packet exceeds PAGE_SIZE. Fix them by put page accordingly. Also decrease the number of buffers during linearizing

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

2016-12-23 Thread Jason Wang
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...@intel.com> Signed-off-by: Jason Wang <jasow...@redhat.com>

[PATCH net 8/9] virtio-net: remove big packet XDP codes

2016-12-23 Thread Jason Wang
Now we in fact don't allow XDP for big packets, remove its codes. Cc: John Fastabend <john.r.fastab...@intel.com> Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/net/virtio_net.c | 44 +++- 1 file changed, 3 insertions(+), 41 deleti

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

2016-12-23 Thread Jason Wang
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(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 77ae358..c1

[PATCH net 1/9] virtio-net: remove the warning before XDP linearizing

2016-12-23 Thread Jason Wang
Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/net/virtio_net.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 08327e0..1067253 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/

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

2016-12-23 Thread Jason Wang
io-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> --- drivers/net/virtio_net.c | 112 --- 1 file chan

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

2016-12-23 Thread Jason Wang
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. Cc: John Fastabend <john.r.fastab...@intel.com> Signed-off-by: Jaso

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

2016-12-23 Thread Jason Wang
. 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> --- drivers/net/virtio_net.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a

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

2016-12-23 Thread Jason Wang
uot; 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 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c

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

2016-12-23 Thread Jason Wang
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.com> Signed-off-by: Jason Wang <jasow...@redhat.com> ---

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

2016-12-23 Thread Jason Wang
when GUEST_UFO is support - remove big packet XDP support - add XDP support or small buffer Please see individual patches for details. Thanks Jason Wang (9): virtio-net: remove the warning before XDP linearizing virtio-net: correctly xmit linearized page on XDP_TX virtio-net: fix page

[PATCH V2] vhost: introduce O(1) vq metadata cache

2016-12-14 Thread Jason Wang
. Signed-off-by: Jason Wang <jasow...@redhat.com> --- Changes from V1: - silent 32bit build warning --- drivers/vhost/vhost.c | 136 -- drivers/vhost/vhost.h | 8 +++ 2 files changed, 118 insertions(+), 26 deletions(-) diff --git a/drivers

Re: [PATCH] vhost: introduce O(1) vq metadata cache

2016-12-14 Thread Jason Wang
/commits/Jason-Wang/vhost-introduce-O-1-vq-metadata-cache/20161214-160153 base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next config: i386-randconfig-x005-201650 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached

[PATCH] vhost: introduce O(1) vq metadata cache

2016-12-13 Thread Jason Wang
. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 136 -- drivers/vhost/vhost.h | 8 +++ 2 files changed, 118 insertions(+), 26 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index c6f2d89..8

[PATCH net] virtio-net: correctly enable multiqueue

2016-12-12 Thread Jason Wang
ty...@mit.edu> Tested-by: Theodore Ts'o <ty...@mit.edu> Cc: Neil Horman <nhor...@tuxdriver.com> Cc: Michael S. Tsirkin <m...@redhat.com> Fixes: 49000102901 ("virtio-net: enable multiqueue by default") Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/net/v

Re: "virtio-net: enable multiqueue by default" in linux-next breaks networking on GCE

2016-12-12 Thread Jason Wang
On 2016年12月13日 11:12, Theodore Ts'o wrote: On Tue, Dec 13, 2016 at 04:28:17AM +0200, Michael S. Tsirkin wrote: That's unfortunate, of course. It could be a hypervisor or a guest kernel bug. ideas: - does host have mq capability? how many queues? - how about # of msix vectors? - after you send

[PATCH] vhost: cache used event for better performance

2016-12-11 Thread Jason Wang
to notify guest. This will be useful for heavy tx load e.g guest pktgen test with Linux driver shows ~3.5% improvement. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 28 ++-- drivers/vhost/vhost.h | 3 +++ 2 files changed, 25 insertions

Re: [PATCH 08/10] vsock/virtio: mark an internal function static

2016-12-11 Thread Jason Wang
On 2016年12月08日 22:25, Michael S. Tsirkin wrote: On Wed, Dec 07, 2016 at 12:21:22PM +0800, Jason Wang wrote: On 2016年12月06日 23:41, Michael S. Tsirkin wrote: virtio_transport_alloc_pkt is only used locally, make it static. Signed-off-by: Michael S. Tsirkin <m...@redhat.com> ---

Re: [PATCH 10/10] virtio: enable endian checks for sparse builds

2016-12-06 Thread Jason Wang
. Tsirkin <m...@redhat.com> --- It seems that there should be a better way to do it, but this works too. Reviewed-by: Jason Wang <jasow...@redhat.com> drivers/block/Makefile | 1 + drivers/char/Makefile | 1 + drivers/char/hw_random/Makefile | 2 ++ drivers/gp

Re: [PATCH 09/10] vsock/virtio: fix src/dst cid format

2016-12-06 Thread Jason Wang
On 2016年12月06日 23:41, Michael S. Tsirkin wrote: These fields are 64 bit, using le32_to_cpu and friends on these will not do the right thing. Fix this up. Cc: sta...@vger.kernel.org Signed-off-by: Michael S. Tsirkin --- net/vmw_vsock/virtio_transport_common.c | 14

Re: [PATCH 08/10] vsock/virtio: mark an internal function static

2016-12-06 Thread Jason Wang
On 2016年12月06日 23:41, Michael S. Tsirkin wrote: virtio_transport_alloc_pkt is only used locally, make it static. Signed-off-by: Michael S. Tsirkin --- net/vmw_vsock/virtio_transport_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH 07/10] vsock/virtio: add a missing __le annotation

2016-12-06 Thread Jason Wang
izeof(guest_cid)); Reviewed-by: Jason Wang <jasow...@redhat.com>

Re: [PATCH 06/10] vhost: add missing __user annotations

2016-12-06 Thread Jason Wang
On 2016年12月06日 23:40, Michael S. Tsirkin wrote: Several vhost functions were missing __user annotations on pointers, causing sparse warnings. Fix this up. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vhost.c | 10 +- 1 file changed, 5 insertions(+), 5

Re: [PATCH 05/10] vhost: make interval tree static inline

2016-12-06 Thread Jason Wang
viewed-by: Jason Wang <jasow...@redhat.com>

Re: [PATCH v2] tun: Use netif_receive_skb instead of netif_rx

2016-12-06 Thread Jason Wang
On 2016年12月07日 11:25, David Miller wrote: From: Jason Wang <jasow...@redhat.com> Date: Wed, 7 Dec 2016 11:21:11 +0800 David, looks like this commit is not in net-next.git. Please help to check. Take a look, it should be there now. Yes, thanks.

Re: [PATCH v2] tun: Use netif_receive_skb instead of netif_rx

2016-12-06 Thread Jason Wang
On 2016年12月02日 03:43, David Miller wrote: From: Andrey Konovalov Date: Thu, 1 Dec 2016 10:34:40 +0100 This patch changes tun.c to call netif_receive_skb instead of netif_rx when a packet is received (if CONFIG_4KSTACKS is not enabled to avoid stack exhaustion). The

Re: [PATCH] virtio-net: Fix DMA-from-the-stack in virtnet_set_mac_address()

2016-12-05 Thread Jason Wang
On 2016年12月06日 10:10, Andy Lutomirski wrote: With CONFIG_VMAP_STACK=y, virtnet_set_mac_address() can be passed a pointer to the stack and it will OOPS. Copy the address to the heap to prevent the crash. Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Jason Wang <jasow...@redhat.com&g

Re: [PATCH v2] tun: Use netif_receive_skb instead of netif_rx

2016-12-01 Thread Jason Wang
s from guest with this patch. Acked-by: Jason Wang <jasow...@redhat.com>

Re: [PATCH net] vhost_net: don't continue to call the recvmsg when meet errors

2016-11-30 Thread Jason Wang
On 2016年12月01日 11:27, Michael S. Tsirkin wrote: On Thu, Dec 01, 2016 at 11:26:21AM +0800, Jason Wang wrote: > > >On 2016年12月01日 11:21, Michael S. Tsirkin wrote: > >On Thu, Dec 01, 2016 at 02:48:59AM +, wangyunjian wrote: > > > >-Original Message- >

Re: [PATCH net] vhost_net: don't continue to call the recvmsg when meet errors

2016-11-30 Thread Jason Wang
On 2016年12月01日 11:21, Michael S. Tsirkin wrote: On Thu, Dec 01, 2016 at 02:48:59AM +, wangyunjian wrote: -Original Message- From: Michael S. Tsirkin [mailto:m...@redhat.com] Sent: Wednesday, November 30, 2016 9:41 PM To: wangyunjian Cc: jasow...@redhat.com; netdev@vger.kernel.org;

Re: [PATCH net] vhost_net: don't continue to call the recvmsg when meet errors

2016-11-30 Thread Jason Wang
On 2016年11月30日 21:40, Michael S. Tsirkin wrote: On Wed, Nov 30, 2016 at 08:10:57PM +0800, Yunjian Wang wrote: When we meet an error(err=-EBADFD) recvmsg, How do you get EBADFD? Won't vhost_net_rx_peek_head_len return 0 in this case, breaking the loop? the error handling in vhost

Re: [PATCH net] vhost_net: don't continue to call the recvmsg when meet errors

2016-11-30 Thread Jason Wang
On 2016年12月01日 10:48, wangyunjian wrote: -Original Message- From: Michael S. Tsirkin [mailto:m...@redhat.com] Sent: Wednesday, November 30, 2016 9:41 PM To: wangyunjian Cc: jasow...@redhat.com; netdev@vger.kernel.org; linux-ker...@vger.kernel.org; caihe Subject: Re: [PATCH net]

Re: [PATCH net] vhost_net: don't continue to call the recvmsg when meet errors

2016-11-30 Thread Jason Wang
continue; } /* Supply virtio_net_hdr if VHOST_NET_F_VIRTIO_NET_HDR */ Acked-by: Jason Wang <jasow...@redhat.com> We may want to rename vhost_discard_vq_desc() in the future, since it does not discard the desc in fact.

Re: The ubufs->refcount maybe be subtracted twice when tun_get_user failed

2016-11-29 Thread Jason Wang
On 2016年11月30日 10:53, Jason Wang wrote: On 2016年11月29日 21:27, wangyunjian wrote: Sorry, I didn't describe it clearly. In fact, the second subtraction happens in the function handle_tx, when tun_get_user fails and zcopy_used is ture. Fllowing the steps: I get your meaning. Thanks

[PATCH net 2/2] macvtap: handle ubuf refcount correctly when meet erros

2016-11-29 Thread Jason Wang
ain. This is wrong and fix this by delay the uarg->callback() until we're sure there's no errors. Signed-off-by: Jason Wang <jasow...@redhat.com> --- The patch is needed for -stable. --- drivers/net/macvtap.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a

[PATCH net 1/2] tun: handle ubuf refcount correctly when meet erros

2016-11-29 Thread Jason Wang
ain. This is wrong and fix this by delay the uarg->callback() until we're sure there's no errors. Reported-by: wangyunjian <wangyunj...@huawei.com> Signed-off-by: Jason Wang <jasow...@redhat.com> --- The patch is needed for -stable. --- drivers/net/tun.c | 10 -- 1 file changed,

Re: The ubufs->refcount maybe be subtracted twice when tun_get_user failed

2016-11-29 Thread Jason Wang
On 2016年11月29日 21:27, wangyunjian wrote: Sorry, I didn't describe it clearly. In fact, the second subtraction happens in the function handle_tx, when tun_get_user fails and zcopy_used is ture. Fllowing the steps: I get your meaning. Thanks for the reporting. Will post patches (since

Re: The ubufs->refcount maybe be subtracted twice when tun_get_user failed

2016-11-29 Thread Jason Wang
On 2016年11月29日 17:30, wangyunjian wrote: In function tun_get_user , the ubufs->refcount may be subtracted twice, when msg_control is true and zerocopy is false. About the below code: static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,

Re: [net-next] macvtap: replace printk with netdev_err

2016-11-29 Thread Jason Wang
l == -ENOSPC) { - printk(KERN_ERR "too many macvtap devices\n"); + netdev_err(vlan->dev, "Too many macvtap devices\n"); retval = -EINVAL; } mutex_unlock(_lock); Acked-by: Jason Wang <jasow...@redhat.com>

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

2016-11-24 Thread Jason Wang
On 2016年11月25日 12:43, Michael S. Tsirkin wrote: 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 later. This is used to avoid possible >regression (small packet TCP stream tra

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

2016-11-24 Thread Jason Wang
axime.coque...@redhat.com> Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/net/virtio_net.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index d4ac7a6..a21d93a 100644 --- a/drivers/net/v

Re: [PATCH net 1/1] driver: macvtap: Unregister netdev rx_handler if macvtap_newlink fails

2016-11-24 Thread Jason Wang
if (err) { + netdev_rx_handler_unregister(dev); + return err; + } + + return 0; } static void macvtap_dellink(struct net_device *dev, Acked-by: Jason Wang <jasow...@redhat.com>

Re: [PATCH 3/3] tools/virtio: use {READ,WRITE}_ONCE() in uaccess.h

2016-11-24 Thread Jason Wang
utl...@arm.com> Cc: Jason Wang <jasow...@redhat.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: linux-ker...@vger.kernel.org Cc: virtualizat...@lists.linux-foundation.org --- tools/virtio/linux/uaccess.h | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/

Re: [PATCH 2/3] vringh: kill off ACCESS_ONCE()

2016-11-24 Thread Jason Wang
with the required include of for the relevant definitions. The userspace tools provide their own definitions in their own . Signed-off-by: Mark Rutland <mark.rutl...@arm.com> Cc: Jason Wang <jasow...@redhat.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: k...@vger.kernel.org Cc: linux-ker...@

<    3   4   5   6   7   8   9   10   11   >