Page MenuHomeFreeBSD

ena: Verify that an ENA ring is in netmap only in native mode
ClosedPublic

Authored by akiyano_amazon.com on Mar 7 2026, 12:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 5, 3:00 PM
Unknown Object (File)
Sun, Apr 5, 9:22 AM
Unknown Object (File)
Wed, Apr 1, 4:47 PM
Unknown Object (File)
Wed, Apr 1, 10:47 AM
Unknown Object (File)
Mon, Mar 30, 2:21 AM
Unknown Object (File)
Wed, Mar 25, 1:59 PM
Unknown Object (File)
Tue, Mar 24, 10:35 PM
Unknown Object (File)
Mon, Mar 23, 8:15 AM
Subscribers

Details

Summary

netmap operates in two modes:

  1. Emulated - netmap handling is done by the network stack, the

NIC driver operates transparently to netmap.

  1. Native - netmap management is done by the NIC driver.

When checking whether a specific ENA ring is running in netmap
mode, only the following checks were done:

  1. IFCAP_NETMAP - Check whether netmap capability is enabled on

the device.

  1. NKR_NETMAP_ON - Check whether netmap is actively using this

ring.

The above checks implied that the netmap mode is native and the
ENA driver needs to handle the netmap logic.
The code was missing an explicit check on whether native mode
is actually on (NAF_NATIVE).
This led to a case where though emulated mode was used and
a netmap application was turned on, the ENA driver still managed
netmap logic partially and caused missing buffers and lack of
refill as part of the datapath.

Note: Enabling netmap emulated mode is insufficient and there's
a need to load a netmap program in order to trigger this use-case.

Add an explicit check of whether NAF_NATIVE mode is set.

The issue was reported in [1].

[1]: https://github.com/amzn/amzn-drivers/issues/361

Fixes: 358bcc4c6cde ("Add support for ENA NETMAP partial initialization")
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

akiyano_amazon.com created this object with edit policy "No One".
akiyano_amazon.com changed the edit policy from "No One" to "All Users".Mar 7 2026, 1:24 AM
This revision is now accepted and ready to land.Mar 7 2026, 5:58 AM