]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
netmap: vtnet: fix RX virtqueue initialization bug
authorVincenzo Maffione <vmaffione@FreeBSD.org>
Mon, 1 Jun 2020 16:10:44 +0000 (16:10 +0000)
committerVincenzo Maffione <vmaffione@FreeBSD.org>
Mon, 1 Jun 2020 16:10:44 +0000 (16:10 +0000)
commitc9de157d3639e1ef99cd4bcbaa92d2a35c9da3bf
tree0b3ab7148b35649b6b22dd9b246982f39b856719
parentb4ee4ce1584d65967e3a75dfccbf7bf65675babd
netmap: vtnet: fix RX virtqueue initialization bug

The vtnet_netmap_rxq_populate() function erroneously assumed
that kring->nr_hwcur = 0, i.e. the kring was in the initial
state. However, this is not always the case: for example,
when a vtnet reinit is triggered by some changes in the
interface flags or capenable.
This patch changes the behaviour of vtnet_netmap_kring_refill()
so that it always starts publishing the netmap buffers starting
from the current value of kring->nr_hwcur.

MFC after: 1 week
sys/dev/netmap/if_vtnet_netmap.h