From b994ebdfbde87a61d9df0938b1b447a0819d47d8 Mon Sep 17 00:00:00 2001 From: Konrad Sztyber Date: Wed, 24 Aug 2022 09:28:25 +0200 Subject: [PATCH] sma: interface for querying QoS capabilities Signed-off-by: Konrad Sztyber Change-Id: I6013205499c122cad95d807c84e609f188b4d2d2 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14189 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Jim Harris --- python/spdk/sma/proto/sma.proto | 42 ++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/python/spdk/sma/proto/sma.proto b/python/spdk/sma/proto/sma.proto index 7f1f04c07..abc427482 100644 --- a/python/spdk/sma/proto/sma.proto +++ b/python/spdk/sma/proto/sma.proto @@ -13,6 +13,14 @@ package sma; option go_package = "spdk.io/sma"; +// Enumeration defining types of devices +enum DeviceType { + DEVICE_TYPE_INVALID = 0; + DEVICE_TYPE_NVME = 1; + DEVICE_TYPE_VIRTIO_BLK = 2; + DEVICE_TYPE_NVMF_TCP = 3; +} + // Volume's crypto parameters message VolumeCryptoParameters { // Key to be used for encryption @@ -120,7 +128,8 @@ message SetQosRequest { // the QoS will be set up on the whole device (all volumes attached to that // device will share QoS settings). Some device types might only support // configuring QoS on per-device (volume_id must be empty) or per-volume level - // (volume_id cannot be empty). + // (volume_id cannot be empty). This information can be obtained by sending a + // GetQosCapabilities request. bytes volume_id = 2; // Maximum allowed IOPS/bandwidth QosLimit maximum = 3; @@ -129,6 +138,34 @@ message SetQosRequest { // SetQos response message SetQosResponse {} +// Get QoS capabilities request +message GetQosCapabilitiesRequest { + // Type of a device to query for QoS capabilities + DeviceType device_type = 1; +} + +// Get QoS capabilities response +message GetQosCapabilitiesResponse { + message QosCapabilities { + // Read IOPS + bool rd_iops = 1; + // Write IOPS + bool wr_iops = 2; + // Read/write IOPS + bool rw_iops = 3; + // Read bandwidth + bool rd_bandwidth = 4; + // Write bandwidth + bool wr_bandwidth = 5; + // Read/write bandwidth + bool rw_bandwidth = 6; + } + // Device level maximum QoS limits + QosCapabilities max_device_caps = 1; + // Volume level maximum QoS limits + QosCapabilities max_volume_caps = 2; +}; + // Storage Management Agent gRPC service definition service StorageManagementAgent { // Creates a new device. A device is an entity that can be used to expose @@ -151,4 +188,7 @@ service StorageManagementAgent { // Configures QoS on a device/volume rpc SetQos (SetQosRequest) returns (SetQosResponse) {} + // Returns QoS capabilities of a given device type + rpc GetQosCapabilities (GetQosCapabilitiesRequest) + returns (GetQosCapabilitiesResponse) {} }