Commit Graph

7035 Commits

Author SHA1 Message Date
Seth Howell
229ef16bb9 lib/env_dpdk: add map file and rev so major version.
There were 9 function symbols removed from the global list
of the library. They were all symbols declared in env_internal.h

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I23210f27dc2bf23ae9e9cf76babb54e623fbc917
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1708
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-22 09:21:55 +00:00
Seth Howell
0f2f4b8b72 lib/conf: add a map file for this library.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: If9e44d65362f164b35f5a15f310214ab1d7ff3a7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1704
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-22 09:21:55 +00:00
Seth Howell
bc0180f67f lib/blobfs: remove spdk prefix from private APIs
This should help reduce confusion within libraries about
which APIs are public and which are private.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I7755081b016f269d4761d8cc2ce4bac2835c077d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1703
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-22 09:21:55 +00:00
Seth Howell
6569a0ea06 lib/blobfs: add a map file.
Also, increment the library version since some non-public symbols have been removed.

Please note, SPDK_LOG_BLOBFS is included in the map file because it is used by the
blobfs_bdev module.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ib05c0b6630951d97b1a5b2931746471eeb9d9630
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1702
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-22 09:21:55 +00:00
Seth Howell
f18f8e930a lib/iscsi: get rid of some unreachable code.
Fix kw warning 12457

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I5ab34269eb6a55a012b8fb4e109a42a3508e4193
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1951
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-22 09:21:04 +00:00
Seth Howell
44e2f5106a lib/nvmf: fix unreachable code.
Fixes kw warning 10446.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I6d66efe27fad5dba60547bf6eaf990f44e69eacd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1950
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-22 09:21:04 +00:00
Tomasz Zawadzki
1fa071d332 conf: provide deprecation message when using INI configuration
Deprecating INI tyle configuration has been a long time coming.
Feature parity is there between JSON-RPC and INI, which should
enable the switch.
All major applications support the JSON-RPC and tests were
moved to the JSON-RPC.

With above in place, it is time to give an explicit notification
to INI config users regarding the lack of support for INI.

In future release the INI configuration will be removed,
until then feedback from users is welcome on any
suggestions how to make the transition smoother.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If47375371791646f2afd06762b9bf6c5b8e009ed
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1941
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-22 09:19:22 +00:00
Ziye Yang
8ad1f4bfa8 lib/sock: remove spdk_sock_set_priority
Since the related feature is already contained in
spdk_sock_listen and spdk_sock_connect functions,
we no longer need this function.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I1eafff0d139fa266a355fbee2bf0fc3947db69fc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1876
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-22 09:19:01 +00:00
Ziye Yang
a2201d050b lib/sock: Introduce lazy free of spdk_sock_placement_id_entry
Purpose: Fix the unbalanced allocation of socket connection.
Suppose we have 4 spdk threads, then there will be 4 sock groups,
each on one spdk thread. And When using the NAPI_ID, each
sock group will be responsible for one NAPI_ID.
For example,
Poll group:                A, B, C, D,
connection with NAPI_ID:   0, 1, 2, 3.

However if connection with NAPI_ID 2 exits first, and we will allocate
socket A (with the roundrobin manner, But not C again). So to avoid
this, we choose lazy free.

Since when the sock poling group is close, it will free them
finally in spdk_sock_remove_sock_group_from_map_table. So
there is no memeory leak, but eliminates unnecessary allocation/dellocation
on spdk_sock_placement_id_entry.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I9bbc9139c8f8f3999eab7cd9259db2d683bd8466
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1873
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-22 09:19:01 +00:00
Tomasz Zawadzki
a6587c7e82 blob: inline _spdk_blob_calculate_lba_and_lba_count()
This is called on hot path for I/O, inline it.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Iec40033eac19f2c66c2984623acb5e157a5ffe05
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1723
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-22 09:18:41 +00:00
Changpeng Liu
163eba9565 nvme: return the physical address in nvme_pcie_ctrlr_alloc_cmb()
Commit 9ad044c4 remove the offset parameter in nvme_pcie_ctrlr_alloc_cmb()
and uses spdk_vtophys() to get the physical address of the submission
queue, however, the memory isn't registered to SPDK yet, so use the
offset to get the physical address again.

Change-Id: Ida0f4a8bf1e72d6446fba442a1b71f0ddaab4bb8
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1933
Community-CI: Mellanox Build Bot
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-22 09:18:22 +00:00
Jacek Kalwas
652fe8a20b nvmf/ctrlr: fix completion for internal connect cmd
Hit assert when completion is done is response to internal connect
cmd. Fix by outstanding counter incr, add missing err handling.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I2ba71f83432831fc043f2b6f6a5cba024045068b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1902
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-20 14:30:56 +00:00
Changpeng Liu
b55279d485 nvme: add Bit Bucket SGL with READ support
When iterating SGL segment, we can use existing virt_addr parameter
to return UINT64_MAX as a special value to indicate this segment need
to be described as Bit Bucket SGL.

Currently only READ command is supported, we can enable the WRITE
and COMPARE support when necessary.

Change-Id: I50aa2b226ec3449c13ed1d97b3224ee8e7de95a8
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1467
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-20 07:41:50 +00:00
Changpeng Liu
532ae9527b nvme: enable separate metadata buffer with SGL support
If the request contains separate metadata buffer, we should set
PSDT 10b when hardware SGL is supported and dword alignment is
required.  SPDK driver doesn't provide SGL metadata data buffer
APIs for now, the separate metadata buffer is alway contiguous,
so we can put the metadata buffer into a data block SGL entry.

Change-Id: I9ccfce755a3169cd2c9b908e4da76081155d9613
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1466
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-20 07:41:50 +00:00
Seth Howell
c3eac3435a nvme/rdma: send an rdma_disconnect during disconnect.
The rdma_disconnect call triggers an RDMA_CM_EVENT_DISCONNECTED
message on the target side. The hope is that the target side will
reply with the same message in a reasonable amount of time. If the
target doesn't have that mechanism implemented, print an error message
and continue with the process.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I164a3538714fa3adfc306ea0c88220ea710e7c39
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1879
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-20 07:40:31 +00:00
Seth Howell
d76965f0fa nvmf/rdma: Send an rdma_disconnect in the fini call.
This also lets us get rid of the set_ibv_state function
since rdma_disconnect does the transition to the error
state for us.

rdma_disconnect triggers an RDMA_CM_EVENT_DISCONNECT on the
initiator side. This is important so we know when qpair ids
can be reused on the initiator side.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I87b80797c84ffa1d2cbe94cf37316b1b674b6c74
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1878
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2020-04-20 07:40:31 +00:00
Seth Howell
6f38799b6e lib/nvmf: call ctrlr_fini after clearing qid from ctrlr bit array.
As soon as we disconnect the qpair, the initiator can submit an
additional request to connect a qpair with the same qid as the
one we connected.

This series is aimed at making sure we don't acknowledge a disconnect
until we have cleared that bit.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I76d9312448a9740911465c146a195996cc567370
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1880
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-20 07:40:31 +00:00
Seth Howell
9d39be44c5 nvmf/ctrlr: remove assert for qpair state.
Historically, we have immediately called the qpair
fini function directly from _spdk_nvmf_qpair_destroy.

However, to fix a race with initiators where we can get
a duplicate QID from the initiator, we will have to clear
the QID bit before calling qpair_fini. Clearing the QID bit
must be done on the controller thread, so we have to pass at
least two messages between calling _spdk_nvmf_qpair_destroy
and qpair_fini. This leaves a gap where we can poll the poll group
and reap completions for the qpair before we call qpair_fini and drain
all of the requests related with the qpair.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I337a0608f88fdda132b8a629a508c0263d2261c5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1881
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-20 07:40:31 +00:00
Shuhei Matsumoto
646f0665d5 lib/iscsi: Remove the "spdk_" prefix from static functions in iSCSI library
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5fe643796f51af5f459a40380afc3545de244de7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1893
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-20 07:38:29 +00:00
Shuhei Matsumoto
93d8cab25e lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in iscsi.h
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I81e4934ca38970cfc1707c2d09f6160c9c452045
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1892
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-20 07:38:29 +00:00
Shuhei Matsumoto
f7b7195aa0 lib/iscsi: Replace the "spdk_" prefix by "iscsi_" for internal APIs declared in iscsi.h
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1e5a8b567e87ab5693402d164bf73fe22afa45af
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1891
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-20 07:38:29 +00:00
Shuhei Matsumoto
3570494de2 lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in conn.h
As other small change, function iscsi_conn_pdu_generic_complete()
had been declared in conn.h but defined in iscsi.c. Move the
definition of it to iscsi.c.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1bd796288036f78a7cba8a1c0af93bd6bc19e9cf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1890
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-20 07:38:29 +00:00
Shuhei Matsumoto
71e29ada6b lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in md5.h
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I51cfa25800e8cbb25db02f425b8d257e4e837d68
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1889
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-20 07:38:29 +00:00
Shuhei Matsumoto
a587a1072a lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in portal_grp.h
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I2c9482c8a89b3dc87f9e4cb55bc298e87472d30c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1888
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-20 07:38:29 +00:00
Shuhei Matsumoto
df53885bc5 lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in init_grp.h
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4f06612aa6e619371f28b2df435e0966d30da275
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1887
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-20 07:38:29 +00:00
Shuhei Matsumoto
6a31372511 lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in tgt_node.h
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I27419445fbd938b56b66a5ba2cc1cde75e7129ac
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1886
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
2020-04-20 07:38:29 +00:00
Shuhei Matsumoto
040095db86 lib/iscsi: Remove unimplemented internal API from tgt_node.h
spdk_iscsi_tgt_node_reset() is not implemented and the code to
call it is commented out. We will have to implement them from scratch
if we do. So remove them in this patch.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I63618b0f8857cb23b57f5a92ec363a91c1d5a912
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1885
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
2020-04-20 07:38:29 +00:00
Shuhei Matsumoto
356cb2332c lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in task.h
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I746660725f013df93b56ea89d11783ee5c568609
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1884
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
2020-04-20 07:38:29 +00:00
Shuhei Matsumoto
be05a8208d lib/iscsi: Remove the "spdk_" prefix from internal APIs declared in param.h
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8ecdc65f1c0ae88d2de45298db45a8f52e4ed2e5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1883
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Seth Howell <seth.howell@intel.com>
2020-04-20 07:38:29 +00:00
Shuhei Matsumoto
be1489b9b9 lib/iscsi: Rename iSCSI global data from g_spdk_iscsi to g_iscsi
The following patch will remove the "spdk_" prefix from iSCSI
internal APIs. The iSCSI global data g_spdk_iscsi is also local in
SPDK iSCSI library. Hence rename it by g_iscsi for consistency.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If35e9d58b1388fd725a505ee9be870e414c37ba5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1831
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2020-04-20 07:38:29 +00:00
Vitaliy Mysak
d7a3a052ab ocf: update ocf submodule to v20.3
New OCF version is ready, so update our submodule.
There were a lot of API changes so
we need to adjust our bdev/ocf and lib/ocf_env code.

Description of code changes:
- env: added small functions like ENV_BUILD_BUG_ON, env_vzalloc_flags
- env: added "destroy" method for all locks
- env: added "execution context" interface
- cache/core "id" field made private
- signature of "ocf_io_configure" changed
- "io->volume" field made private

List of changes to OCF is available at
https://github.com/Open-CAS/ocf/releases
But no new features were implemented for our
OCF module since 19.6

Change-Id: I1ac2b6db0aad2a9840e4fa73d65608c5638fcb23
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1801
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-17 07:32:48 +00:00
Vitaliy Mysak
e316ec90b2 lib/env_ocf: fix locks implementation
Some of the locks implementation in our OCF env
is different from suggested posix implementation (ocf/env/posix),
which leads to deadlocks in OCF v20.3

This patch copies correct implemention from example
posix env.

Change-Id: Ib3bb1cf3532b9e5ebc450a1569c620d95efe6704
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1867
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-17 07:32:48 +00:00
Ben Walker
d3f661cfd7 nvme/pcie: Don't store cmb.end
This isn't actually necessary.

Change-Id: Ic229b44f4eaf628a468fa8c2fa526162e426ec57
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/789
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-16 08:14:18 +00:00
Ben Walker
9ad044c464 nvme/pcie: Make signature of nvme_pcie_ctrlr_alloc_cmb more like other
alloc functions

Make the signature look more like spdk_dma_malloc and family.

Change-Id: I6a31acf3b9edd136924b6e53b9a23c699429b9dc
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/788
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-16 08:14:18 +00:00
Ben Walker
7b28450b3f nvme: Allow users to reserve the CMB for data without mapping it
Separate these two operations into different functions. It is
possible that a CMB may not be visible from the CPU, but still
be present and have data transferred to it by some other DMA
engine. Generalize the API to handle that case.

Change-Id: Ifcd282af0db734fe4a6ef2283ae8e8933d017809
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/787
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-16 08:14:18 +00:00
Ben Walker
6a7aa72edc nvme: Only memory map CMB if user requests it
We only need to register the memory for the CMB if the user
plans to map it for use with data. Delay the operation until then.

This also gives us a way to support unmapping the CMB.

Change-Id: I6121ae2cc3f6f44efae8b52b6582ff9f68432bc8
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/786
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-16 08:14:18 +00:00
Ben Walker
265a8436f4 nvme: Change mapping semantics of controller memory buffer
Instead of creating an allocator where the driver manages the space,
now, since using the CMB for queues and data has already been
disallowed, just create functions to map and unmap the entire CMB.
The user can manage the space.

Change-Id: I023994deda3b517e14d2ba464c7375bf22b58456
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/785
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
2020-04-16 08:14:18 +00:00
Shuhei Matsumoto
33a2974768 lib/scsi: Remove spdk prefix from private functions
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I89aa5dc10150cff74a420ccf8c3842bd12e84f3c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1825
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-16 08:09:14 +00:00
Shuhei Matsumoto
18dec40111 lib/scsi: Remove spdk_ prefix from internal APIs
Remove spdk_ prefix from the name of internal APIs.

Add single underscore as the prefix of the function name to the
private functions if we see any conflict as a result of this change.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If0eabffbdb750db02866c1aa2b29b0c89fab1040
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1824
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-04-16 08:09:14 +00:00
Seth Howell
ba870c2e99 lib/blob: remove some unused internal APIs
spdk_bs_sequence_unmap and spdk_bs_batch_to_sequence were
unused.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I4edc45948941ba700bea353c20ddb4e3f2fa15a4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1701
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-15 22:10:08 +00:00
Seth Howell
ad7fdd12b1 lib/blob: remove spdk_ from non-public APIs
We have an unofficial naming convention that the
spdk_ namespace is reserved for public API functions only.
This patch is attempting to bring the blob library into compliance
with that naming convention.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ie298e41d1b741dae01744826c208378ee60f9d0a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1700
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Broadcom CI
2020-04-15 22:10:08 +00:00
Seth Howell
75365cfa60 lib/blob: add a map file.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I72da725f82dfa3eeb2c0ec6614ecc9ffb0b852a8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1682
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom CI
2020-04-15 22:10:08 +00:00
Seth Howell
869ad9c488 lib/bdev: add a map file.
Also update the so minor version. Apparently spdk_bdev_module_list_find
was not declared global even though it matches the spdk_* regex for the
generic spdk map file. My guess is this is because it isn't actually
used in any file other than bdev.c even though it is declared in
include/bdev_module.h

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I5c4e9ed06130e5d1dcc7235b5c2588f7b98a3ab3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1681
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom CI
2020-04-15 22:10:08 +00:00
Shuhei Matsumoto
1fbc628e7a lib/scsi: Delete unused struct spdk_lun_db_entry
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I95f1b7445e55efe2aec5ab819eaef1d3e25b2507
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1821
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2020-04-15 07:40:06 +00:00
Shuhei Matsumoto
799e0a84af lib/scsi: Merge append and execute SCSI task into a single function
Both for SCSI IO task and management task, append and execute
operations bad bbeen separated into different functions.

Append operation was for LUN reset, and separating into two different
functions was for clarification and readability.

LUN reset is sufficiently stable now.

Merging append and execute SCSI task into a single function is good
as API and enables us to do optimization.

For SCSI management task, merge spdk_scsi_lun_append_mgmt_task into
spdk_scsi_lun_execute_mgmt_task() simply.

For SCSI IO task, merge spdk_scsi_lun_append_task into
spdk_scsi_lun_execute_task() and do a small optimization.
The refined spdk_scsi_lun_execute_task() adds the IO task to the
pending list if there is any pending management task, executes all
existing penging IO tasks first and then the IO task if there is any
pending IO task, or executes the IO task directly otherwise.

Update unit test accordingly.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I26ffc4f4f62747d8cdecb90690f26cd58a9c17f7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1817
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-15 07:40:06 +00:00
Shuhei Matsumoto
2aa74d8ba9 lib/scsi: Inline _scsi_lun_execute_mgmt_task() into the caller function
Inline _scsi_lun_execute_mgmt_task() into the caller function
spdk_scsi_lun_execute_mgmt_task() as another preparation to the following
patches to avoid using double underscores as the prefix of the
function name.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I3c282fff133dfe7afc70c374a2186c14d1eb766c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1829
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-15 07:40:06 +00:00
Shuhei Matsumoto
2144f0b4c3 lib/scsi: Separate pending task and outstanding (submitted) task into different functions
This is a preparation to the following patches to optimize task
submission and remove the spdk_prefix from internal or private
functions.

To avoid using double underscores as the prefix of the function name,
separate pending task check and outstanding task check into
different functions.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ieda54507bf4c781b60fa05d03cd32ca25948e430
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1826
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-15 07:40:06 +00:00
Changpeng Liu
30e42bcecf nvme/opal: remove the device mutex lock finally
We can remove the device lock from now because all the APIs are executed
base on session, the controller can return error if there are multiple
sessions, actually most drives can only support one active session.

Change-Id: I9d5f4dc01a50ec95ef97b38c9e079ef95f37e4de
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1741
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>
2020-04-15 07:39:10 +00:00
Changpeng Liu
e51a2aaf3f nvme/opal: use asynchronous security send/receive transport APIs
opal_send_recv() is a wrapper implementation to use the asynchronous
security send/receive APIs, it can be used in a session context, but
from the view of one session, the opal_send_recv() is still executed
synchronously, but if the drive can support more than one session,
opal_send_recv() can be called from different sessions or threads.

Change-Id: I3a4b2ec14cb7706c39565a6b4fb8a3a4862f3d4c
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1670
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-15 07:39:10 +00:00
Changpeng Liu
71327bfef8 nvme/opal: move the command finalization to generic_pw_cmd()
opal_cmd_finalize() is part of OPAL command construction, so move it
to the common password construction function.

Change-Id: I65ecf1c9181e622f344f7e9284058e2472accd31
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1669
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-15 07:39:10 +00:00
Changpeng Liu
2728b774aa nvme/opal: merge two revert tper command function into one
Also rename it with *build* which is more meaningful.

Change-Id: I6e81e1b641ffdd04a7420e93e67448dc430f5168
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1668
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>
2020-04-15 07:39:10 +00:00
Shuhei Matsumoto
ab0bc5c254 lib/thread: Use function name as poller name by using macro SPDK_POLLER_REGISTER
We will be create fine name for each poller but it will need large
effort. Replacing spdk_poller_register by the macro SPDK_POLLER_REGISTER
will provide better name than function address with minimum effort.

Following patches may improve function name for clarification.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If862a274c5879065c3f7cb04dcb5ca7844523e68
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1781
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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Maciej Szwed <maciej.szwed@intel.com>
Community-CI: Broadcom CI
2020-04-15 07:23:09 +00:00
Jin Yu
2eabc71518 vhost: add packed ring support
Update vhost blk contruct rpc, make it enable to
support packed ring feature.

Change-Id: Ia1f75e72e8441e8d82fad89073e4875f89e5b9cd
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1567
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-15 03:55:59 +00:00
JinYu
cbfc8b2d48 vhost: add the packed ring support for the blk backend
Support the packed ring for the blk backend.The relative
APIs has been submitted to the DPDK upstream and merged.

About the packed ring see below:
https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html#x1-610007

Change-Id: I43488604bf18d40a14c76b95206e07db76a14c0d
Signed-off-by: JinYu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/759
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-15 03:55:59 +00:00
Jin Yu
7ebdb90298 vhost: add the packed ring operations
Add the packed ring operations in spdk vhost.

Change-Id: I25c9701aadbb283f8f3ecccf599a863395d1c7f0
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/758
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-15 03:55:59 +00:00
Jin Yu
39276ee82c vhost: negotiate the packed ring feature
Add the packed ring support in spdk vhost.
Negotiate packed ring feature when start device.

Change-Id: Idef50a1426b6e38d789d8c6982a3ed7594e32cf5
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/672
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-04-15 03:55:59 +00:00
Richael Zhuang
a2dbaf7e83 log: spdk_log_dump more characters than required
When the size of input buffer is larger than 16 and not divisible
by 16, the final line will keep part of the characters of the last
line. For example, if I want to dump "spdk dump 16 more chars",the
output is:
00000000 "hexadecimal" spdk dump 16 mor
00000010 "hexadecimal" e charsmp 16 mor
But the correct should be:
00000000 "hexadecimal" spdk dump 16 mor
00000010 "hexadecimal" e chars

Signed-off-by: Richael Zhuang <richael.zhuang@arm.com>
Change-Id: Iaf3f33c5ce68920ada83c59277f89a547e8030d7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1739
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>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-14 11:34:45 +00:00
Seth Howell
9fe5084860 lib/nvme: when destroying qpairs, abort queued requests.
We should be giving completions for all requests when we destroy a qpair.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I802f5120f2e8289aa825872f8085ac21b5fce0f3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1756
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
2020-04-14 11:34:24 +00:00
Alexey Marchuk
4279766935 nvme: Abort queued reqs when destroying qpair
Change-Id: Idef1b88cf47cf9f82b1f4499ef836dfa741c0c7f
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1791
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-14 11:33:39 +00:00
Alexey Marchuk
f11989385e nvme/rdma: Clean pointer to nvme_request
That is done to make sure that scenario described in github
issue #1292 won't happen

Change-Id: Ie2ad001da701e25ef984ae57da850fb84d51b734
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1771
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-14 11:33:39 +00:00
Alexey Marchuk
581e1bb576 nvme/rdma: Wait for completions of both RDMA RECV and SEND
In some situations we may get a completion of RDMA_RECV before
completion of RDMA_SEND and this can lead to a bug described in #1292
To avoid such situations we must complete nvme_request only when
we received both RMDA_RECV and RDMA_SEND completions.
Add a new field to spdk_nvme_rdma_req to store response idx -
it is used to complete nvme request when RDMA_RECV was completed
before RDMA_SEND
Repost RDMA_RECV when both RDMA_SEND and RDMA_RECV are completed
Side changes: change type of spdk_nvme_rdma_req::id to uint16_t,
repack struct nvme_rdma_qpair

Fixes #1292

Change-Id: Ie51fbbba425acf37c306c5af031479bc9de08955
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1770
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-14 11:33:39 +00:00
Jin Yu
c8bdbc12c3 vhost: refactor vhost scsi process_vq
Add scsi_blk_init function to replace the common
code of task initlization. The same to process_vq
function.

Change-Id: Ied0582ad7f087990c581e6e7aacde6ec201964dc
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1613
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-13 02:11:40 +00:00
Jacek Kalwas
55e0ec894f nvme: fix identify active ns
NVMe ctrlr init state machine shall be async whenever possible so it
is not blocking other code from processing. It can result in deadlock
when cmd producer and consumer are sharing the same thread.

This patch is making identify active ns async by introducing new
state to wait for completions.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: I346d35bab4733d3941e023602854fdd5b1ef23b5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1463
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: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI
2020-04-10 07:08:09 +00:00
Jacek Kalwas
842ae79aa6 nvme: refactor identify active ns
It is a prework for changes related to ctrlr init state machine.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
Change-Id: If289580f65ae27468b659a7ea07a4e4298876e77
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1489
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Community-CI: Broadcom CI
2020-04-10 07:08:09 +00:00
Changpeng Liu
2b5c47b198 nvme/opal: use the return value as the maximum ranges
Change-Id: Ifa7ce53cfbfa614defec1faa1c38f3f8105d2c74
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1666
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-10 07:07:52 +00:00
Changpeng Liu
76d8bbf3f8 nvme/opal: remove timeout
The timeout is designed for REVERT action, the REVERT needs
even several minutes based on different drives.  Due to the
REVERT is low level API, it does need a response from the drive,
even we returned the timeout to the user, the drive is still in
the REVERT state, and it can't be used anymore, so the timeout
here doesn't help anything, just remove it.

Change-Id: I8f5119630d52f40e5bacea8ef8f3c771ee001aeb
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1665
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-10 07:07:52 +00:00
Changpeng Liu
d5de4af2bc nvme/opal: concentrate security receive and status check in one function
Also rename them to security send/recv to reflect the fact.

Change-Id: Icdeb7f15849a9d1aacf5936c5954bb39875f4cd9
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1651
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-10 07:07:52 +00:00
Changpeng Liu
3add68e3d6 nvme/opal: remove opal_finalize_and_send()
Function opal_cmd_finalize() is OPAL command related, it's
part of the OPAL command construction, and opal_send_recv()
is low level security send/receive channel, so it's better
to use them separately.

Change-Id: I0648585726d5caa7b37a4bc6783bcb870c028bd2
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1650
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-10 07:07:52 +00:00
Changpeng Liu
ce25a45654 nvme/opal: allocate session instead of use the global one
Previously the OPAL library uses the global session which
is OK, because the drive can only support 1 session, for
now, we can change the code to use allocated session, this
can make the library to be used in asynchronous way.

Change-Id: Ie033f905bd41c1171b8222d59925dc25729df84e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1649
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-10 07:07:52 +00:00
Changpeng Liu
5b767e1787 nvme/opal: remove callback from opal_finalize_and_send()
The function inside opal_finalize_and_send() will be executed
synchronously, so remove the callback will make the code more
clear.  Also rename the completion function with "_done" suffix.

No code logic change from this patch.

Change-Id: I03c5875457e52009768410ad29a89730a7df1c8b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1648
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-10 07:07:52 +00:00
Darek Stojaczyk
23a7e4b94f env/pci: cleanup spdk_detach_rte by moving code
Change-Id: I1dee015e44ecfbd7fcb1680cce0e6d527d083c99
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1728
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>
2020-04-10 07:07:05 +00:00
Shuhei Matsumoto
99e4374f8d lib/thread: Add busy count for poller to increment only when some work was done
Currently run count of poller has been incremented per execution.
It will be helpful for us to know how poller is busy by adding busy
count which is incremented only when some work is done.

spdk_thread_poll() has used the same timestamp in it, and so this is
the maximum we can do for now.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I0adfbf9a62c959499978124ecc97d377c96c3769
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1713
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-09 13:44:14 +00:00
Shuhei Matsumoto
a12aae4c85 lib/thread: Add timeout to wait until exiting thread is exited
Set 5 seconds timeout to wait until exiting thread is exited into
spdk_thread_poll(). After the timeout, collect error log and then
move the thread to exited forcefully.

Add necessary unit test case accordingly.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ied8f58a2023a3bbe098530810fd3288bef93c3e7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1644
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2020-04-09 13:44:14 +00:00
Shuhei Matsumoto
e9aec6746a lib/thread: thread_poll() polls until the exiting thread is exited
Extract _spdk_thread_exit() from spdk_thread_exit() and
_spdk_thread_poll() calls _spdk_thread_exit() if the thread is in
the exiting state. spdk_thread_exit() changes to move the state to
the exiting state. The spdk_thread_poll() loop will end after the
thread moves to the exited state because the caller of
spdk_thread_poll() will check if the thread is in the exited state,
and break the loop if true.

If the user does not call spdk_thread_exit() explicitly, the reactor
has to terminate all existing threads at its shutdown. In this case,
multiple threads may have some dependency to release I/O channels or
unregister pollers. So the reactor has the large two loops, the first
loop calls spdk_thread_exit() on all threads, the second loop calls
spdk_thread_destroy() if exited or spdk_thread_poll() otherwise for
each thread until all threads are destroyed.

Besides, change the return value of spdk_thread_exit() to return
always 0. Keep it for ABI compatibility. Change ERRLOG to INFOLOG
for _spdk_thread_exit() because it is called repeatedly now. Remove
the check of I/O reference count from _spdk_thread_exit() because
_free_thread() cannot free I/O channel. Refine the unit test
accordingly.

Fixes issue #1288.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iee5fb984a96bfac53110fe991dd994ded31dffa4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1423
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-09 13:44:14 +00:00
Shuhei Matsumoto
6397735bc9 lib/thread: Introduce thread state to distinguish exiting and exited
Add enum spdk_thread_state made of RUNNING, EXITING, and EXITED, and
the current state to struct spdk_thread.

The state EXITING is not actually used in this patch yet.

Replace the flag exit simply by the state EXITED.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6e5dc7184d50ae6d00e6ba00f5e2cf6045e5d48d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1630
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>
2020-04-08 06:43:05 +00:00
Shuhei Matsumoto
719343c94a lib/thread: Change spdk_thread_exit() to nest wrapper function and function body
Change spdk_thread_exit() to nest a wrapper function, spdk_thread_exit()
and a static function made of function body. Include the check if the
state is running into the wrapper function.

These will make the following patches easier.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I81a57407acb772cd869819f2fac6665f61935369
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1642
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-08 06:43:05 +00:00
Shuhei Matsumoto
e7ead00b53 lib/thread: Wait until thread_is_exited() is true by thread_poll() after thread_exit()
Following patches will require thread termination so that thread_exit()
will move thread to exiting, thread_poll() will move thread from
exiting to exited, thread_is_exited() will detect the threadis exited,
and then call thread_destroy().

So change all places as a preparation.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I6b2e8aee5ed7cd160a88b4c9aaed7d90bd9dac07
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1640
Community-CI: Broadcom CI
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>
2020-04-08 06:43:05 +00:00
Shuhei Matsumoto
c9da0aecdc lib/thread: Ignore spdk_thread_exit() call after moving exited
Previously the caller had to check if thread is not exited when
it calls spdk_thread_exit().

Subsequent patches will change return type of spdk_thread_exit()
to void, and so include the check int spdk_thread_exit() in this
patch.

If spdk_thread_exit() is called when the thread is already exited,
collect INFOLOG and return normally.

This will make the next patch a little easier.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8b94261575e770485b33c0b37e76e770b77b417c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1639
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-08 06:43:05 +00:00
Shuhei Matsumoto
78accbf4e5 lib/event: Count reactor CPU stats (idle/busy tsc)
Following the idea of thread CPU stats, add reactor CPU stats.

Reactor CPU stats accumulates run time of spdk_thread_poll() calls
to idle TSC or busy TSC according to their return codes.

Add necessary unit tests.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I1a1391e79d74387c68f1651a61c8900e4c6faf66
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1501
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-08 06:43:05 +00:00
Ben Walker
49826b36cf iscsi: Properly size the receive buffer
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Id736c8a6d9a2cb8bd23017f61eeeccca8a882c03
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1636
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-08 06:42:55 +00:00
Ben Walker
0accbe8a37 nvme/tcp: Properly size the receive buffer
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I38e6e2f532597cb5e359879680edfc2172157c2f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1635
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-08 06:42:55 +00:00
Ben Walker
1621809e7e nvmf/tcp: Correctly size the socket receive buffer
The code used to do this but it was removed when the buffering was
shifted down to the posix layer. Add a way for users of sockets
to still properly size the buffers.

This also means that by default, the receive buffering is not enabled
on sockets. That matches the behavior of the previous release.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I20ce875be2efd841fe3a900047b4655a317d7799
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1560
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-08 06:42:55 +00:00
Ben Walker
ae6519e488 nvmf/tcp: Don't break out of poll loop based on number of PDUs
It's actually faster to process them until you run out of data.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I9e81babdb9bdc405a8dbf03b2f701fe50bcc70f6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1559
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2020-04-08 06:42:55 +00:00
Alexey Marchuk
24d61956ab nvme: Init the status object when tracking the req completion
Currently nvme_completion_poll_status object is allocated using
malloc, so it may cotnain some garbage. In some scenarious
nvme_completion_poll_cb can be triggered before we enter
spdk_nvme_wait_for_completion_*. In that case status object
will be freed by nvme_completion_poll_cb if it contains a
garbage in `timed_out` field. Later spdk_nvme_wait_for_completion
will work with already freed memory.
Fix - allocate nvme_completion_poll_status object using
calloc and explicitly zerofy it before usage

Fixes #1292

Change-Id: Iac39653a6cd102471de16e65814f0760bbeda7d9
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1373
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: <dongx.yi@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2020-04-07 08:38:58 +00:00
Seth Howell
b9a187977d nvme: add poll group handling to qpair path.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I9116cdcb5bbeb16ee74decee5586bda9a42090aa
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/633
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-07 08:38:40 +00:00
Seth Howell
c998c6c69e nvme: add API for qpair poll groups.
This API will allow us to simplify the polling mechanism for qpairs on a single
thread. It also will pave the way for doing transport specific aggregation of
qpair polling to increase performance.

The generic implementation is included. The transport specific calls
have yet to be implemented.

Change-Id: If07b4170b2be61e4690847c993ec3bde9560b0f0
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/579
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-07 08:38:40 +00:00
Seth Howell
5d9d52fd3c lib/nvme: add a disconnect_qpair public API.
Also modify some api documentation to indicate how the
new API should be used.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Icdbfb09aceda28635fdd191c520b36c692c2c100
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1340
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-07 08:38:40 +00:00
Seth Howell
7b4558e356 lib/nvme: add a new API function for connecting I/O qpairs
connect_io_qpair essentially allows us to split the qpair allocation process
in half which will make it possible for us to do more sophisticated things
with RDMA qpairs in poll groups. as a companion to this new API, a connect_only
option has been added to the io_qpair_opts struct which instructs alloc_io_qpair
to only allocate the qpair and not connect it.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I9ba9502dd39436006a9ac71436dd1871d648ed1c
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1123
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2020-04-07 08:38:40 +00:00
Tomasz Zawadzki
c7325e3fad lib/blob: assert that md_page is not extent page
Contidion previous to this should already verify that
md page is not an extent page.

All extent pages are not part of the chain (sequence_num == 0),
and their location (ctx->cur_page) cannot be the root of
md chain (page->id).

Yet during development it could appen, so adding assert
to verify further that the md page is not extent page.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I6d5dc2ae965f8f9a388cd1c8e186145f8ca91db4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1667
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>
2020-04-07 08:37:41 +00:00
Tomasz Zawadzki
955c58fa68 lib/blob: change replay of extent pages to batching
Before this patch reading out the extent pages during
blobstore replay was serialized. Only issuing reads for next
extent page when previous operation finished.

This was done by continously calling _spdk_bs_load_replay_extent_page_cpl()
and decreasing ctx->num_extent_pages.

This patch changes spdk_bs_sequence_* to spdk_bs_batch_*.
All the reads are submitted at once, and only when all of them
finish we proceed to next valid md chain.

Goal of this change is improving efficiency and readability.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I807cdb98166e04706fedb494363f5776e3151827
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1540
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>
2020-04-07 08:37:41 +00:00
Tomasz Zawadzki
22dc6254d6 lib/blob: add extent_pages to load ctx
This variable currently holds single extent page.

Further patch will utilize it to use multiple.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If86ffd57cecf5d3bfd0812a767c784d7bf503fb6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1538
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>
2020-04-07 08:37:41 +00:00
Tomasz Zawadzki
f03586b28a lib/blob: rename extent_pages to extent_page_num in load ctx
This field does not hold actual pages, but just md page numbers
which hold the extent pages.

Rename as prepartation to adding new one that will hold actual
extent pages.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1fb85a58c92a93b968e1fad22e421252399e9281
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1537
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>
2020-04-07 08:37:41 +00:00
Alexey Marchuk
14425544a6 nvme/rdma: Factor out memory key translation
Add function nvme_rdma_get_key to get either lkey
or rkey, use it in request building functions

Change-Id: Ic9e3429e07a10b2dddc133b553e437359532401d
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1462
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>
2020-04-06 07:49:48 +00:00
Alexey Marchuk
d2510a56f3 nvme/rdma: Simplify nvme_rdma_req_init
Cache payload type and in-capsule data transfer support

Change-Id: Id40a6e86d1f29235ca3e0189d7fbcf19baa30ffe
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1461
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>
2020-04-06 07:49:48 +00:00
Darek Stojaczyk
df9660df7b lib/event: fix printing non-null-terminated strings
%*s prints at least * characters and may add padding to the string.
%.*s prints at most * characters.

In a few places we used the first instead of the second and
printed some garbage to screen (in the best case...).

Change-Id: I97a862be61a5e43aa61e8230044dbd64a9db33bd
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1569
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>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-06 07:48:37 +00:00
Seth Howell
e71e81b631 sock: keep track of removed sockets during call to poll
We have been intermittently hitting the assert where
we check sock->cb_fn != NULL in spdk_sock_group_impl_poll_count.

The only way we could be hitting this specific error is if we
wereremoving a socket from a sock group within after receiving
an event for it.

Specifically, we are seeing this error on the NVMe-oF TCP target
which relies on posix sockets using epoll.

The man page for epoll states the following:

 If you use an event cache or store all the file descriptors
 returned from epoll_wait(2), then make sure to provide
 a  way  to  mark its closure dynamically (i.e., caused by
 a previous event's processing).  Suppose you receive 100 events
 from epoll_wait(2), and in event #47 a condition causes event
 #13 to be closed.  If you remove  the  structure  and close(2)
 the file descriptor for event #13, then your event cache might
 still say there are events waiting for that file descriptor
 causing confusion.

 One solution for this is to call, during the processing
 of  event  47,  epoll_ctl(EPOLL_CTL_DEL)  to  delete  file
 descriptor  13 and close(2), then mark its associated data
 structure as removed and link it to a cleanup list.  If
 you find another event for file descriptor 13 in your batch
 processing, you will discover the file descriptor  had
 been previously removed and there will be no confusion.

Since we do store all of the file descriptors returned from
epoll_wait, we need to implement the tracking mentioned above.

fixes issue #1294

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: Ib592ce19e3f0b691e3a825d02ebb42d7338e3ceb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1589
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: Aleksey Marchuk <alexeymar@mellanox.com>
2020-04-06 07:48:33 +00:00
yidong0635
20564d423b nvme/nvme_rdma: Reduced the code lines.
Here destruct contrllers are in one function, and we can
remove the duplicated codes using goto.

It can save several lines of codes.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: Ibf3cb9fe2ea4bfc65d42603a7b13aaf575854580
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1638
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2020-04-03 06:31:52 +00:00
Seth Howell
96250f5b3d make: add a map file for libspdk_accel.
Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I49f0011d0cdb22ae8830d71b3ba554f85f83892e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1400
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>
2020-04-03 06:31:46 +00:00
Michael Haeuptle
55df83ceb6 ENV_DPDK/VFIO: Increase PCI tear down timeout
When removing large number of devices (>8) in parallel,
the 20ms timeout is not long enough.

As part of spdk_detach_cb, DPDK calls into the VFIO driver
which may get delayed due to multiple hot removes being
processed by pciehp driver (pciehp IRQ thread function
is handling the actual removal of a device in paralle but
all of the IRQ thread function compete for a global mutex
increasing processing time and race conditions).

Signed-off-by: Michael Haeuptle <michael.haeuptle@hpe.com>
Change-Id: I470fbbee92dac9677082c873781efe41e2941cd5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1588
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>
2020-04-03 06:31:40 +00:00
Tomasz Zawadzki
eb341e7d32 lvol: do not refer to blob when create returned error
Recent improvements to blobstore code, allow proper
reporting whenever error occured.

Callback for blob_create, should not refer to the blob
pointer when the operation failed.
Defer checking spdk_blob_get_id(blob), til after checking
error code.

This has been encountered in "vhost_boot" test:
  15:20:54	# /var/jenkins/workspace/vhost-autotest/spdk/scripts/rpc.py -s /home/sys_sgci/vhost_test/vhost/0/rpc.sock bdev_lvol_create -u d605539d-2186-486f-bc3e-745e33d37072 lvb0 20000
vhost: blobstore.c:5101: spdk_blob_get_id: Assertion `blob != NULL' failed.

https://ci.spdk.io/results/autotest-per-patch/builds/8135/archive/vhost-autotest/build.log

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Id926576e10a72e0d50fb65105be07c8ae8e40096
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1604
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>
2020-04-02 07:03:35 +00:00