linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mateusz Kusiak <mateusz.kusiak@intel.com>
To: linux-raid@vger.kernel.org
Cc: mariusz.tkaczyk@linux.intel.com, jes@trained-monkey.org
Subject: [PATCH 6/8] imsm: define RAID_10 attribute
Date: Mon, 29 Apr 2024 15:07:18 +0200	[thread overview]
Message-ID: <20240429130720.260452-7-mateusz.kusiak@intel.com> (raw)
In-Reply-To: <20240429130720.260452-1-mateusz.kusiak@intel.com>

Add MPB_ATTRIB_RAID10_EXT attribute to support RAID 10
with more than 4 drives.

Allow more than 4 drives in imsm_orom_support_raid_disks_raid10().

This is one of last patches for introducing R10D4+ to imsm.
Only small adjustments in reshape behaviours are needed.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
---
 platform-intel.c | 3 ++-
 super-intel.c    | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/platform-intel.c b/platform-intel.c
index 40e8fb82da30..15a9fa5ac160 100644
--- a/platform-intel.c
+++ b/platform-intel.c
@@ -76,7 +76,8 @@ static bool imsm_orom_support_raid_disks_count_raid5(const int raid_disks)
 
 static bool imsm_orom_support_raid_disks_count_raid10(const int raid_disks)
 {
-	if (raid_disks == 4)
+	/* raid_disks count must be higher than 4 and even */
+	if (raid_disks >= 4 && (raid_disks & 1) == 0)
 		return true;
 	return false;
 }
diff --git a/super-intel.c b/super-intel.c
index 4b168add4346..2d30931672cd 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -62,6 +62,8 @@
 #define MPB_ATTRIB_RAIDCNG		__cpu_to_le32(0x00000020)
 /* supports expanded stripe sizes of  256K, 512K and 1MB */
 #define MPB_ATTRIB_EXP_STRIPE_SIZE	__cpu_to_le32(0x00000040)
+/* supports RAID10 with more than 4 drives */
+#define MPB_ATTRIB_RAID10_EXT		__cpu_to_le32(0x00000080)
 
 /* The OROM Support RST Caching of Volumes */
 #define MPB_ATTRIB_NVM			__cpu_to_le32(0x02000000)
@@ -89,6 +91,7 @@
 					MPB_ATTRIB_RAID10          | \
 					MPB_ATTRIB_RAID5           | \
 					MPB_ATTRIB_EXP_STRIPE_SIZE | \
+					MPB_ATTRIB_RAID10_EXT      | \
 					MPB_ATTRIB_BBM)
 
 /* Define attributes that are unused but not harmful */
@@ -5552,6 +5555,8 @@ static void imsm_update_version_info(struct intel_super *super)
 			break;
 		case IMSM_T_RAID10:
 			mpb->attributes |= MPB_ATTRIB_RAID10;
+			if (map->num_members > 4)
+				mpb->attributes |= MPB_ATTRIB_RAID10_EXT;
 			break;
 		}
 	}
-- 
2.39.2


  parent reply	other threads:[~2024-04-29 13:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29 13:07 [PATCH 0/8] Add R10D4+ support for IMSM Mateusz Kusiak
2024-04-29 13:07 ` [PATCH 1/8] mdadm: pass struct context for external reshapes Mateusz Kusiak
2024-04-29 13:07 ` [PATCH 2/8] mdadm: use struct context in reshape_super() Mateusz Kusiak
2024-04-29 13:07 ` [PATCH 3/8] imsm: add support for literal RAID 10 Mateusz Kusiak
2024-04-29 13:07 ` [PATCH 4/8] imsm: refactor RAID level handling Mateusz Kusiak
2024-04-29 13:07 ` [PATCH 5/8] imsm: bump minimal version Mateusz Kusiak
2024-04-29 13:07 ` Mateusz Kusiak [this message]
2024-04-29 13:07 ` [PATCH 7/8] imsm: simplify imsm_check_attributes() Mateusz Kusiak
2024-04-29 13:07 ` [PATCH 8/8] imsm: support RAID 10 with more than 4 drives Mateusz Kusiak
2024-05-07  7:47 ` [PATCH 0/8] Add R10D4+ support for IMSM Mariusz Tkaczyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240429130720.260452-7-mateusz.kusiak@intel.com \
    --to=mateusz.kusiak@intel.com \
    --cc=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mariusz.tkaczyk@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).