From f341bacbfdd54158d15495b7c37b3c5367906132 Mon Sep 17 00:00:00 2001 From: ngie Date: Wed, 8 Jun 2016 18:19:34 +0000 Subject: [PATCH] MFC r300856,r300857,r300858,r300874: r300856: Initialize `t` with memset(.., 0, ..) This will help ensure that we're not using random garbage on the stack by accident with respect to the variable r300857: Document the default behavior for -c (0) Bump .Dd for the change r300858: Fix description for -V in the -r case t.verify_test = true is always set when -V is specified, regardless of whether or not the tool is being run in raw mode r300874: Update usage(..) - Document missing options - Sync options with ioatcontrol(8). - Make it clear that the first 2 parameters are always required. git-svn-id: svn://svn.freebsd.org/base/stable/10@301677 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- tools/tools/ioat/ioatcontrol.8 | 7 ++++--- tools/tools/ioat/ioatcontrol.c | 20 ++++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/tools/tools/ioat/ioatcontrol.8 b/tools/tools/ioat/ioatcontrol.8 index 9e156fd89..59539f724 100644 --- a/tools/tools/ioat/ioatcontrol.8 +++ b/tools/tools/ioat/ioatcontrol.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 14, 2015 +.Dd May 27, 2016 .Dt IOATCONTROL 8 .Os .Sh NAME @@ -62,7 +62,8 @@ driver on a specific hardware channel. The arguments are as follows: .Bl -tag -width Ds .It Fl c Ar period -Configure the channel's interrupt coalescing period, in microseconds. +Configure the channel's interrupt coalescing period, in microseconds +(defaults to 0). .It Fl E Test non-contiguous 8k copy. .It Fl f @@ -92,7 +93,7 @@ is a kernel virtual address (by default, .Ar address is assumed to be a physical address) .It Fl V -Dump the resulting hex to syslog +Verify copies/fills for accuracy .It Fl w Write to the specified .Ar address diff --git a/tools/tools/ioat/ioatcontrol.c b/tools/tools/ioat/ioatcontrol.c index 32decc77a..855621743 100644 --- a/tools/tools/ioat/ioatcontrol.c +++ b/tools/tools/ioat/ioatcontrol.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -48,14 +49,19 @@ static void usage(void) { - printf("Usage: %s [-E|-f|-m] OPTIONS [ " + printf("Usage: %s [-c period] [-EfmVz] channel-number num-txns [ " "[ [duration]]]\n", getprogname()); - printf(" %s -r [-v] OPTIONS []\n\n", + printf(" %s -r [-c period] [-vVwz] channel-number address []\n\n", getprogname()); - printf(" OPTIONS:\n"); - printf(" -c - Enable interrupt coalescing (us)\n"); - printf(" -V - Enable verification\n"); - printf(" -z - Zero device stats before test\n"); + printf(" -c period - Enable interrupt coalescing (us) (default: 0)\n"); + printf(" -E - Test non-contiguous 8k copy.\n"); + printf(" -f - Test block fill (default: DMA copy).\n"); + printf(" -m - Test memcpy instead of DMA.\n"); + printf(" -r - Issue DMA to or from a specific address.\n"); + printf(" -V - Enable verification\n"); + printf(" -v -
is a kernel virtual address\n"); + printf(" -w - Write to the specified address\n"); + printf(" -z - Zero device stats before test\n"); exit(EX_USAGE); } @@ -104,6 +110,8 @@ main(int argc, char **argv) bool fflag, rflag, Eflag, mflag; unsigned modeflags; + memset(&t, 0, sizeof(t)); + fflag = rflag = Eflag = mflag = false; modeflags = 0; -- 2.45.0