Skip to content

Commit f87d0fb

Browse files
committed
vringh: host-side implementation of virtio rings.
Getting use of virtio rings correct is tricky, and a recent patch saw an implementation of in-kernel rings (as separate from userspace). This abstracts the business of dealing with the virtio ring layout from the access (userspace or direct); to do this, we use function pointers, which gcc inlines correctly. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 61d0b5a commit f87d0fb

6 files changed

Lines changed: 1215 additions & 1 deletion

File tree

‎drivers/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ obj-$(CONFIG_PPC_PS3) += ps3/
123123
obj-$(CONFIG_OF) += of/
124124
obj-$(CONFIG_SSB) += ssb/
125125
obj-$(CONFIG_BCMA) += bcma/
126-
obj-$(CONFIG_VHOST_NET) += vhost/
126+
obj-$(CONFIG_VHOST_RING) += vhost/
127127
obj-$(CONFIG_VLYNQ) += vlynq/
128128
obj-$(CONFIG_STAGING) += staging/
129129
obj-y += platform/

‎drivers/vhost/Kconfig‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config VHOST_NET
22
tristate "Host kernel accelerator for virtio net"
33
depends on NET && EVENTFD && (TUN || !TUN) && (MACVTAP || !MACVTAP)
4+
select VHOST_RING
45
---help---
56
This kernel module can be loaded in host kernel to accelerate
67
guest networking with virtio_net. Not to be confused with virtio_net
@@ -12,3 +13,10 @@ config VHOST_NET
1213
if STAGING
1314
source "drivers/vhost/Kconfig.tcm"
1415
endif
16+
17+
config VHOST_RING
18+
tristate
19+
---help---
20+
This option is selected by any driver which needs to access
21+
the host side of a virtio ring.
22+

‎drivers/vhost/Kconfig.tcm‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config TCM_VHOST
22
tristate "TCM_VHOST fabric module"
33
depends on TARGET_CORE && EVENTFD && m
4+
select VHOST_RING
45
default n
56
---help---
67
Say M here to enable the TCM_VHOST fabric module for use with virtio-scsi guests

‎drivers/vhost/Makefile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ obj-$(CONFIG_VHOST_NET) += vhost_net.o
22
vhost_net-y := vhost.o net.o
33

44
obj-$(CONFIG_TCM_VHOST) += tcm_vhost.o
5+
6+
obj-$(CONFIG_VHOST_RING) += vringh.o

0 commit comments

Comments
 (0)