DPDK  16.07.2
Data Structures | Functions
rte_ivshmem.h File Reference
#include <rte_memzone.h>
#include <rte_mempool.h>

Go to the source code of this file.

Data Structures

struct  rte_ivshmem_metadata_entry
struct  rte_ivshmem_metadata

Functions

int rte_ivshmem_metadata_create (const char *name)
int rte_ivshmem_metadata_add_memzone (const struct rte_memzone *mz, const char *md_name)
int rte_ivshmem_metadata_add_ring (const struct rte_ring *r, const char *md_name)
int rte_ivshmem_metadata_add_mempool (const struct rte_mempool *mp, const char *md_name)
int rte_ivshmem_metadata_cmdline_generate (char *buffer, unsigned size, const char *name)

Dump all metadata entries from a given metadata file to the console.

Parameters
fA pointer to a file for output

Name of the metadata file to be dumped to console.

void rte_ivshmem_metadata_dump (FILE *f, const char *name)

Detailed Description

The RTE IVSHMEM interface provides functions to create metadata files describing memory segments to be shared via QEMU IVSHMEM.

Definition in file rte_ivshmem.h.

Function Documentation

int rte_ivshmem_metadata_create ( const char *  name)

Creates metadata file with a given name

Parameters
nameName of metadata file to be created
Returns
  • On success, zero
  • On failure, a negative value
Examples:
l2fwd-ivshmem/host/host.c.
int rte_ivshmem_metadata_add_memzone ( const struct rte_memzone mz,
const char *  md_name 
)

Adds memzone to a specific metadata file

Parameters
mzMemzone to be added
md_nameName of metadata file for the memzone to be added to
Returns
  • On success, zero
  • On failure, a negative value
Examples:
l2fwd-ivshmem/host/host.c.
int rte_ivshmem_metadata_add_ring ( const struct rte_ring r,
const char *  md_name 
)

Adds a ring descriptor to a specific metadata file

Parameters
rRing descriptor to be added
md_nameName of metadata file for the ring to be added to
Returns
  • On success, zero
  • On failure, a negative value
Examples:
l2fwd-ivshmem/host/host.c.
int rte_ivshmem_metadata_add_mempool ( const struct rte_mempool mp,
const char *  md_name 
)

Adds a mempool to a specific metadata file

Parameters
mpMempool to be added
md_nameName of metadata file for the mempool to be added to
Returns
  • On success, zero
  • On failure, a negative value
Examples:
l2fwd-ivshmem/host/host.c.
int rte_ivshmem_metadata_cmdline_generate ( char *  buffer,
unsigned  size,
const char *  name 
)

Generates the QEMU command-line for IVSHMEM device for a given metadata file. This function is to be called after all the objects were added.

Parameters
bufferBuffer to be filled with the command line arguments.
sizeSize of the buffer.
nameName of metadata file to generate QEMU command-line parameters for
Returns
  • On success, zero
  • On failure, a negative value
Examples:
l2fwd-ivshmem/host/host.c.