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 with hot unplug. >>> Fix this bu

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

2013-01-17 Thread Wanlong Gao
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 with hot unplug. >> Fix this bug by traversal the online CPUs, and create a per

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

2013-01-17 Thread Jason Wang
On 01/18/2013 01:32 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 > the performance through enabling or disabling the virtqueue > affinity after doing cpu hotplug. > > Cc: Rusty Russell > Cc: "Michael

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 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 with hot unplug. > Fix this bug by traversal the online CPUs, and create a per cpu variable > to find the mapping from CPU to

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

2013-01-17 Thread Wanlong Gao
Add a cpu notifier to virtio-net, so that we can reset the virtqueue affinity if the cpu hotplug happens. It improve the performance through enabling or disabling the virtqueue affinity after doing cpu hotplug. Cc: Rusty Russell Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Eric Dumazet Cc: virt

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

2013-01-17 Thread Wanlong Gao
As Michael mentioned, set affinity and select queue will not work very well when CPU IDs are not consecutive, this can happen with hot unplug. Fix this bug by traversal the online CPUs, and create a per cpu variable to find the mapping from CPU to the preferable virtual-queue. Cc: Rusty Russell C

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

2013-01-17 Thread Amos Kong
On Thu, Jan 17, 2013 at 02:13:08PM +0200, Michael S. Tsirkin wrote: > On Thu, Jan 17, 2013 at 11:49:20AM +1030, Rusty Russell wrote: > > ak...@redhat.com writes: > > > @@ -349,6 +351,14 @@ static int virtio_net_handle_mac(VirtIONet *n, > > > uint8_t cmd, > > > { > > > struct virtio_net_ctrl_

Re: [PATCH] tcm_vhost: Use llist for cmd completion list

2013-01-17 Thread Asias He
On 01/18/2013 04:35 AM, Nicholas A. Bellinger wrote: > Hi Asias! > > On Sun, 2013-01-06 at 14:36 +0800, Asias He wrote: >> This drops the cmd completion list spin lock and makes the cmd >> completion queue lock-less. >> >> Signed-off-by: Asias He >> --- > > Apologies for the long delay to get ba

[PATCH] x86, Allow x2apic without IR on VMware platform.

2013-01-17 Thread Alok Kataria
Please consider this patch to allow x2apic without IR support when running on VMware platform. Tested on top of 3.8-rc3. Thanks, Alok -- Allow x2apic without IR on VMware platform. From: Alok N Kataria This patch updates x2apic initializaition code to allow x2apic on VMware platform even witho

Re: [PATCH 0/5] vhost-scsi: Add support for host virtualized target

2013-01-17 Thread Nicholas A. Bellinger
Hi MST & Co, On Thu, 2013-01-17 at 18:43 +0200, Michael S. Tsirkin wrote: > On Fri, Sep 07, 2012 at 06:48:14AM +, Nicholas A. Bellinger wrote: > > From: Nicholas Bellinger > > > > Hello Anthony & Co, > > > > This is the fourth installment to add host virtualized target support for > > the m

Re: [PATCH] tcm_vhost: Use llist for cmd completion list

2013-01-17 Thread Nicholas A. Bellinger
Hi Asias! On Sun, 2013-01-06 at 14:36 +0800, Asias He wrote: > This drops the cmd completion list spin lock and makes the cmd > completion queue lock-less. > > Signed-off-by: Asias He > --- Apologies for the long delay to get back to this patch. After some initial testing, I'm seeing about abo

Re: [PATCH 0/5] vhost-scsi: Add support for host virtualized target

2013-01-17 Thread Michael S. Tsirkin
On Fri, Sep 07, 2012 at 06:48:14AM +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > Hello Anthony & Co, > > This is the fourth installment to add host virtualized target support for > the mainline tcm_vhost fabric driver using Linux v3.6-rc into QEMU 1.3.0-rc. > > The series i

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

2013-01-17 Thread Stefan Hajnoczi
On Thu, Jan 17, 2013 at 06:30:46PM +0800, 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 t

[RFC] virtio_console: Add DRIVER and INTERFACE to uevent.

2013-01-17 Thread sjur . brandeland
From: Sjur Brændeland Add information so rproc-serial can be easily recogniced from user space. Add the following information to uevent: DRIVER=virtio_console|virtio_rproc_serial INTERFACE=grand-parent/parent/name Signed-off-by: Sjur Brændeland --- Hi, I need some way to identify the major/min

[PATCH] virtio_console: Use virtio device index to generate port name

2013-01-17 Thread sjur . brandeland
From: Sjur Brændeland Use virtio device index for creating unique device port names. Current index allocation in virtio is based on a monotonically increasing variable "index". A better handling of this is to use device index which is allocated by ida. Signed-off-by: Sjur Brændeland --- driver

[PATCH] virtio_console: Let unconnected rproc device receive data.

2013-01-17 Thread sjur . brandeland
From: Sjur Brændeland Allow rproc serial ports to receive data before the port is connected. Rproc serial ports usually talk to very simple remote devices with no control queue managing open/close events. So we must let remote devices write to the virtio ring even if the device is not yet fully

[PATCH] virtio_console: Don't access uninitialized data.

2013-01-17 Thread sjur . brandeland
From: Sjur Brændeland Don't access uninitialized work-queue when removing device. The work queue is initialized only if the device multi-queue. So don't call cancel_work unless this is a multi-queue device. This fixes the following panic: Kernel panic - not syncing: BUG! Call Trace: 62031b28:

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

2013-01-17 Thread Michael S. Tsirkin
On Thu, Jan 17, 2013 at 11:49:20AM +1030, Rusty Russell wrote: > ak...@redhat.com writes: > > @@ -349,6 +351,14 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t > > cmd, > > { > > struct virtio_net_ctrl_mac mac_data; > > > > +if (cmd == VIRTIO_NET_CTRL_MAC_ADDR_SET && elem->ou

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-17 Thread Michael S. Tsirkin
On Thu, Jan 17, 2013 at 12:49:25PM +0100, Sjur Brændeland wrote: > On Thu, Jan 17, 2013 at 12:23 PM, Michael S. Tsirkin wrote: > > On Thu, Jan 17, 2013 at 08:59:38PM +1030, Rusty Russell wrote: > ... > >> +static inline int > >> +__vringh_iov(struct vringh *vrh, u16 i, > >> + struct vring

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-17 Thread Sjur Brændeland
On Thu, Jan 17, 2013 at 12:23 PM, Michael S. Tsirkin wrote: > On Thu, Jan 17, 2013 at 08:59:38PM +1030, Rusty Russell wrote: ... >> +static inline int >> +__vringh_iov(struct vringh *vrh, u16 i, >> + struct vringh_iov *riov, >> + struct vringh_iov *wiov, >> + bool (*getr

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-17 Thread Michael S. Tsirkin
On Thu, Jan 17, 2013 at 08:59:38PM +1030, Rusty Russell wrote: > Getting use of virtio rings correct is tricky, and a recent patch saw > an implementation of in-kernel rings (as separate from userspace). > > This patch attempts to abstract the business of dealing with the > virtio ring layout from

[PATCH v3 1/2] move virtnet_send_command() above virtnet_set_mac_address()

2013-01-17 Thread akong
From: Amos Kong We will send vq command to set mac address in virtnet_set_mac_address() a little fix of coding style Signed-off-by: Amos Kong --- drivers/net/virtio_net.c | 89 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/driv

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

2013-01-17 Thread akong
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, it's atomic. VIRTIO_NET_F_CTRL_MAC_ADDR is a new feature bit for compatibility. Signe

[PATCH v3 0/2] make mac programming for virtio net more robust

2013-01-17 Thread akong
From: Amos Kong Currenly mac is programmed byte by byte. This means that we have an intermediate step where mac is wrong. Second patch introduced a new vq control command to set mac address, it's atomic. V2: check return of sending command, delay eth_mac_addr() V3: restore software address whe

[PATCH 6/6] tools/virtio: adapt for API changes.

2013-01-17 Thread Rusty Russell
Signed-off-by: Rusty Russell --- tools/virtio/vringh_test.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c index f3868f4..df09a3f 100644 --- a/tools/virtio/vringh_test.c +++ b/tools/virtio/vri

[PATCH 4/6] tools/virtio: add vring_test.

2013-01-17 Thread Rusty Russell
This is mainly to test the drivers/vhost/vringh.c code, but it also uses the drivers/virtio/virtio_ring.c code for the guest side. Usage for testing the basic implementation: ./vringh_test # Test with indirect descriptors ./vringh_test --indirect # Test with indire

[PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-17 Thread Rusty Russell
Getting use of virtio rings correct is tricky, and a recent patch saw an implementation of in-kernel rings (as separate from userspace). This patch attempts to abstract the business of dealing with the virtio ring layout from the access (userspace or direct); to do this, we use function pointers,

[PATCH 3/6] tools/virtio: separate headers more.

2013-01-17 Thread Rusty Russell
This makes them a bit more like the kernel headers, so we can include more real kernel headers in our tests. Signed-off-by: Rusty Russell --- tools/virtio/asm/barrier.h | 14 +++ tools/virtio/linux/bug.h|8 ++ tools/virtio/linux/err.h| 26

[PATCH 5/6] vringh: separate callback for notification.

2013-01-17 Thread Rusty Russell
This makes it possible to batch notifications, and the fewer barriers helps performance: Before: (./vringh_test --eventidx --parallel): Using CPUS 0 and 3 Guest: notified 156428, pinged 156251 Host: notified 156251, pinged 78215 R=4.575 U=3.520 S=3.520 Using CPUS 0 and 3 Guest: notified 156617, pi

[PATCH 2/6] tools/virtio: fix compile.

2013-01-17 Thread Rusty Russell
Didn't test that it actually works, mind you! Signed-off-by: Rusty Russell --- tools/virtio/linux/virtio.h |9 - tools/virtio/virtio_test.c |6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h index

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

2013-01-17 Thread akong
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 to set MAC address, it's atomic. VIRTIO_NET_F_CTRL_MAC_ADDR is a new feature b

[PATCH v2] virtio-spec: set mac address by a new vq command

2013-01-17 Thread akong
From: Amos Kong Virtio-net driver currently programs MAC address 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, and added a new feature flag VIRTIO_NET_F_MAC_ADDR for this feature. Signed-

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

2013-01-17 Thread Michael S. Tsirkin
On Thu, Jan 17, 2013 at 09:39:54AM +0100, Stefan Hajnoczi wrote: > On Thu, Jan 17, 2013 at 01:45:11PM +0800, Amos Kong wrote: > > On Thu, Jan 17, 2013 at 11:49:20AM +1030, Rusty Russell wrote: > > > ak...@redhat.com writes: > > > > @@ -349,6 +351,14 @@ static int virtio_net_handle_mac(VirtIONet *n,

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-17 Thread Michael S. Tsirkin
On Thu, Jan 17, 2013 at 12:40:29PM +1030, Rusty Russell wrote: > "Michael S. Tsirkin" writes: > > On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: > >> "Michael S. Tsirkin" writes: > >> >> +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) > >> >> +{ > >> >> + struct

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

2013-01-17 Thread Stefan Hajnoczi
On Thu, Jan 17, 2013 at 01:45:11PM +0800, Amos Kong wrote: > On Thu, Jan 17, 2013 at 11:49:20AM +1030, Rusty Russell wrote: > > ak...@redhat.com writes: > > > @@ -349,6 +351,14 @@ static int virtio_net_handle_mac(VirtIONet *n, > > > uint8_t cmd, > > > { > > > struct virtio_net_ctrl_mac mac_d

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

2013-01-17 Thread Amos Kong
On Thu, Jan 17, 2013 at 01:45:11PM +0800, Amos Kong wrote: > On Thu, Jan 17, 2013 at 11:49:20AM +1030, Rusty Russell wrote: > > ak...@redhat.com writes: > > > @@ -349,6 +351,14 @@ static int virtio_net_handle_mac(VirtIONet *n, > > > uint8_t cmd, > > > { > > > struct virtio_net_ctrl_mac mac_d