aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/virtio
diff options
context:
space:
mode:
authorVincenzo Maffione <vmaffione@FreeBSD.org>2020-06-03 17:42:17 +0000
committerVincenzo Maffione <vmaffione@FreeBSD.org>2020-06-03 17:42:17 +0000
commit2d769e25b1d525edcf747c2058ce2b7c9e6c6699 (patch)
treec3940b93b51224ca48f5d04fc250554ba63816f5 /sys/dev/virtio
parent78a3645fd239a1be33fc181bd28d5b52df54e4f0 (diff)
downloadsrc-2d769e25b1d525edcf747c2058ce2b7c9e6c6699.tar.gz
src-2d769e25b1d525edcf747c2058ce2b7c9e6c6699.zip
netmap: vtnet: add vtnrx_nm_refill index to receive queues
The new index tracks the next netmap slot that is going to be enqueued into the virtqueue. The index is necessary to prevent the receive VQ and the netmap rx ring from going out of sync, considering that we never enqueue N slots, but at most N-1. This change fixes a bug that causes the VQ and the netmap ring to go out of sync after N-1 packets have been received. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=361758
Diffstat (limited to 'sys/dev/virtio')
-rw-r--r--sys/dev/virtio/network/if_vtnetvar.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/dev/virtio/network/if_vtnetvar.h b/sys/dev/virtio/network/if_vtnetvar.h
index 69340c0ec65e..e2e1f3362360 100644
--- a/sys/dev/virtio/network/if_vtnetvar.h
+++ b/sys/dev/virtio/network/if_vtnetvar.h
@@ -80,6 +80,7 @@ struct vtnet_rxq {
struct taskqueue *vtnrx_tq;
struct task vtnrx_intrtask;
#ifdef DEV_NETMAP
+ uint32_t vtnrx_nm_refill;
struct virtio_net_hdr_mrg_rxbuf vtnrx_shrhdr;
#endif /* DEV_NETMAP */
char vtnrx_name[16];