HomeFreeBSD

netmap: iflib: fix asserts in netmap_fl_refill()

Description

netmap: iflib: fix asserts in netmap_fl_refill()

When netmap_fl_refill() is called at initialization time (e.g.,
during netmap_iflib_register()), nic_i must be 0, since the
free list is reinitialized. At the end of the refill cycle, nic_i
must still be zero, because exactly N descriptors (N is the ring size)
are refilled.
This patch therefore fixes the assertions to check on nic_i rather
than on nm_i. The current netmap_reset() may in fact cause nm_i
to be != 0 while the device is resetting: this may happen when
multiple non-cooperating processes open different subsets of the
available netmap rings.

PR: 252518
MFC after: 1 week

Details

Provenance
vmaffioneAuthored on Jan 9 2021, 9:35 PM
Parents
rG1d238b07d5d4: netmap: iflib: stop krings during interface reset
Branches
Unknown
Tags
Unknown