Commit Graph

18835 Commits

Author SHA1 Message Date
Tomasz Zawadzki
c34f15e09c env_dpdk: keep DPDK 20.11 compatiblity
Patch below added copies of pci realted headers to keep
compatiblity with <= DPDK 22.07.
(1eb35ac) env_dpdk: add copies of 22.07 pci-related header files

Unfortunetly the rte_bus/bus_pci/dev headers from DPDK 22.07 are
not compatibile going back to DPDK 20.11.

The issues are:
- lack of RTE_TAILQ_ENTRY defined in rte_os.h
- rte_intr_handle being part of rte_pci_device rather than pointer

pci_dpdk_2207.c even before this patch is not binary compatible with
DPDK 20.11 - see pci_device_*_interrupt_2207() functions.
There would need to be another copy of headers matching that version
of DPDK to resolve this issue.

SPDK supports up to two latest LTS releases. Which right now includes
DPDK 20.11, but soon will be dropped due to DPDK 22.11 release.

Having compile time defines here, keeps the older DPDK working.
Meanwhile backwards compatiblity in SPDK is no worse than before.
The recent changes to env_dpdk, are aiming to improve support
with newer versions of DPDK.

Change-Id: If4dc601cb03e18c2cad61f3a93080e8265ca5fcc
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14795
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@nvidia.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-30 15:56:33 +00:00
Tomasz Zawadzki
5accac26fd CHANGELOG: add missing entries for SPDK 22.09
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I2507a58f19a4f76a01caf7cfce788f69dba3e35b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14757
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>
2022-09-30 07:47:47 +00:00
Artur Paszkiewicz
030951b454 test/blockdev.sh: test raid5f
Change-Id: Id41448dc828d153ee328d9ce2d1dfff6e8fae5b7
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14718
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>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
9cf1ab5b1c module/raid: fix async module stopping
If the module stop handler is asynchronous we must wait until it
finishes before unregistering the io_device.

Change-Id: I149b716d9f4b0c1680b3e43b395fc9ec5b90d70c
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14717
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
a51649faf6 bdev: use write_unit_size for acwu and write_zeroes
Change-Id: Idbcfc110c153a62082f84f3304f1e245f2fc3daf
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14716
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
3fc593b61f test/bdevio: adjust writes to write_unit_size
Make writes larger when necessary to comply with the bdev's write unit
size requirement.

Change-Id: Ief60d369bb3efb5de083c5951672e20f2dd9e0af
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14715
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
2e73b5c7fb test/bdevio: refactor two tests
Refactor blockdev_write_read_offset_plus_nbytes_equals_bdev_size() and
blockdev_write_read_offset_plus_nbytes_gt_bdev_size() to use
blockdev_write_read() similar to how it's done in other tests.

Change-Id: Iba853a0df1facd88ce7c206163386f6c8a9c7c1b
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14714
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
65e08d1265 examples/hello_bdev: support write_unit_size
Change-Id: Ifd9b73560d1f47d545825b69c20a1f02204596a9
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14713
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
28932f6e42 ut/raid5f: test bdev_io error handling
Change-Id: I640827006c2c533f599af07931041009d7158e5e
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14712
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
c2eea87ac4 raid5f: calculate and write parity
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Ia1b82d555c966b9b291eeb2426c42846b93e7fec
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7703
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
69c448a30e lib/util: add ISA-L accelerated xor generation
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I3ef9dadb4c68e92760c8426f0fffb7b249829e2b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12080
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
7131bec415 raid5f: full stripe writes
Implement support for full stripe writes without parity calculation.

The size and alignment of write IOs must be a multiple of full stripe
size. To reflect this, the raid bdev's write_unit_size is set
accordingly. We rely on the bdev layer to split larger IOs based on
that.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: I6940280ad870f3bd678fd19346b06ba4bdadd52e
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7702
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
d6e9827e9f bdev: split writes based on write_unit_size
Add new bdev property split_on_write_unit which, if set to true, causes
writes to be split to match write_unit_size and fail if not aligned to
or not multiple of write_unit_size.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Id49f58a3288ddf5cfe4921ce4020ae4bcdd67298
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11390
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
c89e20084b module/raid: support for raid module private io channel
Let the raid modules create their own IO channels by implementing the
get_io_channel callback.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Id4f6c90721474edd70a6e987c67f8f774737da27
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7700
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
95a0494902 module/raid: fix device destruction
Move device cleanup to spdk_io_device_unregister() callback. This fixes
a case when the device would be freed before its last io channel was
closed, leading to use after free condition.

Repurpose raid_bdev_free() to actually free the bdev.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Ib667b4d5ac1b34a0f2dda69f6b0775d9363dbfee
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11398
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-29 22:52:45 +00:00
Artur Paszkiewicz
77bddc0f96 raid5f: read support
Depend on bdev layer to send down chunk sized IOs, based on
optimal_io_boundary.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Change-Id: Iec45f4917117d35c3a9e807940e49091dfcba870
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7699
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:52:45 +00:00
Tomasz Zawadzki
ef1bec0088 CHANGELOG: fix typos and order of entries
Fix typos, formatting and order of entries.
No new entry is added in this patch.

Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I8f4f48d9fec71cfc29a06b02d96a80eaba23eee9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14754
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>
2022-09-29 22:23:41 +00:00
Konrad Sztyber
72ea6db37a changelog: add a note about v22.09 changes in SMA
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ie998ae9e1a9a9a60bbe74bd388932dd3128b5564
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14749
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>
2022-09-29 22:23:41 +00:00
Konrad Sztyber
cdffb29760 changelog: add a note about v22.09 changes in the VMD driver
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ie03d1c26fffaef848ef881346d6d76a4276cc4ba
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14748
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 22:23:41 +00:00
Changpeng Liu
6d7f012af4 test/vfio-user: add virtio_blk|scsi VM fio|restart test case
Change-Id: If5369e76d5be42005a2c26d10c04dc0b03cb9092
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14665
Reviewed-by: Michal Berger <michal.berger@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-29 19:42:56 +00:00
Changpeng Liu
39eba86723 test/vfio_user: rename existing vfio_user NVMe test cases
This is the preparation to add virtio device test cases
with vfio-user target.

Change-Id: I08a33ac9cb6c1a6239841077facbf84927383814
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14647
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 19:42:56 +00:00
Changpeng Liu
8b260d5c92 virtio/vfio_user: add virtio_scsi device support
Example usage using `bdevperf` as the client:

Start `spdk_tgt` with created virtio_scsi device:
1. scripts/rpc.py bdev_malloc_create -b malloc0 $((512)) 512
2. scripts/rpc.py vfu_virtio_create_scsi_endpoint vfu.0 --cpumask 0x1 --num-io-queues=4 \
                                                  --qsize=128 --packed-ring
3. scripts/rpc.py vfu_virtio_scsi_add_target vfu.0 --scsi-target-num=0 --bdev-name malloc0

Start `bdevperf`:
1. test/bdev/bdevperf/bdevperf -r /var/tmp/spdk.sock.1 -g -s 2048 -q 128 -o 4096 \
                               -w randread -t 30 -m 0x2
2. scripts/rpc.py -s /var/tmp/spdk.sock.1 bdev_virtio_attach_controller --dev-type scsi \
                  --trtype vfio-user --traddr vfu.0 VirtioScsi0
3. test/bdev/bdevperf/bdevperf.py -s /var/tmp/spdk.sock.1 perform_tests

Change-Id: Id95908a5243e9a224a9bd709a22b87740c50b835
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13897
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-09-29 19:42:56 +00:00
Changpeng Liu
295e54d144 virtio/vfio_user: add virtio_blk device support
Add vfio-user transport support based on existing virtio client
library.

Test steps using bdevperf:

Start `spdk_tgt` with created virtio_blk device:
1. build/bin/spdk_tgt
2. scripts/rpc.py bdev_malloc_create -b malloc0 $((512)) 512
3. scripts/rpc.py vfu_virtio_create_blk_endpoint vfu.0 --bdev-name malloc0 \
                                                 --cpumask=0x1 --num-queues=2 \
                                                 --qsize=256 --packed-ring

Start `bdevperf`:
1. test/bdev/bdevperf/bdevperf -r /var/tmp/spdk.sock.1 -g -s 2048 -q 128 -o 4096 \
                               -w randread -t 30 -m 0x2
2. scripts/rpc.py -s /var/tmp/spdk.sock.1 bdev_virtio_attach_controller --dev-type blk \
                  --trtype vfio-user --traddr vfu.0 VirtioBlk0
3. test/bdev/bdevperf/bdevperf.py -s /var/tmp/spdk.sock.1 perform_tests

Change-Id: I368c4becebbca57328a25fc750e41c353420e481
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13896
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 19:42:56 +00:00
Changpeng Liu
e50ade3153 vfio_user: remove CONFIG_VFIO_USER flag for client library
The client vfio_user library doesn't require this flag as
it is totally owned in SPDK, so remove it.

Change-Id: I8f7b1df18017ceac24dbb8a0417871f25f6bee0d
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13895
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 19:42:56 +00:00
Changpeng Liu
5004d7b8e8 module/vfu_device: add virtio-scsi emulation
Here we use vfu_tgt library and emulate a virtio-scsi device
as the next use case.

Compared with vhost-user-scsi, the packed ring is supported with this
patch.

Example usage method:

1. scripts/rpc.py bdev_malloc_create -b malloc0 $((512)) 512
2. scripts/rpc.py vfu_virtio_create_scsi_endpoint vfu.0 --cpumask 0x1 --num-io-queues=4 \
                                                  --qsize=128 --packed-ring
3. scripts/rpc.py vfu_virtio_scsi_add_target vfu.0 --scsi-target-num=0 --bdev-name malloc0
4. Start QEMU with '-device vfio-user-pci,socket=/spdk/vfu.0'

Change-Id: I8f35d1d21aaec34844d6ddb59dc997a64f141179
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12673
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 19:42:56 +00:00
Changpeng Liu
23ef63882c module/vfu_device: add virtio-blk emulation
Here we use vfu-tgt library and emulate a virtio-blk device
as the first use case of vfu-tgt library.

Usage example with QEMU:

1. build/bin/spdk_tgt
2. scripts/rpc.py bdev_malloc_create -b malloc0 $((512)) 512
3. scripts/rpc.py vfu_virtio_create_blk_endpoint vfu.0 --bdev-name malloc0 \
                                                 --cpumask=0x1 --num-queues=2 \
                                                 --qsize=256 --packed-ring
4. Start QEMU with '-device vfio-user-pci,socket=/spdk/vfu.0'

Change-Id: I45e45360c669584583b0b8a3f83250ab6c48efec
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12315
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Community-CI: Mellanox Build Bot
2022-09-29 19:42:56 +00:00
Changpeng Liu
da231290b2 lib/vfu_tgt: add library for PCI device emulation
Previously SPDK use libvfio-user library to provide emulated NVMe
devices to VM, but it's limited to NVMe device type only.  Here we
add SPDK vfu_target library abstraction based on libvfio-user which
supports more PCI device types.

We will add virtio-blk and virtio-scsi devices emulation based on
vfu_tgt library in following patches, actually this library can
support NVMe emulation too, due to the fact that the NVMe emulation
is already exist, so we will keep the NVMe emulation which based on
libvfio-user directly as it is.

Change-Id: Ib0ead6c6118fa62308355fe432003dd928a2fae9
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12597
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 19:42:56 +00:00
Jim Harris
c7f5010984 env_dpdk: add dpdk_pci_device_get_mem_resource
This allows eliminating dpdk_pci_device_vtophys and
dpdk_pci_device_map_bar, reducing the amount of
code we need to maintain in the per-DPDK version
implementations.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I73d15eb75bf7fe8340d85494425e15651fec5425
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14722
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-09-29 15:32:24 +00:00
Jim Harris
5be703ef35 env_dpdk: break up dpdk_pci_device_copy_identifiers
Break this function up into three APIs instead:

* dpdk_pci_device_get_addr
* dpdk_pci_device_get_id
* dpdk_pci_device_get_numa_node

This more clearly delineates the requirements we
have from the DPDK PCI device/driver APIs.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie585c8252d63c15c6e6884d60f8a064c3f0ab94f
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14684
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-09-29 15:32:24 +00:00
Jim Harris
1eb35ac7e3 env_dpdk: add copies of 22.07 pci-related header files
Moving forward, we want to still be able to run against
<= 22.07 versions of DPDK, which exposed the necessary
data structures in public header files.  But since we
will be building against newer versions of DPDK which
don't expose them publicly, we need a copy of the 22.07
header files in our tree.

Exclude these header files from astyle and POSIX include
file checks in check_format.sh

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Icd8a067af41a2ba031ce8f875a8a2b63f722ab69
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14683
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-09-29 15:32:24 +00:00
Jim Harris
2f1cf63cfb check_format.sh: remove cpp_headers exclusion
We don't track any files in test/cpp_headers, so there
is no need to do a grep -v to exclude files that
contain "cpp_headers".  This was a remnant from before
we started using git ls-files to determine which files
to run through astyle.

Fixes: fb87f80c ("scripts/check_format.sh: only check tracked files")

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If08f0bd5c96990dc5e4ca4641c53f70a82590470
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14689
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-29 15:32:24 +00:00
Jim Harris
25f89bd584 check_format.sh: remove "rte_vhost" exclusions
This was a remnant from ages ago when we had rte_vhost
DPDK code copied into our repo.  We actually have a file
named rte_vhost_user.c which is not DPDK code that was
getting excluded from astyle checking.

So this also includes the astyle violations that had
crept into this file.  In a couple of places, change
the enum return type to int, this reduces astyle
confusion on function and if brace style.

Same applies to POSIX include checking - we don't need
to exclude rte_vhost_user.c from this either.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: If3a25011ad54c694c15a91f7be66d862c765c5db
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14688
Community-CI: Mellanox Build Bot
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-29 15:32:24 +00:00
GangCao
13c7a98d33 thread: add assert for io_channel_iter allocation failure
For example, in the calling from spdk_bdev_get_current_qd(), if
spdk_for_each_channel() failed to allocate struct spdk_io_channel_iter,
it will just return and the ctx allocated in spdk_bdev_get_current_qd()
is not released.

Instead to change the public API of spdk_for_each_channel() to return
the failed status to let the caller properly handle the NOMEM case and
release the allocation, it just adds the assert here.

Change-Id: I6a95207dd390586bdae4e86e5d550cdac709e10a
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14657
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-29 07:27:27 +00:00
Krishna Kanth Reddy
78ff96bb73 bdev_xnvme: free bdev_xnvme structure after device is fully unregistered
Fix for the issue 2702.
spdk_bdev plugin crashes while handling xnvme devices.

xnvme_queue_term gets invoked after the bdev_xnvme_free executes and
frees the xnvme structures. xnvme_queue_term references the xnvme->dev
structure, after it is freed, resulting in a segmentation fault.

Implemented a bdev_xnvme_destruct_cb, that frees the xnvme structures
after the xnvme_queue_term invokes and the device is fully unregistered.

Signed-off-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
Change-Id: I9338c84baf4b61ec2e0d324e67bfefcb96485156
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14680
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
2022-09-28 06:47:35 +00:00
MengjinWu
f1bec928d1 nvmf/tcp: add admin queue depth check before init
max_aq_depth should be not smaller than 2 or greater
than 4096

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: I205fbb4345cfdc41ebaf30c953da263fe9f0e9a8
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14691
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: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
2022-09-28 06:39:14 +00:00
MengjinWu
bf887576cb nvmf/tcp: add IO queue depth check before init
max_queue_depth should be not smaller than 2 or greater
than 65536

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: I0f2a4b8df6eb1b140a11936fc6929f1285a7d717
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14619
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: Konrad Sztyber <konrad.sztyber@intel.com>
Community-CI: Mellanox Build Bot
2022-09-28 06:39:14 +00:00
MengjinWu
5eb3239cdf nvmf/tcp: Refine the macro definition of queue depth
Refine the macro definition name about queue depth and
prepare for next patch.

Signed-off-by: MengjinWu <mengjin.wu@intel.com>
Change-Id: I85bee2528ae4ab70292fc11aa62d05bae0c28a77
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14664
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.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>
Community-CI: Mellanox Build Bot
2022-09-28 06:39:14 +00:00
Krzysztof Karas
19c1d632f1 trace: update trace help inside SPDK target
Delete bit masks from trace help (found inside
build/bin/spdk_tgt -h help text), as they do not
provide useful information, are much harder to
remember and use, and migh leave user confused.
Since we provide trace group names anyway, bit masks
are excessive.

Change --tpoint-group-mask parameter name to
--tpoint-group, because we do not provide
bit masks anymore.

Drop "default" tpoint group mask from help text,
since it does not enable any tracepoints and
may confuse the user.

Change-Id: I2ca780883dfa7822e76523e9ba1fc65a7bfe5a99
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14656
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-27 19:41:17 +00:00
Sebastian Brzezinka
d5dc6a8853 test/llvm_vfio_fuzz: test normal IO during fuzzing
Second vfio-user ctrlr is use to perform normal IO while fuzzing other
one, misbehaving ctrlr should not affect IO operation.

-Y <path/to/ctrlr> Path of addition controller to perform normal io

Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Change-Id: I11c34e97723f9359bacd7866a9828a6d89c74992
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13882
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>
2022-09-27 19:41:07 +00:00
Indraneel M
5eafc3a279 bdev/uring: Proper handling for conventional zones
Identify and properly handle conventional zones (in smr drives) by using
zone type and WP state. Bdevs supporting zoned devices(like uring, nvme and
vbdev_zone_block) now update the zone type information. As a result, the
fio plugin now uses this info instead of hard coding the zone type.
Also adds new WP state(ZONE_STATE_NOT_WP) for handling zones w/o WP.

Signed-off-by: Indraneel M <Indraneel.Mukherjee@wdc.com>
Change-Id: If031e0742d68c55c35e95ddc33d478939bbd52fe
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14572
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: Mellanox Build Bot
2022-09-27 19:40:44 +00:00
Indraneel M
958d196c1d configure: uring bdev zoned support default enable
Enable zoned support by default when uring bdev is enabled.
Also introduce --without-uring-zns to disable zoned support when not
needed.

Signed-off-by: Indraneel M <Indraneel.Mukherjee@wdc.com>
Change-Id: Ief7a3d29bf9e0c95ede624164e49679e46f01251
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14589
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2022-09-27 19:40:14 +00:00
Michal Berger
87afc01e5a test/dd: Wait 1s before checking the noatime flag
This test has been recently failing in a way where atime is not
updated within the stat's %X resolution. Add simple sleep to
mitigate that.

Fixes issue: #2720.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I106357175028849ba037c9ee78c1e22a772fdfa3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14675
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-09-27 15:42:06 +00:00
Jaroslaw Chachulski
3e5fc847c0 test/fuzz: Add '-s 256' argument to autofuzz_vhost.sh script
Add '-s 256' argument to 'autofuzz_vhost.sh' script. It was missed
in  https://review.spdk.io/gerrit/c/spdk/spdk/+/14249. Reorder flags
to be consistent with test/vhost/fuzz/fuzz.sh

Fixes issue #2716.

Signed-off-by: Jaroslaw Chachulski <jaroslawx.chachulski@intel.com>
Change-Id: I86ddc0b841c3733d10b51b062e61b6168fa3f2ca
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14672
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.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>
2022-09-27 15:41:43 +00:00
Simon A. F. Lund
cfe5d18823 bdev/xnvme: enable polling on io_uring_cmd
Fixes #2708 for io_uring_cmd.

This is a minimal approach to enabling polling for bdev_xnvme. Ideally,
more would be done, however, there are several blockers to remove when
doing so. Thus, this commit only enables polling on
io_mechanism=io_uring_cmd.

Signed-off-by: Simon A. F. Lund <simon.lund@samsung.com>
Change-Id: Ifa604b52bb2b924fab4b559fae06f26a3574db42
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14679
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-27 15:36:32 +00:00
Xinliang Liu
ecbdca493e pkgdep: add support for openEuler Linux
OpenEuler Linux although is not compatible with RHEL, but it uses the
same package manager DNF as RHEL and references the package naming of
RHEL.

OpenEuler Linux is becoming the mainstream linux distro in China. So
adding support for it makes sense. For more details about it see:
https://www.openeuler.org/en/.

Fixes: #2713
Change-Id: Ife38a1f897bf6170a0c3ed0a5238ceda018a41f2
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14639
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: wanghailiang <hailiangx.e.wang@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Michal Berger <michal.berger@intel.com>
2022-09-27 10:20:53 +00:00
Michal Berger
23ed60ea31 rpmbuild: Fix dpdk version check and bump it to 20.11
dpdk packages are versioned differently across different distros. In
particular, packages under fedora use Epoch in the spec. This requires
the condition to include this value, otherwise rpmbuild assumes it's 0
failing the check.

Also, add extra log to build_rpm_with_rpmed_dpdk test to indicate
when rpmbuild fails due to not resolved build dependencies.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: Ia4bab6e6486e20c24f7386a085b499462fe5fe0d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14662
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.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>
2022-09-27 07:44:15 +00:00
Tomasz Zawadzki
4bdf131f56 scripts/dpdk_mem_info: fix line break during print
Reported-by: GangCao <gang.cao@intel.com>
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Change-Id: I906b9fec1057f5ac56e4ab2d723a36e0b5351361
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14591
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
2022-09-27 06:27:41 +00:00
Szulik, Maciej
1b575d831d lib/nvmf: add explicit iovcnt init to silence LTO related warning
When Link Time Optimization is enabled, compiler can sometimes produce
additional warnings saying that some variables may be uninitialized.

To supress the warning it is enough to add explicit initialization
of the variable causing the issue, in this case 'iovcnt = 0'.

Signed-off-by: Szulik, Maciej <maciej.szulik@intel.com>
Change-Id: I080b20a6008643ae78c8e3a6c2d183193ef6c1bf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14674
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: Jacek Kalwas <jacek.kalwas@intel.com>
Community-CI: Mellanox Build Bot
2022-09-26 15:36:23 +00:00
Michal Berger
9b8939660a test/scheduler: Fallback to checking user mode load if idle check fails
During tests, the main portion of the app's time is spent in user
mode when polling is in effect. Currently, the idleness of given cpu
is determined in comparision to all the possible states the cpu can
be in. This makes it easier for third party processes to impact the
idleness of the cpu (as it may be lowered via different kinds of
loads).

For instance, if target cpu suddenly sees spike in a system
load (even up to 100%) it should not be relevant for the test where
it's known that the app's polling utilized mainly user mode prior
switching the scheduler.

With that in mind, if the general idle check fails, lookup the
raw samples matching the user mode and if the load is relatively
low (<= 15%) consider this as a pass.

Signed-off-by: Michal Berger <michallinuxstuff@gmail.com>
Change-Id: I4ab260d8bcf20a69f2f0be10f0fd7be577682be3
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12909
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-09-26 15:36:07 +00:00
Michal Berger
7d080339ec test/scheduler: Set default value for $cpu_time
Also, adjust collect_cpu_idle()'s printout.

Signed-off-by: Michal Berger <michallinuxstuff@gmail.com>
Change-Id: I8ad18130591b0c91e6f4380e5a0e14eb41096639
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12908
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
2022-09-26 15:36:07 +00:00