module/raid: specify memory domain support per raid module
Not all raid modules may support memory domains - raid5f currently does not. Add a parameter to struct raid_bdev_module to specify that. Change-Id: I3285c118db846d290837606b3f85ac4b5277de97 Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17601 Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
This commit is contained in:
parent
1a526000d0
commit
72672d4982
@ -680,6 +680,10 @@ raid_bdev_get_memory_domains(void *ctx, struct spdk_memory_domain **domains, int
|
||||
uint32_t i;
|
||||
int domains_count = 0, rc;
|
||||
|
||||
if (raid_bdev->module->memory_domains_supported == false) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* First loop to get the number of memory domains */
|
||||
for (i = 0; i < raid_bdev->num_base_bdevs; i++) {
|
||||
base_bdev = raid_bdev->base_bdev_info[i].bdev;
|
||||
|
@ -201,6 +201,9 @@ struct raid_bdev_module {
|
||||
uint8_t value;
|
||||
} base_bdevs_constraint;
|
||||
|
||||
/* Set to true if this module supports memory domains. */
|
||||
bool memory_domains_supported;
|
||||
|
||||
/*
|
||||
* Called when the raid is starting, right before changing the state to
|
||||
* online and registering the bdev. Parameters of the bdev like blockcnt
|
||||
|
@ -321,6 +321,7 @@ concat_stop(struct raid_bdev *raid_bdev)
|
||||
static struct raid_bdev_module g_concat_module = {
|
||||
.level = CONCAT,
|
||||
.base_bdevs_min = 1,
|
||||
.memory_domains_supported = true,
|
||||
.start = concat_start,
|
||||
.stop = concat_stop,
|
||||
.submit_rw_request = concat_submit_rw_request,
|
||||
|
@ -401,6 +401,7 @@ raid0_resize(struct raid_bdev *raid_bdev)
|
||||
static struct raid_bdev_module g_raid0_module = {
|
||||
.level = RAID0,
|
||||
.base_bdevs_min = 1,
|
||||
.memory_domains_supported = true,
|
||||
.start = raid0_start,
|
||||
.submit_rw_request = raid0_submit_rw_request,
|
||||
.submit_null_payload_request = raid0_submit_null_payload_request,
|
||||
|
@ -189,6 +189,7 @@ static struct raid_bdev_module g_raid1_module = {
|
||||
.level = RAID1,
|
||||
.base_bdevs_min = 2,
|
||||
.base_bdevs_constraint = {CONSTRAINT_MIN_BASE_BDEVS_OPERATIONAL, 1},
|
||||
.memory_domains_supported = true,
|
||||
.start = raid1_start,
|
||||
.stop = raid1_stop,
|
||||
.submit_rw_request = raid1_submit_rw_request,
|
||||
|
Loading…
Reference in New Issue
Block a user