Commit Graph

207 Commits

Author SHA1 Message Date
Roman Sudarikov
5712088a55 Add support for VTune
Change-Id: Ica7f76a5354b27e6e5fd7114de1fdba46434b073
Signed-off-by: Roman Sudarikov <roman.sudarikov@intel.com>
Reviewed-on: https://review.gerrithub.io/362994
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-06 16:24:14 -04:00
Daniel Verkamp
eba5c996c8 bdev: add NVMe I/O passthru command
Change-Id: I4d281be99553629563026cc4f9ab890d0a97986c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/364115
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-06 13:07:32 -04:00
Daniel Verkamp
bac4c02bc4 bdev: change name and product_name to char *
Dynamically allocate bdev names to remove the arbitrary 16-character
name length limit.

All of the existing product_names are constant strings, so those can
just use string literals instead of a copy per bdev.

Change-Id: I3280da67a4fcf2e4ec8ee8193362ca1b96a9c0cb
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363601
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-06 12:37:39 -04:00
Ziye Yang
7bc1a7d1a6 blockdev_nvme: free name in nvme_ctrlr
Need to free this variable.

Change-Id: I78a7d5b312db6487ed65b9d314590a28408da761
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/363477
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-06 12:37:26 -04:00
Edward Yang
54e16f96b3 bdev: Add spdk_bdev_nvme_admin_passthru
Support passthru for NVMe admin commands.

Change-Id: If926f2ecabb078a553158f544c10a92452dbdb39
Signed-off-by: Edward Yang <eyang@us.fujitsu.com>
Reviewed-on: https://review.gerrithub.io/363294
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-05 18:07:10 -04:00
Ben Walker
aec9d3dcb5 bdev: Add I/O stat tracking
Change-Id: I05bb8294471bac3f9ecc4744e28d7d40e57e5364
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362622
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-06-05 16:38:40 -04:00
Daniel Verkamp
a0cb1377f6 Update existing fallthrough comments for GCC 7
The stricter warning levels (-Wimplicit-fallthrough=4) require all-caps
FALLTHROUGH, so update the existing comments to match.

Change-Id: I5f8608101cad31d8ea8e84d48604397f98400e87
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363491
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-06-02 19:48:49 -04:00
Ben Walker
40217741c0 bdev: Move pending queues to mgmt channel
Instead of an array of queues per core, allocate
the queues per management channel.

Change-Id: I4ace5bd13362a549a45aba62e978dabbbe1a333d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362617
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: John Meneghini <johnm@netapp.com>
2017-06-02 13:30:37 -04:00
Ben Walker
151de2c479 bdev: Add robust, thread-safe reset handling
Reset requests will now pass messages to all channels,
correctly abort all queued I/O, wait for that to complete,
and then pass the reset request down to the next lower
layer in the stack.

Change-Id: I167cc5f424d3d0fc52b041bda63ee176f6acea29
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362616
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-02 12:02:53 -04:00
Ben Walker
4fe9536de0 bdev: Remove reset_type
There is now just one type of reset, which is equivalent
to a HARD reset previously.

Change-Id: I955b219cbc5c25793d97de1cc003b30ae99313ac
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362615
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-06-02 12:02:53 -04:00
Ziye Yang
9104fe73ce bdev: make (v)bdev init in async manner
Change-Id: I93684a004e2ae276734edbb4767b5ba1bac3dd48
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/362111
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-05-31 15:30:58 -04:00
Ziye Yang
6e0d1dcdfa subsystem: make subsystem init in async manner
The next patch will make bdev modules init
in the async manner.

Change-Id: I4909c80510d786daf54003b99a5925428cf37373
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/362110
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-31 15:30:58 -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
Daniel Verkamp
cd88c7c53b bdev: add hook for bdev registration
This allows virtual blockdevs to inspect newly-added bdevs and
potentially insert themselves automatically.

Change-Id: If567a950d753e5f08861a5de22a2e1350376e50f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/362077
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-05-30 08:53:29 -04:00
Ben Walker
7058f85318 bdev: When a channel is destroyed, abort all queued I/O
Change-Id: I03d042cbb6de08f7e07b8c0ccc8af44d7b16ae3b
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362614
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-26 17:41:22 -04:00
Ben Walker
35ab754449 bdev: Make spdk_bdev_mgr an I/O device
Currently this is just a placeholder, but eventually
it will be used to replace the per-core queues.

Change-Id: Iefeb90711bcf001a383e36cd4eaadf813af66506
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362613
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-26 17:41:22 -04:00
Ben Walker
d969ac445a io_channel: Remove per-channel priority
This wasn't used anywhere and we currently believe there
are superior software-only techniques for controlling
quality of service.

Change-Id: Icdadd5870ed0629b338c307d2619bbc242c3e7a3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362065
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-26 13:42:19 -04:00
Jim Harris
8933ba2119 bdev/error: do not submit an I/O that will be failed
If error injection is enabled and we choose an I/O to
fail, do not submit the I/O and fail it when completed -
just fail it immediately.

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

Reviewed-on: https://review.gerrithub.io/362386
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-25 13:53:06 -04:00
Jim Harris
24e0f710cf bdev/nvme: only enable hotplug in primary processes
Only DPDK primary processes can initiate device probe.

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

Reviewed-on: https://review.gerrithub.io/362452
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2017-05-25 13:52:09 -04:00
Jim Harris
2e3f07ac40 bdev: add spdk_io_channel parameter to spdk_bdev_reset
This ensures that all spdk_bdev_io structures now have
an attached channel, simplifying some future work around
things like counting the number of outstanding IOs for
a given channel (which otherwise would have had to
account specially for resets).

Reset semantics are still that they affect the entire bdev
and not just the channel it was submitted on.

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

Reviewed-on: https://review.gerrithub.io/362251
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2017-05-24 11:42:15 -04:00
Jim Harris
fa1429ba02 bdev/nvme: clean up return codes
This prepares for translating -ENOMEM from the NVMe
driver into an associated bdev status code.

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

Reviewed-on: https://review.gerrithub.io/362234
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 11:42:15 -04:00
Daniel Verkamp
b9bcc3531e bdev: make enum spdk_bdev_io_status private
The user should not see the bdev_io status directly; the NVMe and SCSI
error code wrappers provide the ability to translate to the desired
format regardless of what kind of error is stored inside the bdev_io.

Replace the spdk_bdev_io_completion_cb status parameter with a bool
simply indiciating whether the I/O completed successfully.

Change-Id: Iad18c2dac4374112c41b7a656154ed3ae1a68569
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/362047
Tested-by: <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-23 16:30:10 -04:00
Ben Walker
305cb239d2 io_channel: Remove unique flag
This is no longer used anywhere. For the places where we previously
used it, we've since found alternate solutions that do not
require it.

Change-Id: I738a80b95ef50348ce1c14969a3812b0a625b3fd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/362064
Tested-by: <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2017-05-22 19:27:17 -04:00
Jim Harris
af781ee003 bdev/nvme: print errno on spdk_nvme_ns_cmd submission failure
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I785bfd663a2921f5e4c0630bce7906a928f26376
2017-05-18 10:23:43 -07:00
Cunyin Chang
32b4ab71a2 bdev/error: Add new bdev/error to inject errors in bdev layer.
Change-Id: I3c68cb5911b3662dbb35f551dc291d5ebdd84bf6
Signed-off-by: Cunyin Chang <cunyin.chang@intel.com>
2017-05-18 07:56:14 -07:00
Daniel Verkamp
a591161cb2 bdev: make struct spdk_bdev contents private
Change-Id: If203e82f8cd10d5998a565ad490ef11e2916687f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-17 09:45:42 -07:00
Daniel Verkamp
9d1e05d2f2 bdev: add getter for write cache enable status
Change-Id: I93656deda8956c77e9565ee1f271795642e62ac9
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-17 09:45:42 -07:00
Jim Harris
4eafea0360 bdev: add a null bdev module
Also change the discovery/nvmf.sh test to use it.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I56bce9a84bd46f13b6d4f34da81abf23413f2598
2017-05-15 14:00:37 -07:00
Daniel Verkamp
1aea6c5b6f bdev: add getter for maximum unmap descriptors
Change-Id: Ifbdd29e2081600bf0d860582d80696546107cf1b
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-15 10:11:23 -07:00
Daniel Verkamp
326786a943 bdev: add getters for block size and block count
Change-Id: I6fad28da43c163ea4e2c4a04ced356b67d63652f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-12 10:34:58 -07:00
Daniel Verkamp
1bcf22cde1 bdev: add getters for bdev name and product name
Change-Id: I6a75fada94fa845ecedd4cd8afc78f4259df14fe
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-12 09:36:30 -07:00
Ben Walker
58afa58a00 bdev: Simplify spdk_bdev_get_io_buf
This was implemented as two functions, but it
is much simpler as one. Also, the public function
was way at the bottom of the file instead of near
spdk_bdev_put_io_buf.

Change-Id: I3a90688910b0542cc77b6333bab15132cf514eeb
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-11 10:48:58 -07:00
Ben Walker
812ffaf1a3 bdev: Simplify spdk_bdev_finish
This was implemented as 3 separate functions but
it is simpler as 1.

Also, this wasn't previously freeing the buffer pools.

Change-Id: Ic1b2b3a0596e745a223099cb2a79bea6ef5c69cc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-11 10:48:58 -07:00
Ben Walker
f2132bfd8a bdev: Simplify spdk_bdev_initialize
This was broken into three functions, but it is
a lot simpler as one.

Change-Id: If58ad50fe7d4f65c598b62f24e9e1ce7a64fdd8e
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-11 10:48:58 -07:00
Ben Walker
ba17fd1bf2 bdev: Move all globals into a single struct
This is better organizationally, but also will serve as
an io_device in the future.

Change-Id: I6d65cf39df59e874d13f5fccc5a489720e86c48f
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-11 10:48:58 -07:00
Daniel Verkamp
6a8cd333a9 bdev: add API function to get buffer alignment
Change-Id: I4c7eff4c903411994fc6bb9fae98f967eb14669c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-10 13:16:27 -07:00
Ben Walker
68be2e2842 bdev: Fix formatting issues
Return types should be on a separate line for definitions.

Change-Id: Iaa38dd00042359fc6640fc67053bd69ebbb7af03
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-10 13:12:18 -07:00
Ben Walker
58734f5222 bdev: Generalize buffer allocation
Make the buffer allocation work for all types of
commands, not just read.

Change-Id: I72d8f67a724566630e7c4a74759fcb08449f7de4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-10 13:12:18 -07:00
John Meneghini
70f8a8e2f4 bdev: Use env mempool wrappers
Change-Id: I22f4f7894462c576c447346684a780bbc34f7ba3
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 11:26:34 -07:00
Daniel Verkamp
22b6098965 bdev: remove spdk_bdev thin_provisioning flag
Blockdevs already indicate support for unmap via
spdk_bdev_io_type_supported(bdev, SPDK_BDEV_IO_TYPE_UNMAP).

Change-Id: I634f27a281fd900bb3a6da2e4ff8a74e43579578
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-09 08:42:10 -07:00
Ben Walker
9ed75e4dab bdev: Rename rbuf to just buf
We plan to use these buffers for more than just reads.

Change-Id: I8fa6cb432a6cfe4406fbf240cd3aa2ae4ab5f3d5
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 08:14:31 -07:00
Ben Walker
ed159eae1b bdev: Eliminate spdk_bdev_io::ctx
The user can get there via the bdev, so this didn't
have a purpose.

Change-Id: I7f85bb71d5ee238d37ba3624d0ac68a161c95e49
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 08:14:31 -07:00
Ben Walker
3415ce1227 bdev: Pass correct channel to bdev modules
Change-Id: I38911e70303f66f479c1495d4dbe02b2205cab8a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-09 08:14:31 -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
Daniel Verkamp
825379870b bdev: add accessor function to get an I/O's iovec
Change-Id: I09321abe93303d6225fbcce4065b0024dd541b19
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-05 09:39:49 -07:00
Daniel Verkamp
91b13bd105 scsi: don't change bdev_io status in spdk_scsi_task_put()
The SCSI task bdev I/O should never be pending when spdk_scsi_task_put()
is called, and just setting the status to failed is not correct (when
the bdev eventually completes the I/O, it will write into the now-freed
bdev_io, which may be reused by someone else).

Change-Id: Iaad6ce9ab41539652abc40147fed47c5012109dc
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 14:59:12 -07:00
Daniel Verkamp
7fb6b33488 bdev: convert set_scsi_status into a bdev_io completion function
In the pattern set by spdk_bdev_io_complete_nvme_status(), allow
blockdev modules to complete a bdev_io with a SCSI status code.

Also move it to the internal bdev header file, since only bdev modules
should be setting bdev_io status codes.

Change-Id: I8b6afad2c02d7c010c5e60f06a7c7e0785eb87ca
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 09:11:42 -07:00
Daniel Verkamp
dc9e11163e bdev: add API to translate to SCSI status
Move the scsi_nvme translation code from the SCSI library into bdev, and
provide a generic way to translate any bdev_io status into a SCSI
status.

Change-Id: Ib61a6209387c24543e31574e2b5ca249e2ac8b74
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
2017-05-04 09:11:42 -07:00
Ben Walker
3d62b39b0d bdev: The bdev layer now generically creates io_channels
These channels can handle generic bdev context.

Change-Id: I61f41884ddf4cf86fa156e9051421b354bbb349d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
2017-05-03 15:16:02 -07:00
Liang Yan
b0091cfe5c bdev/nvme: Increase maximum controllers to 1024
Change-Id: I5a7a5f40b0d3c8c21e26f5358bc84f538a62bff4
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
2017-05-02 13:51:39 -07:00