svn commit: r248791 - in user/attilio/vmcontention: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers contrib/bind9 lib/bind lib/bind/dns lib/bind/dns/dns lib/libc/sys lib/libpmc sbin/nv...
Attilio Rao
attilio at FreeBSD.org
Wed Mar 27 11:31:44 UTC 2013
Author: attilio
Date: Wed Mar 27 11:31:39 2013
New Revision: 248791
URL: http://svnweb.freebsd.org/changeset/base/248791
Log:
MFC
Added:
user/attilio/vmcontention/sys/mips/atheros/ar933x_chip.c
- copied unchanged from r248790, head/sys/mips/atheros/ar933x_chip.c
user/attilio/vmcontention/sys/mips/atheros/ar933x_chip.h
- copied unchanged from r248790, head/sys/mips/atheros/ar933x_chip.h
user/attilio/vmcontention/sys/mips/atheros/ar933x_uart.h
- copied unchanged from r248790, head/sys/mips/atheros/ar933x_uart.h
user/attilio/vmcontention/sys/mips/atheros/ar933xreg.h
- copied unchanged from r248790, head/sys/mips/atheros/ar933xreg.h
Modified:
user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d
user/attilio/vmcontention/contrib/bind9/CHANGES
user/attilio/vmcontention/contrib/bind9/config.h.in
user/attilio/vmcontention/contrib/bind9/configure.in
user/attilio/vmcontention/contrib/bind9/version
user/attilio/vmcontention/lib/bind/config.h
user/attilio/vmcontention/lib/bind/dns/code.h
user/attilio/vmcontention/lib/bind/dns/dns/enumclass.h
user/attilio/vmcontention/lib/bind/dns/dns/enumtype.h
user/attilio/vmcontention/lib/bind/dns/dns/rdatastruct.h
user/attilio/vmcontention/lib/libc/sys/accept.2
user/attilio/vmcontention/lib/libpmc/pmc.sandybridgexeon.3
user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.8
user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.c
user/attilio/vmcontention/share/mk/bsd.own.mk
user/attilio/vmcontention/share/mk/bsd.prog.mk
user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
user/attilio/vmcontention/sys/dev/ath/if_ath.c
user/attilio/vmcontention/sys/dev/ath/if_ath_beacon.c
user/attilio/vmcontention/sys/dev/ath/if_ath_misc.h
user/attilio/vmcontention/sys/dev/ath/if_ath_tx.c
user/attilio/vmcontention/sys/dev/ath/if_ath_tx_edma.c
user/attilio/vmcontention/sys/dev/ath/if_athvar.h
user/attilio/vmcontention/sys/dev/isci/isci_controller.c
user/attilio/vmcontention/sys/dev/isci/isci_io_request.c
user/attilio/vmcontention/sys/dev/nvd/nvd.c
user/attilio/vmcontention/sys/dev/nvme/nvme.c
user/attilio/vmcontention/sys/dev/nvme/nvme.h
user/attilio/vmcontention/sys/dev/nvme/nvme_ctrlr.c
user/attilio/vmcontention/sys/dev/nvme/nvme_ctrlr_cmd.c
user/attilio/vmcontention/sys/dev/nvme/nvme_ns.c
user/attilio/vmcontention/sys/dev/nvme/nvme_ns_cmd.c
user/attilio/vmcontention/sys/dev/nvme/nvme_private.h
user/attilio/vmcontention/sys/dev/nvme/nvme_qpair.c
user/attilio/vmcontention/sys/dev/nvme/nvme_sysctl.c
user/attilio/vmcontention/sys/dev/nvme/nvme_test.c
user/attilio/vmcontention/sys/dev/nvme/nvme_uio.c
user/attilio/vmcontention/sys/dev/sound/pci/hda/hdaa_patches.c
user/attilio/vmcontention/sys/geom/gate/g_gate.c
user/attilio/vmcontention/sys/geom/geom_dev.c
user/attilio/vmcontention/sys/geom/geom_slice.c
user/attilio/vmcontention/sys/geom/nop/g_nop.c
user/attilio/vmcontention/sys/geom/raid/tr_raid1e.c
user/attilio/vmcontention/sys/i386/include/param.h
user/attilio/vmcontention/sys/kern/kern_physio.c
user/attilio/vmcontention/sys/kern/vfs_bio.c
user/attilio/vmcontention/sys/mips/atheros/ar71xx_chip.c
user/attilio/vmcontention/sys/mips/atheros/ar71xx_cpudef.h
user/attilio/vmcontention/sys/mips/atheros/ar724x_chip.c
user/attilio/vmcontention/sys/mips/atheros/ar91xx_chip.c
user/attilio/vmcontention/sys/netgraph/netflow/netflow.c
user/attilio/vmcontention/sys/netgraph/netflow/ng_netflow.c
user/attilio/vmcontention/sys/sys/conf.h
user/attilio/vmcontention/sys/vm/vm_radix.c
user/attilio/vmcontention/usr.sbin/config/main.c
user/attilio/vmcontention/usr.sbin/newsyslog/newsyslog.c
user/attilio/vmcontention/usr.sbin/watchdogd/watchdogd.8
user/attilio/vmcontention/usr.sbin/watchdogd/watchdogd.c
Directory Properties:
user/attilio/vmcontention/ (props changed)
user/attilio/vmcontention/cddl/ (props changed)
user/attilio/vmcontention/cddl/contrib/opensolaris/ (props changed)
user/attilio/vmcontention/contrib/bind9/ (props changed)
user/attilio/vmcontention/lib/libc/ (props changed)
user/attilio/vmcontention/sbin/ (props changed)
user/attilio/vmcontention/sys/ (props changed)
user/attilio/vmcontention/sys/cddl/contrib/opensolaris/ (props changed)
Modified: user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d
==============================================================================
--- user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pointers/err.InvalidAddress5.d Wed Mar 27 11:31:39 2013 (r248791)
@@ -24,7 +24,9 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2012 by Delphix. All rights reserved.
+ */
/*
* ASSERTION:
@@ -32,44 +34,51 @@
* a runtime error.
*
* SECTION: Pointers and Arrays/Generic Pointers
- *
- * NOTES:
- * This test doesn't apply to x86; for the time being, we're working
- * around this with the preprocessor.
*/
#pragma D option quiet
-int array[3];
-uintptr_t uptr;
+#if defined(__i386) || defined(__amd64)
+#define __x86 1
+#endif
+
+int array[2];
+char *ptr;
int *p;
int *q;
int *r;
BEGIN
{
-#ifdef __i386
+ array[0] = 0x12345678;
+ array[1] = 0xabcdefff;
+
+ ptr = (char *) &array[0];
+
+ p = (int *) (ptr);
+ q = (int *) (ptr + 2);
+ r = (int *) (ptr + 3);
+
+ printf("*p: 0x%x\n", *p);
+ printf("*q: 0x%x\n", *q);
+ printf("*r: 0x%x\n", *r);
+
+ /*
+ * On x86, the above unaligned memory accesses are allowed and should
+ * not result in the ERROR probe firing.
+ */
+#ifdef __x86
exit(1);
#else
- array[0] = 20;
- array[1] = 40;
- array[2] = 80;
-
- uptr = (uintptr_t) &array[0];
-
- p = (int *) (uptr);
- q = (int *) (uptr + 2);
- r = (int *) (uptr + 3);
-
- printf("array[0]: %d\t*p: %d\n", array[0], *p);
- printf("array[1]: %d\t*q: %d\n", array[1], *q);
- printf("array[2]: %d\t*r: %d\n", array[2], *r);
-
exit(0);
#endif
}
ERROR
{
+#ifdef __x86
+ exit(0);
+#else
exit(1);
+#endif
}
Modified: user/attilio/vmcontention/contrib/bind9/CHANGES
==============================================================================
--- user/attilio/vmcontention/contrib/bind9/CHANGES Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/contrib/bind9/CHANGES Wed Mar 27 11:31:39 2013 (r248791)
@@ -1,3 +1,10 @@
+ --- 9.8.4-P2 released ---
+
+3516. [security] Removed the check for regex.h in configure in order
+ to disable regex syntax checking, as it exposes
+ BIND to a critical flaw in libregex on some
+ platforms. [RT #32688]
+
--- 9.8.4-P1 released ---
3407. [security] Named could die on specific queries with dns64 enabled.
Modified: user/attilio/vmcontention/contrib/bind9/config.h.in
==============================================================================
--- user/attilio/vmcontention/contrib/bind9/config.h.in Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/contrib/bind9/config.h.in Wed Mar 27 11:31:39 2013 (r248791)
@@ -286,9 +286,6 @@ int sigwait(const unsigned int *set, int
/* Define if your OpenSSL version supports GOST. */
#undef HAVE_OPENSSL_GOST
-/* Define to 1 if you have the <regex.h> header file. */
-#undef HAVE_REGEX_H
-
/* Define to 1 if you have the `setegid' function. */
#undef HAVE_SETEGID
Modified: user/attilio/vmcontention/contrib/bind9/configure.in
==============================================================================
--- user/attilio/vmcontention/contrib/bind9/configure.in Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/contrib/bind9/configure.in Wed Mar 27 11:31:39 2013 (r248791)
@@ -298,7 +298,7 @@ esac
AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h regex.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,,
+AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h sys/sockio.h sys/select.h sys/param.h sys/sysctl.h net/if6.h,,,
[$ac_includes_default
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
Modified: user/attilio/vmcontention/contrib/bind9/version
==============================================================================
--- user/attilio/vmcontention/contrib/bind9/version Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/contrib/bind9/version Wed Mar 27 11:31:39 2013 (r248791)
@@ -7,4 +7,4 @@ MAJORVER=9
MINORVER=8
PATCHVER=4
RELEASETYPE=-P
-RELEASEVER=1
+RELEASEVER=2
Modified: user/attilio/vmcontention/lib/bind/config.h
==============================================================================
--- user/attilio/vmcontention/lib/bind/config.h Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/lib/bind/config.h Wed Mar 27 11:31:39 2013 (r248791)
@@ -286,9 +286,6 @@ int sigwait(const unsigned int *set, int
/* Define if your OpenSSL version supports GOST. */
/* #undef HAVE_OPENSSL_GOST */
-/* Define to 1 if you have the <regex.h> header file. */
-#define HAVE_REGEX_H 1
-
/* Define to 1 if you have the `setegid' function. */
#define HAVE_SETEGID 1
Modified: user/attilio/vmcontention/lib/bind/dns/code.h
==============================================================================
--- user/attilio/vmcontention/lib/bind/dns/code.h Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/lib/bind/dns/code.h Wed Mar 27 11:31:39 2013 (r248791)
@@ -1,7 +1,7 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
Modified: user/attilio/vmcontention/lib/bind/dns/dns/enumclass.h
==============================================================================
--- user/attilio/vmcontention/lib/bind/dns/dns/enumclass.h Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/lib/bind/dns/dns/enumclass.h Wed Mar 27 11:31:39 2013 (r248791)
@@ -1,7 +1,7 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
Modified: user/attilio/vmcontention/lib/bind/dns/dns/enumtype.h
==============================================================================
--- user/attilio/vmcontention/lib/bind/dns/dns/enumtype.h Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/lib/bind/dns/dns/enumtype.h Wed Mar 27 11:31:39 2013 (r248791)
@@ -1,7 +1,7 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
Modified: user/attilio/vmcontention/lib/bind/dns/dns/rdatastruct.h
==============================================================================
--- user/attilio/vmcontention/lib/bind/dns/dns/rdatastruct.h Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/lib/bind/dns/dns/rdatastruct.h Wed Mar 27 11:31:39 2013 (r248791)
@@ -1,7 +1,7 @@
/* $FreeBSD$ */
/*
- * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1998-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
Modified: user/attilio/vmcontention/lib/libc/sys/accept.2
==============================================================================
--- user/attilio/vmcontention/lib/libc/sys/accept.2 Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/lib/libc/sys/accept.2 Wed Mar 27 11:31:39 2013 (r248791)
@@ -28,7 +28,7 @@
.\" @(#)accept.2 8.2 (Berkeley) 12/11/93
.\" $FreeBSD$
.\"
-.Dd December 11, 1993
+.Dd March 26, 2013
.Dt ACCEPT 2
.Os
.Sh NAME
@@ -57,7 +57,13 @@ queue of pending connections, creates a
and allocates a new file descriptor for the socket which
inherits the state of the
.Dv O_NONBLOCK
-property from the original socket
+and
+.Dv O_ASYNC
+properties and the destination of
+.Dv SIGIO
+and
+.Dv SIGURG
+signals from the original socket
.Fa s .
.Pp
If no pending connections are
@@ -129,7 +135,11 @@ to pre-process incoming connections.
.Pp
Portable programs should not rely on the
.Dv O_NONBLOCK
-property being inherited.
+and
+.Dv O_ASYNC
+properties and the signal destination being inherited,
+but should set them explicitly using
+.Xr fcntl 2 .
.Sh RETURN VALUES
The call returns \-1 on error.
If it succeeds, it returns a non-negative
Modified: user/attilio/vmcontention/lib/libpmc/pmc.sandybridgexeon.3
==============================================================================
--- user/attilio/vmcontention/lib/libpmc/pmc.sandybridgexeon.3 Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/lib/libpmc/pmc.sandybridgexeon.3 Wed Mar 27 11:31:39 2013 (r248791)
@@ -219,7 +219,7 @@ L1D.
.It Li MISALIGN_MEM_REF.STORES
.Pq Event 05H , Umask 02H
Speculative cache-line split Store- address uops
-dispatchedto L1D.
+dispatched to L1D.
.It Li LD_BLOCKS_PARTIAL.ADDRESS_ALIAS
.Pq Event 07H , Umask 01H
False dependencies in MOB due to partial compare on
Modified: user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.8
==============================================================================
--- user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.8 Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.8 Wed Mar 27 11:31:39 2013 (r248791)
@@ -33,7 +33,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 17, 2012
+.Dd March 26, 2013
.Dt NVMECONTROL 8
.Os
.Sh NAME
@@ -54,7 +54,10 @@
.Op Fl p
.Aq Fl s Ar size_in_bytes
.Aq Fl t Ar time_in_sec
-.Aq device id
+.Aq namespace id
+.Nm
+.Ic reset
+.Aq controller id
.Sh DESCRIPTION
NVM Express (NVMe) is a storage protocol standard, for SSDs and other
high-speed storage devices over PCI Express.
@@ -62,6 +65,7 @@ high-speed storage devices over PCI Expr
.Dl nvmecontrol devlist
.Pp
Display a list of NVMe controllers and namespaces along with their device nodes.
+.Pp
.Dl nvmecontrol identify nvme0
.Pp
Display a human-readable summary of the nvme0 IDENTIFY_CONTROLLER data.
@@ -76,6 +80,10 @@ Display a hexadecimal dump of the nvme0
Run a performance test on nvme0ns1 using 32 kernel threads for 30 seconds. Each
thread will issue a single 512 byte read command. Results are printed to
stdout when 30 seconds expires.
+.Pp
+.Dl nvmecontrol reset nvme0
+.Pp
+Perform a controller-level reset of the nvme0 controller.
.Sh AUTHORS
.An -nosplit
.Nm
Modified: user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.c
==============================================================================
--- user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.c Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/sbin/nvmecontrol/nvmecontrol.c Wed Mar 27 11:31:39 2013 (r248791)
@@ -56,6 +56,9 @@ __FBSDID("$FreeBSD$");
" <-i intr|wait> [-f refthread] [-p]\n" \
" <namespace id>\n"
+#define RESET_USAGE \
+" nvmecontrol reset <controller id>\n"
+
static void perftest_usage(void);
static void
@@ -64,6 +67,7 @@ usage(void)
fprintf(stderr, "usage:\n");
fprintf(stderr, DEVLIST_USAGE);
fprintf(stderr, IDENTIFY_USAGE);
+ fprintf(stderr, RESET_USAGE);
fprintf(stderr, PERFTEST_USAGE);
exit(EX_USAGE);
}
@@ -241,13 +245,15 @@ devlist(int argc, char *argv[])
fd = open(path, O_RDWR);
if (fd < 0) {
- printf("Could not open %s.\n", path);
+ printf("Could not open %s. errno=%d (%s)\n", path,
+ errno, strerror(errno));
exit_code = EX_NOPERM;
continue;
}
- if (ioctl(fd, NVME_IDENTIFY_CONTROLLER, &cdata) == -1) {
- printf("ioctl to %s failed.\n", path);
+ if (ioctl(fd, NVME_IDENTIFY_CONTROLLER, &cdata) < 0) {
+ printf("Identify request to %s failed. errno=%d (%s)\n",
+ path, errno, strerror(errno));
exit_code = EX_IOERR;
continue;
}
@@ -260,12 +266,15 @@ devlist(int argc, char *argv[])
fd = open(path, O_RDWR);
if (fd < 0) {
- printf("Could not open %s.\n", path);
+ printf("Could not open %s. errno=%d (%s)\n",
+ path, errno, strerror(errno));
exit_code = EX_NOPERM;
continue;
}
- if (ioctl(fd, NVME_IDENTIFY_NAMESPACE, &nsdata) == -1) {
- printf("ioctl to %s failed.\n", path);
+ if (ioctl(fd, NVME_IDENTIFY_NAMESPACE, &nsdata) < 0) {
+ printf("Identify request to %s failed. "
+ "errno=%d (%s)\n", path, errno,
+ strerror(errno));
exit_code = EX_IOERR;
continue;
}
@@ -307,19 +316,22 @@ identify_ctrlr(int argc, char *argv[])
sprintf(path, "/dev/%s", argv[optind]);
- if (stat(path, &devstat) != 0) {
- printf("Invalid device node '%s'.\n", path);
+ if (stat(path, &devstat) < 0) {
+ printf("Invalid device node %s. errno=%d (%s)\n", path, errno,
+ strerror(errno));
exit(EX_IOERR);
}
fd = open(path, O_RDWR);
if (fd < 0) {
- printf("Could not open %s.\n", path);
+ printf("Could not open %s. errno=%d (%s)\n", path, errno,
+ strerror(errno));
exit(EX_NOPERM);
}
- if (ioctl(fd, NVME_IDENTIFY_CONTROLLER, &cdata) == -1) {
- printf("ioctl to %s failed.\n", path);
+ if (ioctl(fd, NVME_IDENTIFY_CONTROLLER, &cdata) < 0) {
+ printf("Identify request to %s failed. errno=%d (%s)\n", path,
+ errno, strerror(errno));
exit(EX_IOERR);
}
@@ -366,19 +378,22 @@ identify_ns(int argc, char *argv[])
sprintf(path, "/dev/%s", argv[optind]);
- if (stat(path, &devstat) != 0) {
- printf("Invalid device node '%s'.\n", path);
+ if (stat(path, &devstat) < 0) {
+ printf("Invalid device node %s. errno=%d (%s)\n", path, errno,
+ strerror(errno));
exit(EX_IOERR);
}
fd = open(path, O_RDWR);
if (fd < 0) {
- printf("Could not open %s.\n", path);
+ printf("Could not open %s. errno=%d (%s)\n", path, errno,
+ strerror(errno));
exit(EX_NOPERM);
}
- if (ioctl(fd, NVME_IDENTIFY_NAMESPACE, &nsdata) == -1) {
- printf("ioctl to %s failed.\n", path);
+ if (ioctl(fd, NVME_IDENTIFY_NAMESPACE, &nsdata) < 0) {
+ printf("Identify request to %s failed. errno=%d (%s)\n", path,
+ errno, strerror(errno));
exit(EX_IOERR);
}
@@ -475,7 +490,7 @@ perftest(int argc, char *argv[])
char path[64];
u_long ioctl_cmd = NVME_IO_TEST;
bool nflag, oflag, sflag, tflag;
- int err, perthread = 0;
+ int perthread = 0;
nflag = oflag = sflag = tflag = false;
name = NULL;
@@ -565,14 +580,14 @@ perftest(int argc, char *argv[])
fd = open(path, O_RDWR);
if (fd < 0) {
- fprintf(stderr, "%s not valid device.\n", path);
+ fprintf(stderr, "%s not valid device. errno=%d (%s)\n", path,
+ errno, strerror(errno));
perftest_usage();
}
- err = ioctl(fd, ioctl_cmd, &io_test);
-
- if (err) {
- fprintf(stderr, "NVME_IO_TEST returned %d\n", errno);
+ if (ioctl(fd, ioctl_cmd, &io_test) < 0) {
+ fprintf(stderr, "NVME_IO_TEST failed. errno=%d (%s)\n", errno,
+ strerror(errno));
exit(EX_IOERR);
}
@@ -580,6 +595,44 @@ perftest(int argc, char *argv[])
exit(EX_OK);
}
+static void
+reset_ctrlr(int argc, char *argv[])
+{
+ struct stat devstat;
+ char path[64];
+ int ch, fd;
+
+ while ((ch = getopt(argc, argv, "")) != -1) {
+ switch ((char)ch) {
+ default:
+ usage();
+ }
+ }
+
+ sprintf(path, "/dev/%s", argv[optind]);
+
+ if (stat(path, &devstat) < 0) {
+ printf("Invalid device node %s. errno=%d (%s)\n", path, errno,
+ strerror(errno));
+ exit(EX_IOERR);
+ }
+
+ fd = open(path, O_RDWR);
+ if (fd < 0) {
+ printf("Could not open %s. errno=%d (%s)\n", path, errno,
+ strerror(errno));
+ exit(EX_NOPERM);
+ }
+
+ if (ioctl(fd, NVME_RESET_CONTROLLER) < 0) {
+ printf("Reset request to %s failed. errno=%d (%s)\n", path,
+ errno, strerror(errno));
+ exit(EX_IOERR);
+ }
+
+ exit(EX_OK);
+}
+
int
main(int argc, char *argv[])
{
@@ -593,6 +646,8 @@ main(int argc, char *argv[])
identify(argc-1, &argv[1]);
else if (strcmp(argv[1], "perftest") == 0)
perftest(argc-1, &argv[1]);
+ else if (strcmp(argv[1], "reset") == 0)
+ reset_ctrlr(argc-1, &argv[1]);
usage();
Modified: user/attilio/vmcontention/share/mk/bsd.own.mk
==============================================================================
--- user/attilio/vmcontention/share/mk/bsd.own.mk Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/share/mk/bsd.own.mk Wed Mar 27 11:31:39 2013 (r248791)
@@ -117,7 +117,7 @@ __<bsd.own.mk>__:
.if !defined(_WITHOUT_SRCCONF)
SRCCONF?= /etc/src.conf
-.if exists(${SRCCONF})
+.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf"
.include "${SRCCONF}"
.endif
.endif
Modified: user/attilio/vmcontention/share/mk/bsd.prog.mk
==============================================================================
--- user/attilio/vmcontention/share/mk/bsd.prog.mk Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/share/mk/bsd.prog.mk Wed Mar 27 11:31:39 2013 (r248791)
@@ -41,6 +41,7 @@ PROG= ${PROG_CXX}
.endif
.if defined(PROG)
+PROGNAME?= ${PROG}
.if defined(SRCS)
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
@@ -73,7 +74,7 @@ SRCS= ${PROG}.c
# - the name of the object gets put into the executable symbol table instead of
# the name of a variable temporary object.
# - it's useful to keep objects around for crunching.
-OBJS= ${PROG}.o
+OBJS+= ${PROG}.o
.if target(beforelinking)
beforelinking: ${OBJS}
@@ -153,13 +154,8 @@ realinstall: _proginstall
.ORDER: beforeinstall _proginstall
_proginstall:
.if defined(PROG)
-.if defined(PROGNAME)
${INSTALL} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME}
-.else
- ${INSTALL} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
- ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}
-.endif
.endif
.endif # !target(realinstall)
Modified: user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Wed Mar 27 11:31:39 2013 (r248791)
@@ -443,7 +443,7 @@ static kmutex_t dtrace_errlock;
#define DTRACE_STORE(type, tomax, offset, what) \
*((type *)((uintptr_t)(tomax) + (uintptr_t)offset)) = (type)(what);
-#ifndef __i386
+#ifndef __x86
#define DTRACE_ALIGNCHECK(addr, size, flags) \
if (addr & (size - 1)) { \
*flags |= CPU_DTRACE_BADALIGN; \
Modified: user/attilio/vmcontention/sys/dev/ath/if_ath.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/if_ath.c Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/sys/dev/ath/if_ath.c Wed Mar 27 11:31:39 2013 (r248791)
@@ -2474,6 +2474,7 @@ _ath_getbuf_locked(struct ath_softc *sc,
/* XXX TODO: should do this at buffer list initialisation */
/* XXX (then, ensure the buffer has the right flag set) */
+ bf->bf_flags = 0;
if (btype == ATH_BUFTYPE_MGMT)
bf->bf_flags |= ATH_BUF_MGMT;
else
@@ -2530,7 +2531,7 @@ ath_buf_clone(struct ath_softc *sc, cons
/* Copy basics */
tbf->bf_next = NULL;
tbf->bf_nseg = bf->bf_nseg;
- tbf->bf_flags = bf->bf_flags & ~ATH_BUF_BUSY;
+ tbf->bf_flags = bf->bf_flags & ATH_BUF_FLAGS_CLONE;
tbf->bf_status = bf->bf_status;
tbf->bf_m = bf->bf_m;
/*
@@ -3410,6 +3411,7 @@ ath_txq_init(struct ath_softc *sc, struc
txq->axq_softc = sc;
TAILQ_INIT(&txq->axq_q);
TAILQ_INIT(&txq->axq_tidq);
+ TAILQ_INIT(&txq->fifo.axq_q);
ATH_TXQ_LOCK_INIT(sc, txq);
}
@@ -4169,7 +4171,7 @@ ath_returnbuf_head(struct ath_softc *sc,
/*
* Free the holding buffer if it exists
*/
-static void
+void
ath_txq_freeholdingbuf(struct ath_softc *sc, struct ath_txq *txq)
{
ATH_TXBUF_LOCK_ASSERT(sc);
@@ -4283,6 +4285,61 @@ ath_tx_freebuf(struct ath_softc *sc, str
*/
}
+static struct ath_buf *
+ath_tx_draintxq_get_one(struct ath_softc *sc, struct ath_txq *txq)
+{
+ struct ath_buf *bf;
+
+ ATH_TXQ_LOCK_ASSERT(txq);
+
+ /*
+ * Drain the FIFO queue first, then if it's
+ * empty, move to the normal frame queue.
+ */
+ bf = TAILQ_FIRST(&txq->fifo.axq_q);
+ if (bf != NULL) {
+ /*
+ * Is it the last buffer in this set?
+ * Decrement the FIFO counter.
+ */
+ if (bf->bf_flags & ATH_BUF_FIFOEND) {
+ if (txq->axq_fifo_depth == 0) {
+ device_printf(sc->sc_dev,
+ "%s: Q%d: fifo_depth=0, fifo.axq_depth=%d?\n",
+ __func__,
+ txq->axq_qnum,
+ txq->fifo.axq_depth);
+ } else
+ txq->axq_fifo_depth--;
+ }
+ ATH_TXQ_REMOVE(&txq->fifo, bf, bf_list);
+ return (bf);
+ }
+
+ /*
+ * Debugging!
+ */
+ if (txq->axq_fifo_depth != 0 || txq->fifo.axq_depth != 0) {
+ device_printf(sc->sc_dev,
+ "%s: Q%d: fifo_depth=%d, fifo.axq_depth=%d\n",
+ __func__,
+ txq->axq_qnum,
+ txq->axq_fifo_depth,
+ txq->fifo.axq_depth);
+ }
+
+ /*
+ * Now drain the pending queue.
+ */
+ bf = TAILQ_FIRST(&txq->axq_q);
+ if (bf == NULL) {
+ txq->axq_link = NULL;
+ return (NULL);
+ }
+ ATH_TXQ_REMOVE(txq, bf, bf_list);
+ return (bf);
+}
+
void
ath_tx_draintxq(struct ath_softc *sc, struct ath_txq *txq)
{
@@ -4298,24 +4355,11 @@ ath_tx_draintxq(struct ath_softc *sc, st
*/
for (ix = 0;; ix++) {
ATH_TXQ_LOCK(txq);
- bf = TAILQ_FIRST(&txq->axq_q);
+ bf = ath_tx_draintxq_get_one(sc, txq);
if (bf == NULL) {
- txq->axq_link = NULL;
- /*
- * There's currently no flag that indicates
- * a buffer is on the FIFO. So until that
- * occurs, just clear the FIFO counter here.
- *
- * Yes, this means that if something in parallel
- * is pushing things onto this TXQ and pushing
- * _that_ into the hardware, things will get
- * very fruity very quickly.
- */
- txq->axq_fifo_depth = 0;
ATH_TXQ_UNLOCK(txq);
break;
}
- ATH_TXQ_REMOVE(txq, bf, bf_list);
if (bf->bf_state.bfs_aggr)
txq->axq_aggr_depth--;
#ifdef ATH_DEBUG
Modified: user/attilio/vmcontention/sys/dev/ath/if_ath_beacon.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/if_ath_beacon.c Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/sys/dev/ath/if_ath_beacon.c Wed Mar 27 11:31:39 2013 (r248791)
@@ -474,6 +474,10 @@ ath_beacon_proc(void *arg, int pending)
vap = sc->sc_bslot[slot];
if (vap != NULL && vap->iv_state >= IEEE80211_S_RUN) {
bf = ath_beacon_generate(sc, vap);
+ /*
+ * XXX TODO: this should use settxdesclinkptr()
+ * otherwise it won't work for EDMA chipsets!
+ */
if (bf != NULL) {
/* XXX should do this using the ds */
*bflink = bf->bf_daddr;
@@ -482,6 +486,10 @@ ath_beacon_proc(void *arg, int pending)
}
}
}
+ /*
+ * XXX TODO: this should use settxdesclinkptr()
+ * otherwise it won't work for EDMA chipsets!
+ */
*bflink = 0; /* terminate list */
}
@@ -540,17 +548,99 @@ ath_beacon_proc(void *arg, int pending)
}
}
-/*
- * Start CABQ transmission - this assumes that all frames are prepped
- * and ready in the CABQ.
- *
- * XXX TODO: methodize this; for the EDMA case it should only push
- * into the hardware if the FIFO isn't full _AND_ then it should
- * tag the final buffer in the queue as ATH_BUF_FIFOEND so the FIFO
- * depth is correctly accounted for.
- */
-void
-ath_beacon_cabq_start(struct ath_softc *sc)
+static void
+ath_beacon_cabq_start_edma(struct ath_softc *sc)
+{
+ struct ath_buf *bf, *bf_last;
+ struct ath_txq *cabq = sc->sc_cabq;
+#if 0
+ struct ath_buf *bfi;
+ int i = 0;
+#endif
+
+ ATH_TXQ_LOCK_ASSERT(cabq);
+
+ if (TAILQ_EMPTY(&cabq->axq_q))
+ return;
+ bf = TAILQ_FIRST(&cabq->axq_q);
+ bf_last = TAILQ_LAST(&cabq->axq_q, axq_q_s);
+
+ /*
+ * This is a dirty, dirty hack to push the contents of
+ * the cabq staging queue into the FIFO.
+ *
+ * This ideally should live in the EDMA code file
+ * and only push things into the CABQ if there's a FIFO
+ * slot.
+ *
+ * We can't treat this like a normal TX queue because
+ * in the case of multi-VAP traffic, we may have to flush
+ * the CABQ each new (staggered) beacon that goes out.
+ * But for non-staggered beacons, we could in theory
+ * handle multicast traffic for all VAPs in one FIFO
+ * push. Just keep all of this in mind if you're wondering
+ * how to correctly/better handle multi-VAP CABQ traffic
+ * with EDMA.
+ */
+
+ /*
+ * Is the CABQ FIFO free? If not, complain loudly and
+ * don't queue anything. Maybe we'll flush the CABQ
+ * traffic, maybe we won't. But that'll happen next
+ * beacon interval.
+ */
+ if (cabq->axq_fifo_depth >= HAL_TXFIFO_DEPTH) {
+ device_printf(sc->sc_dev,
+ "%s: Q%d: CAB FIFO queue=%d?\n",
+ __func__,
+ cabq->axq_qnum,
+ cabq->axq_fifo_depth);
+ return;
+ }
+
+ /*
+ * Ok, so here's the gymnastics reqiured to make this
+ * all sensible.
+ */
+
+ /*
+ * Tag the first/last buffer appropriately.
+ */
+ bf->bf_flags |= ATH_BUF_FIFOPTR;
+ bf_last->bf_flags |= ATH_BUF_FIFOEND;
+
+#if 0
+ i = 0;
+ TAILQ_FOREACH(bfi, &cabq->axq_q, bf_list) {
+ ath_printtxbuf(sc, bf, cabq->axq_qnum, i, 0);
+ i++;
+ }
+#endif
+
+ /*
+ * We now need to push this set of frames onto the tail
+ * of the FIFO queue. We don't adjust the aggregate
+ * count, only the queue depth counter(s).
+ * We also need to blank the link pointer now.
+ */
+ TAILQ_CONCAT(&cabq->fifo.axq_q, &cabq->axq_q, bf_list);
+ cabq->axq_link = NULL;
+ cabq->fifo.axq_depth += cabq->axq_depth;
+ cabq->axq_depth = 0;
+
+ /* Bump FIFO queue */
+ cabq->axq_fifo_depth++;
+
+ /* Push the first entry into the hardware */
+ ath_hal_puttxbuf(sc->sc_ah, cabq->axq_qnum, bf->bf_daddr);
+
+ /* NB: gated by beacon so safe to start here */
+ ath_hal_txstart(sc->sc_ah, cabq->axq_qnum);
+
+}
+
+static void
+ath_beacon_cabq_start_legacy(struct ath_softc *sc)
{
struct ath_buf *bf;
struct ath_txq *cabq = sc->sc_cabq;
@@ -567,6 +657,26 @@ ath_beacon_cabq_start(struct ath_softc *
ath_hal_txstart(sc->sc_ah, cabq->axq_qnum);
}
+/*
+ * Start CABQ transmission - this assumes that all frames are prepped
+ * and ready in the CABQ.
+ */
+void
+ath_beacon_cabq_start(struct ath_softc *sc)
+{
+ struct ath_txq *cabq = sc->sc_cabq;
+
+ ATH_TXQ_LOCK_ASSERT(cabq);
+
+ if (TAILQ_EMPTY(&cabq->axq_q))
+ return;
+
+ if (sc->sc_isedma)
+ ath_beacon_cabq_start_edma(sc);
+ else
+ ath_beacon_cabq_start_legacy(sc);
+}
+
struct ath_buf *
ath_beacon_generate(struct ath_softc *sc, struct ieee80211vap *vap)
{
@@ -632,29 +742,33 @@ ath_beacon_generate(struct ath_softc *sc
/* NB: only at DTIM */
ATH_TXQ_LOCK(&avp->av_mcastq);
if (nmcastq) {
- struct ath_buf *bfm;
+ struct ath_buf *bfm, *bfc_last;
/*
* Move frames from the s/w mcast q to the h/w cab q.
*
- * XXX TODO: This should be methodized - the EDMA
- * CABQ setup code may look different!
- *
* XXX TODO: if we chain together multiple VAPs
* worth of CABQ traffic, should we keep the
* MORE data bit set on the last frame of each
* intermediary VAP (ie, only clear the MORE
* bit of the last frame on the last vap?)
- *
- * XXX TODO: once we append this, what happens
- * to cabq->axq_link? It'll point at the avp
- * mcastq link pointer, so things should be OK.
- * Just double-check this is what actually happens.
*/
bfm = TAILQ_FIRST(&avp->av_mcastq.axq_q);
ATH_TXQ_LOCK(cabq);
- if (cabq->axq_link != NULL)
- *cabq->axq_link = bfm->bf_daddr;
+
+ /*
+ * If there's already a frame on the CABQ, we
+ * need to link to the end of the last frame.
+ * We can't use axq_link here because
+ * EDMA descriptors require some recalculation
+ * (checksum) to occur.
+ */
+ bfc_last = ATH_TXQ_LAST(cabq, axq_q_s);
+ if (bfc_last != NULL) {
+ ath_hal_settxdesclink(sc->sc_ah,
+ bfc_last->bf_lastds,
+ bfm->bf_daddr);
+ }
ath_txqmove(cabq, &avp->av_mcastq);
ATH_TXQ_UNLOCK(cabq);
/*
Modified: user/attilio/vmcontention/sys/dev/ath/if_ath_misc.h
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/if_ath_misc.h Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/sys/dev/ath/if_ath_misc.h Wed Mar 27 11:31:39 2013 (r248791)
@@ -77,6 +77,8 @@ extern int ath_hal_gethangstate(struct a
extern void ath_tx_freebuf(struct ath_softc *sc, struct ath_buf *bf,
int status);
+extern void ath_txq_freeholdingbuf(struct ath_softc *sc,
+ struct ath_txq *txq);
extern void ath_txqmove(struct ath_txq *dst, struct ath_txq *src);
Modified: user/attilio/vmcontention/sys/dev/ath/if_ath_tx.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/if_ath_tx.c Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/sys/dev/ath/if_ath_tx.c Wed Mar 27 11:31:39 2013 (r248791)
@@ -704,21 +704,22 @@ ath_tx_handoff_mcast(struct ath_softc *s
("%s: busy status 0x%x", __func__, bf->bf_flags));
ATH_TXQ_LOCK(txq);
- if (txq->axq_link != NULL) {
- struct ath_buf *last = ATH_TXQ_LAST(txq, axq_q_s);
+ if (ATH_TXQ_LAST(txq, axq_q_s) != NULL) {
+ struct ath_buf *bf_last = ATH_TXQ_LAST(txq, axq_q_s);
struct ieee80211_frame *wh;
/* mark previous frame */
- wh = mtod(last->bf_m, struct ieee80211_frame *);
+ wh = mtod(bf_last->bf_m, struct ieee80211_frame *);
wh->i_fc[1] |= IEEE80211_FC1_MORE_DATA;
- bus_dmamap_sync(sc->sc_dmat, last->bf_dmamap,
+ bus_dmamap_sync(sc->sc_dmat, bf_last->bf_dmamap,
BUS_DMASYNC_PREWRITE);
/* link descriptor */
- *txq->axq_link = bf->bf_daddr;
+ ath_hal_settxdesclink(sc->sc_ah,
+ bf_last->bf_lastds,
+ bf->bf_daddr);
}
ATH_TXQ_INSERT_TAIL(txq, bf, bf_list);
- ath_hal_gettxdesclinkptr(sc->sc_ah, bf->bf_lastds, &txq->axq_link);
ATH_TXQ_UNLOCK(txq);
}
@@ -1815,7 +1816,8 @@ ath_tx_start(struct ath_softc *sc, struc
* XXX duplicated in ath_raw_xmit().
*/
if (IEEE80211_IS_MULTICAST(wh->i_addr1)) {
- if (sc->sc_cabq->axq_depth > sc->sc_txq_mcastq_maxdepth) {
+ if (sc->sc_cabq->axq_depth + sc->sc_cabq->fifo.axq_depth
+ > sc->sc_txq_mcastq_maxdepth) {
sc->sc_stats.ast_tx_mcastq_overflow++;
r = ENOBUFS;
}
@@ -2218,7 +2220,8 @@ ath_raw_xmit(struct ieee80211_node *ni,
* XXX duplicated in ath_tx_start().
*/
if (IEEE80211_IS_MULTICAST(wh->i_addr1)) {
- if (sc->sc_cabq->axq_depth > sc->sc_txq_mcastq_maxdepth) {
+ if (sc->sc_cabq->axq_depth + sc->sc_cabq->fifo.axq_depth
+ > sc->sc_txq_mcastq_maxdepth) {
sc->sc_stats.ast_tx_mcastq_overflow++;
error = ENOBUFS;
}
@@ -2844,7 +2847,7 @@ ath_tx_swq(struct ath_softc *sc, struct
*
* Otherwise, schedule the TID.
*/
- if (txq->axq_depth < sc->sc_hwq_limit) {
+ if (txq->axq_depth + txq->fifo.axq_depth < sc->sc_hwq_limit) {
bf = ATH_TID_FIRST(atid);
ATH_TID_REMOVE(atid, bf, bf_list);
@@ -2868,7 +2871,7 @@ ath_tx_swq(struct ath_softc *sc, struct
ath_tx_tid_sched(sc, atid);
}
- } else if (txq->axq_depth < sc->sc_hwq_limit) {
+ } else if (txq->axq_depth + txq->fifo.axq_depth < sc->sc_hwq_limit) {
/* AMPDU not running, attempt direct dispatch */
DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: xmit_normal\n", __func__);
/* See if clrdmask needs to be set */
Modified: user/attilio/vmcontention/sys/dev/ath/if_ath_tx_edma.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/if_ath_tx_edma.c Wed Mar 27 10:56:15 2013 (r248790)
+++ user/attilio/vmcontention/sys/dev/ath/if_ath_tx_edma.c Wed Mar 27 11:31:39 2013 (r248791)
@@ -136,19 +136,65 @@ MALLOC_DECLARE(M_ATHDEV);
static void ath_edma_tx_processq(struct ath_softc *sc, int dosched);
+/*
+ * Push some frames into the TX FIFO if we have space.
+ */
static void
ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq)
{
- struct ath_buf *bf;
+ struct ath_buf *bf, *bf_last;
int i = 0;
ATH_TXQ_LOCK_ASSERT(txq);
- DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called\n", __func__);
+ DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: Q%d: called\n",
+ __func__,
+ txq->axq_qnum);
TAILQ_FOREACH(bf, &txq->axq_q, bf_list) {
if (txq->axq_fifo_depth >= HAL_TXFIFO_DEPTH)
break;
+
+ /*
+ * We have space in the FIFO - so let's push a frame
+ * into it.
+ */
+
+ /*
+ * Remove it from the normal list
+ */
+ ATH_TXQ_REMOVE(txq, bf, bf_list);
+
+ /*
+ * XXX for now, we only dequeue a frame at a time, so
+ * that's only one buffer. Later on when we just
+ * push this staging _list_ into the queue, we'll
+ * set bf_last to the end pointer in the list.
+ */
+ bf_last = bf;
+ DPRINTF(sc, ATH_DEBUG_TX_PROC,
+ "%s: Q%d: depth=%d; pushing %p->%p\n",
+ __func__,
+ txq->axq_qnum,
+ txq->axq_fifo_depth,
+ bf,
+ bf_last);
+
+ /*
+ * Append it to the FIFO staging list
+ */
+ ATH_TXQ_INSERT_TAIL(&txq->fifo, bf, bf_list);
+
+ /*
+ * Set fifo start / fifo end flags appropriately
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-user
mailing list