Commit Graph

702 Commits

Author SHA1 Message Date
Pawel Wodkowski
46fee78e20 bdev/split: add JSON config dump
Change-Id: I5d12dfb4227441bc147b9356f874fe0051b3ba0b
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401224
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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>
2018-04-04 16:03:00 -04:00
Pawel Wodkowski
a5dbccf02b bdev/split: add RPC support
Split bdevs now can be create using "create_split_bdev". To keep
backward compatibility, this call will not fail if base bdev is not
available yet instead will add base bdev name to its live configuration
and create splits when base bdev will be created (during examin
process).

Change-Id: Ie26ffc0e947f6d88ff56830dd50999795283df2e
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/404164
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@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-04-04 16:03:00 -04:00
GangCao
61e8486c10 bdev/qos: add the QoS setting in conf file
For application like vhost/iSCSI target/NVMe-oF target/etc,
a new section as below can be added for the QoS rate limiting.

[QoS]
  Limit_IOPS Malloc0 100000
  Limit_IOPS Nvme0n1 500000

Also added a sample change at test/lib/bdev/bdev.conf.in

Change-Id: I7c7d951fbe1352ca2571f135c657bc4fa43b56c7
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/393221
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-04-03 19:36:58 -04:00
GangCao
310f324e38 bdev/qos: add the support to reset QoS bdev channel
As there is no I/O channel associated with the QoS
bdev channel, add the specific functions to handle
the reset operation on the QoS bdev channel. The
reset operation will be conducted on the QoS thread.

Related UT code on QoS with reset operation was also
included.

Change-Id: Ibba68ddb132fa926fec6327829157b43ac806713
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/393181
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-03 19:31:50 -04:00
Shuhei Matsumoto
22b8b92275 bdev/error: Add config of error vbdev when the base bdev of it doesn't exist
Currently construct_error_bdev() fails if the base bdev doesn't exist.
This patch add configuration of the error vbdev for the base bdev instead,
and the configuration will be parsed at examine() when the base bdev is
created.

This will improve the usability of error injection for bdev and will be
usable for the upcoming JSON config file.

Change-Id: I550b7f6c74fd8ab6cbd424a192f12a0c0099028e
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403914
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
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-04-03 15:33:14 -04:00
John Kariuki
8ac087613c bdev/passthru: read/write access
Change-Id: I541b5846f2c1c4acd2c7a6771147738112c8f803
Signed-off-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-on: https://review.gerrithub.io/406118
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-04-03 15:15:30 -04:00
Daniel Verkamp
6b5a1d6c24 bdev/pmem: add conf support to test in blockdev.sh
The long-term plan is to use the JSON-based configuration format, but
for now, we need a config file section to be able to test a bdev module
in blockdev.sh.

Change-Id: I2a69f7172693ed6d4939a3b938747e2a1c62ff83
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405908
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-04-03 14:14:29 -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
Pawel Wodkowski
60e8667261 bdev/split: move config scaning to vbdev_split_init
By this we are abble to produce proper RPC config in next patches.

Change-Id: I1ae9e81bf50bc4fb5e6a9cf7bf9b84df7e6377d1
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/403842
Reviewed-by: Shuhei Matsumoto <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: Jim Harris <james.r.harris@intel.com>
2018-03-30 20:47:08 -04:00
Dariusz Stojaczyk
c2520346bf bdev/virtio/blk: fix memory leaks on device init failure
Change-Id: I43dfe7f7067a7344922f4dfbdce34b72754b9c0a
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/405914
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-03-30 19:34:22 -04:00
GangCao
3709dfd674 bdev: update the function to get the QoS setting
Instead of accessing the qos_channel pointer on the bdev,
always have the QoS parameter on the allocated memory of
qos_channel structure.

The bdev->qos_channel is set to NULL in the destroy operation,
and the destroy is through the async message which could
be executed later after the poller function within which
the bdev->qos_channel is accessed (thus a NULL pointer
dereferenced).

In this case, assign the memory address of the allcoated
qos_channel to the function as the parameter to solve
this issue.

Change-Id: I2fdb53cb0a6a29fb41ab28362f8e068d21ee5d12
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/405438
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-30 17:43:25 -04:00
GangCao
898bbb660b bdev: properly handle the io_outstanding count for QoS bdev channel
Change-Id: If9e52b9a16ffff7bd4263bfca85bf7cbaf53984c
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/405868
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-03-30 17:32:01 -04:00
Pawel Wodkowski
39c9463a08 bdev: fix asserts in config dump
Change-Id: I1e7cb7105371c1b2a1feccb715fdb3a7c473ca83
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/405808
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-30 16:18:34 -04:00
Pawel Wodkowski
b29498053d bdev: do not call spdk_bdev_module_finish_iter from bdev unregister ctx
There is a call to spdk_bdev_close () during spdk_bdev_part_base_free
(). This will trigger spdk_bdev_module-> module_fini () if this is the
last descriptor to the last bdev. In module_fini () resource might be
freed. But then, after spdk_bdev_close(), call to base_free_fn () is
done which may try to free the same resource again.

To avoid this, call spdk_bdev_module_finish_iter () after
_spdk_bdev_finish_unregister_bdevs_iter () return.

Change-Id: Ia6eb210504d121772221da18651a90ffc89dbbc4
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/405322
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-30 16:18:34 -04:00
Pawel Wodkowski
4473942f46 bdev: replace tailq by arrays in base and vbdev linking
SPKD base bdev might be part of multiple vbdevs. The same is true in
reverse direction. So consider folowing scenario:

  bdev3  bdev4  bdev5
     |     |     |
   +-+--+  +  +--+--+
  /      \ | /       \
bdev0    bdev1      bdev2

In current implementation bdev0/1/2 will apear as base base for
bdev3/4/5 which is obviously wrong.
This patch try to address this issue.

Change-Id: Ic99c13c8656ceb597aba7e41ccb2fa8090b4f13b
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/405104
Reviewed-by: Shuhei Matsumoto <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: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-30 16:18:34 -04:00
Dariusz Stojaczyk
94de7e9175 bdev/virtio: minor cleanup
Change-Id: Ibb63af85461da8940486d1aeaca5886d3d027b71
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/405377
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: Changpeng Liu <changpeng.liu@intel.com>
2018-03-28 13:12:06 -04:00
Dariusz Stojaczyk
b351819679 bdev/virtio/rpc: allow listing created devices
Listing them through get_bdevs is not enough. Some
devices might not have any LUNs presented while expecting
some to be hotplugged in the future.

```
$ rpc.py get_virtio_scsi_devs
[
  {
    "virtio": {
      "vq_count": 18,
      "type": "user",
      "socket": "/tmp/vhost.0",
      "vq_size": 512
    },
    "name": "VirtioScsi0"
  }
]
```

Change-Id: I56857d7a0637300beba39a8d83a98447f1f74ce7
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/405182
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-28 13:12:06 -04:00
Shuhei Matsumoto
8d57caa11c bdev/error: Remove config of an error vbdev at the removal of the vbdev
Remove configuration of an error vbdev at the removal of the vbdev.
This will lose the strict compatibility but the next patch will make
possible for us to add the removed config dynamically.

This patch will make the implementation cleaner and will not lose
any usability.

Change-Id: Idea7767ab5424427f912c82c66ff7d59d28108ab
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403915
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-27 13:33:18 -04:00
Daniel Verkamp
87f7533a5a bdev/malloc,null: save uuid when getting config
The malloc and null bdevs generate a random UUID if it is not specified
in the construct RPC method; save the current UUID in save_config so we
can reproduce it in load_config.

Change-Id: Iabaa96fa3129189ae6acf3635345b98f71255fbd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405110
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-27 03:15:01 -04:00
Pawel Wodkowski
e7cb376aad subsystem,bdev: rework RPC JSON config dump
Changes:
- change write_config_json to return void as return value is useless.
- int spdk_bdev_config_json() -> void spdk_bdev_subsystem_config_json()
- int spdk_bdev_write_config_json -> void spdk_bdev_config_json()

Change-Id: I46e2e974abada0df67c07ba961543900f8334a8d
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/405052
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-27 02:57:28 -04:00
Pawel Wodkowski
d78e3bbf76 bdev/error: add JSON config dump
Change-Id: Iaaf2c3438d28e03977f031b8d3b999086a73bfe5
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401221
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-27 02:57:28 -04:00
Daniel Verkamp
8f1c45b1b7 bdev/nvme: provide namespace UUID to bdev layer
Change-Id: Ie6e9620ba6bf7aa287ace03ec914c22db4928df1
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/404735
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-27 02:43:46 -04:00
Dariusz Stojaczyk
46bce34c24 bdev/virtio: ensure thread safety for adding/removing devices
Also, device removal is now always deferred to simplify
the locking.

Change-Id: I6b994531630b64860da728a93a0f2d613d8aa5ba
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/405181
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-27 00:58:14 -04:00
Dariusz Stojaczyk
20acc18bf3 bdev/virtio: fix tailq corruption on failed init
Each device was being removed from the tailq twice.
virtio_scsi_dev_remove does the removal by itself.

Change-Id: I2320fc88ac60ddd5952b07b26c679c8f2e887976
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/405180
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-27 00:58:14 -04:00
Dariusz Stojaczyk
6ccc262022 virtio: remove g_virtio_driver
g_virtio_driver contained just a list of all
Virtio-SCSI devices. It's now being removed for
two reasons:
 * it's backend-specific, doesn't fit a generic virtio lib
 * it's difficult to ensure thread-safety for it

Virtio bdev modules will now manage their Virtio
devices by themselves. Virtio-SCSI has now an internal
device list. (And VirtioBlk module maps devices to
bdevs 1:1, so doesn't need any additional work here.)

Change-Id: I3bc68d76d6904df5c56f00fca7ab387871ecf88f
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/405179
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-27 00:58:14 -04:00
Shuhei Matsumoto
783851334d bdev/error: Fix free resource when vbdev_error_init() failed
Change-Id: I38d6b644f5dc2877c0e9834c7551b1de935e4239
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/404324
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: Pawel Wodkowski <pawelx.wodkowski@intel.com>
2018-03-23 13:06:47 -04:00
Jim Harris
3fe80a337c lvol: remove num_clusters member from spdk_lvol
This is not needed - we can easily get the number
of clusters from the underlying blob.

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

Reviewed-on: https://review.gerrithub.io/404615
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>
2018-03-23 04:02:13 -04:00
Pawel Wodkowski
13a05f59cc bdev/rbd: add JSON config dump
Change-Id: I3122c899f76c1ce1eb422bcf73af87d1b41b9364
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401223
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-23 03:57:44 -04:00
Pawel Wodkowski
e301860fb3 bdev/pmem: add JSON config dump
Change-Id: Ife5ed73d6c3eacb24ea33237c843ec68914796fd
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401222
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-23 03:57:44 -04:00
Pawel Wodkowski
523b208f17 bdev/aio: remove deprecated "fname" RPC parameter
Change-Id: I4465326b4fb148fcc825245a1f08b72b7d8ed91a
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/403841
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-23 03:57:44 -04:00
Pawel Wodkowski
b745f41f27 bdev/aio: add JSON config dump
Change-Id: I13b3313ef0d6983df4deb09553d49065ec2ad5e9
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401220
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-23 03:57:44 -04:00
Pawel Wodkowski
010af134ec bdev/null: add JSON config dump
Change-Id: I491df77bd451e8dc60bdaee3b72ad20c1b852e86
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401218
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-23 03:57:44 -04:00
Pawel Wodkowski
856a96a7a9 bdev/malloc: add JSON config dump
Change-Id: I309cc48d95a7a47fbdddc1980662937fb295cf9a
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401219
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
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-03-23 03:57:44 -04:00
Pawel Wodkowski
5ffa5c003a bdev: introduce 'get_bdevs_config' RPC call
Write information needed to recreate each bdev.

Change-Id: I3d2b24fd4aaa8b98ec558d864cc28b55a899452f
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/401217
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-23 03:57:44 -04:00
Dariusz Stojaczyk
f84d1a53be bdev/virtio/blk: implement read-only
Support the virtio RO flag, so that read-only devices
will successfully initialize now. Also do not allow
issuing any writes on a read-only device, so we don't
flood it with requests that are to fail.

Change-Id: I6b77f2338e4478a9abf2d5286344f6412d79284c
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/393461
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-03-23 03:50:28 -04:00
Jim Harris
2af15344ab bdev: add iSCSI initiator bdev module
This uses libiscsi to implement an iSCSI initiator bdev
module for SPDK.  Still a lots of work to do on this - posting
it in case anyone is interested in working on this further.

A number of todo items are listed in a README in the lib/bdev/iscsi
directory.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Change-Id: I060e33de0cd6796246789bf0e1bb4f2df59d8f71
Reviewed-on: https://review.gerrithub.io/390313
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-21 20:35:42 -04:00
paul luse
2191985125 bdev: Vbdev Passthru Example
Example showing the basics of a vbdev via a module that implements
the main functions, and a few extras, needed for a vbdev. The tests
also demonstrate how to configure an application to use a vbdev and
an underlying bdev

Change-Id: I67bf542143eb6532465cdb6af63c0f2ab7084c0e
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/399768
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-03-20 19:10:08 -04:00
Dariusz Stojaczyk
09fb50530e bdev: count per-bdev outstanding I/O
Patch 583a24a4 [1] moved io_outstanding field to the
bdev_module_channel as it was needed there. This patch
re-adds another io_outstanding field to the bdev_channel.
We *do* want to count outstanding I/O for particular bdevs
- mostly for debug purposes.

[1] 583a24a4 ("bdev: share nomem_io data between bdevs built on the
same device")

Change-Id: I723e72c36447f9f778f88fc1769619676cbbaf71
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/396871
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-19 17:28:29 -04:00
Daniel Verkamp
74af349ddb bdev: disable new GCC 7 warning in VTune code
The version of ittnotify_static.c shipped with VTune Amplifier XE 2017
triggers the new GCC 7 -Wimplicit-fallthrough warning.

Change-Id: I8a43beddf464853407639742b1eb89bcac39136d
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/404211
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-19 15:58:15 -04:00
Daniel Verkamp
0d7d3a05c3 bdev: consolidate I/O completion message passing
Simplify the handling of I/O completions that need to be sent as a
message so that they are handled in a single place in
_spdk_bdev_io_complete().

Change-Id: Ic94354ad947d0f1f11241f728aa194a105ff96c4
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/404184
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-19 13:43:53 -04:00
Daniel Verkamp
b20b983b05 bdev: simplify NOMEM control flow
Flip the status != NOMEM check around so that the logic is easier to
follow.

Change-Id: I607e8b5f0cfaa3598a623d0fc3642b11bd42decd
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/404175
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2018-03-19 13:43:53 -04:00
Shuhei Matsumoto
db828b10b4 bdev/error: move config scanning to vbdev_error_init
vbdev_error_init holds config information and examine() uses it.

This patch is necessary to keep compatibility from the .INI config
file to the upcoming JSON config file (based on JSON-RPC).

Change-Id: I1601b7e0dad5f93662177c59536776afd974ff07
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/403913
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
2018-03-16 18:22:17 -04:00
Daniel Verkamp
7fd3a82561 bdev: rearrange struct spdk_bdev_io
Move the commonly-accessed fields to the front so they end up in the
same cache line where possible.

Also tweak the types of type, status, error.nvme.sct, error.nvme.sc,
error.scsi.sc, and error.scsi.sk (they can fit in 8 bits), and move the
Write Zeroes splitting variables into u.bdev.

This reduces sizeof(struct spdk_bdev_io) from 272 to 224, in addition to
the better cache line usage.

Change-Id: I4a91fd07f252e7add4a2db179df9c53268672198
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/404053
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:06:36 -04:00
Dariusz Stojaczyk
45e919d210 bdev/virtio/scsi: hotremove targets on EVENTS_MISSED rescan
When vhost has sent too many events and the eventq
ring is full, the very next event will be sent with
EVENTS_MISSED flag set. Virtio after processing such
event should do a full target rescan to manually detect
all changes - this implies
1) hot-attaching targets that appeared, and
2) hot-detaching those that don't respond properly.
Virtio has been doing only #1 so far.

Change-Id: Ib8be986588913ad41296dcfd6558ff705b99007c
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/402120
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>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-13 17:14:34 -04:00
Dariusz Stojaczyk
def268e6a4 bdev/virtio/scsi: extract virtio response error handling to common func
Virtio response codes other than OK, BAD_TARGET
or INCORRECT_LUN indicate an intermittent device/transport
failure and don't need to be handled by each message
response handler separately.

Change-Id: Iab0b03b3c7b377d2b346344c32e5df143df528b0
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/402119
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-13 17:14:34 -04:00
Daniel Verkamp
d4ef1338b0 bdev: make QoS channel management thread safe
We must hold bdev->mutex around all QoS channel manipulations, not just
channel_count; otherwise, there are race conditions.

Change-Id: I6183aef83f4d5789bded426a1832e3faaa688363
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403367
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2018-03-13 14:06:23 -04:00
Daniel Verkamp
e45c36ffb3 bdev: simplify QoS poller registration
The helper functions were only needed when this was sent as a message,
but they are only called directly in the current code, so just move the
contents of the functions inline to their call sites.

The unregister path can also be simplified to pass the poller directly
to spdk_poller_unregister(); it already handles the case of a NULL
poller.

Change-Id: I509cf8922b53e1e616c9e976610b20061bb50066
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403364
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-13 14:06:23 -04:00
Roman Sudarikov
c3bc40a6ef io_channel: add return value to pollers
This will be used to track time used in pollers - each poller can now
indicate if it found any work to do or not.

For cases where it was obvious and the infrastructure was already in
place, existing pollers have been modified to return 0 or a positive
value to indicate whether work was done.  Other pollers have been
modified to return -1 by default, indicating that the poller isn't
indicating anything about whether work was performed.  This will allow
us to find un-annotated pollers easily in the future and fix them
incrementally.

Change-Id: Ifebfa56604a38434fac5c76ba7263267574ff199
Signed-off-by: Roman Sudarikov <roman.sudarikov@intel.com>
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/391042
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2018-03-13 11:16:20 -04:00
Daniel Verkamp
19100ed580 bdev: rename spdk_bdev_module_if -> spdk_bdev_module
This better matches the style in the rest of SPDK.

No functional change - this is a pure find/replace of
spdk_bdev_module_if to spdk_bdev_module.  Instances of this struct will
be renamed in another patch.

Change-Id: I3f6933c8a366e625fc3a1b6401aee26ee03ba69c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/403368
Tested-by: 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-03-13 00:55:12 -04:00
Lance Hartmann
01d6310742 lib: Return instead of abort() in bdev
Return NULL on resource failure (spdk_mem_get) instead of
abort()'ing in static bdev function.

Change-Id: I0ee2ce4b7e81cf80546119e3db27c987fa912749
Signed-off-by: Lance Hartmann <lance.hartmann@oracle.com>
Reviewed-on: https://review.gerrithub.io/403578
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-03-13 00:50:54 -04:00