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

2012-12-05 Thread Jason Wang
Hi all: This series is an update version of multiqueue virtio-net driver based on Krishna Kumar's work to let virtio-net use multiple rx/tx queues to do the packets reception and transmission. Please review and comments. A protype implementation of qemu-kvm support could by found in

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

2012-12-05 Thread Jason Wang
To support multiqueue transmitq/receiveq, the first step is to separate queue related structure from virtnet_info. This patch introduce send_queue and receive_queue structure and use the pointer to them as the parameter in functions handling sending/receiving. Signed-off-by: Krishna Kumar

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

2012-12-05 Thread Jason Wang
This patch adds the multiqueue (VIRTIO_NET_F_RFS) support to virtio_net driver. VIRTIO_NET_F_RFS capable device could allow the driver to do packet transmission and reception through multiple queue pairs and does the packet steering to get better performance. By default, one one queue pair is

[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 jasow...@redhat.com --- drivers/net/virtio_net.c | 43 +++ 1 files

Re: [PATCH 2/3] virtio: use dev_to_virtio wrapper in virtio

2012-12-05 Thread Michael S. Tsirkin
On Wed, Dec 05, 2012 at 03:03:28PM +0800, Wanlong Gao wrote: Use dev_to_virtio wrapper in virtio to make code clearly. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 25fa1a6..30fc3c9 100644 ---

Re: [PATCH 2/3] virtio: use dev_to_virtio wrapper in virtio

2012-12-05 Thread Michael S. Tsirkin
On Wed, Dec 05, 2012 at 01:16:06PM +0200, Michael S. Tsirkin wrote: On Wed, Dec 05, 2012 at 03:03:28PM +0800, Wanlong Gao wrote: Use dev_to_virtio wrapper in virtio to make code clearly. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- diff --git a/include/linux/virtio.h

Re: [PATCH 3/3] virtio: add drv_to_virtio to make code clearly

2012-12-05 Thread Michael S. Tsirkin
On Wed, Dec 05, 2012 at 03:03:29PM +0800, Wanlong Gao wrote: Add drv_to_virtio wrapper to get virtio_driver from device_driver. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com IMHO a function would be slightly better. --- drivers/virtio/virtio.c | 11 ---

Re: [PATCH 1/3] virtio: change to_vp_device to an inlined definition

2012-12-05 Thread Michael S. Tsirkin
On Wed, Dec 05, 2012 at 03:03:27PM +0800, Wanlong Gao wrote: to_vp_device is worth changing to inlined definition. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com I don't think it's worth it. The oldest gcc I happened to have around is 4.3.3 which is already smart enough to generate

[PATCH V2 2/2] virtio: add drv_to_virtio to make code clearly

2012-12-05 Thread Wanlong Gao
Add drv_to_virtio wrapper to get virtio_driver from device_driver. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/virtio/virtio.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index

[PATCH V2 1/2] virtio: use dev_to_virtio wrapper in virtio

2012-12-05 Thread Wanlong Gao
Use dev_to_virtio wrapper in virtio to make code clearly. Move dev_to_virtio from virtio.h to virtio.c. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/virtio/virtio.c | 24 ++-- include/linux/virtio.h | 1 - 2 files changed, 14 insertions(+), 11

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

2012-12-05 Thread Sjur Brændeland
From: Sjur Brændeland sjur.brandel...@stericsson.com This patch-set introduces a host-side virtqueue implementation and the CAIF Virtio Link layer. See http://lwn.net/Articles/522296/ for background info on CAIF over Virtio. After feedback from Rusty, I have re-factored vhost.c and pulled out

[RFCv2 01/12] vhost: Use struct vring in vhost_virtqueue

2012-12-05 Thread Sjur Brændeland
Pull out common vring attributes from vhost_virtqueue to a new struct vring_host. This allows for reuse of data definitions between vhost and virtio queue when host-side virtio queue is introduced. Also unsigned long is replaced with ulong a couple of places. Signed-off-by: Sjur Brændeland

[RFCv2 02/12] vhost: Isolate reusable vring related functions

2012-12-05 Thread Sjur Brændeland
Prepare for moving virtio ring code out to a separate file by isolating vring related functions. The function vring_add_used_user() and vring_avail_desc_user() that are handling virtio rings from user space are prepared to be moved out. Signed-off-by: Sjur Brændeland

[RFCv2 03/12] virtio-ring: Introduce file virtio_ring_host

2012-12-05 Thread Sjur Brændeland
Move host-side virtio ring functions to file virtio_ring_host.c The functions vring_avail_desc_user(), vring_add_used_user() and vring_next_desc() are moved from vhost.c to the new file virtio_ring_host.c. (The functions are copied as is without any changes) Signed-off-by: Sjur Brændeland

[RFCv2 04/12] virtio-ring: Refactor out the functions accessing user memory

2012-12-05 Thread Sjur Brændeland
Isolate the access to user-memory in separate inline functions. This open up for reuse from host-side virtioqueue implementation accessing virtio-ring in kernel space. Signed-off-by: Sjur Brændeland sjur.brandel...@stericsson.com --- drivers/virtio/virtio_ring_host.c | 81

[RFCv2 05/12] virtio-ring: Refactor move attributes to struct virtqueue

2012-12-05 Thread Sjur Brændeland
Attributes 'weak_barriers' and 'notify' are moved from struct vring_virtqueue to struct virtqueue. Signed-off-by: Sjur Brændeland sjur.brandel...@stericsson.com --- drivers/virtio/virtio_ring.c | 20 +++- include/linux/virtio.h |4 2 files changed, 11

[RFCv2 06/12] virtio_ring: Move SMP macros to virtio_ring.h

2012-12-05 Thread Sjur Brændeland
Move macros from virtio_ring.c to virtio_ring.h so that they can be used outside the file. Signed-off-by: Sjur Brændeland sjur.brandel...@stericsson.com --- drivers/virtio/virtio_ring.c | 21 - include/linux/virtio_ring.h | 20 2 files changed, 20

[RFCv2 07/12] virtio-ring: Add Host side virtio-ring implementation

2012-12-05 Thread Sjur Brændeland
Introduce a host-side virtio queue implementation. The function vring_new_host_virtqueue(), virtqueue_add_buf_to_used() virtqueue_next_avail_desc() are added to virtio_ring_host.c Signed-off-by: Sjur Brændeland sjur.brandel...@stericsson.com --- drivers/virtio/virtio_ring_host.c | 195

[RFCv2 08/12] virtio: Update vring_interrupt for host-side virtio queues

2012-12-05 Thread Sjur Brændeland
From: Sjur Brændeland sjur.brandel...@stericsson.com Add an inline function for vring_interrupt that can handle host side virtio queues. Signed-off-by: Sjur Brændeland sjur.brandel...@stericsson.com --- drivers/virtio/virtio_ring.c |4 ++-- include/linux/virtio_ring.h | 13 -

[RFCv2 09/12] virtio-ring: Add BUG_ON checking on host/guest ring type

2012-12-05 Thread Sjur Brændeland
From: Sjur Brændeland sjur.brandel...@stericsson.com Add BUG_ON to ensure that the correct virtio queue type is used for the virtqueue functions. In addition the function virtqueue_kick_prepare() is changed so that it always returns true if the virtio-ring is reversed. Signed-off-by: Sjur

[RFCv2 11/12] remoteproc: Add support for host-virtqueues

2012-12-05 Thread Sjur Brændeland
Create a virtio-queue in reversed direction if requested by the virtio device. This is done by calling the function vring_new_host_virtqueue(). Signed-off-by: Sjur Brændeland sjur.brandel...@stericsson.com --- drivers/remoteproc/remoteproc_virtio.c | 15 --- 1 files changed, 12

[RFCv2 12/12] caif_virtio: Introduce caif over virtio

2012-12-05 Thread Sjur Brændeland
From: Vikram ARV vikram@stericsson.com caif_virtio is using the remoteproc and virtio framework for communicating with the modem. The CAIF link layer device is registered as a network device. CAIF over virtio uses the virtio rings in both directions, and request a reversed virtio queue in

Re: [PATCHv5] virtio-spec: virtio network device RFS support

2012-12-05 Thread Ben Hutchings
On Mon, 2012-12-03 at 12:58 +0200, Michael S. Tsirkin wrote: Add RFS support to virtio network device. Add a new feature flag VIRTIO_NET_F_RFS for this feature, a new configuration field max_virtqueue_pairs to detect supported number of virtqueues as well as a new command VIRTIO_NET_CTRL_RFS

Re: [PATCH 1/3] virtio: change to_vp_device to an inlined definition

2012-12-05 Thread Stephen Hemminger
On Wed, 5 Dec 2012 15:03:27 +0800 Wanlong Gao gaowanl...@cn.fujitsu.com wrote: to_vp_device is worth changing to inlined definition. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/virtio/virtio_pci.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff

Re: [PATCH 1/3] virtio: change to_vp_device to an inlined definition

2012-12-05 Thread Rusty Russell
Wanlong Gao gaowanl...@cn.fujitsu.com writes: to_vp_device is worth changing to inlined definition. Why? Thanks, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

Re: [PATCH 1/3] virtio: change to_vp_device to an inlined definition

2012-12-05 Thread Rusty Russell
Stephen Hemminger shemmin...@vyatta.com writes: On Wed, 5 Dec 2012 15:03:27 +0800 Wanlong Gao gaowanl...@cn.fujitsu.com wrote: to_vp_device is worth changing to inlined definition. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com --- drivers/virtio/virtio_pci.c | 6 +- 1 file

Re: [PATCH 1/3] virtio: change to_vp_device to an inlined definition

2012-12-05 Thread Wanlong Gao
On 12/06/2012 07:21 AM, Rusty Russell wrote: Wanlong Gao gaowanl...@cn.fujitsu.com writes: to_vp_device is worth changing to inlined definition. Why? OK, I saw your comments, and I dropped this patch already. Thanks, Wanlong Gao Thanks, Rusty.