Commit Graph

245 Commits

Author SHA1 Message Date
Konrad Sztyber
3363ab70dd lib/ftl: retrieve LBA / iovec via getter functions
Replaced all direct accesses to io->lba / io->iov with getter functions,
as they both should behave differently based on the FTL_IO_VECTOR_LBA
flag and io->iov_cnt respectively.

Change-Id: I0d387a2a908cc37afa9e1b97ca5b408cef0d6b08
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450265
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-05-16 07:56:20 +00:00
Konrad Sztyber
4c03cae6f5 lib/ftl: trace early read completion in one place
Moved early read completion (due to cache hit or reading unwritten
data) traces to ftl_submit_read to keep them in one place. Also removed
the context parameter from next_ppa function, as it was unused.

Change-Id: Ic69174a6cdc0e626550cd673789e86bb891094bf
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453683
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-10 22:20:57 +00:00
Konrad Sztyber
8c6f63a3f1 lib/ftl: name ftl_io's LBA / iovec unions
Replaced the unnamed unions with named ones. It makes the assignments
easier (it allows for direct assignment instead of having to choose the
correct union member).

Change-Id: I130233a096070092275a040e73cbaf36106ae1ab
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453682
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-10 22:20:57 +00:00
Konrad Sztyber
f719268ef8 lib/ftl: trace RWB fill before advancing IO position
This fixes incorrect LBA reported by traces (it reported the next one,
as the IO position was advanced before storing the trace).

Change-Id: I788853d729dd25e90c6c899be0616aa3a79d08b3
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/453681
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-10 22:20:57 +00:00
Konrad Sztyber
3cdd17f518 lib/ftl: cleaned up write buffer initialization
Moved freeing the data into one place. Added error checks for all of the
pthread_spin_init calls.

Change-Id: Ic123f75f242fb71b92fcad5acf7b00588c2801c3
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450618
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-10 22:20:57 +00:00
Konrad Sztyber
c262145f61 lib/ftl: prioritize resubmitted batches
Keep write buffer batches marked for resubmission on a separate queue
and treat them with higher priority.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If5bedcfea2e7650b36da231ec3e0cd54e8d2484a
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450264
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
2019-05-10 22:20:57 +00:00
Jim Harris
617184be3b trace: remove short_name
This was not used by any of the trace register descriptions.
Let's remove it rather keeping it around if we don't need it.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/452734
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2019-05-02 08:41:56 +00:00
Konrad Sztyber
a37999b44b lib/ftl: clear flush bitmap during IO completion
Change-Id: I073af62b0af58d2e63bc5d8df8d13fd8ecf94ec9
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451155
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-05-01 18:35:40 +00:00
Wojciech Malikowski
58c4dac9d9 lib/ftl: Limit write queue depth to one per chunk
There are no guarantees of the order of completion
of NVMe IO submission queue so wait for write completion
on specific chunk before submitting another write to it.

To control chunk occupancy split IO to child requests
and release chunk in IO completion callback.

Change-Id: I44147a21b528a7f33fb92b9e77d7de8f5b18f8ff
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449239
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
Reviewed-by: Claire Jihyun In <claire.in@circuitblvd.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-24 23:24:21 +00:00
Wojciech Malikowski
049624823b lib/ftl: Rely on internal IO position during ftl_io_done()
Change-Id: I7a7667e1c4e6321150e5bc8eb4287fb61847ccb5
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450174
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-24 23:24:21 +00:00
Konrad Sztyber
ef5ede4b51 lib/ftl: allow parent/child relations between IOs
Extended the IO descriptors with the ability to group them together in a
parent / child(-ren) relationship. It allows to delay parent completion
until all children are done and enables the children to have additional
context in their completion routines (as opposed to having a single IO
describe all requests).

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I6ad111dc231813e397697109a333e2a5d7f5941d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449068
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-04-24 21:57:06 +00:00
Claire J. In
3be9febdf9 lib/ftl: check for null
Fixes #726.
This prevents a segmentation fault by checking the pointer
before accessing it.

Change-Id: I18a3776fbcd6242c6efd1b88044debaa88c7342f
Signed-off-by: Claire J. In <claire.in@circuitblvd.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449591
Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-04-02 08:22:48 +00:00
Wojciech Malikowski
dd54dff78b lib/ftl: Keep DMA buffer for metadata as part of ftl_md structure
This patch is starting point for metadata refactor
which is needed for efficient ANM events support.

Change-Id: I81d864605e69008d8e3922fb61adf504187447a1
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449328
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-04-02 00:04:58 +00:00
Konrad Sztyber
67194e3ac7 lib/ftl: added band selection traces
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Iafe7021febd12f1f9b00890c357a5d3f26611c31
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449422
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-04-01 09:05:33 +00:00
Konrad Sztyber
9ed090d23d lib/ftl: traces refactor
Replaced tpoint_ids generated based on the properties of the IO with a
static list of tpoint_ids, to fit inside the per-group maximum tpoint
limit (64).

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ifb8b8637a1e6d8f0e7fd3f4363b97fdbedcdb8d5
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448067
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-04-01 09:05:33 +00:00
Konrad Sztyber
a0cb5e9d77 lib/ftl: retrieve caching bdev from configuration
Added means to configure libftl to use (optionally) another bdev as
persistent write buffer cache.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I97028a681be168d9386eac8a226631ff772f803b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448629
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-29 04:42:48 +00:00
Wojciech Malikowski
04814b72a8 lib/ftl: Internal IO retry mechanism in case ENOMEM from nvme layer
Added internal retry IO queue. In case ENOMEM from
nvme layer request is put to retry queue. When some
inflight operations are completed try to make progress
on IOs in retry queue in first place.

Change-Id: Ie9d3d20bd34431ee57f9454f242b0cdca349c804
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448461
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-28 14:17:11 +00:00
Wojciech Malikowski
f8399d4539 lib/ftl: Update internal IO position in one place
Change-Id: Ie925659e8ffca1fb8aaa1252118bc670b3b274fd
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449015
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-28 14:17:11 +00:00
Wojciech Malikowski
e27f64fb98 lib/ftl: Use ftl_io_done() to determine if IO is completed
Change-Id: I76b58764153793f26b167071041ee17673fec63f
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449160
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-03-28 14:17:11 +00:00
Wojciech Malikowski
cfdc60c05a lib/ftl: Avoid splitting read's in case contiguous PPAs
Change-Id: I026902096686da37c0ca7086bb5d91b35d90ffa6
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447340
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>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
Reviewed-by: Claire Jihyun In <claire.in@circuitblvd.com>
2019-03-21 20:11:35 +00:00
Wojciech Malikowski
660a0fae82 lib/ftl: Free IO in case band's relocation was interrupted by shutdown
This leak could be detected by ASAN in FTL CI tests.

Change-Id: I3ab7317dd5288b9fc808fb476627213b00860eb8
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448566
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-21 17:31:43 +00:00
Changpeng Liu
640547c5c1 ftl: free allocated IO queue pair before releasing the controller
Intermittent FTL test failure (ASAN) #717 reported an error, in
ftl_halt_poller() call, ftl_anm_unregister_device() will release
controller first, while in ftl_dev_free_sync() the IO queue pair
will be released again.

Change-Id: Ifac2aa68e66ee5f41eba80c11c61d9dc91ec3408
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448524
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-03-21 07:07:09 +00:00
Changpeng Liu
ef9a7d5c7c ftl: remove unnecessary thread allocation for core IO thread
The value is already initialized via caller.

Change-Id: I3426a9f34cc545337b6bd3d729ca65e31a8e962e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448523
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-21 07:07:09 +00:00
Wojciech Malikowski
11c8fbcf62 lib/ftl: Fix memory leak in restore module
Change-Id: I39c89ef935eeac56fd860b11e1fafd5047072f7e
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448023
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-18 16:33:49 +00:00
Wojciech Malikowski
5d82fa6af7 lib/ftl: Pass errors from nvme layer only in completion callback
FTL should pass IO errors to upper layer only in
completion callback to be consistent on sync and
async error paths.

Change-Id: I29c81af477b476c1e10b7933126737a222553ffa
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447176
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-03-15 05:03:39 +00:00
Wojciech Malikowski
3816651f4b lib/ftl: Try to process more then one I/O completion
This patch allows to process more then one I/O
completion per reactor iteration.

Change-Id: Ib58013cd96c2b7fe378f175b34d58c6d1d219dcd
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447175
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Young Tack Jin <youngtack.jin@circuitblvd.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-03-15 05:03:39 +00:00
Wojciech Malikowski
c5c102ce55 lib/ftl: Fix band picking for write pointer
Removing band from "free list" is moved from FTL_BAND_STATE_OPENING
to FTL_BAND_STATE_PREP state's change actions.
This will fix race condition when one band is prepared (erased)
and write pointer is trying to get next active band.

Change-Id: I9e4fe9482a01ee732271736e4a0e6fcedf2582d8
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/445118
Reviewed-by: Jakub Radtke <jakub.radtke@intel.com>
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>
2019-02-25 22:37:44 +00:00
Wojciech Malikowski
0f12c406d1 lib/ftl: Propagate ENOMEM error during read to upper layer
ENOMEM is expected when nvme_qpair will be out of resources.
In such a case ENOMEM shall be propagated to allow upper (bdev)
layer proper handling.

Change-Id: Ie647c2d3efff24a8de949a22ac42a31dfd0e78b7
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/445580
Reviewed-by: Jakub Radtke <jakub.radtke@intel.com>
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>
2019-02-25 22:37:13 +00:00
Wojciech Malikowski
1442b5f28a lib/ftl: Fix size of write buffer submission queue
SPDK ring size used for write buffer submission queue
must be increased if required number of batches is a
power of two.

Change-Id: I9b9f885064cf6f0f5fe94b0ed4f9d49a4e5c0cd0
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/445721
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-02-22 19:13:40 +00:00
Wojciech Malikowski
b9e462e4a6 lib/ftl: Fix band's metadata inconsistency with L2P
Added check before write submission to indicate if
LBA was update in meantime. In such case don't set band's
metadata and rwb entry cache bit. Previous implementation
invalidates such address during write completion and could
cause that inconsistent lba map was stored into disk.

Change-Id: I4353d9f96c53132ca384aeca43caef8d11f07fa4
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/444403
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-02-15 21:42:14 +00:00
Wojciech Malikowski
8cda50fd96 lib/ftl: Remove NULL pointer checks in external APIs
Change-Id: Ia2d89e7bf350544ced9a8ae40821634dedb3a741
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/443384
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-02-08 16:35:34 +00:00
Wojciech Malikowski
68b49203a7 lib/ftl: Change order of relocation queues processing
ftl_process_reloc should process free_queue in first place
(this will start read operations) and then process write queue.

Change-Id: I3a44b3651cc1526f8a024330472f94aa8d818193
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/443403
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-02-05 18:02:15 +00:00
Wojciech Malikowski
7f21e8c571 lib/ftl: Free IO after lba map read during relocation
Change-Id: Id44f9de4500ec2be45aa4203c5945b1501fbdb21
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/443236
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-02-05 18:02:15 +00:00
Wojciech Malikowski
c8d956fdee lib/ftl: fix IO metadata pointer initialization
Change-Id: I2bad16b6649c279448a3c662ab7b035dbe0a4bfb
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/443251
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-02-04 20:51:37 +00:00
wuzhouhui
4ee969c2cf bdev/ftl: no need to alloc buf when get geo from ssd
The ocssd spec and buildtime-check already ensures
sizeof(struct spdk_ocssd_geometry_data) is 4096, so we can use
struct spdk_ftl_dev::geo as buffer directly.

Change-Id: Id7a52f978d80284fe941d9f5d7bc7219518871e8
Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-on: https://review.gerrithub.io/c/443069
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-02-04 20:51:13 +00:00
Konrad Sztyber
a3777e3f11 ftl: verify LBA format is supported
Verify that the namespace used is formatted with a supported LBA format
(4K block size).

Change-Id: I59e2ed71354e8530d9fa0e3f6b323ded83097afa
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/441881
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-01-29 06:51:46 +00:00
Ben Walker
9fd924cb40 check_format: Verify #include syntax
Change-Id: I63b877a6543293e1a5c349bcb4460b79c81ca8cd
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/441968
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: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2019-01-29 00:12:07 +00:00
Wojciech Malikowski
70b86ec995 ftl: Added unit tests for FTL library
This patch implements unit tests for the following modules:
 * band
 * PPA (Physical Page Address) translations
 * write buffer

Change-Id: Ia7292bd3027347e8a3da77dafe71cde2c016bf38
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/431328
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-01-22 23:22:16 +00:00
Tomasz Zawadzki
8331ebd19c ftl: Added trace support
This patch adds supplementary tracing for OCSSD library to allow
for more efficient debugging and profiling of the user I/O path
as well as the background tasks (maintaining write pointer,
defragmentation, ANM event handling, etc.).

Change-Id: I741f1304f4ee0eba019e31bea7814af475c3296e
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/431327
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-01-18 18:58:04 +00:00
Wojciech Malikowski
5c3591c72e ftl: Added initialization module
This patch adds OCSSD device initialization consisting of the
following:
 * retrieving SSD's geometry and its state
 * verifying configuration
 * initializing core structures (L2P, bands, write buffer, write
 pointers, bad block tables, etc)
 * initializing threads

Change-Id: Ieb643f78035702e834b9ef7830a3db215e35bfb7
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Signed-off-by: Jakub Radtke <jakub.radtke@intel.com>
Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/431326
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-01-18 18:58:04 +00:00
Wojciech Malikowski
5c8f369a41 ftl: Restore state from the SSD
This patch adds the ability to restore the state of the block device
from the SSD, by reading the metadata stored in each band and recover
the L2P (LBA -> PPA map). Only clean shutdown is supported as of yet.

Change-Id: I03e39510a902b098c52edfaedd2e61b43a297bda
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/431325
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
2019-01-17 20:58:57 +00:00
Wojciech Malikowski
0ab3fa895f ftl: Gathering asynchronous NAND management events
The patch adds support for retrieving asynchronous media management
events sent by the drives. SSDs needs to inform the host of various
incidents concerning the data placed on the media. The events include
wear-leveling, read disturb, and background data refresh.

In order to poll for this asynchronous events, a separate thread is
added that polls for completion of admin commands for each of Open
Channel disk and dispatches the ANM events to the appropriate block
devices.

Change-Id: Ic5d4943614c65a9d8849c500826841ae21d4c9c5
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/431324
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-01-11 09:15:39 +00:00
Wojciech Malikowski
cbc81d2659 ftl: Added relocate module
This patch implements module responsible for data relocation due to
defragmentation, wear-leveling, read disturb and/or background data
refresh.

The submodule supports moving whole bands, chunks, as well as
single logical blocks.

Change-Id: Iaef37f50e0bb93986a21e495174f6d5ef8a1f30d
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Signed-off-by: Jakub Radtke <jakub.radtke@intel.com>
Reviewed-on: https://review.gerrithub.io/c/431323
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-01-11 09:15:39 +00:00
Wojciech Malikowski
ef2e614cef ftl: Initial implementation
This patch adds core FTL (flash translation layer) submodules.

On regular SSDs the FTL is part of firmware, whereas Open Channel
enables moving it to the host and allows for having full controll
of data placement on the device.

Main functionalities added:
 * logical to physical address map
 * read / write buffer cache
 * wear-leveling
 * bad block management

Change-Id: I5c28aa277b212734bd4b1f71ae386b3d6f8c3715
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Signed-off-by: Jakub Radtke <jakub.radtke@intel.com>
Signed-off-by: Mateusz Kozlowski <mateusz.kozlowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/431322
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-01-11 09:15:39 +00:00
Wojciech Malikowski
e9a236d275 ftl: Initial headers
This patch introduces core structures required for implementing FTL on
top of Open Channel drives. The Open Channel specification describes raw
access to the media on the SSD. The FTL consumes that API and exposes a
block device interface.

The implementation is based on the revision 2.0 of the Open Channel SSD
specification.

Change-Id: Ie306cdfb7920df3b02233fcb60896745f3184cdc
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/431321
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-01-11 09:15:39 +00:00