net/ark: add PCIe IDS for newly supported devices
PATCH 1/4 net/ark: add PCIe IDS for newly supported devices
Update documentation and release notes
--- doc/guides/nics/ark.rst | 5 +++++ drivers/net/ark/ark_ethdev.c | 4 ++++ 2 files changed, 9 insertions(+)
doc/guides/nics/ark.rst +5 -0
@@ -310,6 +310,10 @@ ARK PMD supports the following Arkville RTL PCIe instances including: * ``1d6c:1024`` - AR-TK242 [2x100GbE Packet Capture Device] * ``1d6c:1025`` - AR-TK242-FX2 [2x100GbE Gen5 Packet Capture Device] * ``1d6c:1026`` - AR-TK242-FX2 [1x200GbE Gen5 Packet Capture Device] +* ``1d6c:102a`` - AR-TK242-FX2 [4x100GbE Gen5 Packet Capture Device] +* ``1d6c:102b`` - AR-ARKV-FX1 [Arkville 128B DPDK Data Mover for Versal/CPM5] +* ``1d6c:102c`` - AR-TK242-V80 [Gen5 PCAP Processor] +* ``1d6c:102d`` - AR-TK242-FX2 [8x10GbE Gen5 Packet Capture-Replay Device] Arkville RTL Core Configurations --------------------------------
@@ -322,6 +326,7 @@ stream interfaces for both AMD/Xilinx and Intel FPGAs. * ARK-FX0 - 256-bit 32B datapath (PCIe Gen3, Gen4) * ARK-FX1 - 512-bit 64B datapath (PCIe Gen3, Gen4, Gen5) +* ARKV-FX1 - 1024-bit 128B datapath (AMD PCIe Versal, Gen5 ) * ARK-FX2 - 1024-bit 128B datapath (PCIe Gen5x16 Only) DPDK and Arkville Firmware Versioning
drivers/net/ark/ark_ethdev.c +4 -0
@@ -102,6 +102,10 @@ static const struct rte_pci_id pci_id_ark_map[] = { {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1024)}, {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1025)}, {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1026)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102a)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102b)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102c)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102d)}, {.vendor_id = 0, /* sentinel */ }, };
Signature · 1 line
2.34.1
PATCH 2/4 net/ark: remove double mbuf frees
From: John Miller <[email protected]>
--- drivers/net/ark/ark_ethdev_rx.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +0 -4
@@ -538,7 +538,6 @@ void eth_ark_dev_rx_queue_release(void *vqueue) {struct ark_rx_queue *queue; -uint32_t i; queue = (struct ark_rx_queue *)vqueue;if (queue ==0 )
@@ -551,9 +550,6 @@ eth_ark_dev_rx_queue_release(void *vqueue)/* Need to clear out mbufs here, dropping packets along the way */ eth_ark_rx_queue_drain (queue); -for (i =0 ; i < queue->queue_size; ++i) -rte_pktmbuf_free (queue->reserve_q[i]); -rte_free (queue->reserve_q);rte_free (queue->paddress_q);rte_free (queue);
Signature · 1 line
2.34.1
PATCH 3/4 net/ark: improve ring handling for segmented packets
In reply to Ed Czeckhandle case where complete packet is not yet available
--- drivers/net/ark/ark_ethdev_rx.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +8 -4
@@ -313,11 +313,15 @@ eth_ark_recv_pkts(void *rx_queue, } } -if (unlikely (meta->pkt_len > queue->dataroom)) - cons_index =eth_ark_rx_jumbo - (queue, meta, mbuf, cons_index +1 ); -else +if (unlikely (meta->pkt_len > queue->dataroom)) { +uint32_t tcons =eth_ark_rx_jumbo (queue, meta, mbuf, cons_index +1 ); +if ((int32_t )(prod_index - tcons) >=0 ) + cons_index = tcons;/* nominal condition */ +else +break ; + }else { cons_index +=1 ; + } rx_pkts[nb] = mbuf; nb++;
Signature · 1 line
2.34.1
PATCH 4/4 net/ark: improve Rx queue recovery after mbuf exhaustion
In reply to Ed Czeckuse 4-K page aligned buffers
reduce message spew
attempt to allocate smaller chunks of buffers
--- drivers/net/ark/ark_ethdev_rx.c | 37 ++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 12 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +25 -12
@@ -42,6 +42,7 @@ struct __rte_cache_aligned ark_rx_queue {rx_user_meta_hook_fn rx_user_meta_hook;void *ext_user_data; +uint32_t starvation;uint32_t dataroom;uint32_t headroom;
@@ -57,8 +58,6 @@ struct __rte_cache_aligned ark_rx_queue {/* The queue Index is used within the dpdk device structures */ uint16_t queue_index; -uint32_t unused; -/* next cache line - fields written by device */ alignas(RTE_CACHE_LINE_MIN_SIZE )RTE_MARKER cacheline1;
@@ -185,12 +184,12 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, queue->reserve_q =rte_zmalloc_socket ("Ark_rx_queue mbuf" , nb_desc *sizeof (struct rte_mbuf *), -512 , +4096 , socket_id); queue->paddress_q =rte_zmalloc_socket ("Ark_rx_queue paddr" , nb_desc *sizeof (rte_iova_t), -512 , +4096 , socket_id);if (queue->reserve_q ==0 || queue->paddress_q ==0 ) {
@@ -265,6 +264,9 @@ eth_ark_recv_pkts(void *rx_queue,return 0 ;if (unlikely (nb_pkts ==0 ))return 0 ; +if (unlikely (queue->starvation)) +eth_ark_rx_seed_mbufs (queue); + prod_index = queue->prod_index; cons_index = queue->cons_index;if (prod_index == cons_index)
@@ -453,7 +455,7 @@ eth_ark_rx_stop_queue(struct rte_eth_dev *dev, uint16_t queue_id)static inline int eth_ark_rx_seed_mbufs (struct ark_rx_queue *queue) { -uint32_t limit = (queue->cons_index & ~(ARK_RX_MPU_CHUNK -1 )) + +uint32_t limit =RTE_ALIGN_FLOOR (queue->cons_index,ARK_RX_MPU_CHUNK ) + queue->queue_size;uint32_t seed_index = queue->seed_index;
@@ -461,23 +463,34 @@ eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue)uint32_t seed_m = queue->seed_index & queue->queue_mask;uint32_t nb = limit - seed_index; +int status;/* Handle wrap around -- remainder is filled on the next call */ if (unlikely (seed_m + nb > queue->queue_size)) nb = queue->queue_size - seed_m;struct rte_mbuf **mbufs = &queue->reserve_q[seed_m]; -int status =rte_pktmbuf_alloc_bulk (queue->mb_pool, mbufs, nb); +do { + status =rte_pktmbuf_alloc_bulk (queue->mb_pool, mbufs, nb); +if (status ==0 ) +break ; +/* Try again with a smaller request, keeping aligned with chunk size */ + nb =RTE_ALIGN_FLOOR (nb /2 ,ARK_RX_MPU_CHUNK ); + }while (nb >=ARK_RX_MPU_CHUNK );if (unlikely (status !=0 )) { -ARK_PMD_LOG (NOTICE , -"Could not allocate %u mbufs from pool" -" for RX queue %u;" -" %u free buffers remaining in queue\n" , - nb, queue->queue_index, - queue->seed_index - queue->cons_index); +if (queue->starvation ==0 ) { +ARK_PMD_LOG (NOTICE , +"Could not allocate %u mbufs from pool" +" for RX queue %u;" +" %u free buffers remaining in queue\n" , +ARK_RX_MPU_CHUNK , queue->queue_index, + queue->seed_index - queue->cons_index); + queue->starvation =1 ; + }return -1 ; } + queue->starvation =0 ;if (ARK_DEBUG_CORE ) {/* DEBUG */ while (count != nb) {
Signature · 1 line
2.34.1
Re: [PATCH 4/4] net/ark: improve Rx queue recovery after mbuf exhaustion
drivers/net/ark/ark_ethdev_rx.c eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue) · line 488
Quoted 7 lines · On Wed, 3 Sep 2025 17:28:45 -0400 Ed Czeck <[email protected]> wrote:
drivers/net/ark/ark_ethdev_rx.c +7
-0+if (queue->starvation ==0 ) { +ARK_PMD_LOG (NOTICE , +"Could not allocate %u mbufs from pool" +" for RX queue %u;" +" %u free buffers remaining in queue\n" , +ARK_RX_MPU_CHUNK , queue->queue_index, + queue->seed_index - queue->cons_index);
Keep messages to one source line and succinct as possible. Assume messages in production are going to a log manager such as journald.
Re: [PATCH 4/4] net/ark: improve Rx queue recovery after mbuf exhaustion
In reply to Ed CzeckQuoted 4 lines · On Wed, 3 Sep 2025 17:28:45 -0400 Ed Czeck <[email protected]> wrote:
drivers/net/ark/ark_ethdev_rx.c +0
-0@@ -185,12 +184,12 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, queue->reserve_q = rte_zmalloc_socket("Ark_rx_queue mbuf", nb_desc * sizeof(struct rte_mbuf *),
drivers/net/ark/ark_ethdev_rx.c eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, · line 194
Quoted 10 lines
drivers/net/ark/ark_ethdev_rx.c +2
-2-512 , +4096 , socket_id); queue->paddress_q =rte_zmalloc_socket ("Ark_rx_queue paddr" , nb_desc *sizeof (rte_iova_t), -512 , +4096 , socket_id);
Not all ARM systems use page size of 4096. Some are larger. The parameter changed is the alignment value, not the size. The allocation is taking place on huge pages where the page size is typically 2 Megabytes or larger. Why is this doing anything useful?
Re: [PATCH 4/4] net/ark: improve Rx queue recovery after mbuf exhaustion
In reply to Ed Czeckdrivers/net/ark/ark_ethdev_rx.c eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue) · line 489
Quoted 8 lines · On Wed, 3 Sep 2025 17:28:45 -0400 Ed Czeck <[email protected]> wrote:
drivers/net/ark/ark_ethdev_rx.c +8
-0+if (queue->starvation ==0 ) { +ARK_PMD_LOG (NOTICE , +"Could not allocate %u mbufs from pool" +" for RX queue %u;" +" %u free buffers remaining in queue\n" , +ARK_RX_MPU_CHUNK , queue->queue_index, + queue->seed_index - queue->cons_index); + queue->starvation =1 ;
Best to not split messages across lines, it makes it harder for users to search the source.
PATCH v2 1/4 net/ark: add PCIe IDS for newly supported devices
In reply to Ed CzeckUpdate documentation and release notes
update link speed capabilities for 200G and 400G
---
v2:
- included 2 more device id
- updated link speeds
--- doc/guides/nics/ark.rst | 7 +++++++ drivers/net/ark/ark_ethdev.c | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-)
doc/guides/nics/ark.rst +7 -0
@@ -310,6 +310,12 @@ ARK PMD supports the following Arkville RTL PCIe instances including: * ``1d6c:1024`` - AR-TK242 [2x100GbE Packet Capture Device] * ``1d6c:1025`` - AR-TK242-FX2 [2x100GbE Gen5 Packet Capture Device] * ``1d6c:1026`` - AR-TK242-FX2 [1x200GbE Gen5 Packet Capture Device] +* ``1d6c:102a`` - AR-TK242-FX2 [4x100GbE Gen5 Packet Capture Device] +* ``1d6c:102b`` - AR-ARKV-FX1 [Arkville 128B DPDK Data Mover for Versal/CPM5] +* ``1d6c:102c`` - AR-TK242-V80 [Gen5 PCAP Processor] +* ``1d6c:102d`` - AR-TK242-FX2 [8x10GbE Gen5 Packet Capture-Replay Device] +* ``1d6c:102e`` - AR-TK242-FX2 [8x25GbE Gen5 Packet Capture-Replay Device] +* ``1d6c:102f`` - AR-TK242-FX2 [1x400GbE Gen5 Packet Capture-Replay Device] Arkville RTL Core Configurations --------------------------------
@@ -322,6 +328,7 @@ stream interfaces for both AMD/Xilinx and Intel FPGAs. * ARK-FX0 - 256-bit 32B datapath (PCIe Gen3, Gen4) * ARK-FX1 - 512-bit 64B datapath (PCIe Gen3, Gen4, Gen5) +* ARKV-FX1 - 1024-bit 128B datapath (AMD PCIe Versal, Gen5 ) * ARK-FX2 - 1024-bit 128B datapath (PCIe Gen5x16 Only) DPDK and Arkville Firmware Versioning
drivers/net/ark/ark_ethdev.c +9 -1
@@ -102,6 +102,12 @@ static const struct rte_pci_id pci_id_ark_map[] = { {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1024)}, {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1025)}, {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1026)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102a)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102b)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102c)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102d)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102e)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102f)}, {.vendor_id = 0, /* sentinel */ }, };
@@ -733,7 +739,9 @@ eth_ark_dev_info_get(struct rte_eth_dev *dev,RTE_ETH_LINK_SPEED_25G |RTE_ETH_LINK_SPEED_40G |RTE_ETH_LINK_SPEED_50G | - RTE_ETH_LINK_SPEED_100G); +RTE_ETH_LINK_SPEED_100G | +RTE_ETH_LINK_SPEED_200G | + RTE_ETH_LINK_SPEED_400G); dev_info->rx_offload_capa =RTE_ETH_RX_OFFLOAD_TIMESTAMP ;
Signature · 1 line
2.34.1
PATCH v2 2/4 net/ark: remove double mbuf frees
From: John Miller <[email protected]>
--- drivers/net/ark/ark_ethdev_rx.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +0 -4
@@ -538,7 +538,6 @@ void eth_ark_dev_rx_queue_release(void *vqueue) {struct ark_rx_queue *queue; -uint32_t i; queue = (struct ark_rx_queue *)vqueue;if (queue ==0 )
@@ -551,9 +550,6 @@ eth_ark_dev_rx_queue_release(void *vqueue)/* Need to clear out mbufs here, dropping packets along the way */ eth_ark_rx_queue_drain (queue); -for (i =0 ; i < queue->queue_size; ++i) -rte_pktmbuf_free (queue->reserve_q[i]); -rte_free (queue->reserve_q);rte_free (queue->paddress_q);rte_free (queue);
Signature · 1 line
2.34.1
PATCH v2 3/4 net/ark: improve ring handling for segmented packets
In reply to Ed Czeckhandle case where complete packet is not yet available
--- drivers/net/ark/ark_ethdev_rx.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +8 -4
@@ -313,11 +313,15 @@ eth_ark_recv_pkts(void *rx_queue, } } -if (unlikely (meta->pkt_len > queue->dataroom)) - cons_index =eth_ark_rx_jumbo - (queue, meta, mbuf, cons_index +1 ); -else +if (unlikely (meta->pkt_len > queue->dataroom)) { +uint32_t tcons =eth_ark_rx_jumbo (queue, meta, mbuf, cons_index +1 ); +if ((int32_t )(prod_index - tcons) >=0 ) + cons_index = tcons;/* nominal condition */ +else +break ; + }else { cons_index +=1 ; + } rx_pkts[nb] = mbuf; nb++;
Signature · 1 line
2.34.1
PATCH v2 4/4 net/ark: improve Rx queue recovery after mbuf exhaustion
In reply to Ed Czeckuse 4-K page aligned buffers to reduce PCIe requests reduce message spew
attempt to allocate smaller chunks of buffers during starvation
---
v2:
- reduced message to single line.
- Added comments on buffer alignment. PCIe devices deal with page size of 4096 bytes. By aligning this buffer to a 4K boundary, we will reduce the number of PCIe read requests.
--- drivers/net/ark/ark_ethdev_rx.c | 34 ++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +23 -11
@@ -42,6 +42,7 @@ struct __rte_cache_aligned ark_rx_queue {rx_user_meta_hook_fn rx_user_meta_hook;void *ext_user_data; +uint32_t starvation;uint32_t dataroom;uint32_t headroom;
@@ -57,8 +58,6 @@ struct __rte_cache_aligned ark_rx_queue {/* The queue Index is used within the dpdk device structures */ uint16_t queue_index; -uint32_t unused; -/* next cache line - fields written by device */ alignas(RTE_CACHE_LINE_MIN_SIZE )RTE_MARKER cacheline1;
@@ -187,10 +186,11 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, nb_desc *sizeof (struct rte_mbuf *),512 , socket_id); +/* Align buffer to PCIe's page size of 4K to reduce upstream read requests from FPGA */ queue->paddress_q =rte_zmalloc_socket ("Ark_rx_queue paddr" , nb_desc *sizeof (rte_iova_t), -512 , +4096 , socket_id);if (queue->reserve_q ==0 || queue->paddress_q ==0 ) {
@@ -265,6 +265,9 @@ eth_ark_recv_pkts(void *rx_queue,return 0 ;if (unlikely (nb_pkts ==0 ))return 0 ; +if (unlikely (queue->starvation)) +eth_ark_rx_seed_mbufs (queue); + prod_index = queue->prod_index; cons_index = queue->cons_index;if (prod_index == cons_index)
@@ -453,7 +456,7 @@ eth_ark_rx_stop_queue(struct rte_eth_dev *dev, uint16_t queue_id)static inline int eth_ark_rx_seed_mbufs (struct ark_rx_queue *queue) { -uint32_t limit = (queue->cons_index & ~(ARK_RX_MPU_CHUNK -1 )) + +uint32_t limit =RTE_ALIGN_FLOOR (queue->cons_index,ARK_RX_MPU_CHUNK ) + queue->queue_size;uint32_t seed_index = queue->seed_index;
@@ -461,23 +464,32 @@ eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue)uint32_t seed_m = queue->seed_index & queue->queue_mask;uint32_t nb = limit - seed_index; +int status;/* Handle wrap around -- remainder is filled on the next call */ if (unlikely (seed_m + nb > queue->queue_size)) nb = queue->queue_size - seed_m;struct rte_mbuf **mbufs = &queue->reserve_q[seed_m]; -int status =rte_pktmbuf_alloc_bulk (queue->mb_pool, mbufs, nb); +do { + status =rte_pktmbuf_alloc_bulk (queue->mb_pool, mbufs, nb); +if (status ==0 ) +break ; +/* Try again with a smaller request, keeping aligned with chunk size */ + nb =RTE_ALIGN_FLOOR (nb /2 ,ARK_RX_MPU_CHUNK ); + }while (nb >=ARK_RX_MPU_CHUNK );if (unlikely (status !=0 )) { -ARK_PMD_LOG (NOTICE , -"Could not allocate %u mbufs from pool" -" for RX queue %u;" -" %u free buffers remaining in queue\n" , - nb, queue->queue_index, - queue->seed_index - queue->cons_index); +if (queue->starvation ==0 ) { +ARK_PMD_LOG (NOTICE , +"Could not allocate %u mbufs from pool for RX queue %u; %u free buffers remaining\n" , +ARK_RX_MPU_CHUNK , queue->queue_index, + queue->seed_index - queue->cons_index); + queue->starvation =1 ; + }return -1 ; } + queue->starvation =0 ;if (ARK_DEBUG_CORE ) {/* DEBUG */ while (count != nb) {
Signature · 1 line
2.34.1
PATCH v3 1/4 net/ark: add PCIe IDS for newly supported devices
In reply to Ed CzeckUpdate documentation and release notes
update link speed capabilities for 200G and 400G
---
v2:
- included 2 more device id
- updated link speeds
--- doc/guides/nics/ark.rst | 7 +++++++ drivers/net/ark/ark_ethdev.c | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-)
doc/guides/nics/ark.rst +7 -0
@@ -310,6 +310,12 @@ ARK PMD supports the following Arkville RTL PCIe instances including: * ``1d6c:1024`` - AR-TK242 [2x100GbE Packet Capture Device] * ``1d6c:1025`` - AR-TK242-FX2 [2x100GbE Gen5 Packet Capture Device] * ``1d6c:1026`` - AR-TK242-FX2 [1x200GbE Gen5 Packet Capture Device] +* ``1d6c:102a`` - AR-TK242-FX2 [4x100GbE Gen5 Packet Capture Device] +* ``1d6c:102b`` - AR-ARKV-FX1 [Arkville 128B DPDK Data Mover for Versal/CPM5] +* ``1d6c:102c`` - AR-TK242-V80 [Gen5 PCAP Processor] +* ``1d6c:102d`` - AR-TK242-FX2 [8x10GbE Gen5 Packet Capture-Replay Device] +* ``1d6c:102e`` - AR-TK242-FX2 [8x25GbE Gen5 Packet Capture-Replay Device] +* ``1d6c:102f`` - AR-TK242-FX2 [1x400GbE Gen5 Packet Capture-Replay Device] Arkville RTL Core Configurations --------------------------------
@@ -322,6 +328,7 @@ stream interfaces for both AMD/Xilinx and Intel FPGAs. * ARK-FX0 - 256-bit 32B datapath (PCIe Gen3, Gen4) * ARK-FX1 - 512-bit 64B datapath (PCIe Gen3, Gen4, Gen5) +* ARKV-FX1 - 1024-bit 128B datapath (AMD PCIe Versal, Gen5 ) * ARK-FX2 - 1024-bit 128B datapath (PCIe Gen5x16 Only) DPDK and Arkville Firmware Versioning
drivers/net/ark/ark_ethdev.c +9 -1
@@ -102,6 +102,12 @@ static const struct rte_pci_id pci_id_ark_map[] = { {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1024)}, {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1025)}, {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1026)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102a)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102b)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102c)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102d)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102e)}, + {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x102f)}, {.vendor_id = 0, /* sentinel */ }, };
@@ -733,7 +739,9 @@ eth_ark_dev_info_get(struct rte_eth_dev *dev,RTE_ETH_LINK_SPEED_25G |RTE_ETH_LINK_SPEED_40G |RTE_ETH_LINK_SPEED_50G | - RTE_ETH_LINK_SPEED_100G); +RTE_ETH_LINK_SPEED_100G | +RTE_ETH_LINK_SPEED_200G | + RTE_ETH_LINK_SPEED_400G); dev_info->rx_offload_capa =RTE_ETH_RX_OFFLOAD_TIMESTAMP ;
Signature · 1 line
2.34.1
PATCH v3 2/4 net/ark: remove double mbuf frees
From: John Miller <[email protected]>
--- drivers/net/ark/ark_ethdev_rx.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +0 -4
@@ -538,7 +538,6 @@ void eth_ark_dev_rx_queue_release(void *vqueue) {struct ark_rx_queue *queue; -uint32_t i; queue = (struct ark_rx_queue *)vqueue;if (queue ==0 )
@@ -551,9 +550,6 @@ eth_ark_dev_rx_queue_release(void *vqueue)/* Need to clear out mbufs here, dropping packets along the way */ eth_ark_rx_queue_drain (queue); -for (i =0 ; i < queue->queue_size; ++i) -rte_pktmbuf_free (queue->reserve_q[i]); -rte_free (queue->reserve_q);rte_free (queue->paddress_q);rte_free (queue);
Signature · 1 line
2.34.1
PATCH v3 3/4 net/ark: improve ring handling for segmented packets
In reply to Ed Czeckhandle case where complete packet is not yet available
--- drivers/net/ark/ark_ethdev_rx.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +8 -4
@@ -313,11 +313,15 @@ eth_ark_recv_pkts(void *rx_queue, } } -if (unlikely (meta->pkt_len > queue->dataroom)) - cons_index =eth_ark_rx_jumbo - (queue, meta, mbuf, cons_index +1 ); -else +if (unlikely (meta->pkt_len > queue->dataroom)) { +uint32_t tcons =eth_ark_rx_jumbo (queue, meta, mbuf, cons_index +1 ); +if ((int32_t )(prod_index - tcons) >=0 ) + cons_index = tcons;/* nominal condition */ +else +break ; + }else { cons_index +=1 ; + } rx_pkts[nb] = mbuf; nb++;
Signature · 1 line
2.34.1
PATCH v3 4/4 net/ark: improve Rx queue recovery after mbuf exhaustion
In reply to Ed Czeckuse 4-K aligned buffers to reduce PCIe requests reduce message spew
attempt to allocate smaller chunks of buffers during starvation
---
v3:
- Use #define for pcie boundary
The PCIE spec states "requests must not specify an Address/Length combination that causes a Memory Space access to cross a 4-KB boundary." Buffer alignment to 4KB boundaries will minimize the number of 4-KB boundary in a given buffer and then can reduce TLP read requests from FPGA to host.
v2:
- reduced message to single line.
- Added comments on buffer alignment. PCIe devices deal with page size of 4096 bytes. By aligning this buffer to a 4K boundary, we will reduce the number of PCIe read requests.
--- drivers/net/ark/ark_ethdev_rx.c | 35 ++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-)
drivers/net/ark/ark_ethdev_rx.c +24 -11
@@ -14,6 +14,7 @@#define ARK_RX_META_SIZE 32#define ARK_RX_META_OFFSET (RTE_PKTMBUF_HEADROOM - ARK_RX_META_SIZE)#define ARK_RX_MPU_CHUNK (64U) +#define ARK_PCIE_BOUNDARY 4096/* Forward declarations */ struct ark_rx_queue ;
@@ -42,6 +43,7 @@ struct __rte_cache_aligned ark_rx_queue {rx_user_meta_hook_fn rx_user_meta_hook;void *ext_user_data; +uint32_t starvation;uint32_t dataroom;uint32_t headroom;
@@ -57,8 +59,6 @@ struct __rte_cache_aligned ark_rx_queue {/* The queue Index is used within the dpdk device structures */ uint16_t queue_index; -uint32_t unused; -/* next cache line - fields written by device */ alignas(RTE_CACHE_LINE_MIN_SIZE )RTE_MARKER cacheline1;
@@ -187,10 +187,11 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, nb_desc *sizeof (struct rte_mbuf *),512 , socket_id); +/* Align buffer to PCIe's boundary size to reduce upstream read request TLPs from FPGA */ queue->paddress_q =rte_zmalloc_socket ("Ark_rx_queue paddr" , nb_desc *sizeof (rte_iova_t), -512 , +ARK_PCIE_BOUNDARY , socket_id);if (queue->reserve_q ==0 || queue->paddress_q ==0 ) {
@@ -265,6 +266,9 @@ eth_ark_recv_pkts(void *rx_queue,return 0 ;if (unlikely (nb_pkts ==0 ))return 0 ; +if (unlikely (queue->starvation)) +eth_ark_rx_seed_mbufs (queue); + prod_index = queue->prod_index; cons_index = queue->cons_index;if (prod_index == cons_index)
@@ -453,7 +457,7 @@ eth_ark_rx_stop_queue(struct rte_eth_dev *dev, uint16_t queue_id)static inline int eth_ark_rx_seed_mbufs (struct ark_rx_queue *queue) { -uint32_t limit = (queue->cons_index & ~(ARK_RX_MPU_CHUNK -1 )) + +uint32_t limit =RTE_ALIGN_FLOOR (queue->cons_index,ARK_RX_MPU_CHUNK ) + queue->queue_size;uint32_t seed_index = queue->seed_index;
@@ -461,23 +465,32 @@ eth_ark_rx_seed_mbufs(struct ark_rx_queue *queue)uint32_t seed_m = queue->seed_index & queue->queue_mask;uint32_t nb = limit - seed_index; +int status;/* Handle wrap around -- remainder is filled on the next call */ if (unlikely (seed_m + nb > queue->queue_size)) nb = queue->queue_size - seed_m;struct rte_mbuf **mbufs = &queue->reserve_q[seed_m]; -int status =rte_pktmbuf_alloc_bulk (queue->mb_pool, mbufs, nb); +do { + status =rte_pktmbuf_alloc_bulk (queue->mb_pool, mbufs, nb); +if (status ==0 ) +break ; +/* Try again with a smaller request, keeping aligned with chunk size */ + nb =RTE_ALIGN_FLOOR (nb /2 ,ARK_RX_MPU_CHUNK ); + }while (nb >=ARK_RX_MPU_CHUNK );if (unlikely (status !=0 )) { -ARK_PMD_LOG (NOTICE , -"Could not allocate %u mbufs from pool" -" for RX queue %u;" -" %u free buffers remaining in queue\n" , - nb, queue->queue_index, - queue->seed_index - queue->cons_index); +if (queue->starvation ==0 ) { +ARK_PMD_LOG (NOTICE , +"Could not allocate %u mbufs from pool for RX queue %u; %u free buffers remaining\n" , +ARK_RX_MPU_CHUNK , queue->queue_index, + queue->seed_index - queue->cons_index); + queue->starvation =1 ; + }return -1 ; } + queue->starvation =0 ;if (ARK_DEBUG_CORE ) {/* DEBUG */ while (count != nb) {
Signature · 1 line
2.34.1
Quoted 5 lines · On Mon, 15 Sep 2025 11:02:01 -0400 Ed Czeck <[email protected]> wrote:
Update documentation and release notes
update link speed capabilities for 200G and 400GSigned-off-by Ed Czeck <[email protected]>---
Patches queued to next-net