Commit Graph

499 Commits

Author SHA1 Message Date
Pawel Wodkowski
461cfcecc6 CONFIG: add missing CONFIG_ options
Also fix options that doesn't start with CONFIG_ prefix.

Change-Id: I32a24373328bab8f513d56c0c09b5a86589f690c
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/427767
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-10-04 21:31:42 +00:00
Yanbo Zhou
3bb7438e05 fio_plugin: add more information and fix a minor error for usage guide
Change-Id: I65ba8eda2bfcb442f676bc85d6a6fd952ff3389a
Signed-off-by: Yanbo Zhou <yanbo.zhou@intel.com>
Reviewed-on: https://review.gerrithub.io/427098
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-09-28 18:40:13 +00:00
Jakub Radtke
9bb9752881 ocssd: add chunk notification log struct
This patch adds struct for "Chunk Notification Log".
New log page is used to report the state of chunk, lblk or pu.
Implementation is consistent with Open-Channel
specification (rev. 2.0)

Change-Id: I8aaf01c14d2f0faf8b8f8a6a773b6cb9bf97b38d
Signed-off-by: Jakub Radtke <jakub.radtke@intel.com>
Reviewed-on: https://review.gerrithub.io/426233
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-09-27 01:30:45 +00:00
Seth Howell
c58d3c445b mk: Add all external libs to sys_libs
This allows us to better distinguish between external and internal libs.
This series is aimed at fixing github issue 434
Change-Id: I2ed141f909e7c4a800df02061007b0d23da25380
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/425434
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-09-14 22:56:46 +00:00
Xiaodong Liu
c91b30d57b fio_plugin: fix wrong block_size with PI
block_size should be extended_sector_size in case of
metadata or PI is enabled.

Change-Id: I2cba61975b0541ef64839a8cd117eb42f19742b3
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/425061
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-09-10 16:26:00 +00:00
Shuhei Matsumoto
cee0fef138 perf: Fix performance degradation when the ns is formatted to use Protection Information
Format of namespace is not changed during running but namespace
information is collected by identify command for every IO.

This caused much degradation of performance.

Hence call spdk_nvme_ns_get_data() and hold the pointer to the
buffer in which namespace information is stored  at registration
of namespace and use the pointer in both task_extended_lba_setup_pi()
and task_extended_lba_pi_verify().

Change-Id: I12461ccb763247bbb9ccbe34802805ace67d9400
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/424362
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-09-04 23:03:40 +00:00
zkhatami88
eb6a2cb8f5 nvme:replacing spdk_dma_malloc with spdk_z/malloc
Change-Id: I755d36495e7d8e55c26c4103a9520102223798ef
Signed-off-by: zkhatami88 <z.khatami88@gmail.com>
Reviewed-on: https://review.gerrithub.io/409960
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-08-31 17:42:29 +00:00
Dariusz Stojaczyk
b5616804dc perf: cleanup cmdline params for consistency
'-s' option is usually associated with the memory size,
but our ioat/perf and nvme/perf use it for io size.

To keep those consistent:
 '-s' option (io size) was be changed to '-o'
 '-d' option (mem size) was be changed to '-s'

Change-Id: I97cef4c0a4e6e902277dd50dfb43bde420a6427e
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/422654
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-08-20 16:28:01 +00:00
Ben Walker
af4d1bdc60 nvme/perf: The -r parameter can now contain "ns:X"
Transport addresses can now additional contain an "ns"
key whose value is a specific nsid to connect to. If
unspecified, all namespaces will be used, which is
the previous behavior.

Change-Id: Icbebe32d68a1f97acaa1197c7fec5f119f33ec4d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/421267
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
2018-08-06 16:26:37 +00:00
Jim Harris
121d632c02 nvme_manage: use SCNu64 for uint64_t input
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3e27c98a9dd72dce4fb333f04f8026392d1fcad3

Reviewed-on: https://review.gerrithub.io/420794
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-31 21:57:34 +00:00
Xiaodong Liu
d4a5ef7eab ocssd: print ocssd chunk info in identify app
Get Log Page - Chunk Information could return info
of all chunks. In order to have a glance of them,
by default, get information of 8 chunks starting
from the first chunk.

Change-Id: I7c395f631a3e7f02d59ad6758b347e249baa9c3d
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/411593
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2018-07-30 03:08:21 +00:00
Xiaodong Liu
ade59b217b ocssd: print ocssd features in identify app
Change-Id: Id79793e375e0f1dc2690869c4c38f59209cf806b
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/411592
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-07-30 03:06:17 +00:00
Lance Hartmann
ef468ff71b fio/nvme: Fix segfault upon fio completion.
Cancel the thread polling admin completions only after
all of the individual fio threads have been cleaned up.

Change-Id: I6ddedf043664073631f2161d3969ae743323003b
Signed-off-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/420575
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-27 16:43:03 +00:00
Liang Yan
13fbedcc03 identify: add printing NMIC field in print_namespace
Change-Id: If9cb6d1d3a27325ca271c030d85af8a456e49f95
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/420129
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-25 08:42:22 +00:00
Xiaodong Liu
2824eed5d1 ocssd: print ocssd geometry in identify app
Change-Id: Ida194ff6213a78e15d77e89542650439e8eab348
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/411591
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-07-25 04:24:02 +00:00
Xiaodong Liu
a691aa3121 fio_plugin: add extended lba format pi support
Following the PI operation inside nvme/perf, add 2 PI
options into fio engine option.
SPDK ioengine will check whether PI information should
be generated or verified.

Running with PI setting, following settings are required:
1. In fio configure file, add PRACT like "pi_act=0", and
set PRCHK by flags(GUARD|REFTAG|APPTAG), like "pi_chk=GUARD".
2. Format device namespace with proper PI setting
3. In fio configure file, blocksize should be set as the
sum of data and metadata.

Sequential Write and following Sequential Read can be used
to evaluate it quickly.

Change-Id: I54e202bb8510cd987772117dff241aec714c8fb9
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/414753
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2018-07-13 22:38:27 +00:00
Ziye Yang
8f26b74e02 examples: make debug flag option consistent
Will change -t to -L

Change-Id: Ie04edf1fd3877b36fde1bae66a84de29f6617bbf
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/415947
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-06-21 05:18:53 +00:00
Ben Walker
81bb01c959 fio/nvme: Add 'hostnqn' option to fio configuration file
The user can now specify which host NQN to use for identification
purposes.

Change-Id: I50d1f868af82a72d57e4bc42d70ee74c6fb1147c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/415551
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-06-18 23:28:22 +00:00
Ben Walker
e051eb8310 fio/nvme: Add a thread to occasionally poll admin qpairs
This makes keep alive work correctly during long runs.

Change-Id: Idc7277373920b48177a037aefe809e056f83cf10
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/415538
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-06-18 23:28:22 +00:00
Andrey Kuzmin
4e51a274de Fix fio_plugin build for FIO_IOOPS_VERSION >= 24.
Fio commit d3b07186b1d4c7c1d9adc1306407458ce41ad048 changed return
type of the ioengine->queue method to a new enumeration type
fio_q_status. Add preprocessor checks to ensure SPDK fio_plugin builds
successfully with both current and earlier fio ioengine API version.

Change-Id: Ie9eb818473c6453624d6cfe51a19c6bf0d17e334
Signed-off-by: Andrey Kuzmin <andrey.v.kuzmin@gmail.com>
Reviewed-on: https://review.gerrithub.io/413749
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-06-05 16:35:52 +00:00
Ben Walker
99c8c6d8e1 nvme: Allow users to request which I/O command set they'd like to use
As of NVMe 1.3b, there is only one command set. But pipe
this through the driver per-spec anyway.

Change-Id: I4faf8596f5ce638e5e2a500b424e00ceb6e89edc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/412102
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-05-24 22:42:38 +00:00
Sai Tallamraju
27a2d1d04d nvmf:Add RNIC HBA userspace library for FreeBSD
Change-Id: I7d929e7520007f29511299442f791038f7a4ce1d
Signed-off-by: John Meneghini <johnm@netapp.com>
Reviewed-on: https://review.gerrithub.io/409539
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-05-07 16:53:43 +00:00
Daniel Verkamp
dc09939226 nvme_spec: add Transport SGL Data Block descriptor
Defined in ratified NVMe 1.3 TP 4008 (2017-08-22).

Change-Id: I42479c8a0acbdc1a2df54061ffbc12a54385cd94
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/409059
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-04-30 17:18:40 +00:00
Daniel Verkamp
dbcc9c1e4b nvme/identify: allow negative Celsius temperatures
The original temperature values are all in (unsigned) Kelvin and cannot
be negative due to the laws of physics, but when we convert these
temperatures to Celsius, they can be negative.  Fix the printf
specifiers and calculations to take this into account.

Change-Id: I0326b96bf71137a5c1cdaf068ab6bcd91d8411b9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/408907
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-30 17:11:28 +00:00
Changpeng Liu
23d7be9433 examples/perf: set the number of IO requests for each queue pair
Low level NVMe driver will set the hardware IO queue size
based on MQES and users' input, perf tool has requested
maximum IO queue size when started, but for the number
of IO requests, it uses the default value.  While here,
set the number of IO requests to a higher value, so that
for high queue depth tests, the perf tool will not fail.

Fix the issue #256.

Change-Id: I6d11ec65e0f3b246b824875fa17d74a31fd2702b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/403256
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-23 20:09:26 +00:00
Changpeng Liu
df159388ff examples/fio_plugin: add SGL support for R/W commands
Add an new option to let users choose PRP or SGL for I/O commands,
for SGL, users can append `-enable_sgl=1` when starting fio tests.
PRP is used by default.

Change-Id: Ic28c85c95fdd92d4bbe8a02616686b57e91e7271
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/407251
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
2018-04-13 12:42:49 -04:00
Daniel Verkamp
83b9f6864c nvme/identify: print Command Effects log page
Change-Id: I28ba1485ff42491ffd141800edcf5d5d1c7c0e28
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/406490
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-09 15:54:17 -04:00
Ed Rodriguez
06fbf4b34b nvme: Use active namespace list for enumerating namespaces
- Add support for multi page CNS 0x2
 - Use CNS value 0x02 (SPDK_NVME_IDENTIFY_ACTIVE_NS_LIST)
   to query active namespaces
 - Add an API to iterate the active list

Change-Id: Iea524881fa6e3610a7d85ab02a2005a92fd633df
Signed-off-by: John Meneghini <johnm@netapp.com>
Reviewed-on: https://review.gerrithub.io/401957
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-02 17:17:40 -04:00
Daniel Verkamp
7b4bc2a243 nvme/identify: print ASCII strings with helper
SN, MN, and FR are ASCII strings as defined by the NVMe spec; use the
new print_ascii_string() helper function to print them.  This trims the
trailing spaces and prevents accidentally printing any control
characters to the screen if the device provides an invalid ASCII string.

Change-Id: Ifaf383a79e13be62625250e7e79a305ebaa3612b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405926
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-04-02 15:44:35 -04:00
Daniel Verkamp
f945642ac3 nvme/identify: print firmware slot information
Change-Id: I730fa785f91034e15881d4ca3b94a98e9381f89b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405825
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 16:26:10 -04:00
Daniel Verkamp
1e3c4c8b37 nvme/identify: print namespace UUID if present
Change-Id: I8c455ad6bb71fb2519ac741c78aa0ed5de643729
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405807
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-30 16:26:10 -04:00
Daniel Verkamp
0920923ce2 nvme/perf: remove PCI ID print in probe_cb
The vendor:device ID is already printed out in attach_cb, so printing it
again in probe_cb isn't that useful.

This also lets us remove the last use of spdk_pci_get_device(), allowing
it to be deprecated and removed in future patches.

Change-Id: Ie65abf136cce4d413f06594f91533ab9f9d4aca7
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405708
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-29 01:46:43 -04:00
Daniel Verkamp
a78ddd8231 nvme: add function to get PCI device from ctrlr
This allows us to remove most uses of spdk_pci_get_device(), which looks
up a PCI device structure from an arbitrary PCI address.  This function
is problematic, since it uses internal DPDK data structures that aren't
meant to be part of the public API.  There is still one use in the
codebase, which will be cleaned up in another patch.

Change-Id: Ia1fe1f799c240195f6871c1d92821074f884c4e6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405707
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-29 01:46:43 -04:00
Daniel Verkamp
c937fab3cb nvme: use uint32_t consistently for NSID values
A few places were accidentally storing namespace IDs in uint16_t.

Change-Id: Iae9d709fb20bc1ac0a584ccd9683b721ce5de961
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403886
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-16 14:15:08 -04:00
Daniel Verkamp
8a6ba58cb4 scripts/check_format: check for spaces before tabs
Automatically detect more whitespace errors.

All existing cases are fixed; only whitespace change (verify with
diff -w) except for one comment style fixup in include/spdk/nvme.h.

Change-Id: If750e54b9c8e3421ea6feda5f20184a31431631e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/402360
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-05 11:09:13 -05:00
Daniel Verkamp
d81f3dfd3e util: add spdk_mem_all_zero() function
Unify several similar functions checking for a buffer of all zero bytes
into the util library.

Change-Id: Idfbeffa22add34ac9ed1bd75ee27d6bd8b188940
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/400892
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-02-23 10:05:32 -05:00
Changpeng Liu
450ee00944 examples/perf: add application verification for e2e data protection tests
For end-to-end data protection tests with extended lba format, when
Protection Information Action bit was cleared to 0, the perf
application can do some comparison based on the flags we used
for writes. For the unexptected protection information value, print
a notice for users.

Change-Id: I9851ce6338030f9b57180cd5e46368e0c94bc212
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/394158
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-02-21 15:10:20 -05:00
Daniel Verkamp
76f54a29d2 nvme/identify: dump namespace NGUID and EUI-64
Change-Id: I82f126e84ef8daf3c14829482b5c3f5090bcbe12
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/399532
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-02-20 12:01:47 -05:00
Stephen Bates
1f9da54e9c cmb_copy: An example app that uses NVMe CMBs
Add a new example application that copies data between two NVMe
namespaces, on two different NVMe controllers via the CMB that belongs
to one of said controllers. This avoids using CPU system memory as a
DMA buffer and reduces the number of external DMAs from two to one.

Use:

./cmb_test -h

for usage.

Change-Id: Id930fb3bdb5c09bbecadae449a5238a73eeef642
Signed-off-by: Stephen Bates <sbates@raithlin.com>
Reviewed-on: https://review.gerrithub.io/397040
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-02-14 12:36:01 -05:00
Daniel Verkamp
8f3d0a6413 hello_world: If supported, use CMB WDS buffer
If the NVMe controller to be tested supports a CMB with the WDS
feature then we use that for the write phase of hello_world.

Change-Id: Ide6ee1005a892ca977bd32a974cd644256e95c8a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Signed-off-by: Stephen Bates <sbates@raithlin.com>
Reviewed-on: https://review.gerrithub.io/397039
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-02-12 19:11:44 -05:00
Pan Liu
c3b4772590 don't attach inactive namespace in fio plugin, in order to avoid IO error.
Change-Id: Id259261d387998f332dee11dca740ecaba311de4
Signed-off-by: Pan Liu <liupan1111@gmail.com>
Reviewed-on: https://review.gerrithub.io/399274
Reviewed-by: GangCao <gang.cao@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-02-12 12:13:44 -05:00
Daniel Verkamp
64465d0dc8 Remove trailing whitespace before \n in printf()
Tree-wide cleanup of all instances of printf()-style functions where a
format string contains a space before a newline character.

Change-Id: Ib5b5861e97bed9e9d62db03875547e3f771f4769
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/397031
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
2018-02-06 11:16:50 -05:00
Cunyin Chang
37273c20c2 nvme: add Boot Partition Support to CAP register
Add the section of boot partition support.

Change-Id: I81357d657f1a55376ab98b5ffab511c6227e43c8
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/397033
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2018-02-02 12:25:01 -05:00
Ziye Yang
b232bff575 nvme perf: fix the caculation for average, min, max latency
This patch is used to fix the time caculation for
average, min, max latency.

Also changes the float to double to make it more accurate.

Change-Id: Ia91278f04656787e2dcf94dd37d839bcf31d618d
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/394674
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-23 17:01:23 -05:00
Daniel Verkamp
273442b390 nvme/fio_plugin: update to fio 3.3
A previous commit updated the fio version for the bdev fio plugin, but
the NVMe fio plugin should also be updated.

Change-Id: I32fab18563b6b723a3e9b71589e3a3904196d07f
Fixes: 21ec62533d ("CHANGELOG: add fio 3.3 support")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/395788
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-01-22 15:58:17 -05:00
Lance Hartmann
095f4254f1 lib: Return instead of exit/abort in env_dpdk
Modifies spdk_env_init() and spdk_mem_map_init() such that
they return on failure instead of terminating with exit()
or abort().

Change-Id: I054c1d9b2e46516ff53d845328ab9547f54bdbc4
Signed-off-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/393987
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
2018-01-10 16:20:15 -05:00
Ben Walker
0aa48e09da fio: Update full_bench.fio example to reduce latency
Add some options to reduce the number of calls to
get time.

Change-Id: Iceea12b1ad82cba96d1a4bd687af3e9743d5f58a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/393686
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-01-09 13:40:59 -05:00
Ben Walker
feb082a24a fio: Remove the trim step from full_bench.fio
The test already writes to the entire device twice, so
the trim step does not actually accomplish anything.

Change-Id: Ie761389511196d659358f18f557feb80087628cc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/393832
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-01-09 13:40:59 -05:00
Jim Harris
bc00666271 util: enable dynamic spdk_histogram_data sizing
Currently, each histogram range is hardcoded to
128 buckets (1ULL << 7), resulting in 58 ranges
(64 - 7 + 1) and a total size of 58 * 128 *
sizeof(uint64_t) = 59392 bytes.

To allow for more usage models in cases where this
size is prohibitive, enable the following changes:

1) specify number of buckets per range (in number of bits)
2) specify max datapoint value (in number of bits)

The latter can be useful for cases where datapoints
are never close to requiring all 64 bits - and allows
reducing the number of ranges.  Any data points that
exceed the max will be tallied in the last bucket
in the last range.

Testing shows no performance disadvantage using the
dynamic approach.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5979bcdff6209faaa9dee293918ef2a78679bcd4

Reviewed-on: https://review.gerrithub.io/392707
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-12-29 14:20:48 -05:00
Changpeng Liu
9ca670ac8a util/crc16: add crc16 library support and unit tests
Change-Id: I7174f1799361b8337ff5590b90ad6a0564ca8e9b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/391899
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-20 15:12:26 -05:00
Changpeng Liu
4046e063c5 example/perf: add extended lba format performance tests support
Change-Id: I127279ba32388bcedb85ed0a2eba9b5345c02eda
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/366532
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-14 12:51:01 -05:00
GangCao
4c4619323d Perf: only count into inflight IO when successfully sending
There is a case in high queue depth situation and the IO may be
failed due to no memory. Our perf tool did not recognize this
and always count the IO in the inflight IOs. Thus in the completion,
it waits more than actual IOs to return and the Perf is hanging.

Change-Id: Ie5472e260c75c5abd80c06eb6c613dc7d1761c78
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/391582
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-12-13 12:21:52 -05:00
Daniel Verkamp
59970a89be astyle: enforce braces around single-line statements
Require braces around all conditional statements, e.g.:

    if (cond)
        statement();

becomes:

    if (cond) {
        statement();
    }

This is the style used through most of the SPDK code, but several
exceptions crept in over time.  Add the astyle option to make sure we
are consistent.

Change-Id: I5a71980147fe8dfb471ff42e8bc06db2124a1a7f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/390914
Reviewed-by: <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-12-11 11:19:32 -05:00
GangCao
0434d5d58f example/perf: add more clear information on large queue depth
Change-Id: I7e9166834c869077a66467b06b51084e1a945a99
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/386198
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-28 16:25:13 -05:00
Ziye Yang
63c1c9d510 nvme,arbitration: remove dpdk dependency
Change-Id: I086f094da6e697239be620f6859f4582275e7c8f
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/388144
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-28 12:44:11 -05:00
lu fan
2716cd2a76 nvme_manage: retry the input command instead of just quitting.
Change-Id: Ifd924bcee94bc4e36530b42a07afb5141b150cad
Signed-off-by: lu fan <lux.fan@intel.com>
Reviewed-on: https://review.gerrithub.io/387722
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-20 19:36:06 -05:00
Ziye Yang
8d716531a6 nvme/perf: fix print message while not finding devices
Change-Id: Ie7282eb2e9f403ae51c449389216bcaf45808277
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/386190
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-17 18:26:24 -05:00
Ziye Yang
cc57c4a9bc fio_plugin: check the whether the qpair can be allocated.
If it cannot be allocated, we should return error.

Change-Id: I48aa50a8842c35ee112fe7185128b1bc1930176e
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/386369
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-11-15 18:00:07 -05:00
GangCao
fe408c9791 example/identify: list the number of I/O queues
This kind of information can be useful on related model
of Intel SSDs.

Change-Id: Iea8a8f48999ba36e2f6cbf33a892147262891b44
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/385805
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-11-14 14:44:49 -05:00
Liang Yan
32b35d9958 nvme/perf: check if aio files exist while no NVMe controller found
Change-Id: I9ced263535e8cd9c9503a208a77832140833c9d3
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/383952
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-26 15:41:50 -04:00
Daniel Verkamp
69a0f437db examples/nvme/hotplug: free task on error path
If the spdk_dma_zmalloc() call for the task buffer fails, we should free
the task before returning an error.

Change-Id: Icf70826dfc7f921d2a18f340480ea7c2ac3df3f4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382851
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-17 15:21:39 -04:00
Daniel Verkamp
0722434074 nvme/identify: print discovery log contents
Now that we can connect directly to a discovery service via
spdk_nvme_connect(), it is useful to have the ability to dump its
discovery log page in the identify example.

Change-Id: Ie32f7ae2f0725874fed56258aa3c07d619fce0dd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/382208
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-12 16:39:55 -04:00
GangCao
13d4f08480 nvme/example: add the call to spdk_nvme_connect()
In this identify example, added a call to the newly introduced
public spdk_nvme_connect() API so that other related change can
refer to this one as an example.

Change-Id: Iba97b6e52810a66d4c781bb563985e84ffb86708
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/382070
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-10-11 13:58:14 -04:00
Ziye Yang
36f9d416a1 fio_plugin: update the README
Describe the phenoemon for peformance difference
between fio + spdk plugin and spdk nvme perf
on multiple NVMe SSDs while both using single
cpu core.

Change-Id: I80c2cfd51cd1d8ec28a11a1a8653469cfc3335eb
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/379573
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-10-10 16:45:00 -04:00
Changpeng Liu
c5d8b108f2 examples/perf: use NVMe Maximum Queue Entries as the default queue size
For perf tests with large I/O size, the NVMe driver may split one
request to several entries based on stripe and maximum transfer size,
so take user's input of queue depth as default queue size of NVMe
queue pair is not accurate. Here the patch evaluate users' input
and report an error when queue entries more than hardware's limit.

Change-Id: I66922a3d673dc97796d7fbe6e86cf5037a45b37d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/379969
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-09-29 18:45:47 -04:00
Daniel Verkamp
8acc4ae5da nvme: add controller option to specify host ID
A random host ID is generated per SPDK application startup if the user
doesn't specify a host ID during controller startup.

This also changes the default host NQN for NVMe-oF connections to a
random UUID NQN based on the host ID.

Change-Id: Ib0f70dd63e53087716842b412a1f134a9991d4da
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/380528
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-09-29 11:43:25 -04:00
Liang Yan
6bfff2f1cc examples/perf: exit perf tool if no controllers found
Change-Id: Ie70236f6be40ad9598969da2a462af44763c4ac4
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/379437
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-09-22 14:15:34 -04:00
Daniel Verkamp
93c803c363 nvme/identify: print error if no controllers found
Change-Id: I5b0411484290bbdf9077e55674ae368312fb01ab
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378185
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2017-09-18 12:54:06 -04:00
Daniel Verkamp
b163dc0216 nvme/perf: replace DPDK uses with env abstractions
Fully port the remaining uses of rte_ functions from DPDK to the SPDK
env library abstraction layer.

This also simplifies buffer allocation: each task only needs to be
allocated once during the initial submit_io() call, rather than using a
mempool to get/put the task on every I/O.

Change-Id: I39c8caff81bbb1467101ba3b24a389c437075c61
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/378220
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2017-09-13 12:51:46 -04:00
Daniel Verkamp
455525f5a0 examples/nvme/hotplug: simplify buffer management
We don't need to allocate/free tasks on every I/O; we can just
allocate the tasks and buffers once in the initial submit_io() loop.

This also removes the remaining direct DPDK calls from the hotplug
example.

Change-Id: Ie8774b289e650b3fa64614f2da0efbefd013a610
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376864
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-09-05 17:55:01 -04:00
Ziye Yang
a99dd7751f fio_plugin: Fix the performance issue on testing multiple remote nvme subsystem
The reason is that we create duplicated qpair on same subsystem many times,
thus the performance is influenced. And this patch can fix this issue.

Change-Id: I075b028b15e0d34857a89510710642f2d9520235
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/375782
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-31 19:08:49 -04:00
Ziye Yang
9e8853953a fio_plugin: Poll qpairs on the same thread in round-robin manner
With this change, the polling qpairs can be in round-robin manner.

Change-Id: I1926468dc596de2a43f42451525650356f44fbbd
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/375707
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-31 19:08:49 -04:00
Daniel Verkamp
e3971c41ea nvme_spec: update Identify Controller SGLS field
In NVMe 1.3, the Identify Controller data SGLS field's definition was
changed; in NVMe 1.2, the first bit simply indicated whether SGLs were
supported, but in NVMe 1.3, the first two bits now indicate whether SGLs
are supported and whether they require Dword-aligned data.

Change-Id: I9181055a86f52ad939b65eca5af66a400594a696
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/376027
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-29 15:05:09 -04:00
GangCao
c6dc4d184d example/identify: make clear the usage of -p parameter
Change-Id: I6401bcb3a025ae96b156decf4668fd8863ea2fc5
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/371108
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-02 17:17:03 -04:00
GangCao
9b847c1574 example/arbitration: correct the configuration display
Change-Id: I15a16727b0be960b74ae0a04c98c4e792c57e04b
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/371297
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-08-01 13:47:24 -04:00
Paul Luse
4ef6d0f934 fio_plugin: stop specifying io_queue_size in the probe_cb()
This will cause the NVMe driver to use the default qpair size
as opposed to setting it up for the first job in what may end
being a series of jobs in the same fio config file. If we
don't do this and subsequent jobs are specifying a higher queue
depth than earlier jobs, the NVMe qpairs will be too small and
performance results can be way off.

Future fix logged on Trello to correctly size q pairs even when
multiple jobs are specified in a single file but this is a small
optimization.

Change-Id: I73a7b83b10418dd22b663a50ea8e33a6c3d7ecf7
Signed-off-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/371240
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-08-01 13:42:55 -04:00
GangCao
f07ed6efa7 example/nvme_manage: add the shm_id parameter for multiprocess
Change-Id: Ifdae15e36d7330b4e72f4a08b263c9de7303caeb
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/371830
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-08-01 13:41:46 -04:00
Daniel Verkamp
ce4fcbce71 nvme: add I/O qpair creation options
Add a new struct spdk_nvme_io_qpair_opts to allow the user to override
controller options on a per-I/O qpair basis.

Existing callers with qprio == 0 can be updated to:

  ... = spdk_nvme_ctrlr_alloc_io_qpair(ctrlr, NULL, 0);

Callers that need to specify a non-default qprio should be updated to:

  struct spdk_nvme_io_qpair_opts opts;
  spdk_nvme_ctrlr_get_default_io_qpair_opts(ctrlr, &opts, sizeof(opts));
  opts.qprio = SPDK_NVME_QPRIO_...;
  ... = spdk_nvme_ctrlr_alloc_io_qpair(ctrlr, &opts, sizeof(opts));

Change-Id: I8ac3ea369535cfde759abbe75e1d974b6450a800
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369676
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-18 18:33:20 -04:00
Daniel Verkamp
37962990e4 nvme/fio_plugin: fix ->queue() error reporting
FIO backends are supposed to return a negative value on error.

Add special handling for -ENOMEM (out of requests) case to return
FIO_Q_BUSY, indicating that FIO should resubmit the request later.

This is part of the fix for issue #169, which is related to high queue
depths with large I/Os causing the NVMe library to run out of request
objects.

Change-Id: I4fa4001b078b07c42fcd4d1357434575b2c84023
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/369664
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-14 18:15:07 -04:00
Daniel Verkamp
ac4398a31d log: set print level when enabling tracelogs
The default print level used by the apps is SPDK_LOG_NOTICE, which will
prevent the tracelogs from being shown.

Change-Id: I5f136e8aa0be0aa7634c7dd72231f2c23b129e51
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/368803
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-07-11 18:02:47 -04:00
Isaac Otsiabah
6fb1ce422e update_firmware: Allow option to download and enable firmware image.
Support both SPDK_NVME_FW_COMMIT_REPLACE_IMG and SPDK_NVME_FW_COMMIT_REPLACE_AND_ENABLE_IMG.
Return code will specify if conventional reset is required.
For now, return error if subsystem reset is required.

Change-Id: I41a05675a210dd0bbf170517b32ee9e05da9a797
Signed-off-by: Isaac Otsiabah <iotsiabah@us.fujitsu.com>
Reviewed-on: https://review.gerrithub.io/367287
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-07 17:12:57 -04:00
Ben Walker
7347136f8b fio_plugin: Update to 2.21, SPDK configure script
Documentation update - the plugin just works with 2.21 with no
changes.

Change-Id: If1fb2367a00065bfb5627d0d2af9683e5c909dc1
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/367734
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-07-05 17:16:14 -04:00
Ziye Yang
908ecf9cc4 fio_plugin: add 1 io_queue_depth
Checked the code and found that our nvme perf example
added 1 io_queue_depth. Since if you set queue_depth=n,
the real entry is n - 1.

Change-Id: Ie204fc061b98e853e9b810eff21f79565c2ad8d0
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/367931
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-07-05 15:40:34 -04:00
Daniel Verkamp
83289767cd nvme/fio_plugin: make NVMe-oF check generic
Any transport that is not PCIe is a NVMe over Fabrics transport and
requires a subsystem NQN.

Change-Id: I68bfe49086f7f633fea8589ac15069327c4a4aa9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/367290
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-28 13:10:56 -04:00
Jim Harris
c1f49bedb1 fio_plugin: allow specifying a shared memory ID
While here, change the recently added mem_size_mb to
also use the automatic option parsing for integer values
provided by fio.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I889073b3b3b01c7003b21d8ace61e71b672ff2df

Reviewed-on: https://review.gerrithub.io/367284
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-28 13:06:37 -04:00
Jim Harris
2887f8ef49 fio_plugin: fix README
We do not need quotes around the filename.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I31685409eb5d956cdfb2fc30896e9e43312b61a3

Reviewed-on: https://review.gerrithub.io/367280
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-06-28 13:06:37 -04:00
Jim Harris
79f53469eb nvme/perf: add additional latency cutoffs
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1aee7aba522cc816f69709cfc95d12c50a5d0f4b

Reviewed-on: https://review.gerrithub.io/367279
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-28 13:06:37 -04:00
Daniel Verkamp
e09174b1eb nvme/fio_plugin: fix declaration after statement
Change-Id: I41c67fc3df3a7823765929351eef9b159415490d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/367125
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-27 13:57:06 -04:00
John Kariuki
596f92f583 fio_plugin: add mem_size to fio config file
While doing performance testing for the SPDK NVMe driver using fio with
our fio_plugin, I saw the error (transport->ctrlr_create_io_qpair() failed)
when running 18 jobs on my system. The error was happening when trying
to allocate memory for the trackers at line 890 in the lib/nvme/nvme_pcie.c.
Root cause was the fio_plugin.c initializes the environment with only
512 MB of hugepage RAM. I changed opts.mem_size to 1024 and rebuild
the plugin the issue was resolved.
This patch enables setting the mem_size in the fio config file using
parameter named mem_size_mb. E.g. mem_size_mb=1024

Change-Id: I3541b2029a6b36c26f814101313f49c2dd98c9bc
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-on: https://review.gerrithub.io/365735
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-26 13:49:55 -04:00
Jim Harris
c09bfe8965 lib/env: add spdk_unaffinitize_thread
This can be used by threads within SPDK to undo the
affinitization done either by DPDK (for DPDK lcores)
or by inheriting the parent's thread when using
pthread_create().

This will be used by the stub app to unaffinitize
the reactor core to allow the scheduler to flexibly
move it to an idle core.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I7e550953cd9dcd7fd9d98bfbb70660994f2eefcd

Reviewed-on: https://review.gerrithub.io/366680
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-23 11:02:04 -04:00
Changpeng Liu
633f975e58 examples/perf: fill buffer with non-zeroed data when QD=1
Change-Id: Ibbe601489d16a9585e56de1c95fe31e9a602a7e0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/366387
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-21 19:02:29 -04:00
Jim Harris
5dff1923b6 test/nvme: use stub to accelerate test time
For now, just hardcode the shm_id to 0 for any test apps
that currently do not support command-line arguments.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic8de44d4badc4c9b8858596b7f55dcc04371371b

Reviewed-on: https://review.gerrithub.io/365732
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-06-16 15:27:13 -04:00
Ziye Yang
d939572ab3 event/env: remove dpdk_ prefix
Remove dpdk_ prefix in spdk_app_opts and spdk_env_opts

Change-Id: I6f231f67072b808e84945d41b1fe31a180beb350
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/365787
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-16 14:20:26 -04:00
cunyinch
7c4fe3d2d3 example/hotplug: quit from hotplug once the count of hotplug is correct.
This patch will cut down the autotest time.

Change-Id: Ica23bbe39884f1f51f42f836e7c9fa9007c06693
Signed-off-by: cunyinch <cunyin.chang@intel.com>
Reviewed-on: https://review.gerrithub.io/365736
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-16 14:06:31 -04:00
Daniel Verkamp
127cc4c0f3 nvme/perf: avoid divide by 0 if no I/O completed
Change-Id: I7ccff922465195c7fe9836633196cd7a8816c11c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/365071
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-15 17:43:18 -04:00
Ziye Yang
fb6c541d37 app, opts: add a new dpdk configuration: no-pci
In this patch, we also update perf and identify
examples. If there is no local nvme device info
parsing, we will set dpdk initialization with no-pci
choice.

Change-Id: I58b2d291b7b53894aeb194a16798ff1c72cf25b4
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/365361
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-06-15 14:09:31 -04:00
Daniel Verkamp
9e90fd6e93 nvme/identify: update for NVMe 1.3 features
Change-Id: I6450afc1f2361afcf1e0ee0528a6940ce5f321f1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/365525
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-15 13:45:12 -04:00
Jim Harris
5044e4f65a histogram: move nvme/perf histogram code to a common header
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia0083365b2da63cb38aebb9f7bbc02f4dfd1ae94

Reviewed-on: https://review.gerrithub.io/365263
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-14 14:20:03 -04:00
Changpeng Liu
e43d414731 examples/nvme: fix the wrong usage of data buffer for reservation
Change-Id: I394937f10d067ccb270c30b54549514da77cb952
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/364939
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-14 12:46:25 -04:00
Jim Harris
7b7799bf9c fio_plugin: switch to LD_PRELOAD instead of dynamically loading
fio has a race between reap_threads() and free_ioengine().  free_ioengine()
will call the ioengine's cleanup routine and then dlclose it if it
is dynamically linked (like the spdk fio plugin).  free_ioengine() does
not set td->io_ops = NULL though until after dlclose() is complete.  If
reap_threads() tries to dereference td->io_ops after our plugin has been
closed but before io_ops was set to NULL, it will segfault.

Solution (until an upstream fio fix is available) is to use LD_PRELOAD
instead.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ide4eb3cb92a636513289107fc211fdf1f98b616f

Reviewed-on: https://review.gerrithub.io/365272
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <optimistyzy@gmail.com>
2017-06-14 11:12:29 -04:00
Daniel Verkamp
9f237eac85 env_dpdk: save and restore optind in spdk_env_init
DPDK's use of getopt() needs special handling of the optind global
variable since we are passing it a separate array of arguments (not the
typical argv and argc).  Set optind to 1 internally to env_dpdk so that
the apps don't need to know about it, and restore optind in case the
calling app is also using getopt().

Change-Id: Icbf07002c99fa9f94c866e8eff707124b0ef679b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/365062
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-13 17:39:38 -04:00
Isaac Otsiabah
73c9bd296a nvme_manage: trim newline from fgets() buffer
Fixes firmware update trying to open the firmware file with a newline
appended to the path.

Change-Id: I82c37e304a8a85901a5c9d419143cf20af079c34
Signed-off-by: Isaac Otsiabah <iotsiabah@us.fujitsu.com>
Reviewed-on: https://review.gerrithub.io/364705
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-12 16:30:12 -04:00
Changpeng Liu
b6a9493bb1 nvme: enable CMB for submission queue by default
Also provide an option in perf tool let users to
disable it.

Change-Id: If4952513d77cecaa4f9403fbea811d86916ee87c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/363311
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-05 13:03:48 -04:00
Daniel Verkamp
9da3f4dd8c nvme/perf: don't fail if no namespaces ran
Gracefully handle ns_count == 0 in print_performance() rather than
asserting.

Change-Id: If8f8d56a2dd4d21ddc61069555c2b90d027431f4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363614
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: Ben Walker <benjamin.walker@intel.com>
2017-06-02 18:05:18 -04:00
John Meneghini
8a44220b1a env: Rename spdk_malloc/zmalloc/realloc/free to spdk_dma_(func)
- rename spdk_malloc_socket to spdk_dma_malloc_socket
  - rename spdk_malloc to spdk_dma_malloc
  - rename spdk_zmalloc to spdk_dma_zmalloc
  - rename spdk_realloc to spdk_dma_realloc
  - rename spdk_free to spdk_dma_free

Change-Id: I52a11b7a4243281f9c56f503e826fd7c4a1fd883
Signed-off-by: John Meneghini <johnm@netapp.com>
Reviewed-on: https://review.gerrithub.io/362604
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-31 15:30:27 -04:00
Ben Walker
be186f641e fio: Add a script to prep a system for benchmarks
Also update the example fio file

Change-Id: I2a9074d524072e95340cc0e87041e87e3bb7d4f8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362069
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-31 04:00:41 -04:00
Daniel Verkamp
5597e835c8 nvme/fio_plugin: fix typo in traddr error message
Change-Id: I9ee1c2ab49691f7e31bbec83a057faa718177c90
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/362260
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-25 01:19:36 -04:00
Jim Harris
27c6d380b5 examples/nvme/perf: add a latency summary
A single -L can be used to get the latency summary.
Two -L's (or -LL) can be used to get both the latency
summary and the detailed histogram.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I3fc0f4e2dfff7b041a665fe35aa33f11e4c3ebad
Reviewed-on: https://review.gerrithub.io/362270
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-24 23:39:06 -04:00
Jim Harris
32120b6336 examples/nvme/perf: fix latency calculations
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0c47f2086d4f895cd75f32efc7df30d7182adcb1

Reviewed-on: https://review.gerrithub.io/362269
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-24 23:39:06 -04:00
Jim Harris
66349fbf7b hello_world: fail if no NVMe devices found
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I90feac0377b4870c1552df3eb470e834ceae4f65

Reviewed-on: https://review.gerrithub.io/362265
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-24 11:51:55 -04:00
Jim Harris
8de75f8107 nvme/perf: add software-based latency tracking
The latency tracking is done with ranges of bucket arrays.
The bucket for any given I/O is determined solely by TSC
deltas - any translation to microseconds is only done after
the test is finished and statistics are printed.

Each range has a number of buckets determined by a
NUM_BUCKETS_PER_RANGE value which is currently set to 128.
The buckets in ranges 0 and 1 each map to one specific TSC
delta.  The buckets in subsequent ranges each map to twice
as many TSC deltas as buckets in the previous range:

Range 0:  1 TSC each - 128 buckets cover deltas    0 to  127
Range 1:  1 TSC each - 128 buckets cover deltas  128 to  255
Range 2:  2 TSC each - 128 buckets cover deltas  256 to  511
Range 3:  4 TSC each - 128 buckets cover deltas  512 to 1023
Range 4:  8 TSC each - 128 buckets cover deltas 1024 to 2047
Range 5: 16 TSC each - 128 buckets cover deltas 2048 to 4095
etc.

While here, change some variable names and usage
messages to differentiate between the existing latency
tracking via vendor-specific NVMe log pages on Intel
NVMe SSDs, and the newly added latency tracking done
in software.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I299f1c1f6dbfa7ea0e73085f7a685e71fc687a2b
2017-05-17 09:49:27 -07:00
Daniel Verkamp
905551da05 nvme/fio_plugin: remove dead store
Change-Id: I69d614434e6ce1dd16eb0009d7ededc7be807d09
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-11 16:03:51 -07:00
Daniel Verkamp
93f7d910c6 nvme/fio_plugin: make file-level variables static
These variables are not needed outside of this file.

Change-Id: I577db5140fb4156100e72e6219c8121304a9b137
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-11 16:03:51 -07:00
Daniel Verkamp
dba5490000 nvme/fio_plugin: make setup callback thread safe
Change-Id: I40f858a204bf0ca5e594fc8efcb1a31849e6709b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-11 16:03:51 -07:00
Daniel Verkamp
94a2bec4a8 nvme/fio_plugin: remove unused MAX_LCORE_COUNT
Change-Id: Ie9015d88a8919885c620b51fac61ea49e120ac68
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-11 09:32:39 -07:00
CaoGang
8ff1c0298d example/identify: add new parameters under multi-process scenario
Change-Id: I7a415dbeb49aac778939fc7128371d93865fe927
Signed-off-by: CaoGang <gang.cao@intel.com>
2017-05-10 11:13:13 -07:00
Ben Walker
b961d9cc12 include: Move the remainder of the code base to stdinc.h
Change-Id: I6a142feeaad3117bd3c75e7c5cb7231a1cfa78ae
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-08 13:20:36 -07:00
Ziye Yang
fcc9ad4431 fio_plugin: Support multiple jobs for fio when enabling SPDK
Change-Id: Ib3d354cb8ddcfef990bfdb9adc537258566f0cc3
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-05-03 13:23:37 +08:00
Jim Harris
77f23fe3fa Revert "fio_plugin: Support multiple jobs for fio when enabling SPDK"
This patch is causing intermittent errors in the automated tests, so
reverting for now until this can be resolved.

This reverts commit 1d9891989c.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I237e31b1b8a1a1e28262851ae0a21cd7345f0f1b
2017-05-01 15:53:42 -07:00
Daniel Verkamp
e2bf067577 Fix comma spacing errors spotted by astyle 3.0
Change-Id: Ie0543b220367c68c15bc9c4668e39b5336880021
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-25 10:01:18 -07:00
Ziye Yang
1d9891989c fio_plugin: Support multiple jobs for fio when enabling SPDK
Change-Id: I455c6075d93def33647881cc62a2856b1d014b6d
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-04-25 10:00:40 -07:00
Daniel Verkamp
6b91943209 scripts/check_format.sh: check spaces in comments
Fix up all existing spacing errors in comments and add an automated
check for patterns like /*comment*/.

Change-Id: I28f61c93612dc0f8aed66bd509da78e91ea9737e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-24 13:37:41 -07:00
GangCao
4613ed760c nvme: add the temperature related fields for the health info page
Change-Id: I5231412d122615a92566e81a8712d83577c7327e
Signed-off-by: GangCao <gang.cao@intel.com>
2017-04-24 12:15:23 -07:00
Ziye Yang
177ab97b6e fio_plugin: Reset the cpu core affinity after spdk_env_init
The reaon is that rte_eal_init called in spdk_env_init binds
the master thread on master core, we need to restore the
affinity.

Change-Id: I4eb2d36b74404c1af6d242c4fd5c403bd3d5036c
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-04-21 12:36:40 -07:00
wenzhong wu
013471a121 nvme/fio_plugin: Modify the fio repo address in README.md
Change-Id: I0169bf9ce1b0720bb74057043529a8aac27d36e6
Signed-off-by: wenzhong wu <wenzhongx.wu@intel.com>
2017-04-21 11:05:13 -07:00
Ziye Yang
da06e2ea03 fio_plugin: make spdk_env_init only once
This patch will be prepare to support multi threads.

Change-Id: I2234ae1d564c9cf17b92c85fd0a414adaa639bf2
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-04-21 09:38:45 -07:00
Ziye Yang
13fc774bf4 fio_plugin: add NVMe-oF host support in fio_plugin.
Also adds the automation test case for using remote
NVMe devices exported by NVMe-oF target.

Change-Id: I2b839a4eeec33d5b0c30d654e6013ad8c7949e23
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-04-21 09:38:45 -07:00
GangCao
b3cc183a53 nvme/example: add shm_id in identify tool under multi-proc case
Change-Id: Ia5427dda190d984edc79603c4b41e74ce49a7a5a
Signed-off-by: GangCao <gang.cao@intel.com>
2017-04-17 13:09:45 -07:00
Jim Harris
c3c851f677 nvme/identify: show atomic write unit parameters
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id5bcf3cb1486500a69c68989e28caeb634607954
2017-04-17 11:56:36 -07:00
Daniel Verkamp
4f9f191c89 nvme/perf: align buffers to block size for libaio
This is required by libaio.  Previously, buffers were aligned to 512
bytes, but 4K devices need 4K-aligned buffers.

Change-Id: I96080e72dc77e0e72f426f7c9fe98b6724f66e1b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-06 14:57:33 -07:00
Ben Walker
7f7c03a935 env: Remove all use of RTE_LCORE_FOREACH
Replace with an env abstraction.

Change-Id: I706374d265a270890e1f3ca920a10a0dc09624b0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-05 11:16:37 -07:00
Ben Walker
84230409fd examples: Simplify register_workers algorithm
Several examples have a function to associate workers
with threads. Simplify that algorithm.

This seems to just shift some of the complexity
from register_workers down to main, but in the long
run the DPDK threading will get abstracted into
env as well and greatly simplify that part.

Change-Id: Ic106dde58fa5351a1ce0a058161b08062e121d3b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-04-05 11:13:52 -07:00
Jim Harris
9ee30b87b7 fio_plugin: enforce thread=1
The SPDK fio plugin only supports jobs as threads, not separate
processes.  So log an error and bail if --thread=1 is not
specified.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I318f924e0b7fbb76f11427a447dd7c5fc0ebc221
2017-04-04 09:12:41 -07:00
Prashanth Nayak
1e4920b261 nvme: remove unused rte_* includes
Change-Id: I9a1e6fab58af3a4b7ba5d408c393a00fc177d3a6
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-04-03 12:31:12 -07:00
Ziye Yang
21ce0f4030 examples/nvme: replace sprintf with snprintf
Change-Id: I08c594e26df9e1cdae67596e92db646c92701f85
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-27 13:54:49 -07:00
Ziye Yang
fcc2eec870 nvme_manage: Rely on fgets to NULL terminate string
fgets guarantees that strings returned are NULL terminated,
so delete logic that attempts to insert a NULL terminator.

Change-Id: Ibeadcda9af431091b04daff41596d5738419b43f
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-03-27 12:55:04 -07:00
Changpeng Liu
34369a1243 nvme: fix potential null dereference of spdk_nvme_ctrlr_get_ns
Change-Id: Ibe353e61020caa264cb9b4ad38a091f46ecccfb1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-03-24 12:18:37 -07:00
Changpeng Liu
c3ec79faee examples/perf: update usage information
Change-Id: I427075ead5fcdc15f03e6086d55d59b6b1030b26
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2017-03-23 15:04:03 -07:00
Isaac Otsiabah
f5b56f6356 examples/nvme/fio_plugin: update to FIO 2.18
The enum fio_filetype member FIO_TYPE_DB has been changed to FIO_TYPE_BLOCK.
2017-03-17 15:26:09 -07:00
Daniel Verkamp
d9aed01ff0 nvme/fio_plugin: simplify getevents/event hooks
The previous implementation tried to maintain a ring buffer of completed
I/O retrieved from ->getevents() that had not yet been retrieved by
->event(), but this is not necessary.  None of the other FIO engines
implement this sort of ring buffer, and the only code that calls
->getevents() will always retrieve the full number of events via
->event() afterwards.

Instead, just count how many I/Os have been completed within each
->getevents() call in iocq_count, and reset iocq_count on each new
->getevents().

Change-Id: I2776c3a5c89a0d2b24478328bc138ff7a9fb5bdd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-17 09:37:42 -07:00
Daniel Verkamp
b58a5d73ef util: add SPDK_COUNTOF() array size macro
SPDK_COUNTOF works like sizeof, except it returns the number of elements
in an array instead of the number of bytes.

Change-Id: I38ff4dd3485ed9b630cc5660ff84851d0031911f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-07 12:43:42 -07:00
Daniel Verkamp
ba5081db23 examples/nvme/perf: set io_queue_size in NVMe probe
Since we know the queue depth that we will be using during the test,
request that as the queue size when attaching to NVMe controllers.

Reserve one extra queue entry above the expected queue depth since NVMe
queues must always have one entry free to distinguish between queue
empty and queue full cases.

Change-Id: I809982207edb4894148aec09b10c4e2de4a040d3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-03-07 12:15:59 -07:00
Ben Walker
18d26e42a3 env: Move DPDK intialization into the env library.
Change-Id: Ie3a324f1523ffa0ddb0bd6a24a9a3cd0acbf64b0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-02-15 17:16:37 -07:00
Ben Walker
25270f1d7c Rename instance_id to shm_id and make it default to pid
By default, all SPDK applications will not share memory.
To share memory, start the applications with the same
shared memory id.

Change-Id: Ib6180369ef0ed12d05983a21d7943e467402b21a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-02-15 17:16:37 -07:00
Felipe Franciosi
26c8e7ccef examples/nvme/hello_world: fix typo in comment (#114) 2017-02-15 16:36:22 -07:00
Chun Liu
8314b54996 nvme/fio_plugin: fix compliation with recent FIO
Fixes compilation after fio commit
565e784df05c2529479eed8a38701a33b01894bd ("Don't malloc/memcpy
ioengine_ops on td initialization").

Change-Id: Id7138e774e523af3a27ac24e08b8ccd05a3ed77a
2017-02-07 15:42:36 -07:00
Daniel Verkamp
459cd69571 test/nvme: set DPDK base address for multi-process
Map the DPDK hugepage virtual address space to an area that should not
interfere with randomized mmap() addresses.

Change-Id: Iffc657858f861fc1316f77b68f9f121167d604b1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-31 16:00:46 -07:00
Daniel Verkamp
7a8840c09b nvme/identify: convert NVMe-oF to -r TRID format
Change-Id: I620331e2a865d399bddf2e5759f0a832f9c2e86b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-25 16:31:38 -07:00
Daniel Verkamp
f12e7085ec nvme/perf: allow multiple -r (transport ID) arguments
This allows the user to connect to multiple remote NVMe-oF targets or to
specify multiple specific PCIe device addresses to test.

Change-Id: I05b2072b8aa1480891b37b17b5207369344b617d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-20 17:07:30 -07:00
Daniel Verkamp
042452af55 nvme/perf: convert -r argument to TRID format
Change-Id: Ib0568ace157c19c9a86741b7d46fcf5cdb8cdb69
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-01-19 14:05:57 -07:00
Ziye Yang
0a573526b6 nvme/pcie: Add the support to probe nvme by pci_addr
Currently we use the pci functions provided by DPDK,
it identifies the device by class id related
info but not by pci bdf info, so we can add the filering
by pci_addr in pcie_nvme_enum_cb function.

Change-Id: I5942e98853f00fc10fa6aae5c113517653d1b357
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-01-18 15:30:45 -07:00
GangCao
11f4362130 examples/nvme: add task_count to dynamically allocate memory
The memory allocation is based on user specified queue depth,
number of attached active namespaces(aio files) and number of
cores involved in the IO operations.

Change-Id: I370b9fdacc1bb40d110bec7e96adac2424d39431
Signed-off-by: GangCao <gang.cao@intel.com>
2017-01-17 11:27:16 -07:00
Ziye Yang
1c6d354d41 nvme/identify: change trid to g_trid
Also do some cleanups in parse_args to fix and
optimize the logic.

Change-Id: If00929f45a89be820f2c60e6532f068f9d6abc3b
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2017-01-13 10:58:04 -07:00
Ben Walker
df46c41a4c nvme: Unify spdk_nvme_discover and spdk_nvme_probe
They were very close to the same already, so finish the job.

Change-Id: Ifba9e3b2d11a3e70cbfbe46f57a67552db2757ed
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-19 11:22:57 -07:00
Daniel Verkamp
f8baa259a1 test/nvme/hotplug: print an error if counts mismatch
Change-Id: I99339b16051011c9685d9d8afb79463eba01bfc4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 16:29:34 -07:00
Daniel Verkamp
d24ea9009a nvme: add offset to spdk_nvme_ctrlr_cmd_get_log_page()
Change-Id: I1af4950995062f892062f29db85da2a8dd793d85
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-15 11:16:14 -07:00
Cunyin Chang
d77a04d148 example: Replace the printf with fprintf to stderr.
This patch will make sure the information will show up
on console immediately.

Change-Id: I0080866a40de35fb9deef840551ff212759b0191
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-14 15:04:33 -07:00
Daniel Verkamp
0346dd775e nvme: add ADRFAM (address family) to transport ID
This isn't used yet in the NVMe library, but it will be necessary later
for supporting non-IPv4 addresses.

Change-Id: I167ce63ad25b0e0c9aa192b12d764c8d078e67f9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-14 10:14:10 -07:00
Ben Walker
32e838af3c nvme: Remove probe_info, just use transport_id
The probe_info was reduced to just containing a
transport_id, so remove probe_info entirely.

Change-Id: Ica9a22d126cd14e282decd3eea1a0afe0460f099
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-12 10:49:17 -07:00
Ben Walker
6c2e170dc7 nvme: Remove pci_id from probe_info
This can be obtained by parsing traddr into a pci_addr,
then getting a handle to the pci_dev and asking for all
of the pci information.

Change-Id: I1948cbd3ec65611293192ef5558ace19dd444d4c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-12 10:49:13 -07:00
Ben Walker
3da43e64e4 nvme: Remove pci_addr from probe_info
This can be obtained by parsing the traddr.

Change-Id: Idaf35066cbf900c87e771a44934de99fb5420001
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-12 10:46:50 -07:00
Cunyin Chang
2bd8c87a4c example: Add input parameters for expected hotplug count.
Change-Id: Iac626b05b72b26097d8742d6f427c9cd007a5da4
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-08 20:36:10 -07:00
Ben Walker
5f78155fde nvme: Embed a transport_id in the discovery_info struct
Instead of repeating the fields, just embed a transport_id.

Change-Id: I282704c9d59784abd5f7c93be4e47c673fcf6dde
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-08 11:48:21 -07:00
Ben Walker
4af9f06c73 nvme: Rename discover_info to transport_id
This is a small step toward making discovery more like
scanning a local PCI bus.

Change-Id: Ie7149ad060f2eeb56939b1241187bdf09681f2aa
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-12-08 11:48:21 -07:00
Daniel Verkamp
8b3ec5bb42 nvme/examples/arbitration: clean up duplicated usage
The usage help is already printed when an invalid parameter is specified
or when requested with -h.

Change-Id: If4201ee868106f99084436971763bb7e5e87ede0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-07 13:36:15 -07:00
Daniel Verkamp
801388a796 Add missing .gitignore files for binaries
Change-Id: I2a2b23fb5e71ff4c0b9c85e0709968e8d7e75f63
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-06 09:51:00 -07:00
Daniel Verkamp
104356c97f examples/nvme/hotplug: vastly simplify and rewrite
This example should show how to use the hotplug features of the NVMe
library API.  It doesn't need to measure performance or allow lots of
unrelated options.

For now, the hotplug example will run everything (I/O and hotplug
probes) on a single thread.  The current code has lots of thread safety
problems.  A real application implementing hotplug would likely call
spdk_nvme_probe() on one core and pass remove and add notifications
to other cores via the event framework or another cross-thread
synchronization mechanism.

Change-Id: Id6df39812ef53383edc8ab9edb4cc3540fcb16c0
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-05 11:13:16 -07:00
Ziye Yang
4a0c1021fc nvme: update nvme perf program to test nvmf target
1 update nvme_rdma.c to fix the I/O queue creation bug.
2 update examples/nvme/perf/perf.c
3 add perf.sh

Change-Id: Ic7d4845219deb93bc042e34abbb7b2e05793ccd8
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-12-02 08:41:12 -07:00
Daniel Verkamp
94c2dd8bdf nvme/hotplug: print message when a device is removed
Change-Id: If9c116d72bd889196331567542920c3ca818c68e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-02 08:39:52 -07:00
Daniel Verkamp
051b059e26 examples/nvme/hotplug: return 0 on success
Change-Id: Id19bef766fa2366208aced87ca3433e6ab05ff9b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-01 09:12:26 -07:00
Daniel Verkamp
9d025383eb nvme: rename nqn fields in public API to subnqn
The discover and probe 'nqn' fields are subsystem NQNs, so name them
subnqn to be consistent with the spec and the rest of the code and to
distinguish them from host NQNs.

Change-Id: I4a80fbc1f4b037c8a4f91c8f28d2a96e47c66c47
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-12-01 08:08:19 -07:00
Cunyin Chang
038236949f example: Add example for nvme hotplug.
Change-Id: I7e0bbf48798b77365c4dc968427c8834e0b05a44
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-12-01 10:23:10 +08:00
Daniel Verkamp
7d5bcb4893 nvme: remove spdk_nvme_transport_type from API
Use the NVMe over Fabrics spec definitions for TRTYPE rather than the
internal library transport type.

Change-Id: Idead559a8f8d95274fc580d10e82033822e6eda8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 13:42:00 -07:00
Jim Harris
5616e0880d build: create a common mk file for nvme library tests and examples
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ief0f99b7f014cf905d08e2c0cd9dc99653bd0bb8
2016-11-22 11:45:47 -07:00
Jim Harris
bb155377c3 examples/nvme: rename reservation.c to reserve.c
This enables some future Makefile simplifications.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I071b32fbb695b74880c9659558d9653d3a904c10
2016-11-22 11:45:47 -07:00
Daniel Verkamp
5c146a19f6 nvme/identify: print NVMe over Fabrics probe info
Also clean up the PCI address output to be consistent with tools like
lspci.

Change-Id: I41f704943a1297379a7ad71cdc9ee9508b5235f5
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-22 11:36:34 -07:00
Daniel Verkamp
b3e46acfe9 examples/nvme/identify: clean up arguments
- Make the usage columns line up
- Fix the wording of the usage messages
- Fix the getopt() string for -x, which has no argument
- Use the default discovery NQN if none specified
- Use the nvmf_spec.h #define for max NQN length

Change-Id: I88608ead57d1bee46738ba05dc2074230d22be0d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-21 17:02:12 -07:00
Ziye Yang
246c39a7ee nvme: Add nvme over fabrics support
Change-Id: I6f6259e77baa5dc5861f31ec4a9034e15297d333
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2016-11-18 13:58:44 -07:00
Daniel Verkamp
44e60dc47d build: consolidate library outputs in build/lib
Make it easier to use SPDK libraries by putting them all in a single
directory that can be added with -L rather than scattered around the
source tree.

Change-Id: I5c0f5dd6e7058b5f92fa9bc41548190ffc064761
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-17 13:15:09 -07:00
GangCao
987ba616fa nvme: create the mempool from the name with the suffix of pid
Change-Id: I3bf3ecf5b83e206553d4103d47ed04ebe80387eb
Signed-off-by: GangCao <gang.cao@intel.com>
2016-11-09 22:04:27 -05:00
Daniel Verkamp
fcb00f3780 nvme: expand probe information to a struct
spdk_nvme_probe() will now provide a struct spdk_nvme_probe_info to the
probe and attach callbacks in place of the PCI device pointer.

This struct contains the useful information that could be retrieved from
the PCI device during probe.

The goal of this change is to allow expansion of the probe information
in the future when other transports (specifically, NVMe over Fabrics)
are added that do not necessarily use PCI addressing or device IDs.

Change-Id: I59a2a9e874e248ce5fa1d7f4b57c8056962ff3cd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-02 14:15:02 -07:00
Daniel Verkamp
bbd7e1c4da env: add spdk_pci_addr_parse()
Add a helper function that converts a PCI address from a string into a
struct spdk_pci_addr and use it in place of the various sscanf()
invocations throughout SPDK.

Change-Id: Id2749723f76db741567e01b4bcb0fffb0e425fcd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-02 14:15:02 -07:00
Daniel Verkamp
03aa3af0e7 nvme_manage: use spdk_pci_addr_compare()
Replace open-coded PCI address retrieval and comparison functions with
the new env.h PCI APIs.

Change-Id: I282a3f8d2e0c7c2cfde7b8a752260dd2bf0cb031
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-11-01 09:40:36 -07:00
Ben Walker
7f5b671db7 env: Convert some rte_mempools to spdk_mempools
This converts some, but not all, usage of rte_mempool
to spdk_mempool. The remaining rte_mempools use features
we elected not to expose through spdk_mempool such as
constructors, so that will need to be revisited.

Change-Id: I6528809a864ab466b8d19431789bf0f976b648b6
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-12 09:53:32 -07:00
Ben Walker
0aa2986475 Replace rte_get_tsc calls with spdk_get_ticks
Change-Id: I809b900321433693ff9f2498183ad0dcdbb15030
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-11 13:34:09 -07:00
Ben Walker
2224ff2162 env: Replace rte_malloc with spdk_zmalloc
Use the env library to perform all memory allocations
that previously called DPDK directly.

Change-Id: I6d33e85bde99796e0c85277d6d4880521c34f10d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-11 13:34:09 -07:00
Ben Walker
0dd80395f3 env: Move pci.c from util to env
This allows users to swap their PCI library from
libpciaccess/dpdk to another mechanism using the standard
method for swapping out the env library.

Change-Id: Ib2248f8b43754a540de2ec01897e571f0302b667
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-05 11:53:24 -07:00
Ben Walker
a4747c6048 env: Make the environment library configurable.
This allows users to swap out SPDK's third party
libraries for an implementation based on their own
framework.

Change-Id: Ia0b7384ce5e31acba5ad0d7002dec9e95b759c52
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-05 11:51:37 -07:00
Ben Walker
a30b5532cb memory: Rename to env
The new env library will wrap all third-party library
calls and be easily swappable with alternate implementations
at build time. For now, it's just the memory library
renamed.

Change-Id: I26a70933289f8137107208ba75f7520fd7a33da0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-05 09:49:35 -07:00
Ben Walker
6b1e4e732d Drop libpciaccess and switch to DPDK PCI
This patch also drops support for automatically unbinding
devices from the kernel - run scripts/setup.sh first.

Our generic pci interface is now hidden behind include/spdk/pci.h
and implemented in lib/util/pci.c. We no longer wrap the calls
in nvme_impl.h or ioat_impl.h. The implementation now only uses
DPDK and the libpciaccess dependency has been removed. If using
a version of DPDK earlier than 16.07, enumerating devices
by class code isn't available and only Intel SSDs will be
discovered. DPDK 16.07 adds enumeration by class code and all
NVMe devices will be correctly discovered.

Change-Id: I0e8bac36b5ca57df604a2b310c47342c67dc9f3c
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-10-04 15:59:00 -07:00
Ben Walker
b0e349a804 nvme: Use log library instead of nvme_printf
Change-Id: Ic9b2db9bff3a914b3e5021695287157f1e076f9f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-09-28 10:15:55 -07:00
GangCao
372942e569 nvme: move global request_mempool allocation into nvme_impl
The user no longer needs to create the request pool.

Change-Id: I83bb8948143d4cc961d232f9f30df3106d5e0eab
Signed-off-by: GangCao <gang.cao@intel.com>
2016-09-27 14:25:39 -07:00
Daniel Verkamp
df56ab7711 examples/nvme/arbitration: simplify log page allocation
spdk_nvme_ctrlr_cmd_get_log_page() now allocates a physically contiguous
buffer internally, so the caller does not need to provide special
DPDK-allocated memory.

Change-Id: Ic9964fdea3532303b172e591536b57d102d1d0b1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-22 20:59:10 -07:00
Daniel Verkamp
afd2fc556e examples/nvme/arbitration: fix mixed tabs/spaces
Change-Id: I2c0ac6356107b96a09520ce0a912851215149784
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-22 20:59:10 -07:00
Changpeng Liu
18529e917d nvme: print the End-to-End data protection information in identify application
Change-Id: I97171328f5c7dea593aa1e9b40a96d7a42f37e2c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-09-21 12:55:13 -07:00
Jim Harris
edbed73064 Rename and move fd related helper functions to fd.c.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ieccdd778348e8709ca4ef6cdf4f58f40021638db
2016-09-14 10:51:25 -07:00
Daniel Verkamp
c747375988 examples/nvme/reserve: simplify buffer allocation
Now that the NVMe library handles physically contiguous buffer
allocation for reservation functions, the example can just use normal
local variables.

Change-Id: Ieaafc3affbc2e05541041579d330e26151375366
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-14 09:16:44 -07:00
Daniel Verkamp
03cbd9aa72 nvme/identify: simpify buffer allocation
After the NVMe library API change to perform user copies, we don't need
to pass rte_malloc() memory to the NVMe controller utility functions
like spdk_nvme_ctrlr_cmd_get_log_page().

Use regular global variables to simplify the identify example code.

At the same time, fix the code that retrieves error log pages -
previously, it was allocating space for multiple error log entries, but
it was only passing the size of a single entry to the Get Log Page
command.  Now we preallocate the worst-case array size: ELPE, which
indicates the maximum number of error log page entries, is a single
byte, and it is 0's based, so the largest possible array is just 256
entries.

Change-Id: Ia3b3b85e33bb5482df9d366803fc6e6807bf5d88
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-13 12:49:06 -07:00
Daniel Verkamp
7bd558ab3b nvme/identify: fix spacing of SGL features
Change-Id: I0ec6a6851fe33b93e2fc41adfd9c8cba4c3ab8fd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-09-02 09:22:44 -07:00
Daniel Verkamp
1b957fa58e nvme/identify: print out controller data VER field
Dump both the MMIO region VS register and the Identify Controller VER
field, which should match.

Change-Id: I4c0eaa512424d85169a0f21ee86dbaedbfbc051f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-26 08:48:17 -07:00
Daniel Verkamp
1efc92c7f8 nvme_spec: define OAES bits in Identify Controller
Add bitfields for Optional Asynchronous Events Supported.

Also add it to the nvme/identify example.

Change-Id: Ifeb1cf8af94286a6cf437ec4b6f9e8b752c7d2f9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-26 08:48:17 -07:00
Daniel Verkamp
84812653be nvme/identify: interpret CMIC bitfields
Print out the multi-path I/O features in a human-readable way.

Change-Id: If1302933eff7649c31e21188f71cc361cc90ff01
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-26 08:48:17 -07:00
Daniel Verkamp
060ffe8dee nvme/identify: fix max data transfer when MPSMIN != 0
Correctly calculate the maximum data transfer size as defined in the
spec - MDTS is a power of two in units of the minimum memory page size.

Change-Id: Ifd517d3051a28d404246c5a5d342147aa69ceedc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-26 08:48:17 -07:00
Daniel Verkamp
76af27c0fc nvme/identify: fix Error Recovery Timeout spacing
Change-Id: I4c2f04d72ab80c5341d6d2e5390e9d835c4a67be
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-08-26 08:47:36 -07:00
GangCao
9dfc65b081 nvme: Create Proc Type for primary and secondary processes
Change-Id: I283ce03ed50fd12b9da906b0e09b4559b41776ef
Signed-off-by: GangCao <gang.cao@intel.com>
2016-08-15 09:21:20 -07:00
gongchuang
4d01cd7d8a nvme:fixup print in hello_world (#35)
Signed-off-by: gongchuang <gong.chuang@zte.com.cn>
2016-08-08 11:29:52 -07:00
Jim Harris
a2fbd991cd fio_plugin: add norandommap=1 recommendation to README
While here, also mention that the plugin only supports
a single thread currently.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I265e59a89e77cd8ed26419e811aa2f36afcd37b3
2016-08-02 13:31:38 -07:00
Daniel Verkamp
e120c17a96 examples/nvme/hello_world: specify -n to DPDK
The example won't run without specifying the number of memory channels.

Change-Id: I278c225ee82181677a6206f73a11df09fd045209
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-20 09:05:01 -07:00
Daniel Verkamp
fc8d73f896 nvme_manage: list allocated NS IDs in NS attach
Change-Id: Ie518cc5b1a9eb0cb8a59f4d101b7d2181975728d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-19 14:10:36 -07:00
Ben Walker
68eb363be7 perf: Write a pattern instead of 0.
Writing 0's hits SSD firmware special cases and gives
unrealistically high performance numbers.

Change-Id: I73c72ee52494075e354dcddd067e3ce49c156204
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-07-08 08:49:47 -07:00
Daniel Verkamp
e2256173a8 nvme/identify: dump CAP and VS registers
Change-Id: I157dc7f1eda082f1bdf0a176fc6c6061291e2ac1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-07 15:32:20 -07:00
Tsuyoshi Uchida
247a59082a nvme/perf: add min and max latency (#23)
Change-Id: I8f6ac966dad5f2ef0ab81c5160417dd6cb74a913
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-07-06 13:36:40 -07:00
Daniel Verkamp
19fec6bb9c nvme: add remove callback to spdk_nvme_probe()
This will allow removal notifications to be propagated to the library
user (e.g. for hotplug).

The callback is currently unused, but this at least prepares the API for
the future hotplug support.

Based on a patch by Dave Jiang <dave.jiang@intel.com>

Change-Id: I20b1c2dbf5e084e0b45a7e51205aba4514ee9a95
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 14:21:58 -07:00
Daniel Verkamp
e2d3cc6502 nvme: replace rte_memcpy with specialized function
Use the knowledge that both the source and destination of
nvme_copy_command() are aligned to emit the aligned variants of the
SSE2/AVX mov instructions.

Change-Id: I0a7e32a3bb10b9a1920cd85691b79fa7172eecb3
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-28 14:17:21 -07:00
Ben Walker
6b10df3576 nvme: Update nvme_spec.h to 1.2.1
This moves some definitions from nvmf_spec.h to
nvme_spec.h based on the latest publication.

Change-Id: I51b0abd16f7d034696239894aea5089f8ac70c40
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 09:18:14 -07:00
Ben Walker
9a2f8eb234 nvme: Add gitignore for hello_world example
Change-Id: Ifc6632de1da6733ff78510e64d27fbfeb9ac390e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-06-24 08:55:55 -07:00
Daniel Verkamp
39cc59635a build: include -lrt and -lpthread in LDFLAGS
Simplify the build rules so that common libraries are always linked.

Also fix up a couple of -lpciaccess instances that should have been
changed to $(PCIACCESS_LIB).

Change-Id: I4c50fa3aa59cae013d3385e38fbb830794299f6e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-06-23 09:04:02 -07:00
Tsuyoshi Uchida
7fea41512c fix typo in fio plugin REAME (#25)
Fix defconfig_x86_64-native-linux-gcc to
defconfig_x86_64-native-linuxapp-gcc
2016-06-21 17:08:27 -07:00
Ziye Yang
7991eb1957 Create a utility and enable WRR arbitration mechanism
Change-Id: I2194863ae812ece72c17b78e003ccf7895b8a812
Signed-off-by: GangCao <gang.cao@intel.com>
2016-06-21 16:35:04 -07:00
Jim Harris
213e7a640d examples: add hello_world example for NVMe
This is a very basic example app that shows how to
use the SPDK NVMe driver API for basic enumeration and
I/O operations.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I411f6f90781832f00d98b3d6782a9c2ca6591ce3
2016-06-17 12:05:39 -07:00
Tsuyoshi Uchida
3fc793591d nvme/perf: Improve aio code
Use O_WRONLY flag for write IO
Cleanup io_context_t and io_event when perf exits

Change-Id: Iefa1d8be5e017a1ca5719489c1ec4b868df94722
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-25 15:50:14 -07:00
Tsuyoshi Uchida
239fdb3d2e nvme/perf: Free memory
Free memory of worker_thread, ns_entry and ns_worker_ctx when perf
exits.

Change-Id: I4707eea31ca1a1c4a9ce6ded857c4576e57b4532
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-24 09:55:09 -07:00
Daniel Verkamp
4957d2642a nvme: return NSID from spdk_nvme_ctrlr_create_ns()
Previously, there was no way to determine what namespace ID was assigned
when a namespace was created via the NVMe library interface.

Also drop the incorrect comment about calling
spdk_nvme_ctrlr_process_admin_completions(), since
spdk_nvme_ctrlr_create_ns() checks the admin queue internally.

Change-Id: If90a6e9fc773aefa220ebbf6effc2d033c9f20cc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-18 17:06:09 -07:00
Daniel Verkamp
8f876a612f nvme_manage: display available LBA formats
Add a helper function, get_lba_format(), to print available LBA formats,
and use it in Create Namespace as well as Format NVM.

Change-Id: I4bfa4db0aa5a083f51b8da6b5103acf64f1da788
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-18 16:52:14 -07:00
Ben Walker
ddb59105ee nvme: Add an fio plugin
Change-Id: Ife815e371325df7fbec388530dc09097c3e4ffac
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-05-18 13:51:36 -07:00
GangCao
dd27218532 nvme/identify: Correct the Arbitration Burst bits (0..2)
Change-Id: Ia9bcca01d7d2e2c0a7c97c0a7c7a49f5c3417a0b
Signed-off-by: GangCao <gang.cao@intel.com>
2016-05-16 09:56:50 -07:00
Cunyin Chang
0f805b3622 nvme_manage: Add command to support firmware upgrade.
Change-Id: I3702c979de136a4821dee671434667e8beabf119
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-05-11 10:18:38 -07:00
Changpeng Liu
de1669585e spdk/perf: add average latency statistics to perf tool
Change-Id: Ic8042e0c7b1e727292af211a3857fda987dfb2b0
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
2016-05-11 09:52:04 -07:00
Daniel Verkamp
cd48a01fcb build: wrap $(CURDIR) relative paths in $(abspath)
Resolve relative paths before using them to clean up command lines.

This should also help shorten the overall command line length that gets
embedded in the binary and used when locating the executable from a
coredump.

Change-Id: Ibff9849ede198bb04313496c8b7131485ffaf14f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-05-09 13:56:07 -07:00
Cunyin Chang
32ecdedda3 identify: Add support for intel marketing description page
Change-Id: I9d3db2efa7111b1812aa944d6cf591451c53baa2
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-05-06 09:01:52 +08:00
GangCao
4e91a0b017 manage: add support for protection info and multi-path IO
Also made a slight change in the Namespace Display output.

Change-Id: Ieee288f4ec8c91c11ed5006824a5c7c069e89b00
Signed-off-by: GangCao <gang.cao@intel.com>
2016-04-07 10:24:07 -07:00
Ben Walker
c9290aa492 identify: Print out the NVMe Error Log Page
Change-Id: Ieddc9f4d7f295fc9ffa5c458d9fc8d27465425af
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2016-03-29 09:45:48 -07:00
Daniel Verkamp
173b4144da nvme_manage: shorten simplistic controller listing
Fit all of the info about a controller onto a single line.  This is more
readable with larger numbers of controllers.

Change-Id: I145844d5df5c0b1e3f544fd6c8d846ee94b4e662
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 09:41:23 -07:00
Daniel Verkamp
5bb16e86a1 nvme_manage: replace magic number with #define
Change-Id: I870db323a7801fc0d49cb3ad27e306c898fae603
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 09:41:23 -07:00
Daniel Verkamp
4fe88e4393 nvme_manage: only ask for required info in format
If the selected LBA format does not have metadata, skip the questions
about metadata and protection information.

Change-Id: I3620990eff2f12f2b7df2e8a293314b4001f52b2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-29 09:41:23 -07:00
Daniel Verkamp
6a3735e393 nvme_manage: show supported block sizes for format
Change-Id: I4da94631d9543c6e50b3cd4f8935845a1237ccab
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-23 10:16:18 -07:00
Cunyin Chang
eae688576a spdk: Add nvme format interface and unit tests.
Change-Id: Ie0506debf547a5fc011e116421387a5adb7abf0e
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-17 13:37:20 -07:00
Daniel Verkamp
4fc355ba68 examples/nvme/reserve: add malloc checks and frees
Change-Id: I576ac640c3c8a94237e5437e7e7f029d8526c071
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-17 10:07:55 -07:00
Daniel Verkamp
1698689412 nvme_manage: handle fgets() failure
fgets() will return NULL if it encounters EOF.

Change-Id: I35b1744514f2a90d6e95156c3916a18c1a4ecce2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-16 14:39:42 -07:00
Daniel Verkamp
4ad99808f2 nvme: allow user to override controller defaults
Provide a new structure, spdk_nvme_ctrlr_opts, to let the user modify
the default controller initialization options during probe/attach.

Currently, only the number of queue pairs can be modified in this way;
other options will be added later.

Change-Id: Ie27b9429291d93a9353c0d820f0ad467d3b0e7cb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-16 08:14:15 -07:00
Daniel Verkamp
3272320c73 nvme: make I/O queue allocation explicit
The previous method for registering I/O queues did not allow the user
to specify queue priority for weighted round robin arbitration, and it
limited the application to one queue per controller per thread.

Change the API to require explicit allocation of each queue for each
controller using the new function spdk_nvme_ctrlr_alloc_io_qpair().

Each function that submits a command on an I/O queue now takes an
explicit qpair parameter rather than implicitly using the thread-local
queue.

This also allows the application to allocate different numbers of
threads per controller; previously, the number of queues was capped at
the smallest value supported by any attached controller.

Weighted round robin arbitration is not supported yet; additional
changes to the controller startup process are required to enable
alternate arbitration methods.

Change-Id: Ia33be1050a6953bc5a3cca9284aefcd95b01116e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-14 16:00:54 -07:00
Daniel Verkamp
e3cabfafd7 nvme_manage: accept more PCI address formats
Change-Id: Ie8177b320271c9e7cb9b2216dbdd9c3c11f39579
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-11 09:37:21 -07:00
Cunyin Chang
73b0afa867 nvme manage: nvme manage tool optimization.
Change-Id: I2647451c168a7bcdc739a5f599810387f52b17a8
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-11 09:33:10 -07:00
Cunyin Chang
30089f8939 nvme manage: Add interface for format progress indicator.
This patch just implement the feature of format progress indicator.
the NVMe available does't support FPI currently.

Change-Id: Ie937591fb1720d8a062354322aabcc95ff14b2d3
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-10 09:02:06 +08:00
Daniel Verkamp
b1b84a2a66 nvme_manage: use inttypes.h SCN macro for uint64_t
Also switch from %d to %i to allow either decimal or hexidecimal input.

Change-Id: Ia866f9ab804d09e4bf8a2726b8db99208637a5ed
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-08 08:45:41 -07:00
Daniel Verkamp
2e61a144dd nvme_manage: sort devices by PCI address
This way, they are listed in a consistent order across runs.

Change-Id: Ie920f4e0c2763efb6c1d2856b5ed0f57ecbe48c8
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 16:08:14 -07:00
Daniel Verkamp
ce13ccf8b0 nvme_manage: check NS management support earlier
Don't keep prompting the user for input if the controller doesn't
support the NS management command.

Change-Id: I5bf001657ca1cbbdbf33cafff2509ade2d47bd9d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 15:49:51 -07:00
Daniel Verkamp
6e2a6ff132 nvme_manage: move ctrlr_list to a local variable
This doesn't need to be stored in the device struct, since it is only
used within ns_attach(), and it is freed at the end of the function.

Change-Id: I0d4a14a6743e8cbf9e8f1a6c19c68cf0dfc2bab2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 15:48:45 -07:00
Daniel Verkamp
c015a2485b nvme_manage: move ndata to a local variable
This doesn't need to be stored in the device struct, since it is only
used within ns_manage_add(), and it is freed at the end of the function.

Change-Id: If725408026736d4ef9a0695ab28bc30e6648932e
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2016-03-04 13:51:46 -07:00
Cunyin Chang
9841610855 spdk: Add namespace management interface and unit tests.
Change-Id: I9d203bf7532d50b1f8c8ca50c50df09ded8b5256
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2016-03-04 09:52:30 +08:00