Sub Modules | |
UDMA CPPI Protocol Specific Info | |
UDMA Configuration | |
UDMA Packet Definitions | |
Typedefs | |
typedef struct EnetUdma_DmaDescQ_s * | EnetUdma_DmaDescQHandle |
Opaque handle to Enet UDMA descriptor queue. More... | |
Enet UDMA instance configuration | |
typedef struct EnetUdma_Cfg_s | EnetDma_Cfg |
Opaque handle that holds config Info for Enet DMA channel. More... | |
#define | ENET_UDMA_HPD_SIZE (128U) |
Enet UDMA HPD packet size. More... | |
#define | ENET_UDMA_EXTENDED_PKT_INFO_BLOCK_SIZE (16U) |
Extended Packet Info Block size. More... | |
#define | ENET_UDMA_PROTOCOL_SPECIFIC_INFO_BLOCK_SIZE (16U) |
Extended Packet Info Block size. More... | |
#define | ENET_UDMA_PKT_DESC_RESERVED_SIZE |
Extended Packet Info Block size. More... | |
#define | ENET_UDMA_RING_MEM_SIZE (sizeof(uint64_t)) |
UDMA ring single element size. More... | |
#define | ENET_UDMA_RXMTU_ALIGN (1U << 5U) |
Enet UDMA RX MTU alignment. The RxFlow MTU must be aligned to this value. More... | |
#define | ENET_UDMA_CPSW_MAX_SG_LIST (4U) |
#define | ENET_UDMA_CPSW_HOSTPKTDESC_INDEX (0U) |
Index of the Host Packet(first packet) descriptor. More... | |
#define | ENET_UDMA_CPSW_HOSTBUFDESC_INDEX (1U) |
Index of the first Host Buffer descriptor. More... | |
#define | ENET_UDMA_CPSW_MAX_HOSTBUFDESC_COUNT (ENET_UDMA_CPSW_MAX_SG_LIST - ENET_UDMA_CPSW_HOSTBUFDESC_INDEX) |
#define | ENET_UDMA_HPD_SRC_TAG_LOW_MASK (0xFF) |
Source tag low mask of descriptor (used to get packet's received port number) More... | |
#define | ENET_UDMA_DESC_ALIGNMENT (64U) |
UDMA descriptor address alignment requirement. More... | |
Enet DMA driver callback function types | |
Callback function typedefs so that the EnetDma layer can call into the app layer and let it translate between the hardware packet descriptors and packets and the stack/translation layer's buffers and packets. | |
typedef uint8_t *(* | EnetUdma_AllocRingMemFxn) (void *appPriv, uint32_t numRingEle, uint32_t alignSize) |
Function pointer type for packet allocation function. More... | |
typedef void(* | EnetUdma_FreeRingMemFxn) (void *appPriv, void *pRingMem, uint32_t numRingEle) |
Function pointer type for packet free function. More... | |
typedef struct EnetUdma_DmaDesc_s *(* | EnetUdma_AllocDmaDescFxn) (void *appPriv, uint32_t alignSize) |
Function pointer type for DMA descriptor allocation function. More... | |
typedef void(* | EnetUdma_FreeDmaDescFxn) (void *appPriv, struct EnetUdma_DmaDesc_s *dmaDescPtr) |
Function pointer type for DMA descriptor free function. More... | |
typedef void(* | EnetDma_PktNotifyCb) (void *cbArg) |
Function pointer type for packet notify call back. More... | |
#define ENET_UDMA_HPD_SIZE (128U) |
Enet UDMA HPD packet size.
#define ENET_UDMA_EXTENDED_PKT_INFO_BLOCK_SIZE (16U) |
Extended Packet Info Block size.
#define ENET_UDMA_PROTOCOL_SPECIFIC_INFO_BLOCK_SIZE (16U) |
Extended Packet Info Block size.
#define ENET_UDMA_PKT_DESC_RESERVED_SIZE |
Extended Packet Info Block size.
#define ENET_UDMA_RING_MEM_SIZE (sizeof(uint64_t)) |
UDMA ring single element size.
#define ENET_UDMA_RXMTU_ALIGN (1U << 5U) |
Enet UDMA RX MTU alignment. The RxFlow MTU must be aligned to this value.
As per UDMAP spec: "RX Packet Size Threshold 0: This value is left shifted by 5 bits and compared against the packet size to determine which free descriptor queue should be used for the SOP buffer in the packet" The value programmed is hence supposed to be 32 bit aligned. Programming non aligned values will result in truncation and expected MTU size will not be programmed. For example setting MTU size of 1518 (required MTU size) results in actual value of 1504 getting programmed resulting in packet drop for frames of size 1504 - 1518 which the app expects to less than the programmed MTU based on the param passed. Refer ksdma_udmap spec section 4.4.2.6 for more details
#define ENET_UDMA_CPSW_MAX_SG_LIST (4U) |
Maximum number of scatter gather segments supported in a packet
#define ENET_UDMA_CPSW_HOSTPKTDESC_INDEX (0U) |
Index of the Host Packet(first packet) descriptor.
#define ENET_UDMA_CPSW_HOSTBUFDESC_INDEX (1U) |
Index of the first Host Buffer descriptor.
#define ENET_UDMA_CPSW_MAX_HOSTBUFDESC_COUNT (ENET_UDMA_CPSW_MAX_SG_LIST - ENET_UDMA_CPSW_HOSTBUFDESC_INDEX) |
Count of Host Buffer Descriptor
#define ENET_UDMA_HPD_SRC_TAG_LOW_MASK (0xFF) |
Source tag low mask of descriptor (used to get packet's received port number)
#define ENET_UDMA_DESC_ALIGNMENT (64U) |
UDMA descriptor address alignment requirement.
typedef struct EnetUdma_Cfg_s EnetDma_Cfg |
Opaque handle that holds config Info for Enet DMA channel.
typedef struct EnetUdma_DmaDescQ_s* EnetUdma_DmaDescQHandle |
Opaque handle to Enet UDMA descriptor queue.
typedef uint8_t*(* EnetUdma_AllocRingMemFxn) (void *appPriv, uint32_t numRingEle, uint32_t alignSize) |
Function pointer type for packet allocation function.
typedef void(* EnetUdma_FreeRingMemFxn) (void *appPriv, void *pRingMem, uint32_t numRingEle) |
Function pointer type for packet free function.
typedef struct EnetUdma_DmaDesc_s*(* EnetUdma_AllocDmaDescFxn) (void *appPriv, uint32_t alignSize) |
Function pointer type for DMA descriptor allocation function.
typedef void(* EnetUdma_FreeDmaDescFxn) (void *appPriv, struct EnetUdma_DmaDesc_s *dmaDescPtr) |
Function pointer type for DMA descriptor free function.
typedef void(* EnetDma_PktNotifyCb) (void *cbArg) |
Function pointer type for packet notify call back.
This is called by driver when packet is received on the RX channel or transmission completed from TX channel.
void EnetUdma_initDataPathParams | ( | EnetDma_initCfg * | pDmaConfig | ) |
EnetDma_Handle EnetUdma_initDataPath | ( | Enet_Type | enetType, |
uint32_t | instId, | ||
const EnetDma_initCfg * | pDmaInitCfg | ||
) |
int32_t EnetUdma_deInitDataPath | ( | EnetDma_Handle | hEnetUdma | ) |
int32_t EnetUdma_checkRxFlowSanity | ( | EnetDma_RxChHandle | hRxFlow, |
uint32_t | margin | ||
) |
Check if any packet loss in RX flow FQ and CQ rings.
This development time error checks API checks DMA descriptor loss due to any timing issues. We check amount of descriptors with DMA and free matches the number of allocated with some "margin" for packets in flight.
Note: Margin can vary drastically based on Core (A72 vs R5), type of Udma channel (NORMAL/HC etc.) and size of packet. This makes these API dependent on application configuration.
hRxFlow | [IN] flow handle for the flow we wish to check sanity |
margin | [IN] Amount of packets which can be in flight in DMA |
UDMA_SOK | Number of free descriptors and with DMA matches (total allocated packets - margin) = (packets in CQ + Packets in FQ) |
UDMA_EFAIL | Number offree descriptors and with DMA don't match |
int32_t EnetUdma_checkTxChSanity | ( | EnetDma_TxChHandle | hTxCh, |
uint32_t | margin | ||
) |
Check if any packet loss in TX Channel FQ and CQ rings.
This development time error checks API checks dma desc loss due to any timing issues. We check amount of descriptors with DMA and free matches the number of allocated with some "margin" for packets in flight.
Note: Margin can vary drastically based on Core (A72 vs R5), type of Udma channel (NORMAL/HC etc.) and size of packet. This makes these API dependent on application configuration.
hTxCh | [IN] TX Channel handle for the TX channel we wish to check sanity |
margin | [IN] Amount of packets which can be in flight in DMA |
UDMA_SOK | Number of free descriptors and with DMA matches (total allocated packets - margin) = (packets in CQ + Packets in FQ) |
UDMA_EFAIL | Number of free descriptors and with DMA don't match |
Udma_RingHandle EnetUdma_getTxChFqHandle | ( | EnetDma_TxChHandle | hTxCh | ) |
Get TX channel FQ handle.
Returns FQ handle for TX Channel. This function can be used when auto-recycling of buffers is used.
hTxCh | [IN] TX Channel handle |
EnetUdma_DmaDescQHandle EnetUdma_getTxChDescPoolHandle | ( | EnetDma_TxChHandle | hTxCh | ) |
Get handle to DMA descriptor free pool for TX channel.
Returns DMA descriptor free pool for TX channel. This function can be used when auto-recycling of buffers is used.
hTxCh | [IN] TX channel handle |
Udma_RingHandle EnetUdma_getRxFlowFqHandle | ( | EnetDma_RxChHandle | hRxFlow | ) |
Get RX flow FQ handle.
Returns FQ handle for RX flow. This function can be used when auto-recycling of buffers is used.
hRxFlow | [IN] RX flow handle |
EnetUdma_DmaDescQHandle EnetUdma_getRxFlowDescPoolHandle | ( | EnetDma_RxChHandle | hRxFlow | ) |
Get handle to DMA descriptor free pool for RX flow.
Returns DMA descriptor free pool for RX flow. This function can be used when auto-recycling of buffers is used.
hRxFlow | [IN] RX flow handle |