HomeFreeBSD

Fix PR222744 - netmap errors with iflib em driver

Description

Fix PR222744 - netmap errors with iflib em driver

Fix error when refilling netmap buffers that resulted in the first
buffer of the successive passes through ifl_bus_addrs[] leaving the
first value unset (tmp_pidx started at 1, not zero after the first time
through the loop).

Leave the one unused buffer required by some NICs visible in the netmap
ring rather than hidden. There will always be a buffer in use by the
kernel now when an iflib driver is used via netmap.

Always get the netmap slot index via netmap_idx_n2k() to account for
nkr_hwofs in a consistent way.

Split shared functionality into new functions.
iru_init(): shared by _iflib_fl_refill() and netmap_fl_refill()
netmap_fl_refill(): shared by iflib_netmap_rxsync() and
iflib_netmap_rxq_init()

PR: 222744
Reported by: Shirkdog <mshirk@daemon-security.com>
Reviewed by: sbruno
Approved by: sbruno (mentor)
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D12769

Details

Provenance
shurdAuthored on
Reviewer
sbruno
Differential Revision
D12769: Fix PR222744 - netmap errors with iflib em driver
Parents
rS325166: Avoid enabling MSI-X if MSI-X is disabled globally
Branches
Unknown
Tags
Unknown