Intel® IXP400 Software

Buffer Management

Table 2. IX_MBUF Field Details (Sheet 2 of 2)

Field / MACRO

Purpose

Used by Access-Layer?

 

 

 

IX_OSAL_MBUF_FLAGS

 

 

Parameter type: IX_MBUF *

Buffer flags.

Yes, by some components.

Return type: unsigned char

Description: Returns the flags field of the

 

 

buffer

 

 

 

 

 

Reserved

Reserved field, used to preserve 32-

No.

bit word alignment.

 

 

 

 

 

IX_OSAL_MBUF_NET_POOL

 

 

Parameter type: IX_MBUF *

32-bit pointer to the parent pool of

Yes, by some components.

Return type: unsigned int

the buffer

Description: Returns a 32-bit pointer to the

 

 

 

parent pool of the buffer

 

 

 

 

 

IX_OSAL_MBUF_PKT_LEN

 

 

Parameter type: IX_MBUF *

Total length (octets) of the data

Yes, where buffer chaining is

Return type: unsigned int

sections of all buffers in a chain of

Description: Returns the length of the packet

buffers (packet). Typically set only in

supported.

the first buffer in the chain (packet).

 

(typically stored in the first buffer of the

 

 

 

packet only)

 

 

 

 

 

Reserved

Used by VxWorks*

No.

 

 

 

3.6Mapping to OS Native Buffer Types

OSAL provides buffer-translation macros for users to translate OS-specific buffer formats to OSAL IXP buffer format and vice versa. The mapping of OS buffer fields to the IXP400 software buffer format is usually done in the OS specific driver component. However, for ease of users the OSAL component provides generic macros for VxWorks, and Linux operating system that does the translation. Depending upon the build, the OSAL component will translate the macros to its OS- specific implementation. The general syntax for using these macros is as follows:

IX_OSAL_CONVERT_OSBUF_TO_IXPBUF(osBufPtr,ixpBufPtr)

IX_OSAL_CONVERT_IXPBUF_TO_OS_BUF(ixpBufPtr,osBufPtr)

These macros are intended to replace Linux skbuf and VxWorks mbuf conversions. Users can also define their own conversion utilities in their package to translate their buffers to IXP buffers (IX_OSAL_MBUF).

3.6.1VxWorks* M_BLK Buffer

The first structure IX_MBUF of the IXP_BUF buffer format is compatible with VxWorks M_BLK structure. It is also intended to provide a backward compatibility to previous Intel® IXP400 Software release. For this reason, when compiled for VxWorks, the IX_MBUF buffer format is compatible directly as an M_BLK buffer. The Intel® IXP400 Software does not make use of all the fields defined by the M_BLK buffer. The macros listed in Table 3 are used by the IXP400 software to access the correct fields within the M_BLK structure.

The M_BLK structure is defined in the global VxWorks header file “netBufLib.h”.

April 2005

IXP400 Software Version 2.0

Programmer’s Guide

46

Document Number: 252539, Revision: 007

 

Page 46
Image 46
Intel IXP400 manual Mapping to OS Native Buffer Types, VxWorks* Mblk Buffer, Ixmbuf Field Details Sheet 2