Commit Graph

2957 Commits

Author SHA1 Message Date
Daniel Verkamp
cdaf4fd922 nvme/rdma: re-use memory registrations if possible
We don't need to re-register memory with the same ibv protection domain
more than once; maintain a global list of already-registered PDs and
reuse the existing registration for other queues.

Change-Id: I7ec9c35ed93083faa00cca4cb5c61104200a4c66
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405702
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-30 17:37:15 -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
Shuhei Matsumoto
cf4cf8d52a event/app: Refactor read global params of config file in spdk_app_start()
Refactor spdk_app_start() in lib/event/app.c to support JSON config file.

Change-Id: Ia2b36e517b59b6ac1ffb12cb818efc8064fae495
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405362
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-03-30 17:31:04 -04:00
Shuhei Matsumoto
a4c86be7f0 event/app: Refactor check config file operation in spdk_app_start()
Refactor spdk_app_start() in lib/event/app.c to support JSON config
file.

Change-Id: I157573eea48b774579158f41a9010e5faa1a3de5
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/405361
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-03-30 17:31:04 -04:00
Daniel Verkamp
c5008b37a0 nvmf: report support for Command Effects log page
Change-Id: Ia382110fbbadea51d3b454e07e775afc9e286eae
Fixes: c5cd53cce0 ("Support for Commands Supported and Effects Log Page")
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405821
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:57 -04:00
Daniel Verkamp
ed6e83f958 nvmf: implement Firmware Slot Information log page
Change-Id: I93a4cae46dad7ec42fd82fa4917fd27e3b14c46a
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405827
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
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
44758678e6 rpc: free req before kill() to make asan complain a little bit less
Change-Id: I1c33687d37b2108acbc15ef09902ded194106633
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/405428
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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-03-30 16:18:34 -04:00
Pawel Wodkowski
35aefc9e84 app,lib: fix checking mmap return value
Some places use NULL to check for mmap failure but mmap return
MAP_FAILED in this case.

Change-Id: I4796fa52421da53c94223a9e8cc26ac04968f1d8
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/405648
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
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-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
3d220b925f vhost: cleanup, remove unused functions
Change-Id: I70b567de366cc89ef2682c5788c49865435337df
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/405551
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 12:50:27 -04:00
Daniel Verkamp
258845450d env: deprecate spdk_pci_get_device()
This isn't possible to implement using the current public API of DPDK,
and all of the in-tree users have been removed.  Replace the
implementation with a stub that always returns NULL and mark it
deprecated so that any users have a release to update their code.

Change-Id: I4bc71f0a9fd518923484e862333b0c5e86883980
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405710
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
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
Dariusz Stojaczyk
07526d85ef env/dpdk: use MEMPOOL_F_NO_PHYS_CONTIG
This is required for DPDK's single file segments.
Without this flag, mempools are likely to fail to
create. We don't necesarrily depend on physical
contiguity anywhere in SPDK and a quick NVMe+UIO
perf test shows no performance regressions.

Change-Id: I6b36b66bedfc99ee491663b5f2d21e079de12c44
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/403594
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-27 21:23:53 -04:00
Dariusz Stojaczyk
c45669cf89 env/dpdk: support memsegs without phys addr assigned
If those are encountered, SPDK will get physical
addreses by itself (either IOVAs from vfio or
real physical addreses from /proc/self/pagemap).

Change-Id: I321892f7dfb26054087a86cd24502efff05883ea
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/404138
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-27 21:23:53 -04:00
Dariusz Stojaczyk
aa8e7002ba app: add -g flag hinting dpdk to create just one hugetlbfs file
This makes use of the `--single-file-segments` DPDK param.

Change-Id: I21ddd955841748ea087c0d006875514be56f2107
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/401112
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-27 21:23:53 -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
2c7e3a05e3 rocksdb: remove nonsensical fallocate #ifdef
Our implementation of WritableFile::Allocate() was wrapped in #ifdef
ROCKSDB_FALLOCATE_PRESENT, which is set based on whether the target
system supports fallocate(); SPDK doesn't use the kernel filesystem
interface, so using that check makes no sense.

The #ifdef was also incorrectly wrapping WritableFile::RangeSync() and
WritableFile::GetUniqueId(), which are totally unrelated to fallocate.

Change-Id: I9655074353f79cf7a63e3e3d9c455cd39a683062
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405332
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-27 12:41:12 -04:00
Daniel Verkamp
d9ba3805c7 rocksdb: fix WritableFile::mSize type
All of the uses of this member variable treat it as uint64_t.

Change-Id: Iba9cf2eae1f2bd79617e2785ad498526f1115c10
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405331
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-27 12:41:12 -04:00
Daniel Verkamp
e2af3284cb rocksdb: check spdk_fs_open_file() return value
Make sure spdk_fs_open_file() succeeds in all of the RocksDB environment
file constructors.  NewSequentialFile() already checked this, but
SpdkRandomAccessFile and SpdkWritableFile did not.

Change-Id: Ie298e0cd29366eb698a0358740310fec62af7f9c
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/405326
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-27 12:41:12 -04:00
Tomasz Zawadzki
56cfdb1daa blobstore: destroy bs_dev on spdk_bs_load fail
Some error paths before _spdk_bs_alloc did not
destroy bs_dev.

After succesfull _spdk_bs_alloc, destroying is done
in _spdk_bs_free.

Change-Id: Ib69ae9707e12a646af80f7892af49cc4f79c199e
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/405223
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-27 12:21:21 -04:00
Tomasz Zawadzki
ea3a17fb55 blob: disallow bs load on device with unsupported block length
Blobstore supports only block lengths that are less than
SPDK_BS_PAGE_SIZE or when multiplication of block len
results in SPDK_BS_PAGE_SIZE.

This was checked only on spdk_bs_init(), but not spdk_bs_load().

When not checked, it caused issues with lvol store tasting.
During tasting, there is an attempt to perform spdk_bs_load()
on a given device.
It was possible to hit asserts in blobstore by creating
malloc with block size 8192.

Change-Id: I30b62bebad405b581eb2158925884adc616d9b92
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/404537
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-27 12:21:21 -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
2f2dde6394 event: allow subsystem to write configuration in async way
Change-Id: I5a09551ff6a97ae363fa6166b284cbfc2538d736
Signed-off-by: Pawel Wodkowski <pawelx.wodkowski@intel.com>
Reviewed-on: https://review.gerrithub.io/404372
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
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
Daniel Verkamp
15bd6999db nvme: add spdk_nvme_ns_get_uuid() function
This function retrieves the UUID from a namespace, if available.

Change-Id: I98c55375948b92eaf429b41fb36dfea4e2b780a2
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/404734
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
Daniel Verkamp
3d57e4a8f4 nvme: unify Identify command helpers
Convert nvme_ctrlr_cmd_identify_controller() and
nvme_ctrlr_cmd_identify_namespace() into a single function,
nvme_ctrlr_cmd_identify(), with generic parameters that should be
suitable for all current callers as well as future users.

These functions were internal-only, so there is no public API change.

Change-Id: I3dbb3e6b00308b67ba1f161f8a6b11b6333fca57
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/404733
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
Daniel Verkamp
af5683b705 lvol: read uuid xattr before name
This just moves some code around in preparation for an upcoming patch -
no functional change.

Change-Id: Ib1584fcf65d1be2063766588a79c434ad5fef716
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/404032
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2018-03-23 04:18:23 -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
Jim Harris
1cc6601a77 lvol: remove length xattr
This is always just the number of clusters in the
underlying blob.  The length xattr was set but never
retrieved later so it's obviously not needed.

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

Reviewed-on: https://review.gerrithub.io/404614
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
Jim Harris
ffc6a2ad50 blob: use internal _spdk_blob_resize when creating blob
Upcoming patches will make spdk_blob_resize() asynchronous
to allow for resizing while I/O is in progress.  During
blob creation, it is not possible for I/O to be in progress,
so just use the internal _spdk_blob_resize which will
remain synchronous and called only after I/O is frozen.

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

Reviewed-on: https://review.gerrithub.io/404613
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
2018-03-23 04:02:13 -04:00
Jim Harris
620209e046 blob: rename _spdk_resize_blob to _spdk_blob_resize
This internal function then will match noun/verb order
of the public spdk_blob_resize function.

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

Reviewed-on: https://review.gerrithub.io/404612
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
Dariusz Stojaczyk
f70f4b8568 lib/event: do not clobber g_spdk_app on failed init
This fixes a double free in spdk_app_fini().
If spdk_app_start() failed, the g_spdk_app.config
was becoming a dangling pointer which would be
accessed and freed by spdk_app_fini()

Change-Id: Ifa833f5706d391356df39db4e1c538db7a1c7dcb
Signed-off-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/404358
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-23 03:46:50 -04:00