android_kernel_motorola_sm6225/arch/ia64
Michael S. Tsirkin 3a4d5c94e9 vhost_net: a kernel-level virtio server
What it is: vhost net is a character device that can be used to reduce
the number of system calls involved in virtio networking.
Existing virtio net code is used in the guest without modification.

There's similarity with vringfd, with some differences and reduced scope
- uses eventfd for signalling
- structures can be moved around in memory at any time (good for
  migration, bug work-arounds in userspace)
- write logging is supported (good for migration)
- support memory table and not just an offset (needed for kvm)

common virtio related code has been put in a separate file vhost.c and
can be made into a separate module if/when more backends appear.  I used
Rusty's lguest.c as the source for developing this part : this supplied
me with witty comments I wouldn't be able to write myself.

What it is not: vhost net is not a bus, and not a generic new system
call. No assumptions are made on how guest performs hypercalls.
Userspace hypervisors are supported as well as kvm.

How it works: Basically, we connect virtio frontend (configured by
userspace) to a backend. The backend could be a network device, or a tap
device.  Backend is also configured by userspace, including vlan/mac
etc.

Status: This works for me, and I haven't see any crashes.
Compared to userspace, people reported improved latency (as I save up to
4 system calls per packet), as well as better bandwidth and CPU
utilization.

Features that I plan to look at in the future:
- mergeable buffers
- zero copy
- scalability tuning: figure out the best threading model to use

Note on RCU usage (this is also documented in vhost.h, near
private_pointer which is the value protected by this variant of RCU):
what is happening is that the rcu_dereference() is being used in a
workqueue item.  The role of rcu_read_lock() is taken on by the start of
execution of the workqueue item, of rcu_read_unlock() by the end of
execution of the workqueue item, and of synchronize_rcu() by
flush_workqueue()/flush_work(). In the future we might need to apply
some gcc attribute or sparse annotation to the function passed to
INIT_WORK(). Paul's ack below is for this RCU usage.

(Includes fixes by Alan Cox <alan@linux.intel.com>,
David L Stevens <dlstevens@us.ibm.com>,
Chris Wright <chrisw@redhat.com>)

Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-15 01:43:29 -08:00
..
configs sgi-gru: remove SGI_GRU as a valid config option for ia64 configs with SGI_UV 2009-04-02 19:05:07 -07:00
dig x86, ia64: convert to use generic dma_map_ops struct 2009-01-06 14:06:57 +01:00
hp [IA64] fix SBA IOMMU to handle allocation failure properly 2009-12-14 16:38:43 -08:00
ia32 elf: kill USE_ELF_CORE_DUMP 2009-12-16 07:20:12 -08:00
include/asm Merge branch 'for-33' of git://repo.or.cz/linux-kbuild 2009-12-17 07:23:42 -08:00
kernel Merge branch 'for-33' of git://repo.or.cz/linux-kbuild 2009-12-17 07:23:42 -08:00
kvm vhost_net: a kernel-level virtio server 2010-01-15 01:43:29 -08:00
lib [IA64] fix csum_ipv6_magic() 2009-09-02 09:14:48 -07:00
mm Merge git://git.infradead.org/iommu-2.6 2009-12-16 10:11:38 -08:00
oprofile [IA64] implement ticket locks for Itanium 2009-09-25 08:42:16 -07:00
pci vsprintf: use %pR, %pr instead of %pRt, %pRf 2009-11-04 13:06:41 -08:00
scripts ia64/pv_ops/pvchecker: support mov = ar.itc paravirtualization 2009-03-26 10:50:09 -07:00
sn ia64: use bitmap_find_next_zero_area 2009-12-16 07:20:21 -08:00
uv [IA64] Simplify SGI uv vs. sn2 driver issues 2008-11-04 11:29:39 -08:00
xen percpu: make percpu symbols in xen unique 2009-10-29 22:34:13 +09:00
install.sh kbuild: use INSTALLKERNEL to select customized installkernel script 2009-09-20 12:18:14 +02:00
Kconfig ia64: convert to dynamic percpu allocator 2009-10-02 13:28:56 +09:00
Kconfig.debug [PATCH] Move Kprobes and Oprofile to "Instrumentation Support" menu 2005-11-07 07:53:35 -08:00
Makefile ia64: move nr-irqs.h to include/generated 2009-12-12 13:08:14 +01:00
module.lds Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00