Commit c94ecfae authored by Konrad Sztyber's avatar Konrad Sztyber Committed by Jim Harris
Browse files

lib/bdev: zoned info in get_bdevs RPC call



Zoned bdev properties were added to the result of the get_bdevs RPC
call:
 - zoned: indicates whether the device is zoned or a regular
   block device
 - zone_size: number of blocks in a single zone
 - max_open_zones: maximum number of open zones
 - optimal_open_zones: optimal number of open zones

The "zoned" field is a boolean and is always present, while the rest is
only available for zoned bdevs.

Change-Id: Ib82b39d4ab20543d0a754dbc4c0317885fb831d1
Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467144


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarMateusz Kozlowski <mateusz.kozlowski@intel.com>
Reviewed-by: default avatarMaciej Szwed <maciej.szwed@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 724357e6
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -7,6 +7,15 @@
Added `spdk_bdev_get_write_unit_size()` function for retrieving required number
of logical blocks for write operation.

New zone-related fields were added to the result of the `get_bdevs` RPC call:
 - `zoned`: indicates whether the device is zoned or a regular
   block device
 - `zone_size`: number of blocks in a single zone
 - `max_open_zones`: maximum number of open zones
 - `optimal_open_zones`: optimal number of open zones
The `zoned` field is a boolean and is always present, while the rest is only available for zoned
bdevs.

### nvmf

The `spdk_nvmf_tgt_create` function now accepts an object of type `spdk_nvmf_target_opts`
+1 −0
Original line number Diff line number Diff line
@@ -611,6 +611,7 @@ Example response:
      "block_size": 512,
      "num_blocks": 20480,
      "claimed": false,
      "zoned": false,
      "supported_io_types": {
        "read": true,
        "write": true,
+7 −0
Original line number Diff line number Diff line
@@ -267,6 +267,13 @@ spdk_rpc_dump_bdev_info(struct spdk_json_write_ctx *w,

	spdk_json_write_named_bool(w, "claimed", (bdev->internal.claim_module != NULL));

	spdk_json_write_named_bool(w, "zoned", bdev->zoned);
	if (bdev->zoned) {
		spdk_json_write_named_uint64(w, "zone_size", bdev->zone_size);
		spdk_json_write_named_uint64(w, "max_open_zones", bdev->max_open_zones);
		spdk_json_write_named_uint64(w, "optimal_open_zones", bdev->optimal_open_zones);
	}

	spdk_json_write_named_object_begin(w, "supported_io_types");
	spdk_json_write_named_bool(w, "read",
				   spdk_bdev_io_type_supported(bdev, SPDK_BDEV_IO_TYPE_READ));
+2 −1
Original line number Diff line number Diff line
@@ -27,5 +27,6 @@
    "write": $(S),
    "write_zeroes": $(S)
  },
  "uuid": "$(S)"
  "uuid": "$(S)",
  "zoned": false
}