Describe the bug
DpdkMgr::send_tx_burst() leaks packet mbufs when rte_ring_enqueue() fails. The failure path calls free_tx_burst(burst), which returns the TX burst pointer arrays and metadata, but it does not free the packet mbufs allocated by get_tx_packet_burst().
Steps/Code to reproduce bug
- Use the DPDK raw TX path.
- Allocate a TX burst and packet mbufs with
get_tx_packet_burst().
- Populate the burst.
- Call
send_tx_burst() when the TX work ring is full, causing rte_ring_enqueue() to fail.
At that point, send_tx_burst() returns NO_SPACE_AVAILABLE after freeing only the burst metadata/pointer arrays, so the application no longer has handles for the packet mbufs.
Expected behavior
If send_tx_burst() cannot enqueue the burst, DAQIRI should free all unsubmitted packet mbufs before releasing the burst metadata.
Environment overview (please complete the following information)
- Environment location: Source review
- Method of DAQIRI install: source
Environment details
- DAQIRI version: current
main
Additional context
The public API docs distinguish free_tx_burst() from free_all_packets_and_burst_tx(): free_tx_burst() frees metadata only and expects packet buffers to have already been freed. On the enqueue-failure path, the packets were never submitted to the TX worker, so send_tx_burst() must clean them up itself.
Describe the bug
DpdkMgr::send_tx_burst()leaks packet mbufs whenrte_ring_enqueue()fails. The failure path callsfree_tx_burst(burst), which returns the TX burst pointer arrays and metadata, but it does not free the packet mbufs allocated byget_tx_packet_burst().Steps/Code to reproduce bug
get_tx_packet_burst().send_tx_burst()when the TX work ring is full, causingrte_ring_enqueue()to fail.At that point,
send_tx_burst()returnsNO_SPACE_AVAILABLEafter freeing only the burst metadata/pointer arrays, so the application no longer has handles for the packet mbufs.Expected behavior
If
send_tx_burst()cannot enqueue the burst, DAQIRI should free all unsubmitted packet mbufs before releasing the burst metadata.Environment overview (please complete the following information)
Environment details
mainAdditional context
The public API docs distinguish
free_tx_burst()fromfree_all_packets_and_burst_tx():free_tx_burst()frees metadata only and expects packet buffers to have already been freed. On the enqueue-failure path, the packets were never submitted to the TX worker, sosend_tx_burst()must clean them up itself.