On 1/12/2024 12:29 PM, Morten Brørup wrote: >> From: Ferruh Yigit [mailto:ferruh.yi...@amd.com] >> Sent: Friday, 12 January 2024 12.34 >> >> On 1/11/2024 3:17 PM, jer...@marvell.com wrote: >>> From: Jerin Jacob <jer...@marvell.com> >>> >>> Introduce a new API to retrieve the number of used descriptors >>> in a Tx queue. Applications can leverage this API in the fast path to >>> inspect the Tx queue occupancy and take appropriate actions based on >> the >>> available free descriptors. >>> >>> A notable use case could be implementing Random Early Discard (RED) >>> in software based on Tx queue occupancy.
<...> >>> /** >>> * @internal >>> * Structure used to hold opaque pointers to internal ethdev Rx/Tx >>> @@ -116,7 +119,9 @@ struct rte_eth_fp_ops { >>> eth_tx_descriptor_status_t tx_descriptor_status; >>> /** Copy used mbufs from Tx mbuf ring into Rx. */ >>> eth_recycle_tx_mbufs_reuse_t recycle_tx_mbufs_reuse; >>> - uintptr_t reserved2[2]; >>> + /** Get the number of used Tx descriptors. */ >>> + eth_tx_queue_count_t tx_queue_count; >>> >> >> Similarly, can you please move it above 'tx_descriptor_status'? > > No. I think struct rte_eth_fp_ops is part of the public API, so moving down > tx_descriptor_status and recycle_tx_mbufs_reuse would break the API. > ack (Dave highlighted the same)