Search code examples
dpdk

DPDK buffers received from the RX ring and freeded on the TX path


Consider a DPDK program where each EAL thread:

  • receives a packet on its own RX queue
  • modifies the buffer in place
  • puts it back on the TX ring to echo it back to the sender

The RX buffers are not explicitely freeed as they are re-used on the TX ring. Is it good practice to depend on the TX queue to be processed by the NIC to free up entries in the RX ring?


Solution

  • The buffers successfully put in the Tx queue will be freed by the PMD. That’s the only option, so yes it’s a good practice.

    Please note though, that placing a burst of packets in the Tx queue might fail, as the queue might be full for some reason. So if there are any packets left unqueued after rte_eth_tx_burst(), those must be freed manually or the transmission must be retried.