|
Data Structures |
struct | IxMbufPool |
| Implementation of buffer pool structure for use with non-VxWorks OS. More...
|
Defines |
#define | IX_MBUF_POOL_SIZE_ALIGN(size) |
| This macro takes an integer as an argument and rounds it up to be a multiple of the memory cache-line size.
|
#define | IX_MBUF_POOL_MBUF_AREA_SIZE_ALIGNED(count) |
| This macro calculates, from the number of mbufs required, the size of the memory area required to contain the mbuf headers for the buffers in the pool. The size to be used for each mbuf header is rounded up to a multiple of the cache-line size, to ensure each mbuf header aligns on a cache-line boundary. This macro is used by IX_MBUF_POOL_MBUF_AREA_ALLOC().
|
#define | IX_MBUF_POOL_DATA_AREA_SIZE_ALIGNED(count, size) |
| This macro calculates, from the number of mbufs required and the size of the data portion for each mbuf, the size of the data memory area required. The size is adjusted to ensure alignment on cache line boundaries. This macro is used by IX_MBUF_POOL_DATA_AREA_ALLOC().
|
#define | IX_MBUF_POOL_MBUF_AREA_ALLOC(count, memAreaSize) |
| Allocates the memory area needed for the number of mbuf headers specified by count. This macro ensures the mbuf headers align on cache line boundaries. This macro evaluates to a pointer to the memory allocated.
|
#define | IX_MBUF_POOL_DATA_AREA_ALLOC(count, size, memAreaSize) |
| Allocates the memory pool for the data portion of the pool mbufs. The number of mbufs is specified by count. The size of the data portion of each mbuf is specified by size. This macro ensures the mbufs are aligned on cache line boundaries This macro evaluates to a pointer to the memory allocated.
|
#define | IX_MBUF_POOL_FREE_COUNT(poolPtr) |
| Returns the number of free buffers currently in the specified pool.
|
#define | IX_MBUF_POOL_FREE_COUNT(poolPtr) |
| Returns the number of free buffers currently in the specified pool.
|
#define | IX_MBUF_MAX_POOLS |
| The maximum number of pools that can be allocated.
|
#define | IX_MBUF_POOL_NAME_LEN |
| The maximum string length of the pool name.
|
#define | IX_MBUF_POOL_INIT(poolPtrPtr, count, size, name) |
| Wrapper macro for ixOsBuffPoolInit() See function description below for details.
|
#define | IX_MBUF_POOL_INIT_NO_ALLOC(poolPtrPtr, bufPtr, dataPtr, count, size, name) |
| Wrapper macro for ixOsBuffPoolInitNoAlloc() See function description below for details.
|
#define | IX_MBUF_POOL_GET(poolPtr, bufPtrPtr) |
| Wrapper macro for ixOsBuffPoolUnchainedBufGet() See function description below for details.
|
#define | IX_MBUF_POOL_PUT(bufPtr) |
| Wrapper macro for ixOsBuffPoolBufFree() See function description below for details.
|
#define | IX_MBUF_POOL_PUT_CHAIN(bufPtr) |
| Wrapper macro for ixOsBuffPoolBufChainFree() See function description below for details.
|
#define | IX_MBUF_POOL_SHOW(poolPtr) |
| Wrapper macro for ixOsBuffPoolShow() See function description below for details.
|
#define | IX_MBUF_POOL_MDATA_RESET(bufPtr) |
| Wrapper macro for ixOsBuffPoolBufDataPtrReset() See function description below for details.
|
Typedefs |
typedef IxMbufPool | IX_MBUF_POOL |
| The buffer pool structure, mapped to appropraite OS-specific implementation.
|
Enumerations |
enum | IxMbufPoolAllocationType {
IX_MBUF_POOL_TYPE_SYS_ALLOC,
IX_MBUF_POOL_TYPE_USER_ALLOC
} |
| Used to indicate how the pool memory was allocated. More...
|
Functions |
IX_STATUS | ixOsBuffPoolInit (IX_MBUF_POOL **poolPtrPtr, int count, int size, char *name) |
| This function creates a new buffer pool.
|
IX_MBUF_POOL * | ixOsBuffPoolAllocate (void) |
| This function allocates buffers from the available pool.
|
UINT32 | ixOsBuffPoolDataAreaSizeGet (int count, int size) |
| This function calcultes the size of data memory required to create a new buffer pool.
|
IX_MBUF * | ixOsBuffPoolMbufInit (int mbufSizeAligned, int dataSizeAligned, IX_MBUF_POOL *poolPtr) |
| Allocate memory for mbuf and data and initialise mbuf header fields.
|
UINT32 | ixOsBuffPoolMbufAreaSizeGet (int count) |
| This function calcultes the size of mbuf memory required to create a new buffer pool.
|
IX_STATUS | ixOsBuffPoolInitNoAlloc (IX_MBUF_POOL **poolPtrPtr, void *poolBufPtr, void *poolDataPtr, int count, int size, char *name) |
| This function creates a new buffer pool, with user-allocated memory.
|
IX_STATUS | ixOsBuffPoolUnchainedBufGet (IX_MBUF_POOL *poolPtr, IX_MBUF **newBufPtrPtr) |
| This function gets a buffer from the buffer pool.
|
IX_MBUF * | ixOsBuffPoolBufFree (IX_MBUF *bufPtr) |
| This function returns a buffer to the buffer pool.
|
void | ixOsBuffPoolBufChainFree (IX_MBUF *bufPtr) |
| This function returns a buffer chain to the buffer pool.
|
IX_STATUS | ixOsBuffPoolShow (IX_MBUF_POOL *poolPtr) |
| This function prints pool statistics.
|
IX_STATUS | ixOsBuffPoolBufDataPtrReset (IX_MBUF *bufPtr) |
| This function resets the data pointer of a buffer.
|
IX_STATUS | ixOsBuffPoolUninit (IX_MBUF_POOL *pool) |
| Unitialize buffer pool.
|
Currently, the pool has 2 underlying implementations - one for the vxWorks OS, and another which attempts to be OS-agnostic so that it can be used on other OS's such as Linux. The API is largely the same for all OS's, but there are some differences to be aware of. These are documented in the API descriptions below.
The most significant difference is this: when this module is used with the WindRiver VxWorks OS, it will create a pool of vxWorks "MBufs". These can be used directly with the vxWorks "netBufLib" OS Library. For other OS's, it will create a pool of generic buffers. These may need to be converted into other buffer types (sk_buff's in Linux, for example) before being used with any built-in OS routines available for manipulating network data buffers.