[PATCHv2 net-next 0/8] enable/disable zero copy tx dynamically

2012-10-31 Thread Michael S. Tsirkin
tun supports zero copy transmit since 0690899b4d4501b3505be069b9a687e68ccbe15b, however you can only enable this mode if you know your workload does not trigger heavy guest to host/host to guest traffic - otherwise you get a (minor) performance regression. This patchset addresses this problem by n

[PATCHv2 net-next 1/8] skb: report completion status for zero copy skbs

2012-10-31 Thread Michael S. Tsirkin
Even if skb is marked for zero copy, net core might still decide to copy it later which is somewhat slower than a copy in user context: besides copying the data we need to pin/unpin the pages. Add a parameter reporting such cases through zero copy callback: if this happens a lot, device can take t

[PATCHv2 net-next 2/8] skb: api to report errors for zero copy skbs

2012-10-31 Thread Michael S. Tsirkin
Orphaning frags for zero copy skbs needs to allocate data in atomic context so is has a chance to fail. If it does we currently discard the skb which is safe, but we don't report anything to the caller, so it can not recover by e.g. disabling zero copy. Add an API to free skb reporting such errors

[PATCHv2 net-next 3/8] tun: report orphan frags errors to zero copy callback

2012-10-31 Thread Michael S. Tsirkin
When tun transmits a zero copy skb, it orphans the frags which might need to allocate extra memory, in atomic context. If that fails, notify ubufs callback before freeing the skb as a hint that device should disable zerocopy mode. Signed-off-by: Michael S. Tsirkin --- drivers/net/tun.c | 1 + 1

[PATCHv2 net-next 8/8] vhost-net: reduce vq polling on tx zerocopy

2012-10-31 Thread Michael S. Tsirkin
It seems that to avoid deadlocks it is enough to poll vq before we are going to use the last buffer. This is faster than c70aa540c7a9f67add11ad3161096fb95233aa2e. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) di

[PATCHv2 net-next 4/8] vhost-net: cleanup macros for DMA status tracking

2012-10-31 Thread Michael S. Tsirkin
Better document macros for DMA tracking. Add an explicit one for DMA in progress instead of relying on user supplying len != 1. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 3 ++- drivers/vhost/vhost.c | 2 +- drivers/vhost/vhost.h | 12 +--- 3 files changed, 12 insert

[PATCHv2 net-next 5/8] vhost: track zero copy failures using DMA length

2012-10-31 Thread Michael S. Tsirkin
This will be used to disable zerocopy when error rate is high. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vhost.c | 7 --- drivers/vhost/vhost.h | 4 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 906fd9f..5aff

[PATCHv2 net-next 6/8] vhost: move -net specific code out

2012-10-31 Thread Michael S. Tsirkin
Zerocopy handling code is vhost-net specific. Move it from vhost.c/vhost.h out to net.c Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 45 drivers/vhost/tcm_vhost.c | 1 + drivers/vhost/vhost.c | 53 +++-

[PATCHv2 net-next 7/8] vhost-net: select tx zero copy dynamically

2012-10-31 Thread Michael S. Tsirkin
Even when vhost-net is in zero-copy transmit mode, net core might still decide to copy the skb later which is somewhat slower than a copy in user context: data copy overhead is added to the cost of page pin/unpin. The result is that enabling tx zero copy option leads to higher CPU utilization for g

Re: [rfc net-next v6 0/3] Multiqueue virtio-net

2012-10-31 Thread Jason Wang
On 10/31/2012 03:05 AM, Rick Jones wrote: On 10/30/2012 03:03 AM, Jason Wang wrote: 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 a

Re: Linux-next changes for module and virtio trees.

2012-10-31 Thread Stephen Rothwell
Hi Rusty, On Wed, 31 Oct 2012 13:58:15 +1030 Rusty Russell wrote: > > Stephen Rothwell writes: > > > > On Tue, 02 Oct 2012 15:56:56 +0930 Rusty Russell > > wrote: > >> > >> Please remove my quilt tree > >> http://ozlabs.org/~rusty/kernel/rr-latest/ from linux-next, and use my > >> git

[RFC virtio-next 0/4] Introduce CAIF Virtio and reversed Vrings

2012-10-31 Thread Sjur Brændeland
This patch-set introduces the CAIF Virtio Link layer. The purpose is to communicate with a remote processor (a modem) over shared memory. Virtio is used as the transport mechanism, and the Remoteproc framework provides configuration and management of the Virtio rings and devices. The modem and Linu

[RFC virtio-next 2/4] include/vring.h: Add support for reversed vritio rings.

2012-10-31 Thread Sjur Brændeland
From: Sjur Brændeland Add last avilable index to the vring_virtqueue structure, this is done to prepare for implementation of the reversed vring. Signed-off-by: Sjur Brændeland --- drivers/virtio/vring.h |3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/virtio/vring.h b/drivers

[RFC virtio-next 3/4] virtio_ring: Call callback function even when used ring is empty

2012-10-31 Thread Sjur Brændeland
From: Sjur Brændeland Enable option to force call of callback function even if used ring is empty. This is needed for reversed vring. Add a helper function __vring_interrupt and add extra boolean argument for forcing callback when interrupt is called. The original vring_interrupt semantic and si

[RFC virtio-next 1/4] virtio: Move definitions to header file vring.h

2012-10-31 Thread Sjur Brændeland
From: Sjur Brændeland Move the vring_virtqueue structure, memory barrier and debug macros out from virtio_ring.c to the new header file vring.h. This is done in order to allow other kernel modules to access the virtio internal data-structures. Signed-off-by: Sjur Brændeland --- Tis patch trigge

[RFC virtio-next 4/4] caif_virtio: Add CAIF over virtio

2012-10-31 Thread Sjur Brændeland
From: Sjur Brændeland Add the CAIF Virtio Link layer, used for communicating with a modem over shared memory. Virtio is used as the transport mechanism. In the TX direction the virtio rings are used in the normal fashion, sending data in the available ring. But in the rx direction the the we hav

Re: [PATCH 14/16] virtio: Convert dev_printk(KERN_ to dev_(

2012-10-31 Thread Rusty Russell
Joe Perches writes: > dev_ calls take less code than dev_printk(KERN_ > and reducing object size is good. > Convert if (printk_ratelimit()) dev_printk to dev__ratelimited. > > Signed-off-by: Joe Perches Applied. Thanks, Rusty. ___ Virtualization mail