Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
vhost.c File Reference
#include <linux/eventfd.h>
#include <linux/vhost.h>
#include <linux/virtio_net.h>
#include <linux/mm.h>
#include <linux/mmu_context.h>
#include <linux/miscdevice.h>
#include <linux/mutex.h>
#include <linux/rcupdate.h>
#include <linux/poll.h>
#include <linux/file.h>
#include <linux/highmem.h>
#include <linux/slab.h>
#include <linux/kthread.h>
#include <linux/cgroup.h>
#include <linux/net.h>
#include <linux/if_packet.h>
#include <linux/if_arp.h>
#include "vhost.h"

Go to the source code of this file.

Data Structures

struct  vhost_attach_cgroups_struct
 

Macros

#define vhost_used_event(vq)   ((u16 __user *)&vq->avail->ring[vq->num])
 
#define vhost_avail_event(vq)   ((u16 __user *)&vq->used->ring[vq->num])
 

Enumerations

enum  { VHOST_MEMORY_MAX_NREGIONS = 64, VHOST_MEMORY_F_LOG = 0x1 }
 

Functions

void vhost_work_init (struct vhost_work *work, vhost_work_fn_t fn)
 
void vhost_poll_init (struct vhost_poll *poll, vhost_work_fn_t fn, unsigned long mask, struct vhost_dev *dev)
 
void vhost_poll_start (struct vhost_poll *poll, struct file *file)
 
void vhost_poll_stop (struct vhost_poll *poll)
 
void vhost_poll_flush (struct vhost_poll *poll)
 
void vhost_work_queue (struct vhost_dev *dev, struct vhost_work *work)
 
void vhost_poll_queue (struct vhost_poll *poll)
 
void vhost_enable_zcopy (int vq)
 
long vhost_dev_init (struct vhost_dev *dev, struct vhost_virtqueue *vqs, int nvqs)
 
long vhost_dev_check_owner (struct vhost_dev *dev)
 
long vhost_dev_reset_owner (struct vhost_dev *dev)
 
int vhost_zerocopy_signal_used (struct vhost_virtqueue *vq)
 
void vhost_dev_cleanup (struct vhost_dev *dev, bool locked)
 
int vhost_log_access_ok (struct vhost_dev *dev)
 
int vhost_vq_access_ok (struct vhost_virtqueue *vq)
 
long vhost_dev_ioctl (struct vhost_dev *d, unsigned int ioctl, unsigned long arg)
 
int vhost_log_write (struct vhost_virtqueue *vq, struct vhost_log *log, unsigned int log_num, u64 len)
 
int vhost_init_used (struct vhost_virtqueue *vq)
 
int vhost_get_vq_desc (struct vhost_dev *dev, struct vhost_virtqueue *vq, struct iovec iov[], unsigned int iov_size, unsigned int *out_num, unsigned int *in_num, struct vhost_log *log, unsigned int *log_num)
 
void vhost_discard_vq_desc (struct vhost_virtqueue *vq, int n)
 
int vhost_add_used (struct vhost_virtqueue *vq, unsigned int head, int len)
 
int vhost_add_used_n (struct vhost_virtqueue *vq, struct vring_used_elem *heads, unsigned count)
 
void vhost_signal (struct vhost_dev *dev, struct vhost_virtqueue *vq)
 
void vhost_add_used_and_signal (struct vhost_dev *dev, struct vhost_virtqueue *vq, unsigned int head, int len)
 
void vhost_add_used_and_signal_n (struct vhost_dev *dev, struct vhost_virtqueue *vq, struct vring_used_elem *heads, unsigned count)
 
bool vhost_enable_notify (struct vhost_dev *dev, struct vhost_virtqueue *vq)
 
void vhost_disable_notify (struct vhost_dev *dev, struct vhost_virtqueue *vq)
 
struct vhost_ubuf_refvhost_ubuf_alloc (struct vhost_virtqueue *vq, bool zcopy)
 
void vhost_ubuf_put (struct vhost_ubuf_ref *ubufs)
 
void vhost_ubuf_put_and_wait (struct vhost_ubuf_ref *ubufs)
 
void vhost_zerocopy_callback (struct ubuf_info *ubuf)
 

Macro Definition Documentation

#define vhost_avail_event (   vq)    ((u16 __user *)&vq->used->ring[vq->num])

Definition at line 43 of file vhost.c.

#define vhost_used_event (   vq)    ((u16 __user *)&vq->avail->ring[vq->num])

Definition at line 42 of file vhost.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
VHOST_MEMORY_MAX_NREGIONS 
VHOST_MEMORY_F_LOG 

Definition at line 35 of file vhost.c.

Function Documentation

int vhost_add_used ( struct vhost_virtqueue vq,
unsigned int  head,
int  len 
)

Definition at line 1338 of file vhost.c.

void vhost_add_used_and_signal ( struct vhost_dev dev,
struct vhost_virtqueue vq,
unsigned int  head,
int  len 
)

Definition at line 1498 of file vhost.c.

void vhost_add_used_and_signal_n ( struct vhost_dev dev,
struct vhost_virtqueue vq,
struct vring_used_elem heads,
unsigned  count 
)

Definition at line 1507 of file vhost.c.

int vhost_add_used_n ( struct vhost_virtqueue vq,
struct vring_used_elem heads,
unsigned  count 
)

Definition at line 1420 of file vhost.c.

long vhost_dev_check_owner ( struct vhost_dev dev)

Definition at line 326 of file vhost.c.

void vhost_dev_cleanup ( struct vhost_dev dev,
bool  locked 
)

Definition at line 442 of file vhost.c.

long vhost_dev_init ( struct vhost_dev dev,
struct vhost_virtqueue vqs,
int  nvqs 
)

Definition at line 293 of file vhost.c.

long vhost_dev_ioctl ( struct vhost_dev d,
unsigned int  ioctl,
unsigned long  arg 
)

Definition at line 832 of file vhost.c.

long vhost_dev_reset_owner ( struct vhost_dev dev)

Definition at line 401 of file vhost.c.

void vhost_disable_notify ( struct vhost_dev dev,
struct vhost_virtqueue vq 
)

Definition at line 1553 of file vhost.c.

void vhost_discard_vq_desc ( struct vhost_virtqueue vq,
int  n 
)

Definition at line 1331 of file vhost.c.

bool vhost_enable_notify ( struct vhost_dev dev,
struct vhost_virtqueue vq 
)

Definition at line 1516 of file vhost.c.

void vhost_enable_zcopy ( int  vq)

Definition at line 249 of file vhost.c.

int vhost_get_vq_desc ( struct vhost_dev dev,
struct vhost_virtqueue vq,
struct iovec  iov[],
unsigned int  iov_size,
unsigned int out_num,
unsigned int in_num,
struct vhost_log log,
unsigned int log_num 
)

Definition at line 1208 of file vhost.c.

int vhost_init_used ( struct vhost_virtqueue vq)

Definition at line 1041 of file vhost.c.

int vhost_log_access_ok ( struct vhost_dev dev)

Definition at line 568 of file vhost.c.

int vhost_log_write ( struct vhost_virtqueue vq,
struct vhost_log log,
unsigned int  log_num,
u64  len 
)

Definition at line 979 of file vhost.c.

void vhost_poll_flush ( struct vhost_poll poll)

Definition at line 135 of file vhost.c.

void vhost_poll_init ( struct vhost_poll poll,
vhost_work_fn_t  fn,
unsigned long  mask,
struct vhost_dev dev 
)

Definition at line 77 of file vhost.c.

void vhost_poll_queue ( struct vhost_poll poll)

Definition at line 153 of file vhost.c.

void vhost_poll_start ( struct vhost_poll poll,
struct file file 
)

Definition at line 90 of file vhost.c.

void vhost_poll_stop ( struct vhost_poll poll)

Definition at line 101 of file vhost.c.

void vhost_signal ( struct vhost_dev dev,
struct vhost_virtqueue vq 
)

Definition at line 1490 of file vhost.c.

struct vhost_ubuf_ref* vhost_ubuf_alloc ( struct vhost_virtqueue vq,
bool  zcopy 
)
read

Definition at line 1575 of file vhost.c.

void vhost_ubuf_put ( struct vhost_ubuf_ref ubufs)

Definition at line 1591 of file vhost.c.

void vhost_ubuf_put_and_wait ( struct vhost_ubuf_ref ubufs)

Definition at line 1596 of file vhost.c.

int vhost_vq_access_ok ( struct vhost_virtqueue vq)

Definition at line 596 of file vhost.c.

void vhost_work_init ( struct vhost_work work,
vhost_work_fn_t  fn 
)

Definition at line 67 of file vhost.c.

void vhost_work_queue ( struct vhost_dev dev,
struct vhost_work work 
)

Definition at line 140 of file vhost.c.

void vhost_zerocopy_callback ( struct ubuf_info ubuf)

Definition at line 1603 of file vhost.c.

int vhost_zerocopy_signal_used ( struct vhost_virtqueue vq)

Definition at line 422 of file vhost.c.