Skip to content

[BUG] Account for TX hardware encap/push overhead in raw MTU sizing #199

@MikesRND

Description

@MikesRND

Describe the bug

Raw-engine MTU sizing accounts for RX decap/pop overhead, but does not include TX hardware encap/push overhead.

For TX transform flows, the application frame fits the configured TX memory region, but the NIC egress wire frame grows after VLAN push or VXLAN/GRE/NVGRE encap — so the MTU can be too small for the transmitted frame.

Current code:

  • DPDK adds RX overhead via flow_max_decap_wire_overhead(rx.flows_).
  • ibverbs ensure_port_mtus() adds RX overhead via flow_max_decap_wire_overhead(intf.rx_.flows_).
  • TX transform overhead is validated with flow_action_wire_overhead(), but is not included in MTU sizing.
  • DPDK TX-only configs are currently cushioned by generated dummy RX queues, which PR #197 - Fix DPDK MTU sizing for asymmetric RX/TX queues #198 preserves.
  • ibverbs creates no dummy queues, so TX-only VLAN-push or tunnel-encap configs may already undersize the netdev MTU.

Steps/Code to reproduce bug

Suggested repro target (Needs hardware confirmation):

  1. Use a raw ibverbs TX-only config.

  2. Configure a TX flow with VLAN push or VXLAN/GRE/NVGRE encap.

  3. Choose a TX buffer frame where:

    TX buffer frame + encap overhead > configured netdev MTU

  4. Start DAQIRI and confirm MTU sizing covers only the TX buffer frame, not the post-encap wire frame.

  5. Send traffic and check NIC/peer counters for drops or missing packets.

Expected behavior

For raw DPDK and raw ibverbs, MTU sizing should be direction-aware:

  • RX required frame = max RX queue buffer frame + max RX decap/pop overhead.
  • TX required frame = max TX queue buffer frame + max TX encap/push overhead.
  • Required port frame = max(RX required frame, TX required frame).

A TX-side helper such as flow_max_encap_wire_overhead(tx.flows_) could mirror flow_max_decap_wire_overhead() and reuse flow_action_wire_overhead().

Environment overview

  • Environment location: Docker or bare-metal
  • Method of DAQIRI install: source

Environment details

Observed by code inspection on current main (PR #198 context); hardware repro still needed.

Relevant code paths:

  • include/daqiri/types.h: flow_action_wire_overhead(), flow_max_decap_wire_overhead()
  • src/engines/dpdk/daqiri_dpdk_engine.cpp: DPDK MTU sizing
  • src/engines/ibverbs/daqiri_ibverbs_engine.cpp: ensure_port_mtus()

Additional context

This is separate from PR #198, which fixes DPDK asymmetric RX/TX queue-buffer MTU sizing without changing TX transform accounting.

Follow-up cleanup after this fix:

  • Once TX transform overhead is included in MTU sizing, DPDK can also stop counting generated dummy RX queues there, making dummy queues consistently setup-only without risking a TX-only transform regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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