![]() |
![]() |
Functions | |
static Pktlib_Info * | Pktlib_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_Pkt * | Pktlib_superHeapAllocPacket (Pktlib_Heap *ptrSuperHeap, uint32_t size) |
Ti_Pkt * | Pktlib_allocPacket (Pktlib_HeapHandle heapHandle, uint32_t size) |
Ti_Pkt * | Pktlib_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_Pkt * | Pktlib_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_Pkt * | Pktlib_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) |
static void __Pktlib_freePacket | ( | Ti_Pkt * | pPkt, |
uint8_t | followLinks | ||
) | [static] |
Description
The function is used to cleanup a packet.
[in] | pPkt | Pointer to the packet. |
[in] | followLinks | Flag which indicates if the links in the packet need to be followed. |
Not | applicable |
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.
[out] | baseStarvationQueue | Pointer to the block of starvation queues allocated. |
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.
[in] | heapHandle | Handle of the heap from where the packet is to be allocated. |
[in] | size | Size of the packet which is to be allocated. |
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.
[in] | ptrPktOrig | Orignal Packet which is to be cloned. |
[in] | ptrClonePacket | The 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. |
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
[in] | a | Handle to the Heap1 to be compared |
[in] | b | Handle to the Heap1 to be compared |
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
[in] | descType | Type of descriptor - Cppi_DescType_HOST, Cppi_DescType_MONOLITHIC |
[in] | descAddr | Memory address of descriptor. |
[in] | queue | Queue Manager - 0 or 1. Queue Number - 0 to 4094 with in queue manager 0 or 1. |
Not | applicable |
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.
[in] | ptrHeapCfg | Heap Configuration using which the heap is to be created |
[out] | errCode | Error code populated if there was an error. |
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.
[in] | name | Name of the super heap |
[in] | memberHeaps | Array of heaps which will be managed by the super heaps. |
[in] | numMemberHeaps | Number of member heaps which need to be monitored by the Super Heap. |
[out] | errCode | Error code populated if there was an error else 0 |
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.
[in] | pPkt | Pointer to the packet. |
Not | Applicable. |
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.
[in] | heapHandle | Heap handle to be deleted |
[out] | errCode | Error Code populated if there is an error. |
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
[in] | name | Name of the heap |
Success | - Heap Handle |
Error | - NULL |
void Pktlib_freePacket | ( | Ti_Pkt * | pPkt | ) |
Description
The function is used to cleanup a packet.
[in] | pPkt | Pointer to the packet. |
Not | applicable |
void Pktlib_garbageCollection | ( | Pktlib_HeapHandle | heapHandle | ) |
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.
[in] | heapHandle | Handle of the heap on which the garbage collector is executed. |
Not | Applicable. |
static uint8_t Pktlib_getCount | ( | Pktlib_Info * | ptrPktLibInfo | ) | [inline, static] |
Description
Internal Utility function is used to get the reference counter
[in] | ptrPktLibInfo | Pointer to the internal packet library information. |
Reference | Counter. |
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.
[in] | ptrPkt | Pointer to the packet |
[in] | ptrDataBuffer | Data Buffer associated with the packet populated by this API |
[in] | dataLen | Data Buffer Length populated by this API |
Not | Applicable. |
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.
[in] | ptrPkt | Pointer to the packet |
Data | Buffer 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.
[in] | ptrPkt | Pointer to the TI packet |
Pointer | to 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.
[in] | memRegion | Memory region for which the descriptor size is required. |
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.
[in] | heapHandle | Handle of the heap for which the statistics are requested. |
[out] | ptrHeapStats | Heap Statistics populated by this API. |
Not | Applicable. |
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.
[in] | heapHandle | Heap handle. |
QMSS | Queue 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.
[in] | heapHandle | Handle of the heap from where the packet is to be allocated. |
Size | of the data buffer. |
static Ti_Pkt* Pktlib_getNextPacket | ( | Ti_Pkt * | ptrPkt | ) | [inline, static] |
Description
The function is used to get the next packet
[in] | ptrPkt | Pointer to the packet |
Next | Linked Packet. |
static Ti_Pkt* Pktlib_getPacketFromDesc | ( | Cppi_HostDesc * | ptrHostDesc | ) | [inline, static] |
Description
The function is used to get the TI packet from the descriptor
[in] | ptrHostDesc | Pointer to the host descriptor. |
Pointer | to 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.
[in] | ptrPkt | Pointer to the packet |
Length | of the packet. |
Pktlib_HeapHandle Pktlib_getPktHeap | ( | Ti_Pkt * | pPkt | ) |
Description
Function returns the heap handle to which the packet belongs to.
[in] | pPkt | Pointer to the packet. |
Heap | handle. |
static uint8_t Pktlib_getPktLibFlags | ( | Pktlib_Info * | ptrPktLibInfo | ) | [inline, static] |
Description
Internal Utility function is used to retreive the "internal" flags
[in] | ptrPktLibInfo | Pointer to the internal packet library information |
Packet | Library flags |
static uint8_t Pktlib_getPktLibHeapIndex | ( | Pktlib_Info * | ptrPktLibInfo | ) | [inline, static] |
Description
Internal Utility function is used to get the heap index
[in] | ptrPktLibInfo | Pointer to the internal packet library information |
Heap | Index. |
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.
[in] | pPkt | Pointer to the packet. |
Pointer | to 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.
[in] | ptrPktHeap | Pointer to the heap for which the statistics are required. |
[out] | dataBufferCount | This is the data buffer starvation counter |
[out] | zeroDataBufferCount | This is the zero data buffer starvation counter |
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.
[in] | pPkt | Pointer to the packet. |
Current | Reference Counter |
uint32_t Pktlib_getVersion | ( | void | ) |
Description
The function is used to get the version information of the packet library
Version | Information. |
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.
[in] | heapHandle | Heap handle. |
QMSS | Queue 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.
[in] | pPkt | Pointer to the packet. |
Not | Applicable. |
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.
[in] | pPkt | Packet to be invalidated |
Not | applicable. |
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?
[in] | pPkt | Pointer to the packet. |
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.
[in] | ptrPkt | Packet for which the number of descriptors are required. |
Number | of 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".
[in] | pPkt1 | Packet1 which is to be merged at the beginning of packet2 |
[in] | pPkt2 | Packet2 which is merged at the end of packet1 |
[in] | pLastPkt | Optional 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 |
Merged | packet |
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.
[in] | ptrPkt | Pointer to the packet |
[in] | dataLen | Data Buffer Length to be configured |
Not | Applicable. |
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.
[in] | ptrPkt | Pointer to the packet |
[in] | offset | Offset value in bytes. |
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.
[in] | ptrPkt | Pointer to the packet |
[in] | packetLen | Length of the packet to be configured. |
Not | applicable |
static void Pktlib_setPktLibFlags | ( | Pktlib_Info * | ptrPktLibInfo, |
uint8_t | flags | ||
) | [inline, static] |
Description
Internal Utility function is used to set the "internal" flags.
[in] | ptrPktLibInfo | Pointer to the internal packet library information |
[in] | flags | Internal flags to be configured. |
Not | Applicable. |
static void Pktlib_setPktLibHeapIndex | ( | Pktlib_Info * | ptrPktLibInfo, |
uint8_t | heapIndex | ||
) | [inline, static] |
Description
Internal Utility function is used to set the heap index
[in] | ptrPktLibInfo | Pointer to the internal packet library information |
[in] | heapIndex | Heap Index to be configured. |
Not | Applicable |
static void Pktlib_setRefCount | ( | Pktlib_Info * | ptrPktLibInfo, |
uint8_t | refCount | ||
) | [inline, static] |
Description
Internal Utility function is used to set the reference counter
[in] | ptrPktLibInfo | Pointer to the internal packet library information |
[in] | refCount | Reference counter to be set |
Not | Applicable. |
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.
[in] | pPkt | Pointer to the packet. |
Not | applicable |
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.
[in] | ptrPkt | Pointer to the packet |
[in] | tag | Tags to be configured in the packet. |
Not | applicable |
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.
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.
[in] | memberHeaps | Array of the heaps which have to be sorted. |
[in] | len | Number of heaps to be sorted. |
Not | Applicable. |
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.
[in] | pOrgPkt | Pointer to the Orignal packet which is to be split. |
[in] | pNewPkt | Pointer to the packet which has no buffer attached to it. |
[in] | splitPacketSize | Size of the packet which is to be split |
[out] | pPkt1 | The pointer to the first packet after the split. |
[out] | pPkt2 | The pointer to the second packet after the split. |
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.
[in] | pOrgPkt | Pointer to the Orignal packet which is to be split. |
[in] | pNewPkt | Pointer to the packet which has no buffer attached to it. |
[in] | splitPacketSize | Size of the packet which is to be split |
[out] | pPkt1 | The pointer to the first packet after the split. |
[out] | pPkt2 | The pointer to the second packet after the split. |
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.
[in] | ptrSuperHeap | Pointer to the super heap from which the packet is to be allocated |
[in] | size | Size of the packet which is to be allocated. |
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.
[in] | pPkt | Packet to be written back |
Not | applicable. |