Commit Graph

10151 Commits

Author SHA1 Message Date
Darek Stojaczyk
606b453fcd vhost/nvme: fix error handling of session start
Session start callbacks have technically two ways
of returning an error code:
 a) as the callback return value, e.g. return -1
 b) via vhost_session_start_done(int rc)

The former doesn't have any effect as that return value
is not checked anywhere. It's only present because we
wanted to use the same function signature as for the
foreach_session() callbacks. It's going to be cleaned
up in subsequent patches, but before that happens we
have to fix vhost_nvme. With vhost_session_start_done(-1)
called, DPDK will terminate the entire socket connection.

Change-Id: Ib1eff17a67eef055b0dc89fa13d1fed2f8a1fbf0
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467230
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>
2019-10-09 02:28:17 +00:00
Darek Stojaczyk
81883ec5a7 vhost: factor out semaphore usage
We'll start using the same code in even more places soon,
so put in a function.

Change-Id: Iee2e091009b14e9d8b56ec8f0d4a86094f7c9727
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467229
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-09 02:28:17 +00:00
Darek Stojaczyk
2072d16e94 vhost: assign poll group in vhost_session_start_done
Threads were assigned to sessions inside
vhost_session_send_event() so far, but even the doxygen
comments say that sessions would be assigned to the thread
which called vhost_session_start_done(). Currently, Vhost
uses only vhost_session_send_event() to schedule starting
the session on some thread, so the code ends up working.
We're about to remove vhost_session_send_event(), so move
the thread (poll group) assignment to start_done().

While here, publish the vhost_poll_group struct definition
via vhost_internal.h. As a replacement for
vhost_session_send_event() we would like to use
spdk_thread_send_msg() which a requires a thread object -
one of the struct fields inside vhost_poll_group.

The code for starting a session could look as follows:

pg = vhost_get_poll_group(cpumask);
spdk_thread_send_msg(pg->thread, cb);
...
cb:
  // start_pollers
  vhost_session_start_done(0);

Change-Id: I563f61509674768c1dea0b03767e9f39a9fb0069
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467228
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: Vitaliy Mysak <vitaliy.mysak@intel.com>
2019-10-09 02:28:17 +00:00
Darek Stojaczyk
fa282f6cb9 vhost/scsi: don't clear svdev->poll_group
Don't unset svdev->poll_group when the last session is
stopped, just keep the old reference in there. When
a session is started, a new poll group will be picked
and svdev->poll_group will get overwritten anyway.

This is just a cleanup that aligns the code for
making vhost_session_send_event() asynchronous.

Change-Id: Ibf145603fd7525a65c4304b0bb1828dcbe2b52cf
Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467227
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2019-10-09 02:28:17 +00:00
Pawel Kaminski
5f6f7eddcc rpc: Rename add_vhost_nvme_ns to vhost_nvme_controller_add_ns
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Change-Id: I769271d0f8043ce4bdaf9a1c4799537e99e3876b
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470399
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
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-10-08 15:50:14 +00:00
Pawel Kaminski
ca731a6a55 rpc: Rename construct_vhost_nvme_controller to vhost_create_nvme_controller
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Change-Id: I3237352097cd78679ef95c519f970693a15c0c50
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470395
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-08 15:50:14 +00:00
Pawel Kaminski
119e911a0a test: Shellcheck - apply rule SC2178
Variable was used as an array but is now assigned a string.

Change-Id: I79e59d80be96657a9c2fc66f9d205458f9db67b2
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468366
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
2019-10-08 15:49:13 +00:00
Pawel Kaminski
7f0efebdf3 test: Shellcheck - apply rule SC2181
Check exit code directly with e.g. 'if mycmd;',
not indirectly with $?.

Rule disabled in test/pmem/common.sh as behaviour
may differ depends on bash version

Change-Id: Ied4c5dfb09e52c5db08becf1ad69a29a1bda426b
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468363
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: Maciej Wawryk <maciejx.wawryk@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
2019-10-08 15:49:13 +00:00
Ben Walker
418992173b sock/posix: Automatically set a reasonable sndbuf size
For new connections, just set the size to a good value for
storage automatically.

Change-Id: Ida2b21eac512a8a25ef70f486b43d5c47be16b63
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470510
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-08 15:48:29 +00:00
Ben Walker
7171d7d4e3 sock/posix: Call set_recvbuf internally
Instead of having two places in the code that do the
syscalls to set up the recvbuf size, just call the
function we already have.

Change-Id: I7d098fc7a39d0593c58fbe05b1f0b14f8b6a360d
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470509
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-08 15:48:29 +00:00
Ben Walker
8efa583f13 test: Add a mock for writev
This is useful for testing partial sends in the socket layer.

Change-Id: Ib5bb62d641ad8d6a23a662261f7c72f5ba55c813
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470520
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-08 15:48:29 +00:00
Konrad Sztyber
2872e958c2 examples/lsvmd: added debug switch
Added -d flag to lsvmd enabling debug logs from libvmd.

Change-Id: I1a9e87341b51082d815a25880f05b951a78e456b
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470647
Reviewed-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-08 15:47:34 +00:00
Shuhei Matsumoto
b422cee886 lib/iscsi: Move spdk_iscsi_send_nopin() up in the file
Move spdk_iscsi_send_nopin() up to the location just above
iscsi_op_nopout().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8792f838ac482d93ae347a355c7964f587e78daf
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470269
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>
2019-10-08 06:40:04 +00:00
Shuhei Matsumoto
e1a6f2b70d lib/iscsi: Move get_transfer_task() up in the file
Move get_transfer_task() up in the file closer to the location
of related functions.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I7ca7fff3e193367992d556d4cd28ef65efe55ef2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470268
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>
2019-10-08 06:40:04 +00:00
Shuhei Matsumoto
058b13081e lib/iscsi: Move get_scsi_task_from_itt/ttt() down in the file
Move get_scsi_task_from_ttt() and get_scsi_task_from_itt() down
in the file close to the location that uses them.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I5218eac3fda85e238d40eed7282d126ebe81c16b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470267
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>
2019-10-08 06:40:04 +00:00
Shuhei Matsumoto
c9e90fd05e lib/iscsi: Use not double pointer but reference to pointer in iscsi_op_login()
Double pointer is clever but reference to pointer is easier to understand
because it may be familiar and reference to pointer has been used
for alloc_len and cid in the same function.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I9b8f886bd99d3ab5b9c82c72a040816b398b308f
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470266
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>
2019-10-08 06:40:04 +00:00
Shuhei Matsumoto
d895ea6053 lib/iscsi: Remove unnecessary declaration of session related functions
Move session related functions, spdk_free_sess(), create_iscsi_sess(),
get_iscsi_sess_by_tsih(), and append_iscsi_sess() up in the file,
and them remove declaration of create_iscsi_sess() and append_iscsi_sess().

This makes the structure of the source code more top-down.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I30f948abc1630b82afbdca512089d950ec73df05
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470265
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>
2019-10-08 06:40:04 +00:00
Shuhei Matsumoto
828a077c7f lib/iscsi: Remove unnecessary declaration of iscsi_reject()
Remove declaration of iscsi_reject(), and move it up in the file.
This makes the structure of the source code more top-down.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4b812bf200bba86c58c84c504134bbe7afe1e967
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470264
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-10-08 06:40:04 +00:00
Shuhei Matsumoto
5dd0e54d7e lib/iscsi: Remove unnecessary declaration of remove_acked_pdu()
Remove unnecessary declaration of remove_acked_pdu(), and move it
down to just above the caller, spdk_iscsi_execute().

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I4af2c9707735669f3baac1fa6fee9bcaaa1cd64f
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470263
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-10-08 06:40:04 +00:00
Shuhei Matsumoto
28dda0c016 lib/iscsi: Remove unnecessary declaration of R2T related functions
Group iscsi_send_r2t(), iscsi_send_r2t_recovery(), and
iscsi_remove_r2t_pdu_from_snack_list() to the following ordering:
 iscsi_send_r2t()
 iscsi_remove_r2t_pdu_from_snack_list()
 iscsi_send_r2t_recovery(),

move the group to just above add_transfer_task(), and then
remove declaration of iscsi_send_r2t() and iscsi_send_r2t_recovery().

This makes the structure of the source code more top-down.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I473ba13a1ac656d4a4553c7e2ac8bae463a6d441
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470262
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-10-08 06:40:04 +00:00
Shuhei Matsumoto
fd6efc7f4a lib/iscsi: Remove unnecessary declarations about task queueing functions
We can remove unnecessary function declarations and make the
structure of the source code top-down.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I8d00c6cec0c0d05a6cd3b70e92062ce9c315ff3b
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470261
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-10-08 06:40:04 +00:00
Shuhei Matsumoto
d8fa5bc145 lib/iscsi: Remove unnecessary declaration about random functions
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ib590a62d400a3b0b47d8b9733010725637847446
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470260
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>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-10-08 06:40:04 +00:00
Ziye Yang
fd98a83ce7 nvmf/tcp: re-organize spdk_nvmf_tcp_req
Run the following command:
pahole ./app/nvmf_tgt/nvmf_tgt -R -C spdk_nvmf_tcp_req

It tells me change the bool definition location
of dif_insert_or_strip.

Change-Id: Ia43ab62bcc223a07e6415b2c769fe4af2b097f18
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470401
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>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2019-10-08 01:45:47 +00:00
Pawel Kaminski
36e04eb4ca rpc: Rename remove_vhost_scsi_target to vhost_scsi_controller_remove_target
Change-Id: If0abef6746f9dad9f146d4f6127dad65ac070620
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469760
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>
Reviewed-by: Maciej Wawryk <maciejx.wawryk@intel.com>
2019-10-07 15:08:18 +00:00
Pawel Kaminski
d4245df913 rpc: Rename add_vhost_scsi_lun to vhost_scsi_controller_add_target
Change-Id: I77334712524f454bb1f7270d5684053c7fd2e24c
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469759
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-10-07 15:08:18 +00:00
Pawel Kaminski
c7e05d839a rpc: Rename construct_vhost_scsi_controller
to vhost_create_scsi_controller

Change-Id: I17919e0808241954f5584b7fa74913b24d5635fa
Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469260
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>
2019-10-07 15:08:18 +00:00
Tomasz Zawadzki
074413c556 lib/blob: update buf and buf_sz when serializing extent_rle
Originally serializing extent_rle was always done as last step.
There was no need to update the buffer pointer,
since it went unused.

Next patches in series expand serialization to new descriptors,
so here the assumption is removed and buf/buf_sz is updated.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I7ccfb500d64e4276359cc98c5587c6301272d728
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468232
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>
2019-10-07 15:07:12 +00:00
Tomasz Zawadzki
be45e54a99 lib/blob: simplify return path in serializing extent_rle
This patch simplifies return path when returning from
serialization of extent_rle.

Both paths will share more code in upcoming patch.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ibb0ebcfe4377fe09709345d580d54050b61d3c88
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468231
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-10-07 15:07:12 +00:00
Tomasz Zawadzki
3e372f35c3 lib/blob: rename extents to extents_rle
In future patches new type of extents will be added,
for compatibility the current extent type will be still
handled in the code.

To signify the difference between those two types,
current type is renamed to SPDK_MD_DESCRIPTOR_TYPE_EXTENT_RLE.
Along with any variables throughout the code,
to make it clear which ones are used.

There are no functional changes in this patch.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I7186ccc452d200036188abf1dcea9660dcedee72
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/468230
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-10-07 15:07:12 +00:00
Tomasz Zawadzki
41f2d0e448 lib/blob: serialize extents in new function
This change moves the code related to serializing
extents into serparate function, in order to allow
more clear changes in further patches.

There are no functional changes in this patch.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: If8d7c90a5b01f1608d20fd00c3e4ff6a340ce305
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/466919
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-10-07 15:07:12 +00:00
Seth Howell
fcaabb48fa queue_extras: use SPDK_CONTAINEROF
A couple of the functions inside of the queue_extras file were relying
on an undefined __containerof function. Replace that with
SPDK_CONTAINEROF. Then add an extra check so that when someone includes
this file on FreeBSD, it doesn't throw compiler warnings for the
redefinitions (see our cpp headers test for example).

The argument order for both functions is the same, namely pointer, type,
member.

Change-Id: I1bd0497ee14df8b37f4de1046e271e5fe144ca82
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470191
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>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-10-07 15:06:01 +00:00
Seth Howell
584a630287 nvme: don't fail the ctrlr from ctrlr_process_init
If we are to have multiple reconnect attempts, we have to control
whetehr the controller is placed in the failed state from outside the
reset function itself. This will allow us to fail the controller only
after all of our retries are exhausted.

Change-Id: Ia82e10325272f25b2b8527336dc3bc507c93b401
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469932
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: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-10-07 15:05:00 +00:00
Seth Howell
f5d88e46e2 nvme: always set ctrlr->is_failed through API
Use the standard API function to fail the controller in all cases.

This patch, and the several following patches are aimed at creating a
mechanism for reporting up to the application layer that a controller is
failed and or removed. To do this, I use the reset_cb to inform the
upper layer that the controller is failed.
This also requires changes to how we handle a controller reset to
pave the way for doing optional reset retries in the libraries.

Change-Id: I06dfce08326c23472a1caa8f6efbac2fd1a720f2
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469635
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-10-07 15:05:00 +00:00
Seth Howell
2c68fef058 nvme: move queued request resubmit to generic layer
We were already passing up from each transport the number of completions
done during the transport specific call. So just use that return code
and batch all of the submissions together at one time in the generic
code.

This change and subsequent moves of code from the transport layer to the
genric layer are aimed at making reset handling at the generic NVMe
layer simpler.

Change-Id: I028aea86d76352363ffffe661deec2215bc9c450
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469757
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
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-10-07 15:05:00 +00:00
Seth Howell
afc9800b06 nvme: _nvme_qpair_submit_request does not requeue
This will be handled by nvme_qpair_submit_request when it receives
-EAGAIN from _nvme_qpair_submit_request.

Change-Id: I5e76aae170c981df0cadaadcd5da1163c715006f
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470407
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>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
2019-10-07 15:05:00 +00:00
Seth Howell
18dc53c531 nvme: move submit_request impl to a private function
This patch series is aimed at preserving the order of qpair entries
when resubmitting queued requests. The hope is that we will make the API
fool proof and future proof against ever reordering any queued requests.

Change-Id: Ib20d61d3abaed637c9c305b75081947630190fd4
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470062
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>
Reviewed-by: Alexey Marchuk <alexeymar@mellanox.com>
2019-10-07 15:05:00 +00:00
Maciej Wawryk
2fec3037b2 test: Shellcheck - include check SC2015
Remove from shellcheck excluded SC2015: Note that
A && B || C is not if-then-else. C may run when A is true.
This warning is not actually present in any of spdk/spdk scripts.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ie8ac6c83dc2d79a06e3b8ebb6ec8ebfec4fa7561
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470129
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-07 11:29:29 +00:00
Maciej Wawryk
a3f1ce1589 test: Shellcheck - correct rule: "Use '[:lower:]'"
Correct shellcheck rule SC2018: Use '[:lower:]' to support
accents and foreign alphabets.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: If11d20a36419366adafc19f173ebbec60b2bea77
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470109
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-07 11:29:29 +00:00
Maciej Wawryk
d32c76f4bf test: Shellcheck - correct rule: "Use '[:upper:]'"
Correct shellcheck rule SC2019: Use '[:upper:]' to support
accents and foreign alphabets.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I9fbaa22ee39d52d5d3a9397ad007b7df295b49b3
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469990
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Pawel Kaminski <pawelx.kaminski@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-07 11:29:29 +00:00
Maciej Wawryk
fdf6b04531 test: Shellcheck - correct rule: "unlike globs"
Correct shellcheck rule SC2022: Note that unlike globs,
o* here matches 'ooo' but not 'oscar'

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ie201a8401c5c501e1fff3d0eb71409163893768e
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469983
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-07 11:29:29 +00:00
Maciej Wawryk
e43d3e06f1 test: Shellcheck - include check SC2094
Remove from shellcheck excluded SC2094: Make sure not
to read and write the same file in the same pipeline.
This warning is not actually present in any of spdk/spdk scripts.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I3fba44d7dc677dbfb4a7964481a7f0661a733dcf
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469979
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2019-10-07 11:29:29 +00:00
Maciej Wawryk
0ac493f50a test: Shellcheck - ignore SC1090 and SC1091 warnings
Add to pernamently excluded in shellcheck:
	*SC1090: Can't follow non-constant source. Use a directive to specify location.
	*SC1091: Not following: (error message here)
We don't want to put commnets in lines where we refer to some sources.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ida7a8924901649d270ed5384677ee23f206da9f1
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469870
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: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-10-07 11:29:29 +00:00
Maciej Wawryk
6f442e5005 test: Shellcheck - correct rule "Remove surrounding $()"
Correct shellcheck rule SC2091: Remove surrounding $() to avoid executing output.

Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Ie172da21e478b1f06132506459f0edf080455b75
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469860
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: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-10-07 11:29:29 +00:00
Marcin Dziegielewski
1ee119ea8b test/ocf: new test remove.sh
This patch adds test that checks correctnes of delete_ocf_bdev rpc
command.

After delete_ocf_bdev command, all settings related to the removed
ocf instance should be cleared and this particular ocf instance should
not be loaded on next application start.

Signed-off-by: Marcin Dziegielewski <marcin.dziegielewski@intel.com>
Change-Id: Ifc61399d9f1ab7407f62b4a25e9bb1468f401880
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465674
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-10-07 11:24:19 +00:00
Marcin Dziegielewski
1ee2e81b30 lib/bdev/ocf: add possibility to remove ocf instance
In current code there is no possibility to remove ocf instance
permanently, even we call delete_ocf_bdev rpc command, on next examine
this instance will be loaded.

This patch introduces changes to delete_ocf_bdev rpc command. When we call
this command via rpc, core related to particular vbdev will be removed
from ocf cache before removing this cache instance. Thanks to that, on
next examine we will not detect this core in cache metadata and therefore
we will not create this instance on next load.

However, in any other situation, we will not touch metadata, so in case of
dirty shutdown/hot remove, on next load, we will recovery this instance.

Signed-off-by: Marcin Dziegielewski <marcin.dziegielewski@intel.com>
Change-Id: Iebef80989ea22ccea7f1b6ba4d734a40c1d5cc5d
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/465675
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>
Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
2019-10-07 11:24:19 +00:00
Tomasz Zawadzki
7ed0ec6832 lib/blob: removed unused idx variable from persist ctx
This variable went unused, since logic in
_spdk_blob_persist_write_page_chain() already dealt with
writing metadata from last to first page.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ic70c47df1ea3bb01c8031244339c42e9936f28b0
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467248
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-10-04 15:20:32 +00:00
Shuhei Matsumoto
04c9c3451f lib/iscsi: Re-check LUN hot plug after aborting SCSI Data-In tasks
LUN hot plug was not checked after aborting SCSI Data-In tasks.

This patch is for the Github issue #938.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I131f9944d71e5fdab53f3010072ea7ed5293158c
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469827
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-10-04 15:17:55 +00:00
Seth Howell
aff8f83bee test/blcokdev: don't print the output of fio.
The nightly tests have a high number of intermittent failures on the
crypto_autotest job at the point where the output of this command gets
printed. I believe that printing that output can cause the ssh
connection to drop.

Change-Id: I5cd510cf7921c7a07b9560a0e5d10a635fd1ac4f
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470089
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>
2019-10-04 15:16:49 +00:00
Wojciech Malikowski
3b2993d101 CHANGELOG.md: zone bdev interface update
Change-Id: I43a6943bb441fe7f75a7ecef08a8073f21a8a7d2
Signed-off-by: Wojciech Malikowski <wojciech.malikowski@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/469101
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>
2019-10-04 15:15:23 +00:00
Jim Harris
c2b3c18b5c mk/spdk.common.mk: remove -std=c++0x
This isn't really needed, and actually hinders
things like Seastar which use more recent C++
variants.

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

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/470079
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2019-10-03 23:02:05 +00:00