Re: [net-next rfc v7 3/3] virtio-net: change the number of queues through ethtool

2012-12-02 Thread Jason Wang
On Sunday, December 02, 2012 06:09:06 PM Michael S. Tsirkin wrote: > On Tue, Nov 27, 2012 at 06:16:00PM +0800, Jason Wang wrote: > > This patch implement the {set|get}_channels method of ethool to allow user > > to change the number of queues dymaically when the device is running.

Re: [net-next RFC] pktgen: don't wait for the device who doesn't free skb immediately after sent

2012-12-02 Thread Jason Wang
On Tuesday, November 27, 2012 08:49:19 AM Stephen Hemminger wrote: > On Tue, 27 Nov 2012 14:45:13 +0800 > > Jason Wang wrote: > > On 11/27/2012 01:37 AM, Stephen Hemminger wrote: > > > On Mon, 26 Nov 2012 15:56:52 +0800 > > > > > > Jason Wang wrote:

Re: [net-next rfc v7 2/3] virtio_net: multiqueue support

2012-12-03 Thread Jason Wang
On 12/03/2012 05:47 PM, Michael S. Tsirkin wrote: > On Mon, Dec 03, 2012 at 02:05:27PM +0800, Jason Wang wrote: >> On Monday, December 03, 2012 12:34:08 PM Rusty Russell wrote: >>> Jason Wang writes: >>>> +static const struct ethtool_ops virtnet_ethtool_ops; >&

Re: [net-next rfc v7 2/3] virtio_net: multiqueue support

2012-12-03 Thread Jason Wang
On 12/03/2012 06:14 PM, Michael S. Tsirkin wrote: > On Tue, Nov 27, 2012 at 06:15:59PM +0800, Jason Wang wrote: >> > - if (!try_fill_recv(&vi->rq, GFP_KERNEL)) >> > - schedule_delayed_work(&vi->rq.refill, 0); >> > + for (i = 0; i &l

Re: [net-next rfc v7 1/3] virtio-net: separate fields of sending/receiving queue from virtnet_info

2012-12-04 Thread Jason Wang
On Monday, December 03, 2012 01:18:48 PM Michael S. Tsirkin wrote: > On Mon, Dec 03, 2012 at 01:15:01PM +0800, Jason Wang wrote: > > > > + > > > > > > > > + /* Work struct for refilling if we run low on memory. */ > > > > > > > > +

Re: [net-next rfc v7 1/3] virtio-net: separate fields of sending/receiving queue from virtnet_info

2012-12-04 Thread Jason Wang
On Tuesday, December 04, 2012 02:13:11 PM Rusty Russell wrote: > Jason Wang writes: > > On Monday, December 03, 2012 12:25:42 PM Rusty Russell wrote: > >> > + > >> > +/* Work struct for refilling if we run low on memory. */ > >> > +s

Re: [net-next rfc v7 2/3] virtio_net: multiqueue support

2012-12-04 Thread Jason Wang
On Monday, December 03, 2012 01:11:18 PM Michael S. Tsirkin wrote: > On Mon, Dec 03, 2012 at 06:01:58PM +0800, Jason Wang wrote: > > On 12/03/2012 05:47 PM, Michael S. Tsirkin wrote: > > > On Mon, Dec 03, 2012 at 02:05:27PM +0800, Jason Wang wrote: > > >> On Monday,

Re: [net-next rfc v7 2/3] virtio_net: multiqueue support

2012-12-04 Thread Jason Wang
On Tuesday, December 04, 2012 09:35:03 AM Michael S. Tsirkin wrote: > On Mon, Dec 03, 2012 at 06:30:49PM +0800, Jason Wang wrote: > > On 12/03/2012 06:14 PM, Michael S. Tsirkin wrote: > > > On Tue, Nov 27, 2012 at 06:15:59PM +0800, Jason Wang wrote: > > >> >

[PATCH net-next 0/3] Multiqueue support for virtio-net

2012-12-04 Thread Jason Wang
ml.org/lkml/2012/6/25/120 - RFC V2: http://lwn.net/Articles/467283/ Perf Numbers: Will do some basic test and post as a reply to this mail. Jason Wang (3): virtio-net: separate fields of sending/receiving queue from virtnet_info virtio_net: multiqueue support virtio-net: change the nu

[PATCH net-next 1/3] virtio-net: separate fields of sending/receiving queue from virtnet_info

2012-12-04 Thread Jason Wang
-off-by: Jason Wang --- drivers/net/virtio_net.c | 271 +- 1 files changed, 149 insertions(+), 122 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 8262232..266f712 100644 --- a/drivers/net/virtio_net.c +++ b/drivers

[PATCH net-next 2/3] virtio_net: multiqueue support

2012-12-04 Thread Jason Wang
processor id. - smp affinity hint were set to the vcpu that owns the queue pairs. Signed-off-by: Krishna Kumar Signed-off-by: Jason Wang --- drivers/net/virtio_net.c| 472 ++- include/uapi/linux/virtio_net.h | 16 ++ 2 files changed, 385 insertions

[PATCH net-next 3/3] virtio-net: change the number of queues through ethtool

2012-12-04 Thread Jason Wang
This patch implement the ethtool_{set|get}_channels method of ethool to allow user to change the number of queues dymaically when the device is running. This would let the user to configure it on demand. Signed-off-by: Jason Wang --- drivers/net/virtio_net.c | 44

Re: [net-next RFC] pktgen: don't wait for the device who doesn't free skb immediately after sent

2012-12-04 Thread Jason Wang
On Monday, December 03, 2012 08:01:11 AM Stephen Hemminger wrote: > On Mon, 03 Dec 2012 14:45:46 +0800 > > Jason Wang wrote: > > On Tuesday, November 27, 2012 08:49:19 AM Stephen Hemminger wrote: > > > On Tue, 27 Nov 2012 14:45:13 +0800 > > > > > > Jaso

Re: [PATCH net-next 2/3] virtio_net: multiqueue support

2012-12-04 Thread Jason Wang
On Tuesday, December 04, 2012 03:24:22 PM Michael S. Tsirkin wrote: > I found some bugs, see below. > Also some style nitpicking, this is not mandatory to address. Thanks for the reviewing. > > On Tue, Dec 04, 2012 at 07:07:57PM +0800, Jason Wang wrote: > > This addes mul

Re: [PATCH net-next 3/3] virtio-net: change the number of queues through ethtool

2012-12-04 Thread Jason Wang
On Tuesday, December 04, 2012 03:49:59 PM Michael S. Tsirkin wrote: > On Tue, Dec 04, 2012 at 07:07:58PM +0800, Jason Wang wrote: > > This patch implement the ethtool_{set|get}_channels method of ethool to > > allow user to change the number of queues dymaically when the device

Re: [PATCH net-next 2/3] virtio_net: multiqueue support

2012-12-04 Thread Jason Wang
On 12/04/2012 11:11 PM, Michael S. Tsirkin wrote: > On Tue, Dec 04, 2012 at 10:45:33PM +0800, Jason Wang wrote: >> On Tuesday, December 04, 2012 03:24:22 PM Michael S. Tsirkin wrote: >>> I found some bugs, see below. >>> Also some style nitpicking, this is not mandator

[PATCH net-next v2 0/3] Multiqueue support in virtio-net

2012-12-05 Thread Jason Wang
V2: http://lwn.net/Articles/467283/ Perf Numbers: Will do some basic test and post as a reply to this mail. Jason Wang (3): virtio-net: separate fields of sending/receiving queue from virtnet_info virtio_net: multiqueue support virtio-net: support changing the number of queue pairs t

[PATCH net-next v2 1/3] virtio-net: separate fields of sending/receiving queue from virtnet_info

2012-12-05 Thread Jason Wang
-off-by: Jason Wang --- drivers/net/virtio_net.c | 282 ++ 1 files changed, 158 insertions(+), 124 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 8262232..0dcaee7 100644 --- a/drivers/net/virtio_net.c +++ b/drivers

[PATCH net-next v2 2/3] virtio_net: multiqueue support

2012-12-05 Thread Jason Wang
. - smp affinity hint to the cpu that owns the queue pairs. This could be used with the flow steering support of the device to guarantee the packets of a single flow is handled by the same cpu. Signed-off-by: Krishna Kumar Signed-off-by: Jason Wang --- drivers/net/virtio_net.c| 473

[PATCH net-next v2 3/3] virtio-net: support changing the number of queue pairs through ethtool

2012-12-05 Thread Jason Wang
This patch implements the ethtool_{set|get}_channels method of virtio-net to allow user to change the number of queues when the device is running on demand. Signed-off-by: Jason Wang --- drivers/net/virtio_net.c | 43 +++ 1 files changed, 43 insertions

[PATCH net-next v3 1/3] virtio-net: separate fields of sending/receiving queue from virtnet_info

2012-12-07 Thread Jason Wang
-off-by: Jason Wang --- drivers/net/virtio_net.c | 282 ++ 1 files changed, 158 insertions(+), 124 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 90ac97d..02a7102 100644 --- a/drivers/net/virtio_net.c +++ b/drivers

[PATCH net-next v3 2/3] virtio_net: multiqueue support

2012-12-07 Thread Jason Wang
. - smp affinity hint to the cpu that owns the queue pairs. This could be used with the flow steering support of the device to guarantee the packets of a single flow is handled by the same cpu. Signed-off-by: Krishna Kumar Signed-off-by: Jason Wang --- drivers/net/virtio_net.c| 473

[PATCH net-next v3 3/3] virtio-net: support changing the number of queue pairs through ethtool

2012-12-07 Thread Jason Wang
This patch implements the ethtool_{set|get}_channels method of virtio-net to allow user to change the number of queues when the device is running on demand. Signed-off-by: Jason Wang --- drivers/net/virtio_net.c | 43 +++ 1 files changed, 43 insertions

Re: [PATCHv6] virtio-spec: virtio network device multiqueue support

2012-12-10 Thread Jason Wang
On Friday, December 07, 2012 04:18:56 PM Michael S. Tsirkin wrote: > Add multiqueue support to virtio network device. > Add a new feature flag VIRTIO_NET_F_MQ for this feature, a new > configuration field max_virtqueue_pairs to detect supported number of > virtqueues as well as a new command VIRTIO

Re: [RFC PATCH] virtio-net: reset virtqueue affinity when doing cpu hotplug

2012-12-26 Thread Jason Wang
r looking at this. > Cc: Rusty Russell > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: virtualization@lists.linux-foundation.org > Cc: net...@vger.kernel.org > Signed-off-by: Wanlong Gao > --- > drivers/net/virtio_net.c | 39

Re: [RFC PATCH] virtio-net: reset virtqueue affinity when doing cpu hotplug

2012-12-26 Thread Jason Wang
sabling the virtqueue >> affinity after doing cpu hotplug. >> >> Cc: Rusty Russell >> Cc: "Michael S. Tsirkin" >> Cc: Jason Wang >> Cc: virtualization@lists.linux-foundation.org >> Cc: net...@vger.kernel.org >> Signed-off-by: Wanlong Gao

Re: [RFC PATCH] virtio-net: reset virtqueue affinity when doing cpu hotplug

2012-12-26 Thread Jason Wang
On 12/26/2012 06:19 PM, Wanlong Gao wrote: > On 12/26/2012 06:06 PM, Jason Wang wrote: >> On 12/26/2012 03:06 PM, Wanlong Gao wrote: >>> Add a cpu notifier to virtio-net, so that we can reset the >>> virtqueue affinity if the cpu hotplug happens. It improve >>>

[PATCH 1/2] vhost_net: correct error hanlding in vhost_net_set_backend()

2012-12-26 Thread Jason Wang
Fix the leaking of oldubufs and fd refcnt when fail to initialized used ring. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 14 +++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index ebd08b2..629d6b5 100644 --- a

[PATCH 2/2] vhost: handle polling failure

2012-12-26 Thread Jason Wang
() report errors to the caller, which could be used caller or userspace. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 75 + drivers/vhost/vhost.c | 16 +- drivers/vhost/vhost.h | 11 ++- 3 files changed, 50 insertions

Re: [PATCH 2/2] vhost: handle polling failure

2012-12-27 Thread Jason Wang
On 12/27/2012 06:01 PM, Wanlong Gao wrote: > On 12/27/2012 02:39 PM, Jason Wang wrote: >> > Currently, polling error were ignored in vhost. This may lead some issues >> > (e.g >> > kenrel crash when passing a tap fd to vhost before calling TUNSETIFF). Fix >&g

Re: [PATCH 1/2] vhost_net: correct error hanlding in vhost_net_set_backend()

2012-12-27 Thread Jason Wang
On 12/27/2012 09:03 PM, Michael S. Tsirkin wrote: > On Thu, Dec 27, 2012 at 02:39:20PM +0800, Jason Wang wrote: >> Currently, polling error were ignored in vhost. This may lead some issues >> (e.g >> kenrel crash when passing a tap fd to vhost before calling TUNSETIFF

Re: [PATCH 1/2] vhost_net: correct error hanlding in vhost_net_set_backend()

2012-12-27 Thread Jason Wang
On 12/27/2012 09:14 PM, Michael S. Tsirkin wrote: > On Thu, Dec 27, 2012 at 02:39:19PM +0800, Jason Wang wrote: >> Fix the leaking of oldubufs and fd refcnt when fail to initialized used ring. >> >> Signed-off-by: Jason Wang >> --- >> drivers/vhost/net.c | 14 +

[PATCH V3 0/2] handle polling errors

2013-01-05 Thread Jason Wang
estore the state before the ioctl when vhost_init_used() fails - log the error when meet polling errors in the data path - don't put into waitqueue when tun_chr_poll() return POLLERR Jason Wang (2): vhost_net: correct error handling in vhost_net_set_backend() vhost: handle polling error

[PATCH V3 1/2] vhost_net: correct error handling in vhost_net_set_backend()

2013-01-05 Thread Jason Wang
Currently, when vhost_init_used() fails the sock refcnt and ubufs were leaked. Correct this by calling vhost_init_used() before assign ubufs and restore the oldsock when it fails. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 16 +++- 1 files changed, 11 insertions(+), 5

[PATCH V3 2/2] vhost: handle polling errors

2013-01-05 Thread Jason Wang
in vhost_net since it was replaced by the checking of poll->wqh. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 74 drivers/vhost/vhost.c | 31 +++- drivers/vhost/vhost.h |2 +- 3 files changed, 49 insertions(

Re: [PATCH V3 2/2] vhost: handle polling errors

2013-01-06 Thread Jason Wang
On 01/06/2013 09:22 PM, Michael S. Tsirkin wrote: > On Sun, Jan 06, 2013 at 03:18:38PM +0800, Jason Wang wrote: >> Polling errors were ignored by vhost/vhost_net, this may lead to crash when >> trying to remove vhost from waitqueue when after the polling is failed. Solve >

Re: [PATCH V2 2/2] virtio-net: reset virtqueue affinity when doing cpu hotplug

2013-01-06 Thread Jason Wang
tifier block to virtnet_info is suggested by > Jason, thank you. > > Cc: Rusty Russell > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Eric Dumazet > Cc: virtualization@lists.linux-foundation.org > Cc: net...@vger.kernel.org > Signed-off-by:

Re: [PATCH V2 2/2] virtio-net: reset virtqueue affinity when doing cpu hotplug

2013-01-06 Thread Jason Wang
On 01/07/2013 03:48 PM, Wanlong Gao wrote: > On 01/07/2013 03:28 PM, Jason Wang wrote: >> On 01/07/2013 03:15 PM, Wanlong Gao wrote: >>> Add a cpu notifier to virtio-net, so that we can reset the >>> virtqueue affinity if the cpu hotplug happens. It improve >>>

Re: [PATCH V3 2/2] vhost: handle polling errors

2013-01-07 Thread Jason Wang
On 01/07/2013 10:55 PM, Michael S. Tsirkin wrote: > On Mon, Jan 07, 2013 at 12:38:17PM +0800, Jason Wang wrote: >> On 01/06/2013 09:22 PM, Michael S. Tsirkin wrote: >>> On Sun, Jan 06, 2013 at 03:18:38PM +0800, Jason Wang wrote: >>>> Polling errors were ignored by vho

Re: [PATCH V3 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-08 Thread Jason Wang
from CPU to the preferable virtual-queue. > > Cc: Rusty Russell > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Eric Dumazet > Cc: virtualization@lists.linux-foundation.org > Cc: net...@vger.kernel.org > Signed-off-by: Wanlo

Re: [PATCH V3 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-08 Thread Jason Wang
On 01/09/2013 09:52 AM, Wanlong Gao wrote: > On 01/08/2013 06:26 PM, Jason Wang wrote: >> On 01/08/2013 06:07 PM, Wanlong Gao wrote: >>> As Michael mentioned, set affinity and select queue will not work very >>> well when CPU IDs are not consecutive, this can happen wi

Re: [RFC PATCH 1/2] move virtnet_send_command() above virtnet_set_mac_address()

2013-01-10 Thread Jason Wang
On 01/10/2013 10:45 PM, ak...@redhat.com wrote: > From: Amos Kong > > We will send vq command to set mac address in virtnet_set_mac_address() > a little fix of coding style Maybe what you need is just a forward declaration. > > Signed-off-by: Amos Kong > --- > drivers/net/virtio_net.c | 89 > +

Re: [Qemu-devel] [RFC PATCH 2/2] virtio-net: introduce a new control to set macaddr

2013-01-10 Thread Jason Wang
On 01/10/2013 10:45 PM, ak...@redhat.com wrote: > From: Amos Kong > > Currently we write MAC address to pci config space byte by byte, > this means that we have an intermediate step where mac is wrong. > This patch introduced a new control command to set MAC address > in one time. > > VIRTIO_NET_F

Re: [PATCH V3 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-11 Thread Jason Wang
On 01/11/2013 03:12 AM, Ben Hutchings wrote: > On Thu, 2013-01-10 at 11:19 +1030, Rusty Russell wrote: >> Wanlong Gao writes: >>> On 01/09/2013 07:31 AM, Rusty Russell wrote: Wanlong Gao writes: > */ > static u16 virtnet_select_queue(struct net_device *dev, struct sk_buff > *

Re: [PATCH V4 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-11 Thread Jason Wang
from CPU to the preferable virtual-queue. Looks like ixgbe is trying to handling a similar issue recently by trying to reuse XPS when the channels and cpus are not equal. I wonder whether we can use the same method. > > Cc: Rusty Russell > Cc: "Michael S. Tsirkin" > Cc: Ja

Re: [PATCH V3 2/2] vhost: handle polling errors

2013-01-13 Thread Jason Wang
On 01/13/2013 07:10 PM, Michael S. Tsirkin wrote: > On Mon, Jan 07, 2013 at 11:04:32PM +0800, Jason Wang wrote: >> On 01/07/2013 10:55 PM, Michael S. Tsirkin wrote: >>> On Mon, Jan 07, 2013 at 12:38:17PM +0800, Jason Wang wrote: >>>> On 01/06/2013 09:22 PM, Michael

Re: [PATCH V3 2/2] vhost: handle polling errors

2013-01-13 Thread Jason Wang
On 01/14/2013 02:57 PM, Michael S. Tsirkin wrote: > On Mon, Jan 14, 2013 at 10:59:02AM +0800, Jason Wang wrote: >> On 01/13/2013 07:10 PM, Michael S. Tsirkin wrote: >>> On Mon, Jan 07, 2013 at 11:04:32PM +0800, Jason Wang wrote: >>>> On 01/07/2013 10:55 PM, Michael

Re: [PATCH v2 2/2] virtio-net: introduce a new control to set macaddr

2013-01-15 Thread Jason Wang
On Wednesday, January 16, 2013 01:57:01 PM ak...@redhat.com wrote: > From: Amos Kong > > Currently we write MAC address to pci config space byte by byte, > this means that we have an intermediate step where mac is wrong. > This patch introduced a new control command to set MAC address > in one ti

Re: [QEMU PATCH v2] virtio-net: introduce a new macaddr control

2013-01-15 Thread Jason Wang
On Wednesday, January 16, 2013 02:16:47 PM ak...@redhat.com wrote: > From: Amos Kong > > In virtio-net guest driver, currently we write MAC address to > pci config space byte by byte, this means that we have an > intermediate step where mac is wrong. This patch introduced > a new control command

Re: [PATCH V5 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-17 Thread Jason Wang
from CPU to the preferable virtual-queue. > > Cc: Rusty Russell > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Eric Dumazet > Cc: virtualization@lists.linux-foundation.org > Cc: net...@vger.kernel.org > Signed-off-by: Wanlong Gao > --- > V4->V5:

Re: [PATCH V5 2/2] virtio-net: reset virtqueue affinity when doing cpu hotplug

2013-01-17 Thread Jason Wang
usty Russell > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Eric Dumazet > Cc: virtualization@lists.linux-foundation.org > Cc: net...@vger.kernel.org > Signed-off-by: Wanlong Gao > --- > V4->V5: > New method to deal with the cpu

Re: [PATCH V5 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-17 Thread Jason Wang
On 01/18/2013 02:25 PM, Wanlong Gao wrote: > On 01/18/2013 02:18 PM, Jason Wang wrote: >> On 01/18/2013 01:32 PM, Wanlong Gao wrote: >>> As Michael mentioned, set affinity and select queue will not work very >>> well when CPU IDs are not consecutive, this can happen wi

Re: [PATCH V6 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-24 Thread Jason Wang
from CPU to the preferable virtual-queue. > > Cc: Rusty Russell > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Eric Dumazet > Cc: virtualization@lists.linux-foundation.org > Cc: net...@vger.kernel.org > Signed-off-by: Wanlong Gao > --- > V5->V6: &g

Re: [PATCH V6 2/3] virtio-net: split out clean affinity function

2013-01-24 Thread Jason Wang
On 01/21/2013 07:25 PM, Wanlong Gao wrote: > Split out the clean affinity function to virtnet_clean_affinity(). > > Cc: Rusty Russell > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Eric Dumazet > Cc: virtualization@lists.linux-foundation.org > Cc: net.

Re: [PATCH V6 2/3] virtio-net: split out clean affinity function

2013-01-24 Thread Jason Wang
On 01/25/2013 12:20 PM, Wanlong Gao wrote: > On 01/25/2013 11:28 AM, Jason Wang wrote: >> On 01/21/2013 07:25 PM, Wanlong Gao wrote: >>> Split out the clean affinity function to virtnet_clean_affinity(). >>> >>> Cc: Rusty Russell >>> Cc: "Mic

Re: [PATCH V6 2/3] virtio-net: split out clean affinity function

2013-01-24 Thread Jason Wang
On 01/25/2013 01:40 PM, Wanlong Gao wrote: > On 01/25/2013 01:13 PM, Jason Wang wrote: >> On 01/25/2013 12:20 PM, Wanlong Gao wrote: >>> On 01/25/2013 11:28 AM, Jason Wang wrote: >>>> On 01/21/2013 07:25 PM, Wanlong Gao wrote: >>>>> Split out the clea

Re: [PATCH V6 2/3] virtio-net: split out clean affinity function

2013-01-24 Thread Jason Wang
On 01/25/2013 02:42 PM, Wanlong Gao wrote: > On 01/25/2013 02:12 PM, Jason Wang wrote: >> On 01/25/2013 01:40 PM, Wanlong Gao wrote: >>> On 01/25/2013 01:13 PM, Jason Wang wrote: >>>> On 01/25/2013 12:20 PM, Wanlong Gao wrote: >>>>> On 01/25/2013 11:28

Re: [PATCH V7 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-25 Thread Jason Wang
from CPU to the preferable virtual-queue. > > Cc: Rusty Russell > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Eric Dumazet > Cc: "David S. Miller" > Cc: virtualization@lists.linux-foundation.org > Cc: net...@vger.kernel.org > Signed-off-by:

Re: [PATCH V7 1/3] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-25 Thread Jason Wang
On 01/25/2013 05:05 PM, Wanlong Gao wrote: > On 01/25/2013 05:00 PM, Jason Wang wrote: >> On 01/25/2013 04:36 PM, Wanlong Gao wrote: >>> As Michael mentioned, set affinity and select queue will not work very >>> well when CPU IDs are not consecutive, this can happen wi

Re: [PATCH 10/16] virtio_net: use virtqueue_add_sgs[] for command buffers.

2013-02-21 Thread Jason Wang
On 02/21/2013 04:30 PM, Wanlong Gao wrote: > On 02/19/2013 03:56 PM, Rusty Russell wrote: >> It's a bit cleaner to hand multiple sgs, rather than one big one. >> >> Signed-off-by: Rusty Russell >> --- >> drivers/net/virtio_net.c | 50 >> ++ >> 1 file

[PATCH] vhost_net: remove tx polling state

2013-03-06 Thread Jason Wang
simpler. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 60 drivers/vhost/vhost.c |3 ++ 2 files changed, 13 insertions(+), 50 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 959b1cd..d1a03dd 100644 --- a

Re: [PATCH] vhost_net: remove tx polling state

2013-03-11 Thread Jason Wang
On 03/11/2013 12:50 AM, Michael S. Tsirkin wrote: > On Thu, Mar 07, 2013 at 12:31:56PM +0800, Jason Wang wrote: >> After commit 2b8b328b61c799957a456a5a8dab8cc7dea68575 (vhost_net: handle >> polling >> errors when setting backend), we in fact track the polling state thr

Re: [PATCH] vhost_net: remove tx polling state

2013-03-11 Thread Jason Wang
On 03/11/2013 03:09 PM, Jason Wang wrote: > On 03/11/2013 12:50 AM, Michael S. Tsirkin wrote: >> On Thu, Mar 07, 2013 at 12:31:56PM +0800, Jason Wang wrote: >>> After commit 2b8b328b61c799957a456a5a8dab8cc7dea68575 (vhost_net: handle >>> polling >>> errors whe

Re: [PATCH] vhost_net: remove tx polling state

2013-03-11 Thread Jason Wang
On 03/11/2013 04:29 PM, Michael S. Tsirkin wrote: > On Mon, Mar 11, 2013 at 03:09:10PM +0800, Jason Wang wrote: >> On 03/11/2013 12:50 AM, Michael S. Tsirkin wrote: >>> On Thu, Mar 07, 2013 at 12:31:56PM +0800, Jason Wang wrote: >>>> After commit 2b8b328b61c799957a456

[PATCH] vhost_net: remove tx polling state

2013-04-11 Thread Jason Wang
18.36/3230.11/+3.6% | zerocopy enabled: sessions|transaction rates|normalize| before/after/+improvements 1 | 7318.33/11929.76/+63.0%| 521.86/843.30/+61.6% | 25| 167264.88/242422.15/+44.9% | 2181.60/2788.16/+27.8% | 50| 272181.02/294347.04/+8.1% | 3071.56/3257.85/+6.1% | Signed-off-b

Re: [PATCH 0/3] vhost cleanups and separate module

2013-05-12 Thread Jason Wang
On 05/07/2013 08:44 PM, Michael S. Tsirkin wrote: > On Tue, May 07, 2013 at 02:13:44PM +0930, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >>> On Mon, May 06, 2013 at 03:41:36PM +0930, Rusty Russell wrote: Asias He writes: > Asias He (3): > vhost: Remove vhost_enable_zcopy

Re: [PATCH] virtio-net: Reporting traffic queue distribution statistics through ethtool

2013-05-19 Thread Jason Wang
virtualization@lists.linux-foundation.org; > k...@vger.kernel.org; net...@vger.kernel.org; linux-ker...@vger.kernel.org; > Jason Wang > Subject: Re: [PATCH] virtio-net: Reporting traffic queue distribution > statistics through ethtool > > On Sun, May 19, 2013 at 04:09:48PM +, Narasim

Re: [PATCH] virtio-net: Reporting traffic queue distribution statistics through ethtool

2013-05-20 Thread Jason Wang
@vger.kernel.org; net...@vger.kernel.org; linux-ker...@vger.kernel.org; > Jason Wang > Subject: Re: [PATCH] virtio-net: Reporting traffic queue distribution > statistics through ethtool > > On Sun, May 19, 2013 at 10:56:16PM +, Narasimhan, Sriram wrote: >> Hi Michael, &g

[PATCH] virtio_net: enable napi after enabling new queues

2013-05-21 Thread Jason Wang
Commit 55257d72bd1c51f25106350f4983ec19f62ed1fa (virtio-net: fill only rx queues which are being used) forgets to enable napi for new enabled queues which breaks the multiqueue receiving. This patch fixes it. Cc: Sasha Levin Signed-off-by: Jason Wang --- drivers/net/virtio_net.c |4 +++- 1

Re: [PATCH] virtio_net: enable napi after enabling new queues

2013-05-21 Thread Jason Wang
On 05/22/2013 01:22 PM, Jason Wang wrote: > Commit 55257d72bd1c51f25106350f4983ec19f62ed1fa (virtio-net: fill only rx > queues which are being used) forgets to enable napi for new enabled queues > which > breaks the multiqueue receiving. This patch fixes it. > > Cc: Sasha Levi

[PATCH V2] virtio_net: enable napi for all possible queues during open

2013-05-21 Thread Jason Wang
fixes this by enabling napi for all possible queues during open. Cc: Sasha Levin Signed-off-by: Jason Wang --- Changes from V1: - enable napi in open instead of virtnet_set_queues() to avoid kernel BUG() when trying to do napi_enable() for a already enabled queue --- drivers/net/virtio_net.c

Re: updated: kvm networking todo wiki

2013-05-24 Thread Jason Wang
On 05/23/2013 04:50 PM, Michael S. Tsirkin wrote: > Hey guys, > I've updated the kvm networking todo wiki with current projects. > Will try to keep it up to date more often. > Original announcement below. Thanks a lot. I've added the tasks I'm currently working on to the wiki. btw. I notice the v

Re: [PATCH] virtio-pci: fix leaks of msix_affinity_masks

2013-06-20 Thread Jason Wang
4/0x160 > [] register_virtio_driver+0x20/0x40 > > v2: change msix_vectors uncoditionaly in vp_free_vectors > > Cc: Rusty Russell > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Signed-off-by: Andrew Vagin > Signed-off-by: Andrey Vagin > --- > driver

Re: [PATCH net] vhost-net: fix use-after-free in vhost_net_flush

2013-06-20 Thread Jason Wang
&vq->mutex); > vhost_zerocopy_signal_used(n, vq); > mutex_unlock(&vq->mutex); > @@ -1091,7 +1096,7 @@ err_used: > vq->private_data = oldsock; > vhost_net_enable_vq(n, vq); > if (ubufs) > - vhost_net_ubuf_pu

[PATCH net] virtio-net: fix the race between channels setting and refill

2013-07-03 Thread Jason Wang
Signed-off-by: Jason Wang --- drivers/net/virtio_net.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index c9e0038..47b4882 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -901,7 +901,6

Re: [PATCH 1/2] virtio: support unlocked queue poll

2013-07-08 Thread Jason Wang
t be able to get rid of a > barrier here. Deferring this optimization until we do some > benchmarking. > > Signed-off-by: Michael S. Tsirkin > --- Tested-by: Jason Wang Acked-by: Jason Wang > drivers/virtio/virtio_ring.c | 56 > ++--

Re: [PATCH 2/2] virtio_net: fix race in RX VQ processing

2013-07-08 Thread Jason Wang
n particular, used event can move backwards, > causing us to lose interrupts. > In a debug build, this can trigger panic within START_USE. > > Jason Wang reports that he can trigger the races artificially, > by adding udelay() in virtqueue_enable_cb() after virtio_mb(). > > Howev

Re: [PATCH 03/10] virtio: console: clean up port data immediately at time of unplug

2013-07-18 Thread Jason Wang
On 07/19/2013 04:16 AM, Amit Shah wrote: > We used to keep the port's char device structs and the /sys entries > around till the last reference to the port was dropped. This is > actually unnecessary, and resulted in buggy behaviour: > > 1. Open port in guest > 2. Hot-unplug port > 3. Hot-plug a p

Re: [PATCH 04/10] virtio: console: return -ENODEV on all read operations after unplug

2013-07-18 Thread Jason Wang
On 07/19/2013 04:16 AM, Amit Shah wrote: > If a port gets unplugged while a user is blocked on read(), -ENODEV is > returned. However, subsequent read()s returned 0, indicating there's no > host-side connection (but not indicating the device went away). > > This also happened when a port was unplu

Re: [PATCH 03/10] virtio: console: clean up port data immediately at time of unplug

2013-07-18 Thread Jason Wang
On 07/19/2013 01:02 PM, Amit Shah wrote: > On (Fri) 19 Jul 2013 [11:21:47], Jason Wang wrote: >> On 07/19/2013 04:16 AM, Amit Shah wrote: > >>> diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c >>> index b04ec95..6bf0df3 100644 >>&

Re: [PATCH 04/10] virtio: console: return -ENODEV on all read operations after unplug

2013-07-19 Thread Jason Wang
On 07/19/2013 01:45 PM, Amit Shah wrote: > On (Fri) 19 Jul 2013 [13:07:49], Jason Wang wrote: >> On 07/19/2013 04:16 AM, Amit Shah wrote: >>> If a port gets unplugged while a user is blocked on read(), -ENODEV is >>> returned. However, subsequent read()s returned 0, ind

Re: [PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug

2013-07-19 Thread Jason Wang
On 07/19/2013 04:16 AM, Amit Shah wrote: > Between poll() being called and processed, the port can be unplugged. > Check if this happened, and bail out. > > Signed-off-by: Amit Shah > --- > drivers/char/virtio_console.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/drivers/char/vir

Re: [PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug

2013-07-19 Thread Jason Wang
On 07/19/2013 03:48 PM, Amit Shah wrote: > On (Fri) 19 Jul 2013 [15:03:50], Jason Wang wrote: >> On 07/19/2013 04:16 AM, Amit Shah wrote: >>> Between poll() being called and processed, the port can be unplugged. >>> Check if this happened, and bail out. >&

Re: [PATCH v2 00/11] virtio: console: fixes for port unplug

2013-07-21 Thread Jason Wang
to stable, and to me it > looks like all are stable candidates. > > v2 > * add patch 11: Jason found a use-after-free in port unplug > * patch 7 introduced a regression where the wake_up_interruptible was >done before guest_connected and host_connected were set to false > >

Re: [PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug

2013-07-22 Thread Jason Wang
On 07/22/2013 01:45 PM, Rusty Russell wrote: > Amit Shah writes: >> On (Fri) 19 Jul 2013 [18:17:32], Jason Wang wrote: >>> On 07/19/2013 03:48 PM, Amit Shah wrote: >>>> On (Fri) 19 Jul 2013 [15:03:50], Jason Wang wrote: >>>>> On 07/19/2013 04:16 AM,

Re: [PATCH 06/10] virtio: console: fix race in port_fops_poll() and port unplug

2013-07-23 Thread Jason Wang
On 07/23/2013 01:26 PM, Rusty Russell wrote: > Jason Wang writes: >> On 07/22/2013 01:45 PM, Rusty Russell wrote: >>> Amit Shah writes: >>>> On (Fri) 19 Jul 2013 [18:17:32], Jason Wang wrote: >>>>> On 07/19/2013 03:48 PM, Amit Shah wrote: >>>

[PATCH 2/4] xen: switch to use hypervisor_cpuid_base()

2013-07-23 Thread Jason Wang
ned-off-by: Jason Wang --- arch/x86/include/asm/xen/hypervisor.h | 16 +--- 1 files changed, 1 insertions(+), 15 deletions(-) diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h index 125f344..d866959 100644 --- a/arch/x86/include/asm/xen/hy

[PATCH V2 4/4] x86: correctly detect hypervisor

2013-07-25 Thread Jason Wang
Tosatti Cc: Gleb Natapov Cc: Paolo Bonzini Cc: Frederic Weisbecker Cc: linux-ker...@vger.kernel.org Cc: de...@linuxdriverproject.org Cc: k...@vger.kernel.org Cc: xen-de...@lists.xensource.com Cc: virtualization@lists.linux-foundation.org Signed-off-by: Jason Wang --- arch/x86/include/asm

[PATCH V2 2/4] xen: switch to use hypervisor_cpuid_base()

2013-07-25 Thread Jason Wang
: Jason Wang --- arch/x86/include/asm/xen/hypervisor.h | 16 +--- 1 files changed, 1 insertions(+), 15 deletions(-) diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h index 125f344..d866959 100644 --- a/arch/x86/include/asm/xen/hypervisor.h

Re: [PATCH V2 4/4] x86: correctly detect hypervisor

2013-08-04 Thread Jason Wang
On 07/25/2013 04:54 PM, Jason Wang wrote: > We try to handle the hypervisor compatibility mode by detecting hypervisor > through a specific order. This is not robust, since hypervisors may implement > each others features. > > This patch tries to handle this situation by always ch

[PATCH 1/6] vhost_net: make vhost_zerocopy_signal_used() returns void

2013-08-15 Thread Jason Wang
None of its caller use its return value, so let it return void. Signed-off-by: Jason Wang --- drivers/vhost/net.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 969a859..280ee66 100644 --- a/drivers/vhost/net.c +++ b

[PATCH 0/6] vhost code cleanup and minor enhancement

2013-08-15 Thread Jason Wang
Hi all: This series tries to unify and simplify vhost codes especially for zerocopy. Plase review. Thanks Jason Wang (6): vhost_net: make vhost_zerocopy_signal_used() returns void vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used() vhost: switch to use

[PATCH 2/6] vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used()

2013-08-15 Thread Jason Wang
Switch to use vhost_add_used_and_signal_n() to avoid multiple calls to vhost_add_used_and_signal(). With the patch we will call at most 2 times (consider done_idx warp around) compared to N times w/o this patch. Signed-off-by: Jason Wang --- drivers/vhost/net.c | 13 - 1 files

[PATCH 4/6] vhost_net: determine whether or not to use zerocopy at one time

2013-08-15 Thread Jason Wang
Currently, even if the packet length is smaller than VHOST_GOODCOPY_LEN, if upend_idx != done_idx we still set zcopy_used to true and rollback this choice later. This could be avoided by determine zerocopy once by checking all conditions at one time before. Signed-off-by: Jason Wang --- drivers

[PATCH 3/6] vhost: switch to use vhost_add_used_n()

2013-08-15 Thread Jason Wang
Let vhost_add_used() to use vhost_add_used_n() to reduce the code duplication. Signed-off-by: Jason Wang --- drivers/vhost/vhost.c | 43 ++- 1 files changed, 2 insertions(+), 41 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c

[PATCH 5/6] vhost_net: poll vhost queue after marking DMA is done

2013-08-15 Thread Jason Wang
We used to poll vhost queue before making DMA is done, this is racy if vhost thread were waked up before marking DMA is done which can result the signal to be missed. Fix this by always poll the vhost thread before DMA is done. Signed-off-by: Jason Wang --- drivers/vhost/net.c |9

[PATCH 6/6] vhost_net: remove the max pending check

2013-08-15 Thread Jason Wang
oming from guest. Guest can easily exceeds the limitation. - We've already check upend_idx != done_idx and switch to non zerocopy then. So even if all vq->heads were used, we can still does the packet transmission. So remove this check completely. Signed-off-by: Jason Wang --- driver

Re: [PATCH 2/6] vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used()

2013-08-19 Thread Jason Wang
On 08/16/2013 05:54 PM, Michael S. Tsirkin wrote: > On Fri, Aug 16, 2013 at 01:16:26PM +0800, Jason Wang wrote: >> > Switch to use vhost_add_used_and_signal_n() to avoid multiple calls to >> > vhost_add_used_and_signal(). With the patch we will call at most 2 times >>

Re: [PATCH 3/6] vhost: switch to use vhost_add_used_n()

2013-08-19 Thread Jason Wang
On 08/16/2013 05:56 PM, Michael S. Tsirkin wrote: > On Fri, Aug 16, 2013 at 01:16:27PM +0800, Jason Wang wrote: >> > Let vhost_add_used() to use vhost_add_used_n() to reduce the code >> > duplication. >> > >> > Signed-off-by: Jason Wang > Does compiler

Re: [PATCH 5/6] vhost_net: poll vhost queue after marking DMA is done

2013-08-19 Thread Jason Wang
On 08/16/2013 06:00 PM, Michael S. Tsirkin wrote: > On Fri, Aug 16, 2013 at 01:16:29PM +0800, Jason Wang wrote: >> We used to poll vhost queue before making DMA is done, this is racy if vhost >> thread were waked up before marking DMA is done which can result the signal >>

<    1   2   3   4   5   6   7   8   9   10   >