Commit 408a2155 authored by Artur Paszkiewicz's avatar Artur Paszkiewicz Committed by Tomasz Zawadzki
Browse files

bdev/error: add nomem error type



Change-Id: Ib957ce29bd02e385ddfc137c0015878362dd8faa
Signed-off-by: default avatarArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19315


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent e2eeafc4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5512,7 +5512,7 @@ Name | Optional | Type | Description
----------------------- | -------- | ----------- | -----------
name                    | Required | string      | Name of the error injection bdev
io_type                 | Required | string      | io type 'clear' 'read' 'write' 'unmap' 'flush' 'all'
error_type              | Required | string      | error type 'failure' 'pending' 'corrupt_data'
error_type              | Required | string      | error type 'failure' 'pending' 'corrupt_data' 'nomem'
num                     | Optional | int         | the number of commands you want to fail.(default:1)
corrupt_offset          | Optional | int         | the offset in bytes to xor with corrupt_value
corrupt_value           | Optional | int         | the value for xor (1-255, 0 is invalid)
+4 −0
Original line number Diff line number Diff line
@@ -234,6 +234,10 @@ vbdev_error_submit_request(struct spdk_io_channel *_ch, struct spdk_bdev_io *bde
		error_disk->error_vector[bdev_io->type].error_num--;
		spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
		break;
	case VBDEV_IO_NOMEM:
		error_disk->error_vector[bdev_io->type].error_num--;
		spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_NOMEM);
		break;
	case VBDEV_IO_PENDING:
		TAILQ_INSERT_TAIL(&error_disk->pending_ios, bdev_io, module_link);
		error_disk->error_vector[bdev_io->type].error_num--;
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ enum vbdev_error_type {
	VBDEV_IO_FAILURE = 1,
	VBDEV_IO_PENDING,
	VBDEV_IO_CORRUPT_DATA,
	VBDEV_IO_NOMEM,
};

typedef void (*spdk_delete_error_complete)(void *cb_arg, int bdeverrno);
+2 −0
Original line number Diff line number Diff line
@@ -47,6 +47,8 @@ rpc_error_bdev_decode_error_type(const struct spdk_json_val *val, void *out)
		*error_type = VBDEV_IO_PENDING;
	} else if (spdk_json_strequal(val, "corrupt_data") == true) {
		*error_type = VBDEV_IO_CORRUPT_DATA;
	} else if (spdk_json_strequal(val, "nomem") == true) {
		*error_type = VBDEV_IO_NOMEM;
	} else {
		SPDK_NOTICELOG("Invalid parameter value: error_type\n");
		return -EINVAL;
+1 −1
Original line number Diff line number Diff line
@@ -1664,7 +1664,7 @@ def bdev_error_inject_error(client, name, io_type, error_type, num,
    Args:
        name: name of error bdev
        io_type: one of "clear", "read", "write", "unmap", "flush", or "all"
        error_type: one of "failure", "pending", or "corrupt_data"
        error_type: one of "failure", "pending", "corrupt_data" or "nomem"
        num: number of commands to fail
        corrupt_offset: offset in bytes to xor with corrupt_value
        corrupt_value: value for xor (1-255, 0 is invalid)
Loading