DPDK  2.0.0
Data Structures | Functions
rte_virtio_net.h File Reference
#include <stdint.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_mbuf.h>

Data Structures

struct  buf_vector
struct  vhost_virtqueue
struct  virtio_net
struct  virtio_memory_regions
struct  virtio_memory
struct  virtio_net_device_ops

Functions

static uint64_t gpa_to_vva (struct virtio_net *dev, uint64_t guest_pa)
int rte_vhost_feature_disable (uint64_t feature_mask)
int rte_vhost_feature_enable (uint64_t feature_mask)
uint16_t rte_vhost_enqueue_burst (struct virtio_net *dev, uint16_t queue_id, struct rte_mbuf **pkts, uint16_t count)
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)

Detailed Description

Interface to vhost net

Function Documentation

static uint64_t gpa_to_vva ( struct virtio_net dev,
uint64_t  guest_pa 
)
inlinestatic

Function to convert guest physical addresses to vhost virtual addresses. This is used to convert guest virtio buffer addresses.

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
mbuf_poolmbuf_pool where host mbuf is allocated.
queue_idvirtio queue index in mq case.
Returns
num of packets dequeued
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
queue_idvirtio queue index in mq case
Returns
num of packets enqueued
int rte_vhost_feature_disable ( uint64_t  feature_mask)

Disable features in feature_mask. Returns 0 on success.

int rte_vhost_feature_enable ( uint64_t  feature_mask)

Enable features in feature_mask. Returns 0 on success.