It makes it possible for stateless clients to send CreateDevice /
DeleteDevice each time a volume is attached / detached. Deleting a
device with attached volumes results in FAILED_PRECONDITION error, which
a client can simply ignore. The device will be deleted during the final
DeleteDevice call, once all volumes are detached.
We limit this behavior to device types that support AttachVolume /
DetachVolume methods, otherwise it would be impossible to delete such
devices.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I244b2b09455ec1430970c70f3fbb739cc9069754
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15670
Reviewed-by: Jing Yan <jing1.yan@intel.com>
Reviewed-by: Filip Szufnarowski <filip.szufnarowski@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
They were missed by the initial set of patches which introduced this
header as a mandatory one across different types of files.
Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I3f9b37d41298c843e1648e72fe8593768ccd37e0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15423
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>
Virtio-blk supports one to one mapping between devices and volumes.
Based on that, we can report underlying bdev capabilities as device
level QoS capabilities.
Signed-off-by: Artsiom Koltun <artsiom.koltun@intel.com>
Change-Id: If7c28c75d087fecec0105002994581fd7ac57f51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15260
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>
In original code, device search was performed only on first
attached bus. If device resided on second attached bus, it couldn't
be found and properly deleted in qemu.
This patch allows to traverse all attached buses to find required
device.
Signed-off-by: Artsiom Koltun <artsiom.koltun@intel.com>
Change-Id: I0840d0a2367d3382c6723ee4cdb6d768128c8032
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14651
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: <sebastian.brzezinka@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
test/sma verifies that bdev-based QoS settings are correctly applied on
vhost devices.
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Change-Id: I1b66275dcf457295e6ae58814f1d08ed319fb52a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14338
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
test/sma verifies that bdev-based QoS settings are correctly applied on
vfio-user devices.
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Change-Id: I0109bfdbcb95d6e683c45c3dbdb2c3c175f10aa2
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14337
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
The generic layer will now handle the SetQoS and GetQosCapabilities
requests.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Icb4c916d3624c3943e2da74d6dbcc3261f90391d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14267
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
The vhost_blk devices will now support volumes with encryption enabled.
Reorder 'imports' according to PEP 8.
Change-Id: Ia4ae0832f4cf91578153da7ca0a28a83707ccdca
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13983
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
The nvmf/vfiouser devices will now support attaching volumes with
encryption enabled. Reorder 'imports' according to PEP 8.
Change-Id: I9862c655c2b57b8bb307f6091d4967afc21c11da
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13982
Tested-by: SPDK CI Jenkins <sys_sgci@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>
The nvmf/tcp devices will now support attaching volumes with encryption
enabled. This basically boils down to getting the crypto bdev name
through the CryptoEngine.get_crypto_bdev() interface (instead of just
using volume_id) and specyfing UUID/NGUID when attaching namespaces
to a subsystem.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Iefddbf07675152aa2e042564eb87c457b6995b9b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/13871
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: <sebastian.brzezinka@intel.com>
This patch utilize generic sma implementation by adding vhost-user
devices manager. It's allow to expose virtualized block devices to
QEMU instances or other arbitrary processes.
Max device capacity depend on available `pci-bridge`
```
devices:
- name: 'vhost_blk'
params:
buses:
- name: 'pci.spdk.0'
count: 32
- name: 'pci.spdk.1'
count: 32
qmp_addr: 127.0.0.1
qmp_port: 9090
```
To attach `pci-bridge` at boot time we need to run qemu with this option
```
device pci-bridge,chassis_nr=1,id=pci.spdk.0
device pci-bridge,chassis_nr=2,id=pci.spdk.1
``
Change-Id: Idbe841b12cf59975ff0e6717f8dc905d38379357
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/12207
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: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Artek Koltun <artsiom.koltun@intel.com>
A device can now be identified by a protocol and a name. This allows to
have multiple types of devices providing the same protocol. The
selection of which device manager to use for specific protocol will be
added in following patches.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ib4a6c323ba6a2a5d36ff958ddc40631fd9329cb1
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11683
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
This patch implements the Volume(Attach|Detach) methods.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I639f1e7b6d4d5a3e52795f9c8b1ae890407e2375
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10277
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
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>
This patch implements the generic DeleteDevice method as well as its
NVMe/TCP implementation.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: Ie7aea6b12c399aec242746e5fae108623a3a161a
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10274
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
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>
Storage Management Agent is a gRPC server that provides an abstraction
layer above the SPDK RPC interface. The interface aims to provide a set
of methods for managing various protocols (e.g. NVMe, virtio-blk) while
hiding the details of a particular transport.
The external API is defined by `lib/python/spdk/sma/proto/sma.proto`
protobuf file. It defines the generic gRPC service methods and their
requests/responses. Device-specific messages are defined in their own
files. This patch also defines messages for creating NVMe and NVMe/TCP
devices.
This patch implements a gRPC service that delegates the work to a
specific device type. A DeviceManager is a class that implements some
of the methods defined by the service for a given type of devices (e.g.
NVMe, virtio-blk, NVMe/TCP, etc.). For now, only the RPC for creating a
device is implemented, others are added in subsequent patches.
The series implements the generic calls as well as their NVMe/TCP
implementation. Support for other devce types could be easily added by
creating a new device manager and defining its protobuf parameter
definition.
Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I17cde3b31d3514878f1027cfcd112b48848f6123
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10273
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>