Intel IXP400 Frozen Dessert Maker User Manual


 
Intel
®
IXP400 Software
Buffer Management
April 2005 IXP400 Software Version 2.0 Programmer’s Guide
46 Document Number: 252539, Revision: 007
3.6 Mapping 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.1 VxWorks* 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”.
IX_OSAL_MBUF_FLAGS
Parameter type: IX_MBUF *
Return type: unsigned char
Description: Returns the flags field of the
buffer
Buffer flags. Yes, by some components.
Reserved
Reserved field, used to preserve 32-
bit word alignment.
No.
IX_OSAL_MBUF_NET_POOL
Parameter type: IX_MBUF *
Return type: unsigned int
Description: Returns a 32-bit pointer to the
parent pool of the buffer
32-bit pointer to the parent pool of
the buffer
Yes, by some components.
IX_OSAL_MBUF_PKT_LEN
Parameter type: IX_MBUF *
Return type: unsigned int
Description: Returns the length of the packet
(typically stored in the first buffer of the
packet only)
Total length (octets) of the data
sections of all buffers in a chain of
buffers (packet). Typically set only in
the first buffer in the chain (packet).
Yes, where buffer chaining is
supported.
Reserved Used by VxWorks* No.
Table 2. IX_MBUF Field Details (Sheet 2 of 2)
Field / MACRO Purpose Used by Access-Layer?