Commit Graph

15870 Commits

Author SHA1 Message Date
Alexey Marchuk
8b21208129 bdev_nvme: Use new extended API
The new API is used if bdev ext_opts is not NULL.

Change-Id: I414b5d19bff54114d6708efed89ba19b5955f56a
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6271
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: Ziye Yang <ziye.yang@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-08-20 07:26:10 +00:00
Alexey Marchuk
ac6f2bdd8d bdev: Add extended versions of readv/writev
New functions accept extendable structure of IO options

Change-Id: If6864df151a3c0ad722785cb26d1f5d4309cd733
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6269
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: Ziye Yang <ziye.yang@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-08-20 07:26:10 +00:00
Alexey Marchuk
c3a5848966 bdev: Add API to get SPDK memory domains used by bdev
Change-Id: Ic9f42eff59bdc4c8c6e73deb76b3eecfc04f80a8
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6268
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-20 07:26:10 +00:00
Alexey Marchuk
110335f192 nvme: Add functions spdk_nvme_ns_cmd_readv/writev_ext
These functions accept extendable structure with IO request options.
The options structure contains a memory domain that can be used to
translate or fetch data, metadata pointer and end-to-end data
protection parameters

Change-Id: I65bfba279904e77539348520c3dfac7aadbe80d9
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6270
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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-20 07:26:10 +00:00
Alexey Marchuk
a422d8b06f nvme: Add API to get SPDK memory domain per nvme controller
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I6db64c7075b1337b1489b2716fc686a6bed595e3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7239
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-20 07:26:10 +00:00
Alexey Marchuk
d06b6097e3 nvme/rdma: Create memory domain per Protection Domain
Add a global list of memory domains with reference counter.
Memory domains are used by NVME RDMA qpairs.

Also refactor ibv_resize_cq in nvme_rdma_ut.c to stub

Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: Ie58b7e99fcb2c57c967f5dee0417e74845d9e2d1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8127
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-20 07:26:10 +00:00
Alexey Marchuk
4e52791092 dma: Introduce memory domain
Memory domain is used to describe memory which belongs to
another address space (e.g. GPU memory or host memory)
Memory domain can be configured with callbacks to translate
data to another memory domain and to fetch data to
local buffers.

Memory domains will be used in extended
bdev/nvme API added in the following patches.

Change-Id: I0dcc7108a4fbf416a11575aa5cf5d7ec501b3d8b
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8126
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-20 07:26:10 +00:00
Maciej Wawryk
6792ae70f1 scripts/pkgdep: add ruby-devel to INSTALL_DEV_TOOLS
Signed-off-by: Maciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: I367b42a84f3af4ca456ea8c2e1263a05a92bbae7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9145
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-08-19 11:24:07 +00:00
Changpeng Liu
e337be4990 libvfio-user: update submodule
This fix issue #2092.

Change-Id: I3192055e2ff9d37b06397e5d7b47a7b7daa0a891
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9207
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-19 07:17:57 +00:00
Konrad Sztyber
5b2e9b229c nvme: move aborted requests to a separate queue before completion
This avoids an infite loop when user sends and then immediately aborts
all requests while the transport cannot submit them (returning -EAGAIN).
It might happen in two cases: 1) if the transport doesn't have any free
requests or 2) if the qpair is still in the NVME_QPAIR_CONNECTING state.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ia1d0b7c93f387524be0ad39597ec49851e1d3af7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8711
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-18 08:13:39 +00:00
Jim Harris
f02e2328ae nvme: save icreq_timeout in tcp qpair
Needed to make this code path asynchronous.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I6b18d4e9fc1a29b30c78f7f087b80913d00f9726
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8598
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
2021-08-18 08:13:39 +00:00
Konrad Sztyber
3ada37faa3 nvme: use poll_group_process_completions in connect_qpair
If a qpair is part of a poll group and it's not configured in the async
mode, it should be using poll group's process_completions variant.

Additionally, connecting qpairs to the poll group was moved up, so that
qpairs are already on the connected qpairs queue when waiting for the
connection to complete.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I08f75bd61a566d1ab60029b6202d9337df75733f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9074
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Monica Kenguva <monica.kenguva@intel.com>
2021-08-18 08:13:39 +00:00
Konrad Sztyber
98b483a35e nvme/rdma: use timeout when destroying qpairs
Replaced poll cycle count with a timeout when destroying a qpair that is
part of a poll group.  Tracking the time instead of a poll count is more
stable, as the number of poll cycles can vary based on the application's
behavior when destroying a qpair.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I7445bc1b411f2905aab7bf3dc7b2d3344712e1eb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9200
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-18 08:11:51 +00:00
Tomasz Zawadzki
b556e43e92 bdev/lvol: add lvol_bdev structure on top of spdk_bdev
Added struct lvol_bdev wrapping around spdk_bdev.
This will help with passing around any context.
For this patch only spdk_lvol is still used.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I23f5be5edda526ad607ea8b45274c945a42d90db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9147
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: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2021-08-17 08:54:40 +00:00
Tomasz Zawadzki
08137e52e9 bdev/lvol: consolidate checking for open lvols on lvs
Same iterator was used in two places already, and new one
will be added in next patch.

Replaced _SAFE variant since entries cannot be removed
while iterating in this loop.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5ee911a5b653cfbdf0b4a39d283bd5eee66c49d8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9092
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-17 08:54:40 +00:00
Jim Harris
92e75dfc28 build: remove lib/.gitignore
This isn't required - we already have the whole build/
directory in the top level .gitignore.

When we remove build/lib/.gitignore, it means
build/lib directory must be created somewhere
before we try to place a library there. Top-level
builds get this directory created automatically,
but building directly from a sub-directory's
Makefile means we need to explicitly create
build/lib.  So add a mkdir -p to the LIB_C
macro to do exactly that to cover these cases.

Also simplify 'make clean' at the top level Makefile.
A lot of work went in there to work around this
.gitignore file that's not needed now that we've
fixed the underlying problem by getting rid of
it.

Suggested-by: John Levon <john.levon@nutanix.com>
Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ibb92ff84d8c2a9bbe3e193c84f15ef3866f07b1f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9169
Reviewed-by: Nick Connolly <nick.connolly@mayadata.io>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@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>
2021-08-17 08:54:30 +00:00
Jim Harris
9ef1a55d0a build: don't put out-of-tree ocf build in build/ dir
When we are testing out-of-tree ocf builds, don't
put the resulting binary in the build directory.
An upcoming patch will enable 'make clean' to just
remove the entire build/ directory, which would
then include this ocf.a binary.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I74040fc414a5009faffaeada7fd76842b8cad38e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9170
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-08-17 08:54:30 +00:00
Evgeniy Kochetov
076d14ce4b nvme/ctrlr: Allocate ANA log page only for active namespaces
Number of active namespaces may change. So, on ANA log page update we
should check if buffer has to be resized.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I1720317ea7f59e5afef73d5c4bd1cd69a7dd6520
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8583
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: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
2021-08-16 08:48:58 +00:00
Evgeniy Kochetov
a8ee010e13 nvme/ctrlr: Add ANA log page allocation helper function
This will simplify subsequent patches.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I2fc78c8bfec7270d6036f2c9ea9e0cf715fc9c7d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9178
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 <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-08-16 08:48:58 +00:00
Evgeniy Kochetov
49e433f8ed nvme/ctrlr: Allocate non-DMA memory for ANA log page
Log page reading function 'spdk_nvme_ctrlr_cmd_get_log_page' does read
into intermediate buffer and then copy to user provided buffer. So,
there is no need for user buffer to allow DMA.

Signed-off-by: Evgeniy Kochetov <evgeniik@nvidia.com>
Change-Id: I7337afa99c3ae666cc43ea2a48317de875334cfc
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9177
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 <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
2021-08-16 08:48:58 +00:00
Ziye Yang
c260537919 accel_perf: check accel engine usage in accel_perf_start function.
In accel_done function, we use g_using_sw_engine to
determine to directly call _accel_done or use thread message
passing way.

However when we get the capability and determine the
value of g_using_sw_engine in mulitple cases. We do not
protect the value of g_num_workers. Then if we use CPU mode
to do test, g_using_sw_engine will not set to be false
in racing condition. Since the value of g_num_workers can be
> 1 when we do the check, i.e., it is a TOC2TOU issue.

The solution is that we check the g_using_sw_engine in
accel_perf_start function.

Fixes issue #2084

Change-Id: I55c18e0443120adb698d5bd27d4522df09f6dcab
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9151
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: Ben Walker <benjamin.walker@intel.com>
2021-08-16 08:48:43 +00:00
Alexey Marchuk
6479ddb358 compress: Add RPC option to enable mlx5_pci PMD
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Change-Id: I31efa2f9dd1aafdb87904083e56d693a699af526
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8781
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: Jim Harris <james.r.harris@intel.com>
2021-08-16 08:48:31 +00:00
Alexey Marchuk
e269bf4e84 mk: Enable build of mlx5_pci compress PMD
This PMD is availabe for BlueField2 DPU.
It requires libmlx5, so configure file is
updated to check if this library exists

Change-Id: Ic0cfbfdf24af393381667435009fb6afc49d9181
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8780
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: Jim Harris <james.r.harris@intel.com>
2021-08-16 08:48:31 +00:00
Konrad Sztyber
5263f0a12f nvme: extract qpair connect fail to a seprate function
In the next patch, the qpair is polled from a poll group and needs a
disconnect callback, which should also fail the qpair, so it makes sense
to have a separate function doing that.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ied76431520962b25220027be829a4609afb6bbda
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9157
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-13 07:27:07 +00:00
Monica Kenguva
771f65bb1f nvme: asynchronous create io qpair
async_mode option is currently supported in PCIe transport layer
to create io qpair asynchronously. User polls the io_qpair for
completions, after create cq and sq completes in order, pqpair
is set to READY state. I/O submitted before the qpair is ready
is queued internally. Currently other transports only support
synchronous io qpair creation.

Signed-off-by: Monica Kenguva <monica.kenguva@intel.com>
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Change-Id: Ib2f9043872bd5602274e2508cf1fe9ff4211cabb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8911
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-13 07:27:07 +00:00
Tomasz Zawadzki
a7b15178c2 lib/event: do not set interrupt mode when eventfd is not supported
spdk_reactor_set_interrupt_mode() writes/reads from fds created during
reactor_interrupt_init(). Since spdk_fd_group_create() depends
on eventfd, this will not work for systems that do not have it.

reactor_interrupt_init() handled lack of support for eventfd correctly,
while spdk_reactor_set_interrupt_mode() did not check for it.

Reported-by: Nick Connolly <nick.connolly@mayadata.io>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I5181d436636c55cca3a06b1947e944502a9204ce
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9131
Reviewed-by: Nick Connolly <nick.connolly@mayadata.io>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@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>
2021-08-13 07:21:33 +00:00
Michal Berger
4f99de088e test/nvmf: Wait for net devices after they are moved from extra netns
Fixes #2072

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: Iab6f1109cb4f3b31b3df62bb9ba678336c8b2502
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9168
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-13 07:20:50 +00:00
ChengqiangMeng
a2838de9dc unittest/nvmf_tcp: Test for nvmf_tcp_icreq_handle
Signed-off-by: ChengqiangMeng <chengqiangx.meng@intel.com>
Change-Id: I068c7917a567e588d0f35e525eb58ed3aaf17fcb
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8936
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>
2021-08-13 07:15:45 +00:00
Ziye Yang
fc9a264595 uring: Not enable zero copy if fd is opened on a loopback device.
In order to not affect the loopback test.

Also create a sock_common.c file which can be used by posix/uring
implementation. We do not put such code in sock.c. Because sock.c
is the general layer. Other users may include their own user space
sock impelmentations. So put those common code in sock_common.c instead.

Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Change-Id: I983ec2313119539e6eed2d9f11ba1488c0ed6560
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8769
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: Ben Walker <benjamin.walker@intel.com>
2021-08-13 07:14:38 +00:00
Ziye Yang
34ab803d30 sock/uring: Add the MSG zero copy feature
This patch tries to add MSG zero copy feature.
Though io_uring supports buffer registration, it only
support io_uring_prep_write_fixed. It means only one
registered buffer can be used. It does not satisfy our
current usage mode.

According to this situation, we still use the MSG_ZEROCOPY
flags in io_uring_prep_sendmsg.

Furthermore, this new feature is dependent on the kernel
version, The currently verified version is
kernel 5.12 rc3. So it is not enabled in the default manner.

For example, if you want to use it on the target side, you can
use the following rpc to configure:

./scripts/rpc.py sock_impl_set_options -i uring --enable-zerocopy-send-server

Change-Id: Ie7bb828f466362add94891989ddf0950dccd9e80
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/957
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: Ben Walker <benjamin.walker@intel.com>
2021-08-13 07:14:38 +00:00
Changpeng Liu
beb6ffd2f7 nvme: add ONCS definition
It's already defined in spdk_nvme_ctrlr_data, just move it out
so that other library can use this definition.

Change-Id: Ic40ba6f6e7870395ad3cec9511ce841f5dc4dff1
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9123
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
2021-08-13 01:25:07 +00:00
Changpeng Liu
1afe4de585 nvmf/vfio-user: refactor map_admin_cmd_req()
PRP1 value 0 is a valid Guest physical address and it may use two vectors
for one page, so we need to set `iovcnt` as the IO commands.  Also
fix the calculation for Get Log Page command.

Change-Id: Ib036bcf1ca9f6644dfd8a7406fea37269cea5c73
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9122
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
0ac315f047 nvmf/vfio-user: inline ctrlr_interrupt_enabled()
This function is called in the IO processing context, also
rename vfio-user controller data structure with "vu_" prefix.

Change-Id: Icb8fd18772f64c1e633f4a8b8eac26d0bafeed16
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9121
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
2746d51aa7 nvmf/vfio-user: inline io_q_id()
This function is called in the IO processing context, also rename
internal queue pair variable with "vu_" prefix.

Change-Id: Iac6be1fddf9ee28e0485ff0c3a707de4e98be96a
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9120
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
40c447f843 nvmf/vfio-user: remove duplicated one line
The submission queue doorbell will be cleared to 0 at the end
of this function.

Change-Id: I0146f3dc208b8ca1d7fec4b2dae1d7395f304444
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8992
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
42abbac90e nvmf/vfio-user: eliminate cq_next function
There is only one place to call it now, so just remove it.

Change-Id: Ib16d640c80dbe79df46c965c5ee8bcd092e57b0d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9013
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: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
2f85499e43 nvmf/vfio-user: don't use Guest's phase bit for completion response
We should maintain phase bit in vfio-user target, it's not safe
to use Guest completion queue's phase bit.

Change-Id: I94856853784802f7695a0484b783d8de4042f8a6
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8988
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
a93387f69f nvmf/vfio-user: remap admin queue during the memory hotplug if necessary
It's wrong to call enable_admin_queue() in the memory hotplug context,
as the function will change doorbells and clear queue pair memory.

We can remap the ADMIN queue pair's memory just same as IO queue pairs.

Change-Id: I090ea40ce0f0613c15319bfb18771a154ca788c7
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8987
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: Ziye Yang <ziye.yang@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
e9fd737a8e nvmf/vfio-user: add map_q function
The map_q function is used to map Guest's physical memory address
to Host virtual address for SQ/CQ.  This function can be used both
for initializing SQ/CQ and remap SQ/CQ, when used for remap SQ/CQ,
we don't need to unmap the related memory region.

Change-Id: Ia42e01a68482e5678dbaf8d0d4e8c04c1a94789d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9012
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: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@intel.com>
2021-08-13 01:25:07 +00:00
Changpeng Liu
7d136a2088 nvmf: use INFOLOG for unsupported commands
Fix #2004.

Change-Id: I60899de4d369f50f159e6bbe1ba9eb546f367d87
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9035
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: Thanos Makatos <thanos.makatos@nutanix.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-12 12:57:50 +00:00
Changpeng Liu
a784122709 nvmf/vfio-user: use correct syslog level
vsnprintf() is called in the IO processing path if we set LOG_DEBUG
by default, which will impact the performance numbers. See below
perf record:

13.44%  reactor_0  [kernel.kallsyms]   [k] do_syscall_64
 7.59%  reactor_0  [kernel.kallsyms]   [k] syscall_return_via_sysret
 7.18%  reactor_0  libc-2.29.so        [.] __vfprintf_internal
 5.60%  reactor_0  [kernel.kallsyms]   [k] entry_SYSCALL_64
 4.74%  reactor_0  [kernel.kallsyms]   [k] vmx_deliver_posted_interrupt
 4.36%  reactor_0  nvmf_tgt            [.] post_completion

Change-Id: Icc12345c341d870375a1db729412acb7b3cd0211
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9079
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: John Levon <levon@movementarian.org>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2021-08-12 12:57:39 +00:00
Changpeng Liu
01936d2ed8 log: add an API to return syslog level based on SPDK's log level
Change-Id: I970119385989e7d97bda065f5aa2bbd82519c655
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9103
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: John Levon <levon@movementarian.org>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-12 12:57:39 +00:00
Konrad Sztyber
aa51757648 bdev/zone_block: check for unmap support in zone reset
Sending the unmap in zone reset is optional (it's only a hint), so if
the base bdev doesn't support it, the reset is completed immediately.

Fixes #2064.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: If2c57eadc20d352a71853d7023599503330e1252
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9154
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-08-12 12:57:24 +00:00
paul luse
7abf75c2b5 lib/idxd: pre translate the completion address for batch entries
Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I9df51acc2bbd3deffcb172c0fd3e7012ec3d4b3b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9100
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: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-12 12:57:07 +00:00
paul luse
d09b5674a4 lib/idxd: reduce size of per channel batch pool
Was set at a pretty high number during early development.
Instead of a #define, lets use the same math we use to
determine the size of the operation and descriptor pools as
that's the max number of batches that will be needed.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ide5311b4b6c931010413d0f82baed0e05d5fcde7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9099
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: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2021-08-12 12:57:07 +00:00
paul luse
31e3ed5ccb lib/idxd: fix leak of DSA operation for non batched commands
When address translation failed we were not putting the op back
into the pool.  In one place also changed the return error from
translation from hardcoded value to the rc returned by the call
to be consistent with the rest of the code.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: I6d0c9c0f469a213721c6a5ce37c4e9dbdcef8183
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9097
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: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-12 12:57:07 +00:00
paul luse
d30e459e8d lib/idxd: pre translate completion record addresses
These are fixed, no reason to tranlate them with every IO.  This
patch is just for non-batched IO.  Batched IO will come later.

Signed-off-by: paul luse <paul.e.luse@intel.com>
Change-Id: Ifb7bdf147658a23714d94bb7f88d7fedd1749153
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9073
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: Ben Walker <benjamin.walker@intel.com>
2021-08-12 12:57:07 +00:00
Michal Berger
0e2b281be7 test/setup: Ignore atari partition table
It seems some versions of blkid report improper atari as an installed
partition table on devices filled with random data. Ignore that case
for now so the tests are able to find usuable nvme device.

Signed-off-by: Michal Berger <michalx.berger@intel.com>
Change-Id: If6604ddf7099d3a98cfa36caab1e806d5f931886
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9143
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2021-08-12 12:56:59 +00:00
Jim Harris
a595959da0 test/nvme/abort: ensure admin queue is sized appropriately
This abort test app will send a lot of abort commands on
the admin queue.  The default admin queue size is
relatively small (32) so increase it if necessary to
account for the expected number of outstanding abort
commands as well as any extra admin commands that may
be sent during test execution such as Keep Alive.

Fixes issue #2048.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I5f64b7fc72a028299b860f09e30d430a64c95d2a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8812
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2021-08-11 06:51:13 +00:00
Jim Harris
690783a3ae env_dpdk: tokenize env_context
DPDK requires each command line parameter to be
passed as a separate string in the args array.  So
we need to tokenize opts.env_context to handle the
case where a user passes multiple arguments in the
env_context string.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ifc72a7c25b31f1296d3aba3a3f7664ad8edf128f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9132
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: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
2021-08-10 08:19:52 +00:00