Module Name:    src
Committed By:   jakllsch
Date:           Tue Jan  3 19:33:32 UTC 2023

Modified Files:
        src/sys/dev/pci: virtio.c

Log Message:
Subtly adjust criteria for notification of Virtio devices in
VIRTIO_F_RING_EVENT_IDX mode.

This fixes stalls in the vioif(4) transmit path that would happen sooner
or later, depending on interface transmit utilization, and were
particularly noticable with a NetBSD guest transmitting to its x86 KVM
host at multi-gigabit speeds.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/pci/virtio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.64 src/sys/dev/pci/virtio.c:1.65
--- src/sys/dev/pci/virtio.c:1.64	Fri Dec 30 21:38:13 2022
+++ src/sys/dev/pci/virtio.c	Tue Jan  3 19:33:31 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: virtio.c,v 1.64 2022/12/30 21:38:13 jakllsch Exp $	*/
+/*	$NetBSD: virtio.c,v 1.65 2023/01/03 19:33:31 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.64 2022/12/30 21:38:13 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.65 2023/01/03 19:33:31 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1148,7 +1148,7 @@ notify:
 		uint16_t o, n, t;
 		uint16_t flags;
 
-		o = virtio_rw16(sc, vq->vq_avail->idx);
+		o = virtio_rw16(sc, vq->vq_avail->idx) - 1;
 		n = vq->vq_avail_idx;
 
 		/*

Reply via email to