Skip to content

[BUG] DPDK RX flow creation failures are silently ignored #128

@dleshchev

Description

@dleshchev

Summary

The DPDK RX flow-creation loop in DpdkMgr::initialize() ignores whether each flow was actually programmed into the NIC. A specific flow can silently fail to be created while the send-to-kernel fallback (added in #125) succeeds — the result is that every packet is quietly delegated to the Linux kernel and the application receives nothing, with no hard error surfaced.

Detail

In src/managers/dpdk/daqiri_dpdk_mgr.cpp (the loop around 2386-2395):

for (const auto& flow : rx.flows_) {
  DAQIRI_LOG_INFO("Adding RX flow {}", flow.name_);
  if (flow.match_.type_ == FlowMatchType::FLEX_ITEM) {
    add_flex_item_flow(intf.port_id_, flow.match_.flex_item_match_, flow.action_.id_);
    has_flex_item_flows = true;
  } else {
    add_flow(intf.port_id_, flow);
    has_standard_flows = true;
  }
}

Neither return value is checked:

  • add_flow() returns struct rte_flow* and yields nullptr on failure — the result is discarded.
  • add_flex_item_flow() only printfs on validation/creation failure and otherwise returns the (possibly null) flow.

Because PR #125 now installs a catch-all SEND_TO_KERNEL fallback at priority 100 in the same group, a config where the specific flow failed to create but the fallback succeeded will look healthy at startup, route all traffic to the kernel, and deliver zero packets to the app.

Suggested fix

Harden the flow loop to match the new fallback path: check the return of add_flow() / add_flex_item_flow(), log a CRITICAL on failure, and either abort initialize() (return;, consistent with the EalCleanupGuard + initialized_ mechanism) or at minimum surface a hard error so the silent kernel-only state is detectable.

Context

Follow-up from the review of #125 (DPDK flow isolation ordering). Largely pre-existing, but adjacent to the path that PR hardened — worth fixing while the area is fresh.

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