HomeFreeBSD

netmap: vtnet: call netmap_rx_irq() under VQ lock

Description

netmap: vtnet: call netmap_rx_irq() under VQ lock

The netmap_rx_irq() function normally wakes up user-space threads
waiting for more packets. In this case, it is not necessary to
call it under the driver queue lock. However, if the interface is
attached to a VALE switch, netmap_rx_irq() ends up calling rxsync
on the interface (see netmap_bwrap_intr_notify()). Although
concurrent rxsyncs are serialized through the kring lock
(see nm_kr_tryget()), the lock acquire operation is not blocking.
As a result, it may happen that netmap_rx_irq() is called on
an RX ring while another instance is running, causing the
second call to fail, and received packets stall in the receive VQ.
We fix this issue by calling netmap_irx_irq() under the VQ lock.

MFC after: 1 week

Details

Provenance
vmaffioneAuthored on Jun 3 2020, 5:27 AM
Parents
rG1b89d00bd436: netmap: vtnet: honor NM_IRQ_RESCHED
Branches
Unknown
Tags
Unknown

Event Timeline