Functions
Packet Library Functions
Packet Library

Functions

static Pktlib_InfoPktlib_getPktLibInfo (Ti_Pkt *pPkt)
static uint8_t Pktlib_getPktLibHeapIndex (Pktlib_Info *ptrPktLibInfo)
static void Pktlib_setPktLibHeapIndex (Pktlib_Info *ptrPktLibInfo, uint8_t heapIndex)
static uint8_t Pktlib_getPktLibFlags (Pktlib_Info *ptrPktLibInfo)
static void Pktlib_setPktLibFlags (Pktlib_Info *ptrPktLibInfo, uint8_t flags)
static uint8_t Pktlib_getCount (Pktlib_Info *ptrPktLibInfo)
static void Pktlib_setRefCount (Pktlib_Info *ptrPktLibInfo, uint8_t refCount)
Pktlib_HeapHandle Pktlib_getPktHeap (Ti_Pkt *pPkt)
static void Pktlib_incRefCount (Ti_Pkt *pPkt)
static void Pktlib_decRefCount (Ti_Pkt *pPkt)
static uint8_t Pktlib_getRefCount (Ti_Pkt *pPkt)
static uint8_t Pktlib_isDataBufferPkt (Ti_Pkt *pPkt)
static void Pktlib_cppiSetReturnQueue (Cppi_DescType descType, Cppi_Desc *descAddr, Qmss_Queue *queue)
static void Pktlib_setReturnQueueToGarbage (Ti_Pkt *pPkt)
static void Pktlib_getQueueStarvationCount (Pktlib_Heap *ptrPktHeap, uint8_t *dataBufferCount, uint8_t *zeroDataBufferCount)
static int32_t Pktlib_allocateStarvationQueue (Qmss_QueueHnd *pBaseStarvationQueue)
static int32_t Pktlib_getDescSize (Qmss_MemRegion memRegion)
int32_t Pktlib_sharedHeapInit (void)
Pktlib_HeapHandle Pktlib_createHeap (Pktlib_HeapCfg *ptrHeapCfg, int32_t *errCode)
static int32_t Pktlib_cmpDataBufferSize (Pktlib_HeapHandle a, Pktlib_HeapHandle b)
static void Pktlib_sortOnDataBufferSize (Pktlib_HeapHandle memberHeaps[], uint32_t len)
Pktlib_HeapHandle Pktlib_createSuperHeap (const char *name, Pktlib_HeapHandle memberHeaps[], int32_t numMemberHeaps, int32_t *errCode)
void Pktlib_invalidatePkt (Ti_Pkt *pPkt)
void Pktlib_writebackPkt (Ti_Pkt *pPkt)
Pktlib_HeapHandle Pktlib_findHeapByName (const char *name)
void Pktlib_getHeapStats (Pktlib_HeapHandle heapHandle, Pktlib_HeapStats *ptrHeapStats)
static void __Pktlib_freePacket (Ti_Pkt *pPkt, uint8_t followLinks)
void Pktlib_garbageCollection (Pktlib_HeapHandle heapHandle)
void Pktlib_freePacket (Ti_Pkt *pPkt)
uint32_t Pktlib_getMaxBufferSize (Pktlib_HeapHandle heapHandle)
static Ti_PktPktlib_superHeapAllocPacket (Pktlib_Heap *ptrSuperHeap, uint32_t size)
Ti_PktPktlib_allocPacket (Pktlib_HeapHandle heapHandle, uint32_t size)
Ti_PktPktlib_packetMerge (Ti_Pkt *pPkt1, Ti_Pkt *pPkt2, Ti_Pkt *pLastPkt)
int32_t Pktlib_clonePacket (Ti_Pkt *ptrPktOrig, Ti_Pkt *ptrClonePacket)
int32_t Pktlib_splitPacket (Ti_Pkt *pOrgPkt, Ti_Pkt *pNewPkt, uint32_t splitPacketSize, Ti_Pkt **pPkt1, Ti_Pkt **pPkt2)
int32_t Pktlib_splitPacket2 (Ti_Pkt *pOrgPkt, Ti_Pkt *pNewPkt, uint32_t splitPacketSize, Ti_Pkt **pPkt1, Ti_Pkt **pPkt2)
Qmss_QueueHnd Pktlib_getInternalHeapQueue (Pktlib_HeapHandle heapHandle)
Qmss_QueueHnd Pktlib_getZeroHeapQueue (Pktlib_HeapHandle heapHandle)
uint32_t Pktlib_getVersion (void)
int32_t Pktlib_deleteHeap (Pktlib_HeapHandle heapHandle, int32_t *errCode)
static Cppi_HostDesc * Pktlib_getDescFromPacket (Ti_Pkt *ptrPkt)
static Ti_PktPktlib_getPacketFromDesc (Cppi_HostDesc *ptrHostDesc)
static uint8_t Pktlib_packetBufferCount (Ti_Pkt *ptrPkt)
static void Pktlib_getDataBuffer (Ti_Pkt *ptrPkt, uint8_t **ptrDataBuffer, uint32_t *dataLen)
static uint32_t Pktlib_getDataBufferLen (Ti_Pkt *ptrPkt)
static uint32_t Pktlib_getPacketLen (Ti_Pkt *ptrPkt)
static Ti_PktPktlib_getNextPacket (Ti_Pkt *ptrPkt)
static void Pktlib_setDataBufferLen (Ti_Pkt *ptrPkt, uint32_t dataLen)
static void Pktlib_setPacketLen (Ti_Pkt *ptrPkt, uint32_t packetLen)
static int32_t Pktlib_setDataOffset (Ti_Pkt *ptrPkt, int32_t offset)
static void Pktlib_setTags (Ti_Pkt *ptrPkt, Cppi_DescTag *tag)

Function Documentation

static void __Pktlib_freePacket ( Ti_Pkt pPkt,
uint8_t  followLinks 
) [static]

Description
The function is used to cleanup a packet.

Parameters:
[in]pPktPointer to the packet.
[in]followLinksFlag which indicates if the links in the packet need to be followed.
Return values:
Notapplicable
static int32_t Pktlib_allocateStarvationQueue ( Qmss_QueueHnd *  pBaseStarvationQueue) [static]

Description
This function is used to allocate a starvation queue. The starvation counters in the Navigator infrastructure are a clear on read and also there is no byte access to this register so a read for a queue would imply that all 4 queues in that register bank will have there counters reset. This function thus ensures that all allocations fit in the same register and the rest of the queues are marked as reserved.

Parameters:
[out]baseStarvationQueuePointer to the block of starvation queues allocated.
Return values:
Success- 0
Error- <0
Ti_Pkt* Pktlib_allocPacket ( Pktlib_HeapHandle  heapHandle,
uint32_t  size 
)

Description
The function is used to allocate a packet of the specified size from the heap. If the size passed is 0; the function allocates a packet with no buffer i.e. bufferless packet. If the size passed is greater than the size of the data packet in the heap then the allocation will fail.

Parameters:
[in]heapHandleHandle of the heap from where the packet is to be allocated.
[in]sizeSize of the packet which is to be allocated.
Return values:
Success- Pointer to the packet
Error- NULL
int32_t Pktlib_clonePacket ( Ti_Pkt ptrPktOrig,
Ti_Pkt ptrClonePacket 
)

Description
The function is used to clone a packet.

Parameters:
[in]ptrPktOrigOrignal Packet which is to be cloned.
[in]ptrClonePacketThe pointer to the cloned packet which is a list of packets with zero buffers. There should be the same number of buffers as the orignal packet.
Return values:
0- Success
-1- Error
static int32_t Pktlib_cmpDataBufferSize ( Pktlib_HeapHandle  a,
Pktlib_HeapHandle  b 
) [static]

Description
Internal function which compares the data buffer sizes of the 2 heaps

Parameters:
[in]aHandle to the Heap1 to be compared
[in]bHandle to the Heap1 to be compared
Return values:
0- Data Buffer Sizes are the same
1- Data Buffer size of Heap 'a' is greater than Data Buffer size of Heap 'b'
<0- Data Buffer size of Heap 'a' is less than Data Buffer size of Heap 'b'
static void Pktlib_cppiSetReturnQueue ( Cppi_DescType  descType,
Cppi_Desc *  descAddr,
Qmss_Queue *  queue 
) [inline, static]

Description
Internal Utility function which modifies the return queue information in the descriptor to the specified queue. This is just a replacement function and will be replaced once we get an optimal CPPI API

Parameters:
[in]descTypeType of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC
[in]descAddrMemory address of descriptor.
[in]queueQueue Manager - 0 or 1. Queue Number - 0 to 4094 with in queue manager 0 or 1.
Return values:
Notapplicable
Pktlib_HeapHandle Pktlib_createHeap ( Pktlib_HeapCfg ptrHeapCfg,
int32_t *  errCode 
)

Description
The function is used to create a heap. There can exist multiple heaps in the system. Each heap has a specific set of properties and can be used by applications to have buffers & descriptors residing in different memory regions with different properties etc.

Parameters:
[in]ptrHeapCfgHeap Configuration using which the heap is to be created
[out]errCodeError code populated if there was an error.
See also:
Pktlib Error Codes
Return values:
Success- Heap Handle
Error- NULL (refer to the error code for more details)
Pktlib_HeapHandle Pktlib_createSuperHeap ( const char *  name,
Pktlib_HeapHandle  memberHeaps[],
int32_t  numMemberHeaps,
int32_t *  errCode 
)

Description
The function is used to create a super heap. The super heap is a collection of multiple heaps of different data buffer sizes. When an application tries to allocate memory using a super heap the 'best' size heap is used to fit the allocationrequest. This allows applications to optimize the memory usage.

Parameters:
[in]nameName of the super heap
[in]memberHeapsArray of heaps which will be managed by the super heaps.
[in]numMemberHeapsNumber of member heaps which need to be monitored by the Super Heap.
[out]errCodeError code populated if there was an error else 0
See also:
Pktlib Error Codes
Return values:
Success- Super Heap Handle
Error- NULL
static void Pktlib_decRefCount ( Ti_Pkt pPkt) [inline, static]

Description
Internal Utility function which is used to decrement the reference counter for the specified packet.

Parameters:
[in]pPktPointer to the packet.
Return values:
NotApplicable.
int32_t Pktlib_deleteHeap ( Pktlib_HeapHandle  heapHandle,
int32_t *  errCode 
)

Description
The function is used to delete the heap. Please ensure that the following criteria are met:-

       a) Once the heap is deleted it is  the responsibility of the 
          application NOT to use the heap for allocations; there is no 
          run time checking added in the PKTLIB API to determine if 
          the heap is operational or not since this will cause 
          performance penalties.
       b) The heap can only be deleted by the core which created the heap
          This needs to be taken care for "shared heaps". This is NOT 
          enforced in the API but is the responsibility of the application.
        
Parameters:
[in]heapHandleHeap handle to be deleted
[out]errCodeError Code populated if there is an error.
Return values:
0- Success
<0- Error
Pktlib_HeapHandle Pktlib_findHeapByName ( const char *  name)

Description
The function is used to find a previously created heap using the name

Parameters:
[in]nameName of the heap
Return values:
Success- Heap Handle
Error- NULL
void Pktlib_freePacket ( Ti_Pkt pPkt)

Description
The function is used to cleanup a packet.

Parameters:
[in]pPktPointer to the packet.
Return values:
Notapplicable

Description
The function is the garbage collector for a specific heap. Packets which are cloned or split and then passed down to the IP blocks for transmission could end up in the heap free queue(s) and would be available for subsequent allocation; this might result in unpredictable behavior because the clones are still in use. Hence packets which have a non-zero reference count have their return queue modified to a garbage collection queue. The API needs to be called periodically to ensure that packets are moved back to the free queues from the garbage collection queue.

Parameters:
[in]heapHandleHandle of the heap on which the garbage collector is executed.
Return values:
NotApplicable.
static uint8_t Pktlib_getCount ( Pktlib_Info ptrPktLibInfo) [inline, static]

Description
Internal Utility function is used to get the reference counter

Parameters:
[in]ptrPktLibInfoPointer to the internal packet library information.
Return values:
ReferenceCounter.
static void Pktlib_getDataBuffer ( Ti_Pkt ptrPkt,
uint8_t **  ptrDataBuffer,
uint32_t *  dataLen 
) [inline, static]

Description
The function is used to get the data buffer associated with the packet.

Parameters:
[in]ptrPktPointer to the packet
[in]ptrDataBufferData Buffer associated with the packet populated by this API
[in]dataLenData Buffer Length populated by this API
Return values:
NotApplicable.
static uint32_t Pktlib_getDataBufferLen ( Ti_Pkt ptrPkt) [inline, static]

Description
The function is used to get the length of the data buffer associated with the packet.

Parameters:
[in]ptrPktPointer to the packet
Return values:
DataBuffer associated with the packet.
static Cppi_HostDesc* Pktlib_getDescFromPacket ( Ti_Pkt ptrPkt) [inline, static]

Description
The function is used to get the descriptor from the TI packet.

Parameters:
[in]ptrPktPointer to the TI packet
Return values:
Pointerto the host descriptor.
static int32_t Pktlib_getDescSize ( Qmss_MemRegion  memRegion) [static]

Description
Internal Utility function which is used to get the descriptor size for the specified memory region.

Parameters:
[in]memRegionMemory region for which the descriptor size is required.
Return values:
Error- -1
Success- Descriptor Size
void Pktlib_getHeapStats ( Pktlib_HeapHandle  heapHandle,
Pktlib_HeapStats ptrHeapStats 
)

Description
The function is used to get the stats of the specified heap.

Parameters:
[in]heapHandleHandle of the heap for which the statistics are requested.
[out]ptrHeapStatsHeap Statistics populated by this API.
Return values:
NotApplicable.
Qmss_QueueHnd Pktlib_getInternalHeapQueue ( Pktlib_HeapHandle  heapHandle)

Description
The function is used to return the internal heap queue where the data buffer packets are stored.

Parameters:
[in]heapHandleHeap handle.
Return values:
QMSSQueue Handle where buffer packets are stored. This could be NULL if the heap was created with no buffer packets or if this was a SUPER Heap.
uint32_t Pktlib_getMaxBufferSize ( Pktlib_HeapHandle  heapHandle)

Description
The function is used to get the MAX data size associated with a heap. During heap creation the size of the data buffers associated with the heap are specified. The function returns the size allocated. If the heap was created with no data buffers (only with zero data buffers) the function will return 0 else it will return the size of the data buffer.

Parameters:
[in]heapHandleHandle of the heap from where the packet is to be allocated.
Return values:
Sizeof the data buffer.
static Ti_Pkt* Pktlib_getNextPacket ( Ti_Pkt ptrPkt) [inline, static]

Description
The function is used to get the next packet

Parameters:
[in]ptrPktPointer to the packet
Return values:
NextLinked Packet.
static Ti_Pkt* Pktlib_getPacketFromDesc ( Cppi_HostDesc *  ptrHostDesc) [inline, static]

Description
The function is used to get the TI packet from the descriptor

Parameters:
[in]ptrHostDescPointer to the host descriptor.
Return values:
Pointerto the TI packet.
static uint32_t Pktlib_getPacketLen ( Ti_Pkt ptrPkt) [inline, static]

Description
The function is used to get the length of the packet. The function should *only* be called for packets which have a single node or for the head of the chained list of packets. Using this API for any other packet is not supported and would cause issues especially if these packets are being pushed across peripherals.

Parameters:
[in]ptrPktPointer to the packet
Return values:
Lengthof the packet.

Description
Function returns the heap handle to which the packet belongs to.

Parameters:
[in]pPktPointer to the packet.
Return values:
Heaphandle.
static uint8_t Pktlib_getPktLibFlags ( Pktlib_Info ptrPktLibInfo) [inline, static]

Description
Internal Utility function is used to retreive the "internal" flags

Parameters:
[in]ptrPktLibInfoPointer to the internal packet library information
Return values:
PacketLibrary flags
static uint8_t Pktlib_getPktLibHeapIndex ( Pktlib_Info ptrPktLibInfo) [inline, static]

Description
Internal Utility function is used to get the heap index

Parameters:
[in]ptrPktLibInfoPointer to the internal packet library information
Return values:
HeapIndex.
static Pktlib_Info* Pktlib_getPktLibInfo ( Ti_Pkt pPkt) [inline, static]

Description
Internal Utility function is used to get the pointer to the packet library information.

Parameters:
[in]pPktPointer to the packet.
Return values:
Pointerto the library information.
static void Pktlib_getQueueStarvationCount ( Pktlib_Heap ptrPktHeap,
uint8_t *  dataBufferCount,
uint8_t *  zeroDataBufferCount 
) [static]

Description
This function is used to read the starvation count. We cannot use the QMSS LLD API for this purpose because the register is a Clear-on-read.

Parameters:
[in]ptrPktHeapPointer to the heap for which the statistics are required.
[out]dataBufferCountThis is the data buffer starvation counter
[out]zeroDataBufferCountThis is the zero data buffer starvation counter
Return values:
Success- 0
Error- <0
static uint8_t Pktlib_getRefCount ( Ti_Pkt pPkt) [inline, static]

Description
Internal Utility function which is used to get the current reference counter for the specified packet.

Parameters:
[in]pPktPointer to the packet.
Return values:
CurrentReference Counter
uint32_t Pktlib_getVersion ( void  )

Description
The function is used to get the version information of the packet library

Return values:
VersionInformation.
Qmss_QueueHnd Pktlib_getZeroHeapQueue ( Pktlib_HeapHandle  heapHandle)

Description
The function is used to return the internal heap queue where the zero buffer packets are stored.

Parameters:
[in]heapHandleHeap handle.
Return values:
QMSSQueue Handle where zero packets are stored. This could be NULL if the heap was created with no zero buffer packets or if this is a SUPER HEAP.
static void Pktlib_incRefCount ( Ti_Pkt pPkt) [inline, static]

Description
Internal Utility function which is used to increment the reference counter for the specified packet.

Parameters:
[in]pPktPointer to the packet.
Return values:
NotApplicable.
void Pktlib_invalidatePkt ( Ti_Pkt pPkt)

Description
The function invalidates the cache contents of the packet. This needs to be called by the application if the packets are located in shared or external memory. If there are mutiple chained packets then the application needs to cycle through the chain and invalidate all the individual packets.

Parameters:
[in]pPktPacket to be invalidated
Return values:
Notapplicable.
static uint8_t Pktlib_isDataBufferPkt ( Ti_Pkt pPkt) [inline, static]

Description
Internal Utility function which is used to check if the packet is a data buffer packet or a bufferless packet?

Parameters:
[in]pPktPointer to the packet.
Return values:
1- Data Buffer attached
0- Bufferless packet
static uint8_t Pktlib_packetBufferCount ( Ti_Pkt ptrPkt) [inline, static]

Description
The function is used to get the number of descriptors which are a part of the packet.

Parameters:
[in]ptrPktPacket for which the number of descriptors are required.
Return values:
Numberof buffers.
Ti_Pkt* Pktlib_packetMerge ( Ti_Pkt pPkt1,
Ti_Pkt pPkt2,
Ti_Pkt pLastPkt 
)

Description
The function is used to merge packets. The function chains "Packet2" to the end of "Packet1".

Parameters:
[in]pPkt1Packet1 which is to be merged at the beginning of packet2
[in]pPkt2Packet2 which is merged at the end of packet1
[in]pLastPktOptional parameter to the last element of the Packet1 chain. If this is known then packet2 is chained to the end of this packet; else the API will try and determine the last element in the Packet1 chain
Return values:
Mergedpacket
static void Pktlib_setDataBufferLen ( Ti_Pkt ptrPkt,
uint32_t  dataLen 
) [inline, static]

Description
The function is used to set the data buffer length associated with the packet.

Parameters:
[in]ptrPktPointer to the packet
[in]dataLenData Buffer Length to be configured
Return values:
NotApplicable.
static int32_t Pktlib_setDataOffset ( Ti_Pkt ptrPkt,
int32_t  offset 
) [inline, static]

Description
The function is used to offset the data buffer in the packet by a specified number of bytes. The data buffer length is also modified to account for the offset.

Parameters:
[in]ptrPktPointer to the packet
[in]offsetOffset value in bytes.
Return values:
Success- 0
Error- <0
static void Pktlib_setPacketLen ( Ti_Pkt ptrPkt,
uint32_t  packetLen 
) [inline, static]

Description
The function is used to set the length of the packet. The function should *only* be called for packets which have a single node or for the head of the chained list of packets. Using this API for any other packet is not supported and would cause issues especially if these packets are being pushed across peripherals.

Parameters:
[in]ptrPktPointer to the packet
[in]packetLenLength of the packet to be configured.
Return values:
Notapplicable
static void Pktlib_setPktLibFlags ( Pktlib_Info ptrPktLibInfo,
uint8_t  flags 
) [inline, static]

Description
Internal Utility function is used to set the "internal" flags.

Parameters:
[in]ptrPktLibInfoPointer to the internal packet library information
[in]flagsInternal flags to be configured.
Return values:
NotApplicable.
static void Pktlib_setPktLibHeapIndex ( Pktlib_Info ptrPktLibInfo,
uint8_t  heapIndex 
) [inline, static]

Description
Internal Utility function is used to set the heap index

Parameters:
[in]ptrPktLibInfoPointer to the internal packet library information
[in]heapIndexHeap Index to be configured.
Return values:
NotApplicable
static void Pktlib_setRefCount ( Pktlib_Info ptrPktLibInfo,
uint8_t  refCount 
) [inline, static]

Description
Internal Utility function is used to set the reference counter

Parameters:
[in]ptrPktLibInfoPointer to the internal packet library information
[in]refCountReference counter to be set
Return values:
NotApplicable.
static void Pktlib_setReturnQueueToGarbage ( Ti_Pkt pPkt) [inline, static]

Description
Internal Utility function which modifies the return queue information in the descriptor to the garbage queue.

Parameters:
[in]pPktPointer to the packet.
Return values:
Notapplicable
static void Pktlib_setTags ( Ti_Pkt ptrPkt,
Cppi_DescTag *  tag 
) [inline, static]

Description
The PKTLIB uses the SOURCE_TAG_HI field to store its private information. This field can get overwritten using the native Cppi_setTag API. This API is a replacement of the above API because it ensures that the PKTLIB Private information is always preserved.

Parameters:
[in]ptrPktPointer to the packet
[in]tagTags to be configured in the packet.
Return values:
Notapplicable
int32_t Pktlib_sharedHeapInit ( void  )

Description
The function is used to initialize the packet library module shared memory Heap. This should be called before any shared memory heaps are created or used and should be done only once in the entire system.

Return values:
Error- -1
Success- 0
static void Pktlib_sortOnDataBufferSize ( Pktlib_HeapHandle  memberHeaps[],
uint32_t  len 
) [static]

Description
The function is used to sort the heaps on the basis of the data buffer size.

Parameters:
[in]memberHeapsArray of the heaps which have to be sorted.
[in]lenNumber of heaps to be sorted.
Return values:
NotApplicable.
int32_t Pktlib_splitPacket ( Ti_Pkt pOrgPkt,
Ti_Pkt pNewPkt,
uint32_t  splitPacketSize,
Ti_Pkt **  pPkt1,
Ti_Pkt **  pPkt2 
)

Description
The function is used to split the packet. Splitting a packet is done at the 'splitPacketSize' specified. The head of the split packet is returned in 'pPkt1' while the head of the second split is returned in 'pPkt2'.

The zero buffer packet is marked as a clone because it refers to the data buffer packet. Data buffer packets cannot be freed till all the clones using them have been freed. The goal should be to free the CLONED packets as soon as possible so that the data buffer packets are not being held.

This variant of the function splits the packet and sets the zero buffer packet (i.e. Cloned Packet) to point to the data *before* the split size and so it is returned in the pPkt1. So use this function if the pPkt1 is getting cleaned before pPkt2.

See also:
Pktlib_splitPacket2
Parameters:
[in]pOrgPktPointer to the Orignal packet which is to be split.
[in]pNewPktPointer to the packet which has no buffer attached to it.
[in]splitPacketSizeSize of the packet which is to be split
[out]pPkt1The pointer to the first packet after the split.
[out]pPkt2The pointer to the second packet after the split.
Return values:
0- Success (The packet passed was used)
1- Success (The packet passed was NOT used)
-1- Error
int32_t Pktlib_splitPacket2 ( Ti_Pkt pOrgPkt,
Ti_Pkt pNewPkt,
uint32_t  splitPacketSize,
Ti_Pkt **  pPkt1,
Ti_Pkt **  pPkt2 
)

Description
The function is used to split the packet. Splitting a packet is done at the 'splitPacketSize' specified. The head of the split packet is returned in 'pPkt1' while the head of the second split is returned in 'pPkt2'.

The zero buffer packet is marked as a clone because it refers to the data buffer packet. Data buffer packets cannot be freed till all the clones using them have been freed. The goal should be to free the CLONED packets as soon as possible so that the data buffer packets are not being held.

This variant of the function splits the packet and sets the zero buffer packet (i.e. Cloned Packet) to point to the data *after* the split size and so it is returned in the pPkt2. So use this function if the pPkt2 is getting cleaned before pPkt1.

See also:
Pktlib_splitPacket
Parameters:
[in]pOrgPktPointer to the Orignal packet which is to be split.
[in]pNewPktPointer to the packet which has no buffer attached to it.
[in]splitPacketSizeSize of the packet which is to be split
[out]pPkt1The pointer to the first packet after the split.
[out]pPkt2The pointer to the second packet after the split.
Return values:
0- Success (The packet passed was used)
1- Success (The packet passed was NOT used)
-1- Error
static Ti_Pkt* Pktlib_superHeapAllocPacket ( Pktlib_Heap ptrSuperHeap,
uint32_t  size 
) [static]

Description
The function is used to allocate a packet of the specified size from the super heap. If the size passed is 0; the function allocates a packet with no buffer i.e. bufferless packet. If the size passed is greater than the size of the data packet in the heap then the allocation will fail.

Parameters:
[in]ptrSuperHeapPointer to the super heap from which the packet is to be allocated
[in]sizeSize of the packet which is to be allocated.
Return values:
Success- Pointer to the packet
Error- NULL
void Pktlib_writebackPkt ( Ti_Pkt pPkt)

Description
The function writeback the cache contents of the packet. This needs to be called by the application if the packets are located in shared or external memory. If there are mutiple chained packets then the application needs to cycle through the chain and invalidate all the individual packets.

Parameters:
[in]pPktPacket to be written back
Return values:
Notapplicable.

Copyright 2014, Texas Instruments Incorporated