Commit Graph

9114 Commits

Author SHA1 Message Date
Yuriy Umanets
f48130c97e lib/env_dpdk: Fixed using rte_compress_isal
When using --with-dpdk=dpdk/install option, we need to check if the
librte_compress_isal was built in DPDK before adding it to the list
of libs. rte_compress_isal is not built by DPDK if libisal is not
installed in the system.

Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Iceb4ebb8cee81aa4254e0a878653c8a8dd50cac6
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11618
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-02 08:39:04 +00:00
Yuriy Umanets
f1980244c0 configure: Fixes with IPSec_mb used by DPDK
- In case that --with-dpdk=dpdk/install option is used, we need to link
  with the proper IPSec_mb libs the DPDK was built with rather than using
  the default location of IPSec_mb submodule located inside the SPDK dir.
- Check with pkg-config if we need to link with IPSec_mb. Find the proper
  IPSec_mb library path for DPDK specified with --with-dpdk=dpdk/install
  option.
- Use the same behavior for plain --with-dpdk.

Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Iea56d20d20556d63cb7ffb5ce2ca78f2244796e1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11617
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-02 08:39:04 +00:00
Yuriy Umanets
3e3fbf919f configure: Checking if libbsd is used by DPDK
- DPDK may or may not decide to use libbsd. SPDK needs to find this out
  and add -lbsd to the list of libraries to prevent linking issues in
  case that --with-dpdk=dpdk/install option is used.
- Use pkg-config for proper detection if the libbsd is in use.

Signed-off-by: Yuriy Umanets <yumanets@nvidia.com>
Change-Id: Ie3de0363fefb9b7337394b00adc862839834f164
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11616
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-03-02 08:39:04 +00:00
Rafal Stefanowski
c39647df83 bdev/ocf: Improve OCF mpools
- Reduce the size of initial memory needed by OCF.
  Number of allocator buffers equal to 16383 is tested to work
  on 24 caches running IO of io_size=512 and io_depth=512, which
  should be more than enough for any real life scenario.
  This reduces initial OCF memory usage from 726 MiB to 392 MiB.
- Fix string handling for the name of the mempool.

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Change-Id: I40063ab1897c479c25904ae4096c5dae3351f73b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10843
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-03-02 08:34:39 +00:00
John Levon
2089c410ca nvmf/vfio-user: support interrupt mode
To fully support interrupt mode for the vfio-user transport, we need to
arrange to wake up in one of two conditions:

 - we receive a vfio-user message on the socket

 - a client writes to one of our BARs

In response, we can process any pending vfio-user messages, as well as
poll the actual queue pairs.

As there is no way for a client-mapped BAR write to cause us to wake up,
interrupt mode can only work when mappable BAR0 is disabled. In that
case, each BAR write becomes a vfio-user message, and can thus be
handled by registering the libvfio-user socket fd with SPDK.

For the poll group poller, we enable interrupt mode for it during the
vfio-user ->poll_group_create() callback; this only works in the case
that no other transports without interrupt mode support are sharing that
poll group.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Ic784d01078b2006edb27892fc0613f934eca930b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10722
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>
Community-CI: Mellanox Build Bot
2022-03-02 08:34:23 +00:00
Tomasz Zawadzki
b514849ca1 lib/vhost: move vhost_user init thread tracking
Keep track of g_vhost_user_init_thread, local to the
rte_vhost_user.c.

There is no need to track this in generic vhost layer.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I1fd22e196a3091284f5f9c3c0c7c70a0e18514cb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11075
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-03-02 08:29:52 +00:00
Tomasz Zawadzki
d7cd645c9f lib/vhost: move rest of vsession managment to rte_vhost_user
Remaining functions that manage or interact with vsessions
are now placed in rte_vhost_user.
Renamed the functions appropriately with vhost_user_* prefix.

While here g_dpdk_sem was made static, since rest of references
from vhost.c was removed.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: Ie9fbf5f08910c136711fb1dfab1b35a5488f0c25

Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11025
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-03-02 08:29:52 +00:00
Tomasz Zawadzki
8ca52b6d7c lib/vhost: move changing vsession interrupt_mode to rte_vhost_user
This functionality is specific for rte_vhost,
so move it to appropriate file.
Renamed to include vhost_user_* prefix.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I9630902f52d4944d0d18a39dfbff05945ce2bdba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11024
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-03-02 08:29:52 +00:00
Tomasz Zawadzki
c0b0cfb9f4 lib/vhost: move vhost_device_ops functions to rte_vhost_user
Functions defined by set of callbacks in vhost_device_ops,
are going to be only used by rte_vhost.
This patch moves those functions into the file, removing them
from vhost.c

g_vhost_user_dev_dirname and _stop_session() are no longer
referenced from vhost.c, so can be removed from vhost_internal.h.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I233206fae3ad5b4549172ac4bd2b036df9ac548b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11023
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-03-02 08:29:52 +00:00
Yifan Bian
27470646c5 nvmf/fc: call free() to the object allocated by calloc()
Change-Id: I694ea9d6e031f96ebe5498a0080d7a741454e227
Signed-off-by: Yifan Bian <yifan.bian@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11751
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-02-28 11:08:16 +00:00
Jim Harris
12d522515f nvme: simplify spdk_nvme_transport_id_populate_trstring
Note that this also works around a false positive in
gcc-11 of type -Wstringop-overread.

Fixes issue #2391.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ib5301b9ef9fa3ead2a1a2318655533a8cfba03fe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11709
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-02-28 11:07:05 +00:00
Jim Harris
fd0f154f47 nvmf: add discovery subsystem entries to discovery log page
When generating the discovery log page, add entries for
the discovery subsystem, skipping the listener associated
with the command generating the log page.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Id6a14a7d5cdce483f8f3c2eff1b4ededd40bc029
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11542
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-02-28 11:06:16 +00:00
Jim Harris
25bc221cee nvmf: deprecate automatic discovery listener
Currently we accept connections to the discovery
subsystem on any listener that has been added to
any subsystem (not just the discovery subsystem).

This is not proper behavior, especially for TCP.  TCP
defines port 8009 (not 4420) as the discovery port,
so the current behavior means that if NVM subsystems
are listening on port 4420, then the discovery
subsystem by default is listening there too.

For now, continue to allow connections, but print
a warning message when someone connects to the
discovery subsystem on a listener trid that wasn't
previously added.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I734bc49d1a21b2edfb675aef4b8551e2d0ccd4d7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11539
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-02-28 11:06:16 +00:00
Evgeniy Kochetov
5c80b1e5ab nvme/rdma: Limit max_sges by command capsule size
According to NVMe over Fabrics spec number of SGLs supported by the
controller is reported in MSDBD. But it is also implicitly limited by
command capsule size (IOCCSZ) since SGL are passed in capsule.

This patch adjusts max_sges to capsule size if required. Adjustment to
MSDBD is also moved to transport layer because it is fabrics specific
parameter and is not valid for PCIe transport.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I44918eb949345c61242ca50a524d21d04b6ac058
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11669
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-02-25 08:18:32 +00:00
Dong Yi
742d818e29 blobstore: Defer to memcpy after all xattr mallocs are finished.
This confirms that the error path can return more efficient
without memcpy such as xattr->name.

Signed-off-by: Dong Yi <dongx.yi@intel.com>
Change-Id: Ic2ed28121ed76eda9d7b24ed6c4c95b0588817de
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11654
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-02-25 08:18:17 +00:00
Rui Chang
0270fc322f nvmf/vfio-user: Fix abort request bug
One simple fix for nvmf_vfio_user_qpair_abort_request().
Current implementation mixed up request of abort cmd and the request
to abort, which cause problems.

Signed-off-by: Rui Chang <rui.chang@arm.com>
Change-Id: Ia0db9aa738e372789fc502ef877fd1c841c0a2e3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11711
Reviewed-by: John Levon <levon@movementarian.org>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-02-25 08:17:45 +00:00
Shuhei Matsumoto
7594030409 nvme: Set dnr to zero for abort_reqs() including a fix of degradation
The patch

nvme: Set dnr to zero for nvme_qpair_abort_reqs()
1b3172f726

did the change stated in the title.

However,

Revert "nvme/rdma: Correct qpair disconnect process"
c8f986c7ee

destroyed it for RDMA transport.

Additionally, we had still set DNR to 1 in nvme_qpair_init().

This patch fixes both.

Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: Iee60ac24aa7e04cce0f394014c9d9afc9d2b56ec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11644
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-02-24 14:56:03 +00:00
Weiguo Li
e685574f76 iscsi: fix a memory leak in error handling
When function returned from the error handling the mempool on
'sess' was not released which lead to a memory leak.

Fixes issue #2393.

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Change-Id: Ida3651e9369fb5c4948969480d398a723b2cb6a2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11714
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2022-02-24 14:55:16 +00:00
Weiguo Li
30af49f77d nvmf: avoid a null dereference before null check
We do the null check for 'fc_req', but already dereferenced it
before the check. Swap their position to avoid null dereference.

Fixes issue #2395.

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Change-Id: I33b9e6b51b54f6ada9c072cf7ab0acda2622472f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11721
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2022-02-24 08:31:28 +00:00
John Levon
5f27092835 thread: add spdk_thread_exec_msg()
A common pattern is:

	if (foo->thread == spdk_get_thread())
		cb(arg);
	else
		spdk_thread_send_msg(foo->thread, cb, arg);

for cases where it's important the callback runs on a particular thread,
but it doesn't matter if it's synchronous or asynchronous.

Add a new API to support this pattern, and convert over the current
instances.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Idfbf77c02c9321c52e07181ffd8b0c437e1ab335
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11503
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-02-23 10:06:49 +00:00
John Levon
594a3a8ec7 nvmf/vfio-user: add interrupt mode support to accept poller
We can ask libvfio-user for the listening socket fd, and register that
for SPDK interrupt handling.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: I8d0ba7a86403f2d0170b9359480f1fefc1036557
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10721
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-02-23 10:05:15 +00:00
John Levon
8a1ad5a20f nvmf/vfio-user: correct accept poller lifetime
The accept poller only needs to run when vfu_attach_ctx() makes sense:
in other words, when we don't have a controller created.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Icef4e6184c9ae6d7951d015530a05132c4ba6994
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10720
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-02-23 10:05:15 +00:00
John Levon
e334bba989 nvmf/vfio-user: make accept poller per-endpoint
Now vfio-user owns its the accept poller itself, there's no reason to
loop across all endpoints: instead, the lifetime of the accept poller is
better matched by creating it in the ->listen() transport callback.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Ia92e29b1cee263f1461f640cfdd27cdb674848fb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10719
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
2022-02-23 10:05:15 +00:00
John Levon
5e37316308 nvmf: pass poll group to transport during create
For the benefit of forthcoming vfio-user changes, register the poll
group poller prior to calling the transport create callback, and pass in
a pointer to the poll group itself.

Signed-off-by: John Levon <john.levon@nutanix.com>
Change-Id: Idbc24126c9d46f8162e4ded07c5a0ecf074fc7dd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10718
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
2022-02-23 10:05:15 +00:00
Dong Yi
be74ac158c event/app_rpc: Fix segmenation fault for scheduler is NULL.
Json writes this scheduler name using pointer, but it sometimes be null.
This case it exists, so add check for it.

Fixes issue #2384

Signed-off-by: Dong Yi <dongx.yi@intel.com>
Change-Id: I7c989c72cfbd53ea6b02d86457b29440484e5a37
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11677
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-02-23 02:34:41 +00:00
Changpeng Liu
945a2e7b76 nvmf/vfio-user: restore queue pair state and CQ reference count in destination VM
The above values were added with shared CQ feature, and they
are left when restore the CQs in destination VM.

Change-Id: Ib1f28dad833da31e571eb2e2f0b5c81f0bf05a3b
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11419
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-02-21 01:48:02 +00:00
Changpeng Liu
903dd88c22 nvmf/vfio-user: save/restore CSTS register when doing live migration
The CSTS register in source VM was left to migrate.

Fix #2362.

Change-Id: Ieef028578d2897b27a6ff594b16801462eb1b75e
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11418
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-02-21 01:48:02 +00:00
Jim Harris
c833f6aa3e env_dpdk: unlink hugepages if shm_id is not specified
The only release to not unlink hugepages after mmaping
them is for multiprocess.  But if shm_id is not
specified, then we aren't using multiprocess.  This
ensures that all hugepages get released when the
process exits, even if there is memory in those
hugepages that was not freed during process shutdown.

Make sure we don't enable both huge-unlink and
single-file-segments at the same time though, DPDK doesn't
support that.

Note that even when using multi-process, if hugepages
aren't released, they aren't really leaked.  DPDK will
clean them up next time the application runs.

Fixes issue #2267.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I017bd4f7ed9cf6aaa141879539b099fb48f357f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10991
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-02-18 14:56:54 +00:00
Jim Harris
5d68b11865 bdev: move parts of _bdev_io_unset_bounce_buf()
Move some of this code into separate functions.  There
is no change in functionality here - this just helps
reduce the size and complexity of an upcoming patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I72243f17312e66bb6ef2168b9b78076c9eb2e6f3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11531
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-02-18 14:54:22 +00:00
Jim Harris
a91b4367ea bdev: move _bdev_io_set_bounce_buf
This helps reduce the size of a future patch.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If5dc2607c91ccb172ee5a27d0a85a7cf6bf3d423
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11530
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-02-18 14:54:22 +00:00
Chunsong Feng
4f36a2a66b nvme/rdma: clear dif_enable when rdma_req is free
The dif_enable is not cleared in _nvmf_rdma_request_free. When the
rdma_req is used again, the dif_enable is true while
dif.dif_ctx->block_size is zero. As a result, an infinite loop occurs in
nvmf_rdma_fill_wr_sgl.

Fix issue: #2380

Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
Change-Id: Ic179855f7b257e39ed4a5f6705fbc9dea64210ae
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11646
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
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>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2022-02-17 23:07:57 +00:00
Weiguo Li
8be59045ea thread: fix double unlock in spdk_io_device_register
Since there is a pthread_mutex_unlock() in normal condition, another
pthread_mutex_unlock() in the "tmp != NULL" branch should be removed,
otherwise will cause a double unlock.

Fixes issue #2378.

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
Change-Id: I6c80a9527dd60e0b7c1d3c54b6da371b31118f02
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11642
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
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>
2022-02-17 17:10:31 +00:00
Mike Gerdts
d0149da224 blob: remove unused inline functions
bs_back_dev_lba_to_io_unit() and bs_num_pages_to_cluster_boundary() are
unused inline functions. The last consumer (by the earlier _spdk_* name)
was removed in commit 6609b776.

Change-Id: Ib1babfed8002fb44451b337aa0db66c15a6805d2
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11561
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: Aleksey Marchuk <alexeymar@mellanox.com>
2022-02-17 17:08:37 +00:00
Mike Gerdts
6c8dc25e13 blob: remove unused bs_sequence_to_batch_completion
bs_sequence_to_batch_completion has been unused since the removal of
other unused code in commit ba870c2e99.

Change-Id: Ifb60c65c1c68d1855b49eda4c57d99e983bca5ec
Signed-off-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11560
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: Aleksey Marchuk <alexeymar@mellanox.com>
2022-02-17 17:08:37 +00:00
Jim Harris
662678dfbe env_dpdk: link dmadev if CONFIG_VHOST=y
rte_dmadev was introduced in DPDK 21.11, and rte_vhost
is now dependent on it. So link rte_dmadev if we find
it and if CONFIG_VHOST is enabled.

Fixes issue #2374.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Iccbf7cb897f51cbc9d545274d4d00a442b2fd353
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11594
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
2022-02-16 11:54:18 +00:00
Jim Harris
0badf81e62 bdev: remove deprecated spdk_bdev_module_finish_done()
For reference, this was deprecated in Aug 2020, commit
ID 511fe1553.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ic0a16af9113b8b136271a2ce6a071bbc379261c4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11545
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-02-15 14:38:37 +00:00
Jim Harris
e8fdde5235 nvmf: remove deprecated max_qpairs_per_ctrlr parameter
This was a parameter on the nvmf_create_transport
RPC, and was replaced with max_io_qpairs_per_ctrlr to
reduce confusion on whether this number included the
admin queue or not.

nvmf_vhost test was using this deprecated parameter.
Change it to use -m (max_io_qpairs_per_ctrlr)
instead. '-p 4' would have been evaluated as 1 admin
queue + 3 I/O queues, but it's likely the intent
was for 4 I/O queues.  This is a perfect example of
why this parameter was deprecated.

For reference, this was deprecated in June 2020,
commit 1551197db.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I4364fc0a76c9993b376932b6eea243d7cefca9cd
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11543
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-02-15 14:38:37 +00:00
zhaoshushu.zss
6488a63fbc bdev/trace: add LBA info for each bdev trace record
To supplement useful information in bdev trace record,
offset and len of each I/O have been added.

Signed-off-by: zhaoshushu.zss <zhaoshushu.zss@alibaba-inc.com>
Change-Id: I3e776144d16cb9eda2a9fb72b83d423ac3050f0d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11504
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
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>
2022-02-15 00:26:20 +00:00
Jim Harris
635d0cbe75 nvme: allocate extra request for fabrics connect
With async connect, we need to avoid the case
where the initiator is sending the icreq, and
meanwhile the application submits enough I/O
such that the request objects are exhausted, leaving
none for the FABRICS/CONNECT command that we need
to send after the icreq is done.

So allocate an extra request, and then use it
when sending the FABRICS/CONNECT command, rather
than trying to pull one from the qpair's STAILQ.

Fixes issue #2371.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If42a3fbb3fd9d863ee48cf5cae75a9ba1754c349
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11515
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-02-14 15:29:39 +00:00
Jim Harris
a97200ad45 nvme: optimize struct spdk_nvme_qpair packing
Group fields such that those not used in the I/O path
are at the end of the structure.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I43eca1faacd29a5bf34be6ee644191d865cd42a9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11514
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-02-14 15:29:39 +00:00
Jim Harris
56618eacb9 nvme: add NVME_INIT_REQUEST macro
This macro will be used in an upcoming patch
that needs to construct an nvme_request structure
outside of the standard nvme_allocate() routines.

Examined x86 optimized assembly with this patch,
and there is no change.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I0f6b8500e06b56edc33f437f351536cf857d13d3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11513
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-02-14 15:29:39 +00:00
Alexey Marchuk
9cd85928e5 bdev: Factor out spdk_bdev_io_complete
Split part of IO completion into 2 functions.
This patch reduces changes in the next patch
which will reuse some part of spdk_bdev_io_complete

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Iaeac81aa5208b4ca303f60410b6a54f8df13b069
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11519
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-02-11 17:03:31 +00:00
Alexey Marchuk
52d1cb5003 bdev: Factor out md initialization with bounce buffer
Move part of function _bdev_io_set_buf which sets
metadata pointer to another function _bdev_io_set_md_buf
Next patches will make copying of bounce buffer async,
metadata will be copied when data copy completes.
This patch makes next change simpler

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Iced45393f43f9c5a4818e4e9eadb3351583e0c00
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11518
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-02-11 17:03:31 +00:00
paul luse
0ae7f4d816 idxd: zero out batch element descriptors before each use
Although there are no use cases right now where a batch can have
mixed op types, there may be in the future and rather than have
one blow up because ops have different reserved fields and its
not valid to submit an op with a non-zero reserved field, go
ahead and zero these out like we do with descriptors in the non
batch case.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I6d1bb416dc84aa1f76407c76aedf0768dd003218
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11325
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-02-10 22:50:47 +00:00
paul luse
7aa1650d28 idxd: minor one LOC cleanup
We always set num_batches to the same value we set num_descriptors
so just make it explicit. Makes it easier to experiment with
different values when performance testing.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I648262001772c791a032d6cab38dc3b03c1d55c1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11354
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-02-10 22:50:47 +00:00
Changpeng Liu
847139f621 util/dif: check metadata buffer in spdk_dix_verify()
Fix issue #2354.

Change-Id: Idcbd6f02b215699929edd333870cfdc19a22bbbe
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11425
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-02-10 22:41:26 +00:00
Ben Walker
3bacd6653d idxd: No longer set token configuration
This has changed to control the number of read buffers allocated to the
group, but it is only valid to set this register if the device has
indicated it supports it. Further, the default value is what we want
anyway, so we can skip setting it altogether.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ic54672ea6cb16acc7613860e36d9f7033048bd98
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11484
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2022-02-10 22:41:12 +00:00
Ben Walker
8c400e494a idxd: Remove unused nop_check callback
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ibda86694edc10a3edec8cb85638b4950647b13eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11435
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-02-10 22:41:12 +00:00
Ben Walker
dbdd27ff47 idxd: Rename idxd_cmdsts_reg to idxd_cmdsts_register
All of the other structs and unions spell out register, so match the
style.

Change-Id: Ie502e80206305037d1518a1db590d89b7479abb4
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11433
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2022-02-10 22:41:12 +00:00
Ben Walker
4ac05e3abc idxd: Rename idxd_genstatus_register to idxd_gensts_register
This is called GENSTS in the spec, so match that name.

Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: I0e8f917e13908f3920ab297e14cb3adee856eaa5
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11432
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-02-10 22:41:12 +00:00