==== //depot/users/kenm/FreeBSD-test2/usr.sbin/camdd/camdd.8#1 - /usr/home/kenm/perforce4/kenm/FreeBSD-test2/usr.sbin/camdd/camdd.8 ==== *** /tmp/tmp.54366.13 Mon Apr 6 21:56:38 2015 --- /usr/home/kenm/perforce4/kenm/FreeBSD-test2/usr.sbin/camdd/camdd.8 Mon Apr 6 21:23:29 2015 *************** *** 31,37 **** .\" .\" $FreeBSD$ .\" ! .Dd March 13, 2015 .Dt CAMDD 8 .Os .Sh NAME --- 31,37 ---- .\" .\" $FreeBSD$ .\" ! .Dd April 6, 2015 .Dt CAMDD 8 .Os .Sh NAME *************** *** 39,45 **** .Nd CAM data transfer utility .Sh SYNOPSIS .Nm ! .Aq Fl i|o Ar pass=pass_dev|file=filename,bs=blocksize,offset=N,depth=N .Op Fl C Ar retry_count .Op Fl E .Op Fl m Ar max_io --- 39,45 ---- .Nd CAM data transfer utility .Sh SYNOPSIS .Nm ! .Aq Fl i|o Ar pass=pass_dev|file=filename,bs=blocksize,offset=N,depth=N,mcs=N .Op Fl C Ar retry_count .Op Fl E .Op Fl m Ar max_io *************** *** 164,169 **** --- 164,189 ---- possible to maintain for especially fast devices. For writes, maintaining the queue depth also depends on a sufficiently fast reading device. + .It mcs=N + Specify the minimum command size to use for + .Xr pass 4 + devices. + Some devices do not support 6 byte + .Tn SCSI + commands. + The + .Xr da 4 + device handles this restriction automatically, but the + .Xr pass 4 + device allows the user to specify the + .Tn SCSI + command used. + If a device does not accept 6 byte + .Tn SCSI + READ/WRITE commands (which is the default at lower LBAs), it will generally + accept 10 byte + .Tn SCSI + commands instead. .El .It Fl C Ar count Specify the retry count for commands sent via the asynchronous ==== //depot/users/kenm/FreeBSD-test2/usr.sbin/camdd/camdd.c#11 - /usr/home/kenm/perforce4/kenm/FreeBSD-test2/usr.sbin/camdd/camdd.c ==== *** /tmp/tmp.54366.104 Mon Apr 6 21:56:38 2015 --- /usr/home/kenm/perforce4/kenm/FreeBSD-test2/usr.sbin/camdd/camdd.c Mon Apr 6 21:30:07 2015 *************** *** 110,115 **** --- 110,116 ---- uint64_t blocksize; uint64_t queue_depth; uint64_t offset; + int min_cmd_size; int write_dev; }; *************** *** 306,311 **** --- 307,313 ---- uint32_t sector_size; uint64_t max_sector; uint64_t sector_io_limit; + int min_cmd_size; int write_dev; int retry_count; int io_timeout; *************** *** 1448,1453 **** --- 1450,1457 ---- #endif } + dev->min_cmd_size = io_opts->min_cmd_size; + dev->run = camdd_pass_run; dev->fetch = camdd_pass_fetch; *************** *** 2317,2323 **** /*readop*/ (dev->write_dev == 0) ? SCSI_RW_READ : SCSI_RW_WRITE, /*byte2*/ 0, ! /*minimum_cmd_size*/ 0, /*lba*/ buf->lba, /*block_count*/ num_blocks, /*data_ptr*/ (data->sg_count != 0) ? --- 2321,2327 ---- /*readop*/ (dev->write_dev == 0) ? SCSI_RW_READ : SCSI_RW_WRITE, /*byte2*/ 0, ! /*minimum_cmd_size*/ dev->min_cmd_size, /*lba*/ buf->lba, /*block_count*/ num_blocks, /*data_ptr*/ (data->sg_count != 0) ? *************** *** 3048,3053 **** --- 3052,3058 ---- "offset=len Specify starting offset in bytes or using K, M, G suffix\n" " NOTE: offset cannot be specified on tapes, pipes, stdin/out\n" "depth=N Specify a numeric queue depth. This only applies to pass(4)\n" + "mcs=N Specify a minimum cmd size for pass(4) read/write commands\n" "Optional arguments\n" "-C retry_cnt Specify a retry count for pass(4) devices\n" "-E Enable CAM error recovery for pass(4) devices\n" *************** *** 3128,3134 **** io_opts->queue_depth = strtoull(value, &endptr, 0); if (*endptr != '\0') { ! warn("invalid queue depth %s", value); retval = 1; goto bailout; } --- 3133,3150 ---- io_opts->queue_depth = strtoull(value, &endptr, 0); if (*endptr != '\0') { ! warnx("invalid queue depth %s", value); ! retval = 1; ! goto bailout; ! } ! } else if (strncasecmp(name, "mcs", 3) == 0) { ! char *endptr; ! ! io_opts->min_cmd_size = strtol(value, &endptr, 0); ! if ((*endptr != '\0') ! || ((io_opts->min_cmd_size > 16) ! || (io_opts->min_cmd_size < 0))) { ! warnx("invalid minimum cmd size %s", value); retval = 1; goto bailout; }