Intel® IXP400 Software

Buffer Management

Note that the M_BLK structure contains many fields that are not used by the IXP400 software. These fields are simply ignored and are not modified by the IXP400 software.

M_BLK buffers support two levels of buffer chaining:

buffer chaining — Each buffer can be chained together to form a packet. This is achieved using the IX_MBUF_NEXT_BUFFER_IN_PKT_PTR equivalent field in the M_BLK. This is supported and required by the IXP400 software.

packet chaining — Each packet can consist of a chain of one or more buffers. Packets can also be chained together (to form a chain of chains). This is not used by the IXP400 software. The IX_MBUF_NEXT_PKT_IN_CHAIN_PTR equivalent field of the M_BLK buffer structure is used for this purpose. Most IXP400 software components will ignore this field.

Note: The VxWorks netMbuf pool library functions will not be supported to allocate and free the IXP_BUF buffers.

Table 3 shows the field mapping between the IX_MBUF and the M_BLK buffer structures through OSAL macros.

Table 3. IX_MBUF to M_BLK Mapping

IX_MBUF

M_BLK

 

 

IX_OSAL_MBUF_NEXT_BUFFER_IN_PKT_PTR

mBlkHdr.mNext

 

 

IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR

mBlkHdr.mNextPkt

 

 

IX_OSAL_MBUF_MDATA

mBlkHdr.mData

 

 

IX_OSAL_MBUF_MLEN

mBlkHdr.mLen

 

 

IX_OSAL_MBUF_TYPE

mBlkHdr.mType

 

 

IX_OSAL_MBUF_FLAGS

mBlkHdr.mFlags

 

 

IX_OSAL_reserved

mBlkHdr.reserved

 

 

IX_OSAL_MBUF_NET_POOL

mBlkPktHdr.rcvif

 

 

IX_OSAL_MBUF_PKT_LEN

mBlkPktHdr.len

 

 

priv

pClBlk

 

 

3.6.2Linux* skbuff Buffer

The buffer format native to the Linux OS is the “skbuff” buffer structure, which is significantly different from the IX_MBUF buffer format used by the IXP400 software.

The Linux skbuf structure is attached to the os_buf_ptr field during transmit or receive and is detached during TxDone. The user must allocate an IXP_BUF header, make a call to a translational function and pass the IXP_BUF buffer to the IXP400 software release. The translation functions enter all the required fields from the OS buffers to respective fields in the first structure, that is, the IX_MBUF structure within the IXP_BUF structure. The translation of fields from the IX_MBUF structure into the NPE shared structure is accomplished by the OSAL component on Transmit and Receive Replenish. On TxDone the user may recycle the IXP_BUF back to the IXP_BUF_POOL or to an internal data structure.

The OSAL layer provides buffer translation macros for users to translate OS-specific buffer formats to IXP_BUF buffer format and vice versa.

Programmer’s Guide

IXP400 Software Version 2.0

April 2005

 

Document Number: 252539, Revision: 007

47

Page 47
Image 47
Intel IXP400 manual Linux* skbuff Buffer, Ixmbuf to Mblk Mapping