Re: [RFC] virtio_net: Adding tx_timeout function.

2015-06-25 Thread Jason Wang
after receiving a timeout during a transmission of a packet. This patch add this feature and throw a timeout exception after 5 HZ. Considering some tests, this is the best time to use here. Signed-off-by: Julio Faracco jcfara...@gmail.com Cc: Jason Wang jasow...@redhat.com Looks like a bunch

Re: [PATCH net-next] Increase limit of macvtap queues

2015-06-15 Thread Jason Wang
On 06/14/2015 04:42 PM, Michael S. Tsirkin wrote: On Fri, Jun 12, 2015 at 07:00:28PM +0530, Pankaj Gupta wrote: Macvtap should be compatible with tuntap for maximum number of queues. '1059590254fa9dce9cafc4f07d1103dbec415e76' removes the limitation and increases number of queues in tuntap.

Re: [RFC V7 PATCH 7/7] vhost_net: add interrupt coalescing support

2015-05-27 Thread Jason Wang
On 05/27/2015 02:02 AM, Stephen Hemminger wrote: On Mon, 25 May 2015 01:24:04 -0400 Jason Wang jasow...@redhat.com wrote: Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/vhost/net.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/vhost/net.c b/drivers/vhost

Re: [PATCH RFC] tun, macvtap: higher order allocations for skbs

2015-06-29 Thread Jason Wang
On 06/29/2015 12:50 PM, Jason Wang wrote: On 06/18/2015 06:20 PM, Michael S. Tsirkin wrote: Needs more testing. Anyone see anything wrong with this? Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/net/macvtap.c | 2 +- drivers/net/tun.c | 2 +- 2 files changed, 2

[RFC V7 PATCH 6/7] vhost: interrupt coalescing support

2015-05-24 Thread Jason Wang
vhost_check_coalesce_and_signal() to check the above two conditions again and schedule a timer for delayed interrupt if the conditions were still not met. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/vhost/vhost.c | 88 -- drivers/vhost/vhost.h

[RFC V7 PATCH 5/7] virtio_net: enable tx interrupt

2015-05-24 Thread Jason Wang
This patch enable tx interrupt for virtio-net driver. This can make socket accounting works again and help to reduce the buffer bloat. To reduce the performance impacts, only enable tx interrupt on newer host with interrupt coalescing support. Signed-off-by: Jason Wang jasow...@redhat.com

[RFC V7 PATCH 4/7] virtio-net: add basic interrupt coalescing support

2015-05-24 Thread Jason Wang
This patch enables the interrupt coalescing setting through ethtool. Cc: Rusty Russell ru...@rustcorp.com.au Cc: Michael S. Tsirkin m...@redhat.com Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/virtio_net.c | 62 drivers/virtio

[RFC V7 PATCH 7/7] vhost_net: add interrupt coalescing support

2015-05-24 Thread Jason Wang
Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/vhost/net.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 7d137a4..5ee28b7 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -320,6 +320,9 @@ static void handle_tx

[RFC V7 PATCH 3/7] virtio-net: optimize free_old_xmit_skbs stats

2015-05-24 Thread Jason Wang
We already have counters for sent packets and sent bytes. Use them to reduce the number of u64_stats_update_begin/end(). Take care not to bother with stats update when called speculatively. Cc: Rusty Russell ru...@rustcorp.com.au Cc: Michael S. Tsirkin m...@redhat.com Signed-off-by: Jason Wang

[RFC V7 PATCH 2/7] virtio_ring: try to disable event index callbacks in virtqueue_disable_cb()

2015-05-24 Thread Jason Wang
Currently, we do nothing to prevent the callbacks in virtqueue_disable_cb() when event index is used. This may cause spurious interrupts which may damage the performance. This patch tries to publish last_used_idx as the used even to prevent the callbacks. Signed-off-by: Jason Wang jasow

[RFC V7 PATCH 0/7] enable tx interrupts for virtio-net

2015-05-24 Thread Jason Wang
in ndo_start_xmit() - Add interrupt coalescing support for virtio-net Changes from RFC v2: - clean up code, address issues raised by Jason Changes from RFC v1: - address comments by Jason Wang, use delayed cb everywhere - rebased Jason's patch on top of mine and include it (with some tweaks) Jason

[RFC V7 PATCH 1/7] virito-pci: add coalescing parameters setting

2015-05-24 Thread Jason Wang
This patch introduces a transport specific methods to set or get the coalescing parameters and implement the pci methods. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/virtio/virtio_pci_modern.c | 15 +++ include/linux/virtio_config.h | 8 include/uapi

Re: [PATCH v2 1/2] virtio-net: rephrase devconf fields description

2015-08-19 Thread Jason Wang
On 08/19/2015 07:54 PM, Victor Kaplansky wrote: On Mon, Aug 17, 2015 at 10:43:46AM +0800, Jason Wang wrote: On 08/16/2015 09:42 PM, Victor Kaplansky wrote: Clarify general description of the mac, status and max_virtqueue_pairs fields. Specifically, the old description is vague about

Re: [PATCH v2 2/2] virtio-net: add default_mtu configuration field

2015-08-19 Thread Jason Wang
On 08/19/2015 07:31 PM, Victor Kaplansky wrote: On Mon, Aug 17, 2015 at 11:07:15AM +0800, Jason Wang wrote: On 08/16/2015 09:42 PM, Victor Kaplansky wrote: @@ -3128,6 +3134,7 @@ struct virtio_net_config { u8 mac[6]; le16 status; le16 max_virtqueue_pairs

Re: [PATCH v2 2/2] virtio-net: add default_mtu configuration field

2015-08-16 Thread Jason Wang
On 08/16/2015 09:42 PM, Victor Kaplansky wrote: Sometimes it is essential for libvirt to be able to configure MTU on guest's NICs to a value different from 1500. The change adds a new field to configuration area of network devices. It will be used to pass initial MTU from the device to the

Re: [PATCH v2 1/2] virtio-net: rephrase devconf fields description

2015-08-16 Thread Jason Wang
On 08/16/2015 09:42 PM, Victor Kaplansky wrote: Clarify general description of the mac, status and max_virtqueue_pairs fields. Specifically, the old description is vague about configuration layout and fields offsets when some of the fields are non valid. Also clarify that validity of two

[PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE

2015-08-24 Thread Jason Wang
...@redhat.com Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/macvlan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 47da435..09d8718 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -1056,7

Re: [PATCH RFC] tun, macvtap: higher order allocations for skbs

2015-06-28 Thread Jason Wang
On 06/18/2015 06:20 PM, Michael S. Tsirkin wrote: Needs more testing. Anyone see anything wrong with this? Signed-off-by: Michael S. Tsirkin m...@redhat.com --- drivers/net/macvtap.c | 2 +- drivers/net/tun.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [Question]Why a skb with frag_list causes BUG_ON in function skb_segment

2015-07-29 Thread Jason Wang
cc netdev for more experts On 07/28/2015 04:53 PM, Zhangjie (HZ) wrote: Hi, I generate a skb as follows: It has a linear data region, 17 frags and the last fragment is in skb_shinfo(skb)-frag_list. Before this skb is sent to driver, dev_hard_start_xmit() will segment it first(skb has

[PATCH net] virtio-net: drop NETIF_F_FRAGLIST

2015-08-04 Thread Jason Wang
only get what we can handle. Cc: Michael S. Tsirkin m...@redhat.com Signed-off-by: Jason Wang jasow...@redhat.com --- The patch is needed for stable. --- drivers/net/virtio_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net

[PATCH net V2] virtio-net: drop NETIF_F_FRAGLIST

2015-08-04 Thread Jason Wang
only get what we can handle. Cc: Michael S. Tsirkin m...@redhat.com Signed-off-by: Jason Wang jasow...@redhat.com --- - Change from V1: coding style fixes. - The patch is needed for stable. --- drivers/net/virtio_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

Re: [PATCH net] virtio-net: drop NETIF_F_FRAGLIST

2015-08-04 Thread Jason Wang
On 08/04/2015 07:11 PM, Sergei Shtylyov wrote: Hello. On 8/4/2015 12:55 PM, Jason Wang wrote: virtio declares support for NETIF_F_FRAGLIST, but assumes that there are at most MAX_SKB_FRAGS + 2 fragments which isn't always true with a fraglist. A longer fraglist in the skb will make

[PATCH net-next RFC 2/2] vhost_net: basic polling support

2015-10-21 Thread Jason Wang
. busyloop_timeout = 50 gives us following improvement on TCP_RR test: size/session/+thu%/+normalize% 1/ 1/ +5%/ -20% 1/50/ +17%/ +3% Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/net.c | 19 +++ 1 file changed, 19 insertions(+) diff

[PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()

2015-10-21 Thread Jason Wang
This path introduces a helper which can give a hint for whether or not there's a work queued in the work list. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 6 ++ drivers/vhost/vhost.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/vhost/vho

Re: [PATCH net] macvtap: unbreak receiving of gro skb with frag list

2015-10-25 Thread Jason Wang
On 10/23/2015 09:37 PM, Michael S. Tsirkin wrote: > On Fri, Oct 23, 2015 at 12:57:05AM -0400, Jason Wang wrote: >> We don't have fraglist support in TAP_FEATURES. This will lead >> software segmentation of gro skb with frag list. Fixes by having >> frag list su

Re: [PATCH net] macvtap: unbreak receiving of gro skb with frag list

2015-10-26 Thread Jason Wang
On 10/26/2015 02:09 PM, Michael S. Tsirkin wrote: > On Mon, Oct 26, 2015 at 11:15:57AM +0800, Jason Wang wrote: >> >> On 10/23/2015 09:37 PM, Michael S. Tsirkin wrote: >>> On Fri, Oct 23, 2015 at 12:57:05AM -0400, Jason Wang wrote: >>>> We don't h

Re: [PATCH v1 1/3] virtio-net: Using single MSIX IRQ for TX/RX Q pair

2015-10-26 Thread Jason Wang
On 10/27/2015 01:52 AM, Ravi Kerur wrote: > Ported earlier patch from Jason Wang (dated 12/26/2014). > > This patch tries to reduce the number of MSIX irqs required for > virtio-net by sharing a MSIX irq for each TX/RX queue pair through > channels. If transport support chan

Re: [PATCH net] macvtap: unbreak receiving of gro skb with frag list

2015-10-26 Thread Jason Wang
On 10/26/2015 04:30 PM, Michael S. Tsirkin wrote: > On Mon, Oct 26, 2015 at 02:53:38PM +0800, Jason Wang wrote: >> >> On 10/26/2015 02:09 PM, Michael S. Tsirkin wrote: >>> On Mon, Oct 26, 2015 at 11:15:57AM +0800, Jason Wang wrote: >>>> On 10/23/201

Re: [PATCH v1 1/3] virtio-net: Using single MSIX IRQ for TX/RX Q pair

2015-10-27 Thread Jason Wang
On 10/27/2015 04:38 PM, Michael S. Tsirkin wrote: > On Mon, Oct 26, 2015 at 10:52:47AM -0700, Ravi Kerur wrote: >> Ported earlier patch from Jason Wang (dated 12/26/2014). >> >> This patch tries to reduce the number of MSIX irqs required for >> virtio-net by sharin

Re: [PATCH net] macvtap: unbreak receiving of gro skb with frag list

2015-10-27 Thread Jason Wang
On 10/27/2015 05:05 PM, Michael S. Tsirkin wrote: > On Tue, Oct 27, 2015 at 10:58:25AM +0800, Jason Wang wrote: >> >> On 10/26/2015 04:30 PM, Michael S. Tsirkin wrote: >>> On Mon, Oct 26, 2015 at 02:53:38PM +0800, Jason Wang wrote: >>>> On 10/26/201

Re: [PATCH v1 1/3] virtio-net: Using single MSIX IRQ for TX/RX Q pair

2015-10-28 Thread Jason Wang
On 10/28/2015 03:21 PM, Michael S. Tsirkin wrote: > On Wed, Oct 28, 2015 at 11:13:39AM +0800, Jason Wang wrote: >> >> On 10/27/2015 04:38 PM, Michael S. Tsirkin wrote: >>> On Mon, Oct 26, 2015 at 10:52:47AM -0700, Ravi Kerur wrote: >>>> Ported earlier pat

[PATCH net-next rfc V2 1/2] vhost: introduce vhost_has_work()

2015-10-29 Thread Jason Wang
This path introduces a helper which can give a hint for whether or not there's a work queued in the work list. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 7 +++ drivers/vhost/vhost.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/vhost/v

[PATCH net-next rfc V2 0/2] basic busy polling support for vhost_net

2015-10-29 Thread Jason Wang
per VM through ioctl. Please review. Thanks Jason Wang (2): vhost: introduce vhost_has_work() vhost_net: basic polling support drivers/vhost/net.c | 54 +++ drivers/vhost/vhost.c | 7 +++ drivers/vhost/vhost.h | 1 + 3 files changed, 58

[PATCH net-next rfc V2 2/2] vhost_net: basic polling support

2015-10-29 Thread Jason Wang
. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/net.c | 54 + 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 9eda69e..30e6d3d 100644 --- a/drivers/vhost/net.c

[PATCH net] macvtap: unbreak receiving of gro skb with frag list

2015-10-22 Thread Jason Wang
("macvtap: simplify usage of tap_features") Cc: Vlad Yasevich <vyase...@redhat.com> Cc: Michael S. Tsirkin <m...@redhat.com> Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/net/macvtap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

Re: [PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()

2015-10-23 Thread Jason Wang
On 10/22/2015 04:38 PM, Michael S. Tsirkin wrote: > On Thu, Oct 22, 2015 at 01:27:28AM -0400, Jason Wang wrote: >> > This path introduces a helper which can give a hint for whether or not >> > there's a work queued in the work list. >> > >> > Signed-

Re: [PATCH net-next RFC 2/2] vhost_net: basic polling support

2015-10-23 Thread Jason Wang
On 10/22/2015 05:33 PM, Michael S. Tsirkin wrote: > On Thu, Oct 22, 2015 at 01:27:29AM -0400, Jason Wang wrote: >> This patch tries to poll for new added tx buffer for a while at the >> end of tx processing. The maximum time spent on polling were limited >> through a modul

Re: [PATCH net-next RFC 2/2] vhost_net: basic polling support

2015-10-23 Thread Jason Wang
On 10/23/2015 12:16 AM, Michael S. Tsirkin wrote: > On Thu, Oct 22, 2015 at 08:46:33AM -0700, Rick Jones wrote: >> On 10/22/2015 02:33 AM, Michael S. Tsirkin wrote: >>> On Thu, Oct 22, 2015 at 01:27:29AM -0400, Jason Wang wrote: >>>> This patch tries to poll for n

[PATCH net-next RFC V3 3/3] vhost_net: basic polling support

2015-11-12 Thread Jason Wang
This patch tries to poll for new added tx buffer or socket receive queue for a while at the end of tx/rx processing. The maximum time spent on polling were specified through a new kind of vring ioctl. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/net.c

[PATCH net-next RFC V3 0/3] basic busy polling support for vhost_net

2015-11-12 Thread Jason Wang
logic into a new helper - Check and exit the loop when there's a pending signal - Disable preemption during busy looping to make sure lock_clock() was correctly used. Jason Wang (3): vhost: introduce vhost_has_work() vhost: introduce vhost_vq_more_avail() vhost_net: basic polling support

[PATCH net-next RFC V3 2/3] vhost: introduce vhost_vq_more_avail()

2015-11-12 Thread Jason Wang
Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 26 +- drivers/vhost/vhost.h | 1 + 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 163b365..b86c5aa 100644 --- a/drivers

[PATCH net-next RFC V3 1/3] vhost: introduce vhost_has_work()

2015-11-12 Thread Jason Wang
This path introduces a helper which can give a hint for whether or not there's a work queued in the work list. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 7 +++ drivers/vhost/vhost.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/vhost/v

Re: [PATCH net-next RFC V3 0/3] basic busy polling support for vhost_net

2015-11-12 Thread Jason Wang
On 11/12/2015 06:16 PM, Jason Wang wrote: > Hi all: > > This series tries to add basic busy polling for vhost net. The idea is > simple: at the end of tx/rx processing, busy polling for new tx added > descriptor and rx receive socket for a while. The maximum number of >

Re: [PATCH net-next RFC V3 0/3] basic busy polling support for vhost_net

2015-11-13 Thread Jason Wang
t tested this for vhost polling. Will run some simple test (e.g pin two vhost threads in one host cpu), and see how well it perform. Thanks > > Thanks, > Felipe > > > > On 12/11/2015 10:20, "kvm-ow...@vger.kernel.org on behalf of Jason Wang" > <kvm-ow...@vger.

Re: [PATCH] vhost: relax log address alignment

2015-11-16 Thread Jason Wang
_SIZE - 1))) { > r = -EINVAL; > break; > } Acked-by: Jason Wang <jasow...@redhat.com> -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH net-next RFC V3 0/3] basic busy polling support for vhost_net

2015-11-16 Thread Jason Wang
On 11/13/2015 05:20 PM, Jason Wang wrote: > > On 11/12/2015 08:02 PM, Felipe Franciosi wrote: >> Hi Jason, >> >> I understand your busy loop timeout is quite conservative at 50us. Did you >> try any other values? > I've also tried 20us. And results shows 50u

Re: [PATCH net-next rfc V2 0/2] basic busy polling support for vhost_net

2015-11-02 Thread Jason Wang
On 10/30/2015 07:58 PM, Jason Wang wrote: > > On 10/29/2015 04:45 PM, Jason Wang wrote: >> Hi all: >> >> This series tries to add basic busy polling for vhost net. The idea is >> simple: at the end of tx processing, busy polling for new tx added >> descript

Re: [PATCH net-next rfc V2 0/2] basic busy polling support for vhost_net

2015-10-30 Thread Jason Wang
On 10/29/2015 04:45 PM, Jason Wang wrote: > Hi all: > > This series tries to add basic busy polling for vhost net. The idea is > simple: at the end of tx processing, busy polling for new tx added > descriptor and rx receive socket for a while. The maximum number of > time (in

Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE

2015-08-25 Thread Jason Wang
On 08/26/2015 12:32 AM, Vlad Yasevich wrote: On 08/25/2015 07:30 AM, Jason Wang wrote: On 08/25/2015 06:17 PM, Michael S. Tsirkin wrote: On Mon, Aug 24, 2015 at 04:33:12PM +0800, Jason Wang wrote: For macvlan, switch to use IFF_NO_QUEUE instead of tx_queue_len = 0. For macvtap, after

Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE

2015-08-27 Thread Jason Wang
On 08/27/2015 06:43 PM, Michael S. Tsirkin wrote: On Wed, Aug 26, 2015 at 01:45:30PM +0800, Jason Wang wrote: On 08/26/2015 12:32 AM, Vlad Yasevich wrote: On 08/25/2015 07:30 AM, Jason Wang wrote: On 08/25/2015 06:17 PM, Michael S. Tsirkin wrote: On Mon, Aug 24, 2015 at 04:33:12PM +0800

Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE

2015-08-30 Thread Jason Wang
On 08/28/2015 08:25 PM, Vlad Yasevich wrote: On 08/27/2015 10:42 PM, Jason Wang wrote: On 08/27/2015 06:43 PM, Michael S. Tsirkin wrote: On Wed, Aug 26, 2015 at 01:45:30PM +0800, Jason Wang wrote: On 08/26/2015 12:32 AM, Vlad Yasevich wrote: On 08/25/2015 07:30 AM, Jason Wang

[PATCH net-next] virtio-net: avoid unnecessary sg initialzation

2015-08-27 Thread Jason Wang
. Tsirkin m...@redhat.com Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/net/virtio_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 53f5660..c006ae4 100644 --- a/drivers/net/virtio_net.c +++ b/drivers

Re: [PATCH net-next] macvtap/macvlan: use IFF_NO_QUEUE

2015-08-25 Thread Jason Wang
On 08/25/2015 06:17 PM, Michael S. Tsirkin wrote: On Mon, Aug 24, 2015 at 04:33:12PM +0800, Jason Wang wrote: For macvlan, switch to use IFF_NO_QUEUE instead of tx_queue_len = 0. For macvtap, after commit 6acf54f1cf0a6747bac9fea26f34cfc5a9029523 (macvtap: Add support of packet capture

Re: [PATCH net-next 3/3] vhost_net: basic polling support

2015-12-03 Thread Jason Wang
On 12/02/2015 08:36 PM, Michael S. Tsirkin wrote: > On Wed, Dec 02, 2015 at 01:04:03PM +0800, Jason Wang wrote: >> >> On 12/01/2015 10:43 PM, Michael S. Tsirkin wrote: >>> On Tue, Dec 01, 2015 at 01:17:49PM +0800, Jason Wang wrote: >>>> On 11/30/201

Re: [PATCH net-next 3/3] vhost_net: basic polling support

2015-12-01 Thread Jason Wang
On 12/01/2015 10:43 PM, Michael S. Tsirkin wrote: > On Tue, Dec 01, 2015 at 01:17:49PM +0800, Jason Wang wrote: >> >> On 11/30/2015 06:44 PM, Michael S. Tsirkin wrote: >>> On Wed, Nov 25, 2015 at 03:11:29PM +0800, Jason Wang wrote: >>>>> This patch tries to

Re: [PATCH RFC] vhost: basic device IOTLB support

2016-01-03 Thread Jason Wang
On 01/04/2016 09:39 AM, Yang Zhang wrote: > On 2015/12/31 15:13, Jason Wang wrote: >> This patch tries to implement an device IOTLB for vhost. This could be >> used with for co-operation with userspace(qemu) implementation of >> iommu for a secure DMA environment in

Re: [PATCH RFC] vhost: basic device IOTLB support

2016-01-03 Thread Jason Wang
On 12/31/2015 07:17 PM, Michael S. Tsirkin wrote: > On Thu, Dec 31, 2015 at 03:13:45PM +0800, Jason Wang wrote: >> This patch tries to implement an device IOTLB for vhost. This could be >> used with for co-operation with userspace(qemu) implementation of >> iommu for a s

Re: [RFC v4 0/5] Add virtio transport for AF_VSOCK

2016-01-03 Thread Jason Wang
On 12/22/2015 05:07 PM, Stefan Hajnoczi wrote: > This series is based on v4.4-rc2 and the "virtio: make find_vqs() > checkpatch.pl-friendly" patch I recently submitted. > > v4: > * Addressed code review comments from Alex Bennee > * MAINTAINERS file entries for new files > * Trace events

[PATCH RFC] vhost: basic device IOTLB support

2015-12-30 Thread Jason Wang
ABLE is not reused (maybe there's a chance). - working at PAGE_SIZE level, don't support large mappings. - better data structure for IOTLB instead of simple hash array. - better API, e.g using mmap() instead of preset userspace address. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/v

Re: [PATCH RFC] vhost: basic device IOTLB support

2016-01-05 Thread Jason Wang
On 01/05/2016 11:18 AM, Yang Zhang wrote: > On 2016/1/4 14:22, Jason Wang wrote: >> >> >> On 01/04/2016 09:39 AM, Yang Zhang wrote: >>> On 2015/12/31 15:13, Jason Wang wrote: >>>> This patch tries to implement an device IOTLB for vhost. Thi

[PATCH net-next 1/3] vhost: introduce vhost_has_work()

2015-11-24 Thread Jason Wang
This path introduces a helper which can give a hint for whether or not there's a work queued in the work list. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 7 +++ drivers/vhost/vhost.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/vhost/v

[PATCH net-next 0/3] basic busy polling support for vhost_net

2015-11-24 Thread Jason Wang
() was correctly used. Jason Wang (3): vhost: introduce vhost_has_work() vhost: introduce vhost_vq_more_avail() vhost_net: basic polling support drivers/vhost/net.c| 72 ++ drivers/vhost/vhost.c | 48

[PATCH net-next 2/3] vhost: introduce vhost_vq_more_avail()

2015-11-24 Thread Jason Wang
Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 26 +- drivers/vhost/vhost.h | 1 + 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 163b365..b86c5aa 100644 --- a/drivers

[PATCH net-next 3/3] vhost_net: basic polling support

2015-11-24 Thread Jason Wang
This patch tries to poll for new added tx buffer or socket receive queue for a while at the end of tx/rx processing. The maximum time spent on polling were specified through a new kind of vring ioctl. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/net.c

Re: [PATCH net-next 3/3] vhost_net: basic polling support

2015-11-30 Thread Jason Wang
On 11/30/2015 06:44 PM, Michael S. Tsirkin wrote: > On Wed, Nov 25, 2015 at 03:11:29PM +0800, Jason Wang wrote: >> > This patch tries to poll for new added tx buffer or socket receive >> > queue for a while at the end of tx/rx processing. The maximum time >> > s

[PATCH V2 0/3] basic busy polling support for vhost_net

2015-11-30 Thread Jason Wang
for busyloop_timeout - Split out the busy polling logic into a new helper - Check and exit the loop when there's a pending signal - Disable preemption during busy looping to make sure lock_clock() was correctly used. Jason Wang (3): vhost: introduce vhost_has_work() vhost: introduce vhost_vq_more_avail

Re: [PATCH net-next 2/3] vhost: introduce vhost_vq_more_avail()

2015-11-30 Thread Jason Wang
On 11/30/2015 04:22 PM, Michael S. Tsirkin wrote: > On Wed, Nov 25, 2015 at 03:11:28PM +0800, Jason Wang wrote: >> Signed-off-by: Jason Wang <jasow...@redhat.com> >> --- >> drivers/vhost/vhost.c | 26 +- >> drivers/vhost/vhost.h | 1 + &

[PATCH V2 2/3] vhost: introduce vhost_vq_more_avail()

2015-11-30 Thread Jason Wang
Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 13 + drivers/vhost/vhost.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 163b365..4f45a03 100644 --- a/drivers/vhost/vhost.c +++ b/drivers

[PATCH V2 3/3] vhost_net: basic polling support

2015-11-30 Thread Jason Wang
This patch tries to poll for new added tx buffer or socket receive queue for a while at the end of tx/rx processing. The maximum time spent on polling were specified through a new kind of vring ioctl. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/net.c

[PATCH V2 1/3] vhost: introduce vhost_has_work()

2015-11-30 Thread Jason Wang
This path introduces a helper which can give a hint for whether or not there's a work queued in the work list. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/vhost.c | 7 +++ drivers/vhost/vhost.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/vhost/v

Re: [PATCH V3 2/2] vhost_net: conditionally enable tx polling

2016-06-08 Thread Jason Wang
On 2016年06月07日 20:26, Michael S. Tsirkin wrote: On Wed, Jun 01, 2016 at 01:56:34AM -0400, Jason Wang wrote: We always poll tx for socket, this is sub optimal since: - it will be only used when we exceed the sndbuf of the socket. - since we use two independent polls for tx and vq

Re: [RFC PATCH V3 0/3] basic device IOTLB support

2016-06-14 Thread Jason Wang
On 2016年05月24日 17:36, Jason Wang wrote: This patch tries to implement an device IOTLB for vhost. This could be used with for co-operation with userspace IOMMU implementation (qemu) for a secure DMA environment (DMAR) in guest. The idea is simple. When vhost meets an IOTLB miss

[PATCH net-next V2] tun: introduce tx skb ring

2016-06-15 Thread Jason Wang
. Signed-off-by: Jason Wang <jasow...@redhat.com> --- - The patch is based on [PATCH v8 0/5] skb_array: array based FIFO for skbs Changes from V1: - switch to use skb array instead of a customized circular buffer - add non-blocking support - rename .peek to .peek_len - drop lockless peeking sinc

Re: [PATCH RFC v7 3/5] skb_array: array based FIFO for skbs

2016-06-05 Thread Jason Wang
On 2016年06月03日 21:04, Michael S. Tsirkin wrote: On Fri, Jun 03, 2016 at 02:58:39PM +0200, Jesper Dangaard Brouer wrote: > >On Thu, 2 Jun 2016 19:08:26 +0300 "Michael S. Tsirkin" wrote: > > >A simple array based FIFO of pointers. Intended for net stack so uses > >skbs for

[PATCH V2 1/2] vhost_net: stop polling socket during rx processing

2016-05-30 Thread Jason Wang
-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/net.c | 56 +++-- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 10ff494..e91603b 100644 --- a/drivers/vhost/net.c +++ b/d

[PATCH V2 0/2] vhost_net polling optimization

2016-05-30 Thread Jason Wang
review Changes from V1: - use vhost_net_disable_vq()/vhost_net_enable_vq() instead of open coding. - Add a new patch for conditionally enable tx polling. Jason Wang (2): vhost_net: stop polling socket during rx processing vhost_net: conditionally enable tx polling drivers/vhost/net.c | 59

[PATCH V2 2/2] vhost_net: conditionally enable tx polling

2016-05-30 Thread Jason Wang
Test shows about 8% improvement on guest rx pps. Before: ~135 After: ~146 Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/net.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index e91603b..5a05fa0 100644 --- a/dri

Re: [PATCH v5 0/2] skb_array: array based FIFO for skbs

2016-05-30 Thread Jason Wang
On 2016年05月23日 18:43, Michael S. Tsirkin wrote: This is in response to the proposal by Jason to make tun rx packet queue lockless using a circular buffer. My testing seems to show that at least for the common usecase in networking, which isn't lockless, circular buffer with indices does not

Re: [PATCH v5 0/2] skb_array: array based FIFO for skbs

2016-05-30 Thread Jason Wang
On 2016年05月30日 23:37, Michael S. Tsirkin wrote: On Mon, May 30, 2016 at 05:59:33PM +0800, Jason Wang wrote: On 2016年05月23日 18:43, Michael S. Tsirkin wrote: This is in response to the proposal by Jason to make tun rx packet queue lockless using a circular buffer. My testing seems to show

Re: [PATCH V2 1/2] vhost_net: stop polling socket during rx processing

2016-05-30 Thread Jason Wang
On 2016年05月30日 23:47, Michael S. Tsirkin wrote: On Mon, May 30, 2016 at 02:47:53AM -0400, Jason Wang wrote: We don't stop rx polling socket during rx processing, this will lead unnecessary wakeups from under layer net devices (E.g sock_def_readable() form tun). Rx will be slowed down

Re: [PATCH V2 2/2] vhost_net: conditionally enable tx polling

2016-05-30 Thread Jason Wang
On 2016年05月30日 23:55, Michael S. Tsirkin wrote: On Mon, May 30, 2016 at 02:47:54AM -0400, Jason Wang wrote: We always poll tx for socket, this is sub optimal since: - it will be only used when we exceed the sndbuf of the socket. - since we use two independent polls for tx and vq

Re: [PATCH] virtio_net: fix virtnet_open and virtnet_probe competing for try_fill_recv

2016-05-25 Thread Jason Wang
On 2016年05月25日 20:33, wangyunjian wrote: In function virtnet_open() and virtnet_probe(), func try_fill_recv() will be executed at the same time. VQ in virtqueue_add() is not protected well and BUG_ON will be triggered when virito_net.ko being removed. Test Script: for (( i=0; i<500;

Re: [PATCH v6 3/3] skb_array: array based FIFO for skbs

2016-06-02 Thread Jason Wang
On 2016年06月01日 20:54, Michael S. Tsirkin wrote: A simple array based FIFO of pointers. Intended for net stack so uses skbs for type safety. Implemented as a set of wrappers around ptr_array. Signed-off-by: Michael S. Tsirkin --- include/linux/skb_array.h | 129

Re: [PATCH v6 0/3] skb_array: array based FIFO for skbs

2016-06-02 Thread Jason Wang
On 2016年06月02日 12:51, David Miller wrote: From: "Michael S. Tsirkin" Date: Wed, 1 Jun 2016 15:54:34 +0300 This is in response to the proposal by Jason to make tun rx packet queue lockless using a circular buffer. My testing seems to show that at least for the common usecase

Re: [PATCH net v2] virtio_net: fix virtnet_open and virtnet_probe competing for try_fill_recv

2016-05-26 Thread Jason Wang
unj...@huawei.com> --- drivers/net/virtio_net.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) The patch is needed for stable. Acked-by: Jason Wang <jasow...@redhat.com> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 49d84e5..e0

[PATCH V3 1/2] vhost_net: stop polling socket during rx processing

2016-05-31 Thread Jason Wang
-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/net.c | 64 +++-- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index f744eeb..1d3e45f 100644 --- a/drivers/vhost/net.c +++ b/d

[PATCH V3 0/2] vhost_net polling optimization

2016-05-31 Thread Jason Wang
review Changes from V2: - Don't enable rx vq if we meet an err or rx vq is empty Changes from V1: - use vhost_net_disable_vq()/vhost_net_enable_vq() instead of open coding. - Add a new patch for conditionally enable tx polling. Jason Wang (2): vhost_net: stop polling socket during rx processing

[PATCH V3 2/2] vhost_net: conditionally enable tx polling

2016-05-31 Thread Jason Wang
Test shows about 8% improvement on guest rx pps. Before: ~135 After: ~146 Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/net.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 1d3e45f..e75ffcc 100644 --- a/dri

[PATCH 1/3] vhost: introduce vhost memory accessors

2016-06-22 Thread Jason Wang
This patch introduces vhost memory accessors which were just wrappers for userspace address access helpers. This is a requirement for vhost device iotlb implementation which will add iotlb translations in those accessors. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost

[PATCH 2/3] vhost: convert pre sorted vhost memory array to interval tree

2016-06-22 Thread Jason Wang
the userspace to send diffs of memory table. - Simplify Device IOTLB implementation. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/net.c | 8 +-- drivers/vhost/vhost.c | 182 -- drivers/vhost/vhost.h | 27 ++-- 3

Re: [RFC PATCH V3 0/3] basic device IOTLB support

2016-06-22 Thread Jason Wang
On 2016年06月22日 00:44, Michael S. Tsirkin wrote: On Tue, May 24, 2016 at 05:36:22PM +0800, Jason Wang wrote: This patch tries to implement an device IOTLB for vhost. This could be used with for co-operation with userspace IOMMU implementation (qemu) for a secure DMA environment (DMAR) in guest

[PATCH 0/3] basic device IOTLB support

2016-06-22 Thread Jason Wang
. - convert from per device iotlb request to per virtqueue iotlb request, this solves the possible deadlock in V1. - read/write permission check support. Please review. Jason Wang (3): vhost: introduce vhost memory accessors vhost: convert pre sorted vhost memory array to interval tree vhost

[PATCH 3/3] vhost: device IOTLB API

2016-06-22 Thread Jason Wang
sure no translation fault happens during vq processing. In most cases, virtqueue were mapped contiguous even in virtual address. So the IOTLB translation for virtqueue itself maybe a little bit slower. We can add fast path on top of this patch. Signed-off-by: Jason Wang <jasow...@redhat.

Re: [PATCH net-next V2] tun: introduce tx skb ring

2016-06-17 Thread Jason Wang
On 2016年06月17日 08:41, Michael S. Tsirkin wrote: On Wed, Jun 15, 2016 at 04:38:17PM +0800, Jason Wang wrote: >We used to queue tx packets in sk_receive_queue, this is less >efficient since it requires spinlocks to synchronize between producer >and consumer. > >This patch t

[PATCH V2 0/3] basic device IOTLB support for vhost_net

2016-06-23 Thread Jason Wang
Changes from RFC V1: - support any size/range of updating and invalidation through introducing the interval tree. - convert from per device iotlb request to per virtqueue iotlb request, this solves the possible deadlock in V1. - read/write permission check support. Please review. Jason Wang (3

[PATCH V2 3/3] vhost: device IOTLB API

2016-06-23 Thread Jason Wang
sure no translation fault happens during vq processing. In most cases, virtqueue were mapped contiguous even in virtual address. So the IOTLB translation for virtqueue itself maybe a little bit slower. We can add fast path on top of this patch. Signed-off-by: Jason Wang <jasow...@redhat.

[PATCH V2 2/3] vhost: convert pre sorted vhost memory array to interval tree

2016-06-23 Thread Jason Wang
the userspace to send diffs of memory table. - Simplify Device IOTLB implementation. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/net.c | 8 +-- drivers/vhost/vhost.c | 182 -- drivers/vhost/vhost.h | 27 ++-- 3

[PATCH V2 1/3] vhost: introduce vhost memory accessors

2016-06-23 Thread Jason Wang
This patch introduces vhost memory accessors which were just wrappers for userspace address access helpers. This is a requirement for vhost device iotlb implementation which will add iotlb translations in those accessors. Signed-off-by: Jason Wang <jasow...@redhat.com> --- drivers/vhost/v

Re: [PATCH net-next V2] tun: introduce tx skb ring

2016-06-22 Thread Jason Wang
On 2016年06月23日 02:18, Michael S. Tsirkin wrote: On Fri, Jun 17, 2016 at 03:41:20AM +0300, Michael S. Tsirkin wrote: >Would it help to have ptr_ring_resize that gets an array of >rings and resizes them both to same length? OK, here it is. Untested so far, and no skb wrapper. Pls let me know

Re: [PATCH net-next V2] tun: introduce tx skb ring

2016-06-16 Thread Jason Wang
On 2016年06月15日 19:55, Jamal Hadi Salim wrote: > On 16-06-15 07:52 AM, Jamal Hadi Salim wrote: >> On 16-06-15 04:38 AM, Jason Wang wrote: >>> We used to queue tx packets in sk_receive_queue, this is less >>> efficient since it requires spinlocks to synchronize between

  1   2   3   4   5   6   7   8   9   10   >