]> git.baikalelectronics.ru Git - kernel.git/commit
vhost: vhost TX zero-copy support
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 18 Jul 2011 03:48:46 +0000 (03:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Jul 2011 17:42:32 +0000 (10:42 -0700)
commit2c001603f4f3f12db28a1d8c8c17b81c7e1490f8
tree56b8bd3df85cfee8e425abe18963e5aad015e2fa
parent700120b321635d0d48c54acadb2a669b4cabe951
vhost: vhost TX zero-copy support

>From: Shirley Ma <mashirle@us.ibm.com>

This adds experimental zero copy support in vhost-net,
disabled by default. To enable, set
experimental_zcopytx module option to 1.

This patch maintains the outstanding userspace buffers in the
sequence it is delivered to vhost. The outstanding userspace buffers
will be marked as done once the lower device buffers DMA has finished.
This is monitored through last reference of kfree_skb callback. Two
buffer indices are used for this purpose.

The vhost-net device passes the userspace buffers info to lower device
skb through message control. DMA done status check and guest
notification are handled by handle_tx: in the worst case is all buffers
in the vq are in pending/done status, so we need to notify guest to
release DMA done buffers first before we get any new buffers from the
vq.

One known problem is that if the guest stops submitting
buffers, buffers might never get used until some
further action, e.g. device reset. This does not
seem to affect linux guests.

Signed-off-by: Shirley <xma@us.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/vhost/net.c
drivers/vhost/vhost.c
drivers/vhost/vhost.h