Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

IxOsBuffPoolMgt.h File Reference

This file contains the mbuf pool implementation API. More...

Go to the source code of this file.

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_POOLixOsBuffPoolAllocate (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.


Detailed Description

This file contains the mbuf pool implementation API.

Date:
9 Oct 2002

Version:
Revision
1.17
-- Intel Copyright Notice --
Copyright 2002-2003 Intel Corporation All Rights Reserved.
The source code contained or described herein and all documents related to the source code ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the Material remains with Intel Corporation or its suppliers and licensors.
The Material is protected by worldwide copyright and trade secret laws and treaty provisions. No part of the Material may be used, copied, reproduced, modified, published, uploaded, posted, transmitted, distributed, or disclosed in any way except in accordance with the applicable license agreement .
No license under any patent, copyright, trade secret or other intellectual property right is granted to or conferred upon you by disclosure or delivery of the Materials, either expressly, by implication, inducement, estoppel, except in accordance with the applicable license agreement.
Unless otherwise agreed by Intel in writing, you may not remove or alter this notice or any other notice embedded in Materials by Intel or Intel's suppliers or licensors in any way.
For further details, please see the file README.TXT distributed with this software.
-- End Intel Copyright Notice --
This module contains the implementation of the OS Services buffer pool management service. This module provides routines for creating pools of buffers for exchange of network data, getting and returning buffers from and to the pool, and some other utility functions.

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.

See also:
IxOsBuffMgt.h

Definition in file IxOsBuffPoolMgt.h.


Define Documentation

#define IX_MBUF_POOL_FREE_COUNT poolPtr   ) 
 

Returns the number of free buffers currently in the specified pool.

Parameters:
IX_MBUF_POOL * [in] poolPtr - a pointer to the pool to query
Returns:
int - the number of free buffers in the pool

Definition at line 214 of file IxOsBuffPoolMgt.h.

Automatically generated from sources. © Intel Corp. 2003