Module Name:    src
Committed By:   jakllsch
Date:           Thu Jul 12 12:48:50 UTC 2018

Modified Files:
        src/sys/arch/arm/arm: cpufunc.c
        src/sys/arch/arm/arm32: vm_machdep.c
        src/sys/dev/pci: ld_virtio.c
        src/sys/dev/virtio: files.virtio

Log Message:
<sys/pmc.h> is gone; dont


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/arch/arm/arm/cpufunc.c
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/arm/arm32/vm_machdep.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/pci/ld_virtio.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/virtio/files.virtio

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

Modified files:

Index: src/sys/arch/arm/arm/cpufunc.c
diff -u src/sys/arch/arm/arm/cpufunc.c:1.169 src/sys/arch/arm/arm/cpufunc.c:1.170
--- src/sys/arch/arm/arm/cpufunc.c:1.169	Thu Jul 12 10:46:42 2018
+++ src/sys/arch/arm/arm/cpufunc.c	Thu Jul 12 12:48:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpufunc.c,v 1.169 2018/07/12 10:46:42 maxv Exp $	*/
+/*	$NetBSD: cpufunc.c,v 1.170 2018/07/12 12:48:50 jakllsch Exp $	*/
 
 /*
  * arm7tdmi support code Copyright (c) 2001 John Fremlin
@@ -49,14 +49,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.169 2018/07/12 10:46:42 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpufunc.c,v 1.170 2018/07/12 12:48:50 jakllsch Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_cpuoptions.h"
 
 #include <sys/types.h>
 #include <sys/param.h>
-#include <sys/pmc.h>
 #include <sys/systm.h>
 #include <machine/cpu.h>
 #include <machine/bootconfig.h>

Index: src/sys/arch/arm/arm32/vm_machdep.c
diff -u src/sys/arch/arm/arm32/vm_machdep.c:1.74 src/sys/arch/arm/arm32/vm_machdep.c:1.75
--- src/sys/arch/arm/arm32/vm_machdep.c:1.74	Thu Jul 12 10:46:42 2018
+++ src/sys/arch/arm/arm32/vm_machdep.c	Thu Jul 12 12:48:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm_machdep.c,v 1.74 2018/07/12 10:46:42 maxv Exp $	*/
+/*	$NetBSD: vm_machdep.c,v 1.75 2018/07/12 12:48:50 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.74 2018/07/12 10:46:42 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.75 2018/07/12 12:48:50 jakllsch Exp $");
 
 #include "opt_armfpe.h"
 #include "opt_pmap_debug.h"
@@ -57,7 +57,6 @@ __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c
 #include <sys/vnode.h>
 #include <sys/cpu.h>
 #include <sys/buf.h>
-#include <sys/pmc.h>
 #include <sys/exec.h>
 #include <sys/syslog.h>
 

Index: src/sys/dev/pci/ld_virtio.c
diff -u src/sys/dev/pci/ld_virtio.c:1.23 src/sys/dev/pci/ld_virtio.c:1.24
--- src/sys/dev/pci/ld_virtio.c:1.23	Thu Jun 21 16:47:06 2018
+++ src/sys/dev/pci/ld_virtio.c	Thu Jul 12 12:48:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_virtio.c,v 1.23 2018/06/21 16:47:06 jakllsch Exp $	*/
+/*	$NetBSD: ld_virtio.c,v 1.24 2018/07/12 12:48:50 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.23 2018/06/21 16:47:06 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.24 2018/07/12 12:48:50 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -38,6 +38,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,
 #include <sys/disk.h>
 #include <sys/mutex.h>
 #include <sys/module.h>
+#include <sys/sysctl.h>
 
 #include <dev/ldvar.h>
 #include <dev/pci/virtioreg.h>
@@ -144,6 +145,25 @@ struct ld_virtio_softc {
 	uint8_t			sc_sync_status;
 };
 
+int ld_virtio_notify_threshold = 0;
+
+static void
+setup_sysctl(void)
+{
+	static bool done;
+
+	if (done)
+		return;
+
+	done = true;
+
+	sysctl_createv(NULL, 0, NULL, NULL,
+	    CTLFLAG_READWRITE, CTLTYPE_INT, "ld_virtio_notify_threshold",
+	    SYSCTL_DESCR(""),
+	    NULL, 0, &ld_virtio_notify_threshold, 0,
+	    CTL_HW, CTL_CREATE, CTL_EOL);
+}
+
 static int	ld_virtio_match(device_t, cfdata_t, void *);
 static void	ld_virtio_attach(device_t, device_t, void *);
 static int	ld_virtio_detach(device_t, int);
@@ -276,7 +296,7 @@ ld_virtio_attach(device_t parent, device
 	sc->sc_virtio = vsc;
 
 	virtio_child_attach_start(vsc, self, IPL_BIO, &sc->sc_vq,
-	    NULL, virtio_vq_intr, 0,
+	    NULL, virtio_vq_intr, VIRTIO_F_PCI_INTR_MPSAFE|VIRTIO_F_PCI_INTR_MSIX,
 	    (VIRTIO_BLK_F_SIZE_MAX | VIRTIO_BLK_F_SEG_MAX |
 	     VIRTIO_BLK_F_GEOMETRY | VIRTIO_BLK_F_RO | VIRTIO_BLK_F_BLK_SIZE |
 	     VIRTIO_BLK_F_FLUSH | VIRTIO_BLK_F_CONFIG_WCE),
@@ -369,6 +389,8 @@ ld_virtio_attach(device_t parent, device
 	ld->sc_flags = LDF_ENABLED | LDF_MPSAFE;
 	ldattach(ld, BUFQ_DISK_DEFAULT_STRAT);
 
+	setup_sysctl();
+
 	return;
 
 err:
@@ -441,7 +463,10 @@ ld_virtio_start(struct ld_softc *ld, str
 			 offsetof(struct virtio_blk_req, vr_status),
 			 sizeof(uint8_t),
 			 false);
-	virtio_enqueue_commit(vsc, vq, slot, true);
+	const bool notify = !dk_strategy_pending(&sc->sc_ld.sc_dksc) ||
+	    sc->sc_ld.sc_queuecnt + 1 >= sc->sc_ld.sc_maxqueuecnt ||
+	    sc->sc_ld.sc_queuecnt + 1 >= (sc->sc_ld.sc_maxqueuecnt * ld_virtio_notify_threshold / 1000);
+	virtio_enqueue_commit(vsc, vq, slot, notify);
 
 	return 0;
 }

Index: src/sys/dev/virtio/files.virtio
diff -u src/sys/dev/virtio/files.virtio:1.2 src/sys/dev/virtio/files.virtio:1.3
--- src/sys/dev/virtio/files.virtio:1.2	Wed Jun  6 20:35:36 2018
+++ src/sys/dev/virtio/files.virtio	Thu Jul 12 12:48:50 2018
@@ -1,6 +1,11 @@
-#	$NetBSD: files.virtio,v 1.2 2018/06/06 20:35:36 jakllsch Exp $
+#	$NetBSD: files.virtio,v 1.3 2018/07/12 12:48:50 jakllsch Exp $
 
 # XXX the contents of the following included file should be moved here
 include "dev/pci/files.virtio"
 
 file	dev/virtio/virtio_mmio.c	virtio_mmio
+
+device	viocon
+attach	viocon at virtio
+file	dev/virtio/viocon.c		viocon	needs-flag
+

Reply via email to