Bug 240798 - nvmecontrol perftest is broken
Summary: nvmecontrol perftest is broken
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Warner Losh
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2019-09-24 20:35 UTC by Stefan Rink
Modified: 2019-09-25 07:02 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Rink 2019-09-24 20:35:24 UTC
Recent changes in perftest.c /sbin/nvmecontrol/perftest.c have broken the tool.
The settings for the test (threads, size) are not set into the ioctl struct and there is check failure where you always need to add -f something or else it wil not accept your parameters.

--- /sbin/nvmecontrol/perftest.c
146c146
<       if (opt.flags == NULL || opt.op == NULL)
---
>       if (opt.op == NULL)
148c148
<       if (strcmp(opt.flags, "refthread") == 0)
---
>       if (opt.flags != NULL && strcmp(opt.flags, "refthread") == 0)
165a166,167
>         io_test.num_threads = opt.threads;
> 
173a176,181
>       if (opt.size < 0){
>               fprintf(stderr, "Invalid size.\n");
>               arg_help(argc, argv, f);
>       }
> 
>       io_test.size=opt.size;
Comment 1 olevole 2019-09-24 20:58:10 UTC
This patch should only fix the optional arguments, right?

With/without patch I still get null values for nvme perftest on FreeBSD current:

% uname -a
FreeBSD test.my.domain 13.0-CURRENT FreeBSD 13.0-CURRENT r351591 GENERIC  amd64

% nvmecontrol perftest -n 12 -o read -s 16384 -t 30 nvme0ns1 -f refthread
Threads:  0 Size:      0  READ Time:  30 IO/s:       0 MB/s:    0

% nvmecontrol devlist
 nvme0: SAMSUNG MZPLL3T2HMLS-00003
    nvme0ns1 (3052360MB)

    
% nvmecontrol identify nvme0
Controller Capabilities/Features
================================
Vendor ID:                   144d
Subsystem Vendor ID:         144d
Serial Number:               S3GYNA0K900015
Model Number:                SAMSUNG MZPLL3T2HMLS-00003
Firmware Version:            GPNA5B3Q
Recommended Arb Burst:       8
IEEE OUI Identifier:         38 25 00
Multi-Path I/O Capabilities: Multiple controllers, Multiple ports
Max Data Transfer Size:      131072 bytes
Controller ID:               0x0021
Version:                     1.2.0

Admin Command Set Attributes
============================
Security Send/Receive:       Not Supported
Format NVM:                  Supported
Firmware Activate/Download:  Supported
Namespace Managment:         Supported
Device Self-test:            Not Supported
Directives:                  Not Supported
NVMe-MI Send/Receive:        Not Supported
Virtualization Management:   Not Supported
Doorbell Buffer Config:      Not Supported
Get LBA Status:              Not Supported
Sanitize:                    Not Supported
Abort Command Limit:         8
Async Event Request Limit:   16
Number of Firmware Slots:    3
Firmware Slot 1 Read-Only:   Yes
Per-Namespace SMART Log:     No
Error Log Page Entries:      256
Number of Power States:      1
Total NVM Capacity:          3200631791616 bytes
Unallocated NVM Capacity:    0 bytes
Host Buffer Preferred Size:  0 bytes
Host Buffer Minimum Size:    0 bytes

NVM Command Set Attributes
==========================
Submission Queue Entry Size
  Max:                       64
  Min:                       64
Completion Queue Entry Size
  Max:                       16
  Min:                       16
Number of Namespaces:        32
Compare Command:             Not Supported
Write Uncorrectable Command: Supported
Dataset Management Command:  Supported
Write Zeroes Command:        Supported
Save Features:               Supported
Reservations:                Supported
Timestamp feature:           Not Supported
Verify feature:              Not Supported
Fused Operation Support:     Not Supported
Format NVM Attributes:       Crypto Erase, Per-NS Erase, Per-NS Format
Volatile Write Cache:        Not Present
Comment 2 Stefan Rink 2019-09-24 22:49:08 UTC
(In reply to olevole from comment #1)
On FreeBSD 12 with the patched nvmecontrol from current I get;

root@SuperBSD:/tmp/sbin # ./nvmecontrol perftest -n 12 -o read -s 16384 -t 30 nvme0ns1
Threads: 12 Size:  16384  READ Time:  30 IO/s:  202591 MB/s: 3165
root@SuperBSD:/tmp/sbin # ./nvmecontrol perftest -n 12 -o read -s 16384 -t 30 nvme0ns1 -f refthread
Threads: 12 Size:  16384  READ Time:  30 IO/s:  202780 MB/s: 3168


Looks like the threads and size is still 0 in your test, did the patch apply correctly?
Comment 3 commit-hook freebsd_committer 2019-09-25 00:25:45 UTC
A commit references this bug:

Author: imp
Date: Wed Sep 25 00:24:57 UTC 2019
New revision: 352665
URL: https://svnweb.freebsd.org/changeset/base/352665

Log:
  After my comnd changes, the number of threads and size weren't set. In
  addition, the flags are optional, but were made to be mandatory. Set
  these things, as well as santiy check the specified size.

  Submitted by: Stefan Rink
  PR: 240798

Changes:
  head/sbin/nvmecontrol/perftest.c
Comment 4 olevole 2019-09-25 07:02:34 UTC
(In reply to Stefan Rink from comment #2)

yes, it looks like I applied the patch incorrectly. All fine now:

% nvmecontrol perftest -n 32 -o read -s 512 -t 30 nvme0ns1
Threads: 32 Size:    512  READ Time:  30 IO/s:  217932 MB/s:  106

% nvmecontrol perftest -n 32 -o read -s 16384 -t 30 nvme0ns1
Threads: 32 Size:  16384  READ Time:  30 IO/s:  115952 MB/s: 1811