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:
Artur Paszkiewicz 2023-04-14 11:15:09 +02:00 committed by Konrad Sztyber
parent 1a526000d0
commit 72672d4982
5 changed files with 10 additions and 0 deletions

View File

@ -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;

View File

@ -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

View File

@ -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,

View File

@ -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,

View File

@ -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,