netmap operates in two modes:
- Emulated - netmap handling is done by the network stack, the
NIC driver operates transparently to netmap.
- 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:
- IFCAP_NETMAP - Check whether netmap capability is enabled on
the device.
- 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.