Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/jdolecek-ncq]: src/sys/dev/ata make usage of NCQ 'high' priority for BPR...
details: https://anonhg.NetBSD.org/src/rev/6eb99136766f
branches: jdolecek-ncq
changeset: 352795:6eb99136766f
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Sat Oct 07 15:24:36 2017 +0000
description:
make usage of NCQ 'high' priority for BPRIO_TIMECRITICAL xfers settable via
sysctl, too
diffstat:
sys/dev/ata/wd.c | 19 ++++++++++++++++---
sys/dev/ata/wdvar.h | 5 ++++-
2 files changed, 20 insertions(+), 4 deletions(-)
diffs (66 lines):
diff -r f1cdb4ab6a02 -r 6eb99136766f sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c Sat Sep 30 21:32:31 2017 +0000
+++ b/sys/dev/ata/wd.c Sat Oct 07 15:24:36 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wd.c,v 1.428.2.35 2017/09/28 20:34:23 jdolecek Exp $ */
+/* $NetBSD: wd.c,v 1.428.2.36 2017/10/07 15:24:36 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -54,7 +54,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.35 2017/09/28 20:34:23 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.428.2.36 2017/10/07 15:24:36 jdolecek Exp $");
#include "opt_ata.h"
#include "opt_wd.h"
@@ -751,7 +751,7 @@
xfer->c_bio.flags |= ATA_LBA48;
xfer->c_flags |= C_NCQ;
- if ((wd->drvp->drive_flags & ATA_DRIVE_NCQ_PRIO) &&
+ if (WD_USE_NCQ_PRIO(wd) &&
BIO_GETPRIO(bp) == BPRIO_TIMECRITICAL)
xfer->c_bio.flags |= ATA_PRIO_HIGH;
}
@@ -2360,6 +2360,19 @@
return;
}
+ wd->drv_ncq_prio = true;
+ if ((error = sysctl_createv(&wd->nodelog, 0, NULL, NULL,
+ CTLFLAG_READWRITE, CTLTYPE_BOOL, "use_ncq_prio",
+ SYSCTL_DESCR("use NCQ PRIORITY if supported"),
+ NULL, 0, &wd->drv_ncq_prio, 0,
+ CTL_HW, node->sysctl_num, CTL_CREATE, CTL_EOL))
+ != 0) {
+ aprint_error_dev(wd->sc_dev,
+ "could not create %s.%s.use_ncq_prio sysctl - error %d\n",
+ "hw", device_xname(wd->sc_dev), error);
+ return;
+ }
+
#ifdef WD_CHAOS_MONKEY
wd->drv_chaos_freq = 0;
if ((error = sysctl_createv(&wd->nodelog, 0, NULL, NULL,
diff -r f1cdb4ab6a02 -r 6eb99136766f sys/dev/ata/wdvar.h
--- a/sys/dev/ata/wdvar.h Sat Sep 30 21:32:31 2017 +0000
+++ b/sys/dev/ata/wdvar.h Sat Oct 07 15:24:36 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdvar.h,v 1.43.4.9 2017/09/28 20:34:23 jdolecek Exp $ */
+/* $NetBSD: wdvar.h,v 1.43.4.10 2017/10/07 15:24:36 jdolecek Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -78,6 +78,9 @@
bool drv_ncq;
#define WD_USE_NCQ(wd) \
((wd)->drv_ncq && ((wd)->drvp->drive_flags & ATA_DRIVE_NCQ))
+ bool drv_ncq_prio;
+#define WD_USE_NCQ_PRIO(wd) \
+ ((wd)->drv_ncq_prio && ((wd)->drvp->drive_flags & ATA_DRIVE_NCQ_PRIO))
#ifdef WD_CHAOS_MONKEY
int drv_chaos_freq; /* frequency of simulated bio errors */
int drv_chaos_cnt; /* count of processed bio read xfers */
Home |
Main Index |
Thread Index |
Old Index