#include <stdint.h>
#include <linux/vhost.h>
#include <linux/virtio_ring.h>
#include <linux/virtio_net.h>
#include <sys/eventfd.h>
#include <sys/socket.h>
#include <linux/if.h>
#include <rte_memory.h>
#include <rte_mempool.h>
#include <rte_ether.h>
Go to the source code of this file.
Detailed Description
Interface to vhost net
Definition in file rte_virtio_net.h.
Function Documentation
static uint64_t gpa_to_vva |
( |
struct virtio_net * |
dev, |
|
|
uint64_t |
guest_pa |
|
) |
| |
|
inlinestatic |
int rte_vhost_feature_disable |
( |
uint64_t |
feature_mask | ) |
|
int rte_vhost_feature_enable |
( |
uint64_t |
feature_mask | ) |
|
Enable features in feature_mask. Returns 0 on success.
- Examples:
- vhost/main.c.
uint16_t rte_vhost_enqueue_burst |
( |
struct virtio_net * |
dev, |
|
|
uint16_t |
queue_id, |
|
|
struct rte_mbuf ** |
pkts, |
|
|
uint16_t |
count |
|
) |
| |
This function adds buffers to the virtio devices RX virtqueue. Buffers can be received from the physical port or from another virtual device. A packet count is returned to indicate the number of packets that were succesfully added to the RX queue.
- Parameters
-
dev | virtio-net device |
queue_id | virtio queue index in mq case |
pkts | array to contain packets to be enqueued |
count | packets num to be enqueued |
- Returns
- num of packets enqueued
- Examples:
- tep_termination/vxlan_setup.c, and vhost/main.c.
uint16_t rte_vhost_dequeue_burst |
( |
struct virtio_net * |
dev, |
|
|
uint16_t |
queue_id, |
|
|
struct rte_mempool * |
mbuf_pool, |
|
|
struct rte_mbuf ** |
pkts, |
|
|
uint16_t |
count |
|
) |
| |
This function gets guest buffers from the virtio device TX virtqueue, construct host mbufs, copies guest buffer content to host mbufs and store them in pkts to be processed.
- Parameters
-
dev | virtio-net device |
queue_id | virtio queue index in mq case |
mbuf_pool | mbuf_pool where host mbuf is allocated. |
pkts | array to contain packets to be dequeued |
count | packets num to be dequeued |
- Returns
- num of packets dequeued
- Examples:
- tep_termination/main.c, and vhost/main.c.