Skip to content

[BUG] DPDK TX enqueue failure leaks packet mbufs #131

@fallintoplace

Description

@fallintoplace

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

  1. Use the DPDK raw TX path.
  2. Allocate a TX burst and packet mbufs with get_tx_packet_burst().
  3. Populate the burst.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions