NDN-DPDK
High-Speed Named Data Networking Forwarder
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions | Variables
mbuf.c File Reference
#include "mbuf.h"

Functions

bool Mbuf_RegisterDynFields ()
 Register mbuf dynfields. More...
 
int Mbuf_AsIovec (struct rte_mbuf *m, struct iovec *iov, uint32_t offset, uint32_t length)
 Gather segments of m as iovec. More...
 
struct rte_mbuf * Mbuf_AllocRoom (struct rte_mempool *mp, struct iovec *iov, int *iovcnt, uint16_t firstHeadroom, uint16_t firstDataLen, uint16_t eachHeadroom, uint16_t eachDataLen, uint32_t pktLen)
 Allocate room within chained mbufs. More...
 
void Mbuf_RemainingIovec (struct spdk_iov_xfer ix, struct iovec *iov, int *iovcnt)
 Recover remaining iovecs after spdk_iov_xfer_* operations. More...
 

Variables

int Mbuf_Timestamp_DynFieldOffset_ = -1
 

Function Documentation

◆ Mbuf_AllocRoom()

struct rte_mbuf* Mbuf_AllocRoom ( struct rte_mempool *  mp,
struct iovec *  iov,
int *  iovcnt,
uint16_t  firstHeadroom,
uint16_t  firstDataLen,
uint16_t  eachHeadroom,
uint16_t  eachDataLen,
uint32_t  pktLen 
)

Allocate room within chained mbufs.

Parameters
mpmempool to create mbufs.
[out]iovroom iov, must be filled/zeroed by caller.
[in,out]iovcntiov capacity; room iov count.
firstHeadroomheadroom in first mbuf.
firstDataLendata length in first mbuf, defaults to maximum available.
eachHeadroomheadroom in subsequent mbuf.
eachDataLendata length in subsequent mbuf, defaults to maximum available.
pktLentotal packet length i.e. size of room.
Returns
chained mbuf, or NULL upon failure.
Postcondition
rte_errno=E2BIG if either firstHeadroom+firstDataLen or eachHeadroom+eachDataLen exceeds mp dataroom.
rte_errno=EFBIG if number of segments would exceed *iovcnt .

◆ Mbuf_AsIovec()

int Mbuf_AsIovec ( struct rte_mbuf *  m,
struct iovec *  iov,
uint32_t  offset,
uint32_t  length 
)

Gather segments of m as iovec.

Parameters
[out]iovmust have m->nb_segs room.
Returns
iov count.

◆ Mbuf_RegisterDynFields()

bool Mbuf_RegisterDynFields ( )

Register mbuf dynfields.

◆ Mbuf_RemainingIovec()

void Mbuf_RemainingIovec ( struct spdk_iov_xfer  ix,
struct iovec *  iov,
int *  iovcnt 
)

Recover remaining iovecs after spdk_iov_xfer_* operations.

Parameters
ixinitialized io_xfer instance.
[out]iovremaining iov, must have capacity as spdk_iov_xfer_init iovcnt.
[out]iovcntremaining iov count.

Variable Documentation

◆ Mbuf_Timestamp_DynFieldOffset_

int Mbuf_Timestamp_DynFieldOffset_ = -1