Not only 4KB page size is supported on AArch64. The most common is 4KB
and 64KB. 16KB is supported too. We can get it by "getconf PAGESIZE".
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454447 (master)
(cherry picked from commit 5327875c74)
Change-Id: I6f09741372d35e868228528d976fe3b5a65ff96c
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457229
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Make construct_ocf_bdev call accept 'wb'
as allowed cache mode.
Previusly user could only create OCF bdevs
in WriteThrough or PassThrough modes.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455628 (master)
(cherry picked from commit 1e0e0ea1fc)
Change-Id: Ic2e1c8d2905cb51fc13c080aa7b7a4dfd7d9387f
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457585
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Implement metadata probe functionality to load cache state
from disk.
During metadata probe, we inspect UUIDs of core devices
and create vbdev configurations based on them.
Then, to start vbdev, we use load path (loadq = true).
After this change persistent metadata is officially supported,
we can save and restore cache state from persistant storage.
WriteBack mode is now safe to use in respect to unexpected shutdowns,
because all information about dirty data is also restored during cache load.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455417 (master)
(cherry picked from commit 9686948334)
Change-Id: I6cf86aabd68177b88638a68ea6a5b78a1068a4d0
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457584
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This patch updates submodule and appropriate functions.
Cleaner poller is now registered only when needed.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455408 (master)
(cherry picked from commit 5983f92cfc)
Change-Id: Ic4ca7ce6f77b71ac12c19462f62ae7cd96c59006
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457582
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Interpret volume->open() options as our vbdev_ocf_base struct.
This is used during metadata probe procedure, when there is no
vbdev configurations created, so we need to pass base structure
as option.
This patch is a prepartion for persistant metadata support,
and it does not change current behavior.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455415 (master)
(cherry picked from commit fec9d4146b)
Change-Id: I0b7435df1692d8b3028931c6c9fc50d2d84b2557
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457274
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Use OCF per-volume UUID field to serialize bdev names.
This is going to be used during cache load to find out
which bdevs we want to attach.
Note that there is in fact "user_metadata" buffor that is
also stored in cache metadata, but we cannot use it
because its size is limited to 64 bytes.
UUID in OCF terms is not standarized
and is meant to be used to store custom immutable data.
This change preparation for persistent metadata support.
Functionality is not changed. (everything works the same way)
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455414 (master)
(cherry picked from commit 4003ebf73c)
Change-Id: Ia9204fae29106f5b816d93a6771425a223d6c028
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457268
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Change shutdown behavior such that now first bdev destruct() call
stops OCF cache instance.
Previusly, cache was stopped when single vbdev was referencing it.
This patch is related to persistent metadata support.
Without this change, every time a SPDK application is stopped,
only the last core is remembered in metadata,
because vbdevs detach by 1 by 1, each time updating the metadata.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455413 (master)
(cherry picked from commit 1292ef24e7)
Change-Id: I57db3f77db525177c024ee85e660a85aff2f8c31
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457267
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Fix instance function for OCF ctx interface.
This function is used for persistent metadata only.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455412 (master)
(cherry picked from commit efe48d7ca9)
Change-Id: I9583ea8eb21f07a3e9072a9552bed1c077cb7114
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457266
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Make init_vbdev() accept NULL as cache_mode if loadq flag
is set.
This is needed for load path because we don't know cache mode
before the actual load (happens later).
This change is related to persistant metadata support.
This patch does not change current behavior because loadq flag
is always false.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455411 (master)
(cherry picked from commit cca2eab10a)
Change-Id: I42727eb841d87903c81bd5e6d51b6d4869ed9be3
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457265
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Implement load path for OCF cache.
During load OCF will read metadata from cache disk and restore its state.
management_channel initialization is moved before cache load/attach part
because ocf_mngt_cache_load() needs it to read metadata.
This patch is a preparation for persistant metadata support.
Load path is never used yet because loadq flag is always false.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455410 (master)
(cherry picked from commit 2b1c1e7031)
Change-Id: Iff6c1c52eae7b9f52812a8bd3d5ae6d6facedd60
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457264
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Add new loadq flag that indicates if vbdev
should load cache instance from disk or start a new one.
This change is a preparation for persistent metadata support.
Functionality is not changed in this patch as the loadq flag is always false.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455409 (master)
(cherry picked from commit 242564a82c)
Change-Id: I1baac7f988e6eeadb4f365ba7bfab8019d55a753
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457263
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
I didn't test delete after making a bunch of channel changes so there
were some bugs in that path. Also as a drive-by I NULL out the
base_desc in vbdev_reduce_load_cb() to be consistent with other places
where I'm closing the base desc.
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452267 (master)
(cherry picked from commit 168738298b)
Change-Id: Iddd5dc704cde8eb7a6a5a3a8481e064a5c6c6d4e
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457228
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Modify FIO test to use all cache modes that we support,
including WriteBack
New test config uses Nvme bdevs instead of mallocs because
memory is an issue when testing OCF
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451022 (master)
(cherry picked from commit d6f0613d19)
Change-Id: I3abec9605b61791f8ebaaaf08b88a011a50d3f26
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457261
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Do management flush during OCF shutdown to write all dirty requests to cores.
Dirty requests are relevant to WriteBack mode only.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450683 (master)
(cherry picked from commit 40cac0ecad)
Change-Id: I778a73ed8ab5659921f192f638027d513c239814
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457260
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Implement cleaner that is used in WriteBack mode.
Cleaner is a background agent that does synchronization
of data between cache and its cores.
Cleaner usually runs every ~20 seconds to perform cleaning.
The synchronization is a simmilar operation to OCF management flushes.
We need cleaner for WriteBack because only WriteBack mode
produces dirty data that cleaner needs to deal with.
Cleaner requires adopting trylock() because in current version
cleaner uses management lock when performs cleaning,
which may lead to deadlocks if cleaner runs on
the same thread as management operations.
WriteBack mode is fully functional after this change,
but persistent metadata support is required to use it for production.
Cleaner will run on management thread for now.
We plan to implement functionality of
chosing a CPU core where cleaner should run.
Cleaning policy is not configurable yet.
The default is ALRU with 20 sec interval.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448537 (master)
(cherry picked from commit 80a2ff01f3)
Change-Id: I35aa7e00c44e0d7a77e64e60df1f66f20be03f55
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457258
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Create new management channel and handle sharing between vbdevs.
This channel is going to be used for management operations
that produce IOs (such as flush) and also for cleaner.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455272 (master)
(cherry picked from commit eb58ad5379)
Change-Id: Ieeed8454a7ab7459c86ac06ec6c0ece038bc928e
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457257
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Implement management queue for asynchronous management that is provided
in new OCF API. This is a neccessery step to be able to implement
metadata support.
OCF submodule was updated to get management queue functionality
It has to be done in this patch because OCF module will not work
otherwise.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448619 (master)
(cherry picked from commit 54eeeac6e0)
Change-Id: Id19c2e5bd6a5d26fee41752b62720e408dc082e8
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457256
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
OCF queue list needs to be managed synchronously.
This patch uses our own mutex to achieve that because we cannot rely on
ocf_mngt_cache_lock() as it may produce deadlocks when using
cleaner.
Alternative way would be to use trylock, but
we need to register a poller for it and do locking concurently
which doesn't seem to be possible in callbacks of io channel.
We agreed with OCF team that we are going to change this part
when OCF will deliver safe ocf_mngt_cache_lock() function.
This patch fixes a very rare failure on our CI that looked like this:
```
04:33:02 vbdev_ocf.c: 134:stop_vbdev: *NOTICE*: Not stopping cache instance 'Malloc0' because it is referenced by other OCF bdev
04:33:03 MalCache1: Core core2 successfully removed
04:33:03 MalCache1: Stopping cache
04:33:03 MalCache1: Done saving cache state!
04:33:03 src/ocf/mngt/ocf_mngt_cache.c:1576:2: runtime error: pointer index expression with base 0x000000000000 overflowed to 0xffffffffffffffa8
04:33:03 #0 0x7f3c52d54c26 in _ocf_mngt_cache_stop src/ocf/mngt/ocf_mngt_cache.c:1576
04:33:03 #1 0x7f3c52d5579f in ocf_mngt_cache_stop src/ocf/mngt/ocf_mngt_cache.c:1657
04:33:03 #2 0x7f3c52cbe9f4 in stop_vbdev /var/jenkins/workspace/NVMe_tests/nvme_phy_autotest/spdk/lib/bdev/ocf/vbdev_ocf.c:147
04:33:03 #3 0x7f3c52cbf4a0 in vbdev_ocf_destruct /var/jenkins/workspace/NVMe_tests/nvme_phy_autotest/spdk/lib/bdev/ocf/vbdev_ocf.c:216
```
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450682 (master)
(cherry picked from commit 244d6e3daa)
Change-Id: Id6fafb444958f3becdc480e44762074c6c081e1f
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457255
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Introduce cache context structure that is going to be used
for sharing per cache info. For example: management queue,
cleaner_channel, cleaner_thread.
Lifetime of this structure ends with last vbdev that gets unregistered
and NOT when cache stops because cache does not have to be freed
there.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451403 (master)
(cherry picked from commit 4e7fb25066)
Change-Id: I66252084d7efda92edd10fb737c8e9c8169b4f6d
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457254
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Adapt to new async API which was changed recently
This is a neccessery step to be able to implement persistent metadata support
OCF submodule was updated to get new API
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448397 (master)
(cherry picked from commit f51d3b6dd7)
Change-Id: I6bf9941ab0557981235c5be27686594a1b8ac3a0
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457253
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Move last step of register chain to the top because it is arguably more readable.
This should not be done in previus patch because it spoils the gerrithub diff.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454574 (master)
(cherry picked from commit cac0e9d01c)
Change-Id: If51642a32c5cf2a757ca20485d2347410653ca2a
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457252
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Use new trylock API to prevent lockups when using OCF cleaner.
Starting and stoping OCF bdev becomes asynchronous with this patch.
Using trylock means that we have to poll function that does locking each
time we want to initiate some operation on cache instance.
This is the reason why management functions become asynchronous.
Each management operation now has a _poll() operation associated with it.
_poll() uses trylock and continues when cache is locked.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447888 (master)
(cherry picked from commit 9000deb734)
Change-Id: I83b9fbe87c27433e178583411b87a68b8efaf58e
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457251
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This patch is a preparation for adopting ocf_cache_trylock() function.
Register OCF bdev path uses vbdev_ocf_mngt_ interface now
Register stays synchronous blocking operation in this patch,
but with adoption of ocf_cache_trylock() function,
register will be asynchronous, in which case we
want to use mngt_ interface.
This series of OCF patches will enable WriteBack support for OCF bdev.
There is a lot of preparation before we will be able
to actually implement WriteBack.
Dependencies look like this:
- WriteBack
- Cleaner
- trylock
- Persistent metadata
- asynchronous management API
Cleaner is a background agent that does synchronization
of data between cache and its cores.
Cleaner usually runs every ~30 seconds to perform cleaning.
The synchronization is a simmilar operation to OCF management flushes.
We need cleaner for WriteBack because only WriteBack mode
produces dirty data that cleaner needs to deal with.
Cleaner requires adopting trylock() because in current version
cleaner uses management lock when performs cleaning,
which may lead to deadlocks if cleaner runs on
the same thread as management operations.
Peristent metadata is functionality of OCF
that allows to restore cache state after shutdown
We need persistent metadata in context of shutdown
with some data being dirty which may only happen
when using WriteBack mode
Support for persistent metadata requieres
asynchronous OCF API because in current version
we will have a deadlock during metadata initialization
because it is required to be done on different thread
than cache initialization.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455225 (master)
(cherry picked from commit c3d044cbd7)
Change-Id: I45d84a5fa0c96581d522050dad186b06d489226e
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457244
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
In some cases user may want to flag blob for removal
then do some operations (before removing it) and while
it happens there might be power failure. In such cases
we should remove this blob on next blobstore load.
Example of such usage is delete snapshot functionality
that will be introduced in upcoming patch.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453835 (master)
(cherry picked from commit 92cafd1586)
Change-Id: I85f396b73762d2665ba8aec62528bb224acace74
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457273
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This patch moves _spdk_blob_set_thin_provision function
higher in the file as it will be later used during
blobstore load.
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455488 (master)
(cherry picked from commit 543d8b7b67)
Change-Id: Ife37ef8c69b88903646b2002b3561101c1eb5135
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457272
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
when qemu connect to vhost, but don't send msg to vhost. We use
kill -15 to destroy vhost process. it will lead to deadlock.
(A)
* rte_vhost_driver_unregister()
* pthread_mutex_lock hold vhost_user.mutex (1)
* wait TAILQ_FIRST(&vsocket->conn_list) is NULL
(B)
* fdset_event_dispatch()
* vhost_user_read_cb() start
* vhost_user_msg_handler() start
* dev->notify_ops is NULL because qemu just connect, no message recv.
* vhost_driver_callback_get()
* pthread_mutex_lock hold vhost_user.mutex (2)
(A) & (B) deadlock
To avoid this scenes, when qemu connect in vhost_new_device()
initialize dev->notify_ops
Signed-off-by: Tianyu yang <yangtianyu2@huawei.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454832 (master)
(cherry picked from commit 151a357ca3)
Change-Id: Iaf699da41dfa3088cfc0f09688b50fada6b2c8d6
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457269
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This matches the Linux kernel target. Users can
still decrease this default when creating the
transport (i.e. -p option for nvmf_create_transport
in rpc.py).
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454820 (master)
(cherry picked from commit bf647c168a)
Change-Id: Icad59350a2cd35cfc4ad76d06399345191680c05
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457243
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
We could run into issues with this if we were using an arbitrarily large
amount of cores to run SPDK.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452250 (master)
(cherry picked from commit 61948a1ca7)
Change-Id: Ia7add027d7e6ef1ccb4a69ac328dbdf4f2751fd8
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457236
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Allow user to set timeout for poller in management operations.
Now also all management pollers have 5 sec default timeout.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453655 (master)
(cherry picked from commit c967d539d8)
Change-Id: Ic75f2b150ef21ccd673b80aa84f16c9a24f90e32
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457238
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Add stop function to management interface.
It is needed for error handling when execution has to be aborted early.
Example flow:
```
rc = op();
if (rc) {
handle();
vbdev_ocf_mngt_stop();
} else {
vbdev_ocf_mngt_continue();
}
```
This can be improved in the future, because currently, error
handling cannot be a management operation on its own (but should be).
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453654 (master)
(cherry picked from commit bbbe9e1ce6)
Change-Id: I9ba528db8a9957ee561e5c1b5528b16bd143d5d8
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457237
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Replace remove_base() function by smaller ones:
detach_cache(), remove_cache_bdev(),
detach_core(), remove_core_bdev()
This change is necessary for implementing asynchronous unregister using
trylock API.
Also introduce stop status variable because unregister path has changed.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452416 (master)
(cherry picked from commit 27ddbb7393)
Change-Id: I62599cafacdba685848bd7d32d3d5245907ee4a1
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457233
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reorder function for register and unregister path to make code more
readable.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452415 (master)
(cherry picked from commit b29ec8a261)
Change-Id: I3479b231de1f6a4f84f9538f345e62eb73e6847c
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457232
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
stop_vbdev() is management a function so it should be one of the steps
of unregister_path[]. It will have to be when stoping is asynchronous,
but right now it is not a hard requirement.
remove_base() no longer calls stop_vbdev() because that was actually a
dead code.
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453653 (master)
(cherry picked from commit 1ddc8cb53a)
Change-Id: Ie2d87da0fbe7807efea084181ea386b323e6b9d8
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457231
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
We throttle the number of data_in operations per
connection. Currently after a read is completed,
we try to send more data_in operations since one
has just been completed.
But we are trying to send more too early. The data_in_cnt
doesn't actually get decremented until after the PDU is
written on the socket. So this results in a case
where data_in_cnt == 64, and all 64 read operations
complete before any of those 64 are actually transmitted
onto the TCP socket. There are no more read operations
waiting, so we won't try to handle the data_in list
again, and if none of these 64 resulted in a SCSI
command completing, then the initiator may not send us
any more read I/O which would have also kicked the data_in
list.
So the solution is to kick the data_in list after the
PDU has been written - not after a read I/O is completed
back from the SCSI layer.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455454 (master)
(cherry picked from commit 59a1fbe937)
Change-Id: Ia01cf96e8eb6e08ddcaaeff449386e78de7c5bc5
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457271
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: GangCao <gang.cao@intel.com>
The datain handling code path will set the LUN to
NULL if it finds a task's LUN has been hotremoved.
This could happen before the iscsi hotplug routine
actually gets a chance to run. If this happens,
one of these tasks doesn't actually get freed, and
then will be freed after the lun is closed -
causing a segfault in the bdev layer since it may
have a bdev_io associated with it.
Found by running the iscsi_tgt/fio test after
applying the next patch in this series.
There's more work needed in this hot remove clean up
path - currently we are just freeing a lot of PDUs
rather than completing them with error status when
a LUN is hot removed. But let's tackle that
separately.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/455460 (master)
(cherry picked from commit 462c12d9e9)
Change-Id: I8d27f0c7a79ae91cb6504e5ff6ffc8e346c9e54c
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457270
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Previous test cases got passed, is because all parameters
are filtered to be same accidentally, for example:
Previous, they are
event=bdev_register:66ab4189
ev_type=bdev_register:66ab4189
ev_ctx=bdev_register:66ab4189
ex_ev_type='bdev_register:[[:alnum:]-]+'
ex_ev_ctx='bdev_register:[[:alnum:]-]+'
But actually they should be:
event=bdev_register:66ab4189
ev_type=bdev_register
ev_ctx=66ab4189
ex_ev_type='bdev_register'
ex_ev_ctx='[[:alnum:]-]+'
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454442 (master)
(cherry picked from commit 31736dc25c)
Change-Id: I7a2dc801931f792a39fc2775d883679cf8185fd0
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457240
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Here we should consider about that ctrlr may be NULL,
so add assert here.
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454546 (master)
(cherry picked from commit 1c8efbdd51)
Change-Id: If4c8b2c6382ae6fdad541168d2e2b856fb5b8182
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457239
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
If user defines some flags then cc.flags.mk
file is generated. This causes tests to exit with 1.
This change help testing delete snapshot feature
where we need to define flag by command:
export CFLAGS=-DSPDK_ENABLE_SNAPSHOT_DELETION
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454457 (master)
(cherry picked from commit 9abbab3647)
Change-Id: I6ddd52d6260393785269e7f34a4b65bf95e5c4e2
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457235
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
There are some QEMU bugs with resets for NVMe emulation.
It simply hasn't been tested for this test's very
stressful reset scenarios.
Since this test is failing the nightly builds fairly
regularly on VMs, just have this test print an
error message and exit 0 when it finds a QEMU SSD.
This will also allow us to enable this test per-patch
in a future patch.
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454517 (master)
(cherry picked from commit 223a87b023)
Change-Id: I1013f1d84ab4d0e13f713fe99352b011d77dd1f8
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457230
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
When iSCSI target failed to start due to insuccificent resource like PDU pool,
one memory is double freed.
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453981 (master)
(cherry picked from commit e358eaeeea)
Change-Id: I1b68d4f0f130b024be9f8406c8d1611e92a27787
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457225
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
According to my code understanding, should be assigned
itself instead of req.
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452120 (master)
(cherry picked from commit dfbbcc74dd)
Change-Id: I0af4d56f8029269e0632bb6be6c9d912c7106cf8
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457213
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Valgrind reports error "epoll_ctl(event) points to uninitiazlized
byte(s)" when running unit test. Fix it by initializing variable event
to a known state.
Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453525 (master)
(cherry picked from commit 09a782dcff)
Change-Id: I756687c1077eeb632c045c316a76714aa453b918
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457210
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
bdev_raid.sh was using configuration file (bdev.conf.in)
made for blockdev.sh. Changes in that config file affected
the raid tests.
Since the test actually only used two malloc devices as
raid bases, switching to RPC makes it simpler clearer
to understand what is used in tests. Additionally
making raid tests standalone from blockdev.sh.
Fixes issue #777
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453644 (master)
(cherry picked from commit 9011f2401b)
Change-Id: Ia4c5858852241a9fd8212690aefbf015c98d1b57
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457209
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Previously the socket was only used in single rpc call,
upcoming patch will use of the $rpc_py.
Moving socket to $rpc_py simplifies calling it in multiple
parts of the script.
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453643 (master)
(cherry picked from commit a394f62868)
Change-Id: Id1ba86740237c32a6f0259562c0b5c11d917bbcf
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457208
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Ordinary python str.split() will by default split on each whitespace.
This includes arguments for rpc.py which expect a whitespace separated list,
eg. construct_raid_bdev -b "Bdev_1 Bdev_2".
shlex.split() prevents splitting on quoted arguments.
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453652 (master)
(cherry picked from commit 22c3befd3d)
Change-Id: If37eb87cf82a161263f2b247baff5c8a77c43efc
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/457222
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>