Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Mar 2012 18:35:07 +0000 (UTC)
From:      Doug Ambrisko <ambrisko@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r233621 - projects/head_mfi/usr.sbin/mfiutil
Message-ID:  <201203281835.q2SIZ7Jt049113@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ambrisko
Date: Wed Mar 28 18:35:07 2012
New Revision: 233621
URL: http://svn.freebsd.org/changeset/base/233621

Log:
  Now that mfi(4) header files uses the absolute number of entries to
  make the mfi_array 288 bytes, remove this magic number and the
  calculations that go with it.  Use the MFI_MAX_ROW_SIZE and
  sizeof(struct mfi_array) in place of the prior calculations.
  
  Change reporting a disk as "SYSTEM" when it is a "JBOD" reported
  by the firmware and MegaCli.  A JBOD appears as /dev/mfisyspd<n>.
  
  This also means the mfiutil command to "create jbod" is now a
  little confusing since a RAID per drive is not really what LSI
  defines JBOD to be.  In the future mfiutil should have an option
  to create real JBOD's and enable that option in RAID controllers
  that support it.  In testing, it appears the RAID cache is not
  used with JBOD but is with the RAID per disk.  When this is
  implemented more testing should be done to determine the pro's and
  con's of JBOD versus RAID per disk.
  
  Reviewed by:	jhb

Modified:
  projects/head_mfi/usr.sbin/mfiutil/mfi_config.c
  projects/head_mfi/usr.sbin/mfiutil/mfi_drive.c

Modified: projects/head_mfi/usr.sbin/mfiutil/mfi_config.c
==============================================================================
--- projects/head_mfi/usr.sbin/mfiutil/mfi_config.c	Wed Mar 28 18:19:21 2012	(r233620)
+++ projects/head_mfi/usr.sbin/mfiutil/mfi_config.c	Wed Mar 28 18:35:07 2012	(r233621)
@@ -211,9 +211,8 @@ clear_config(int ac, char **av)
 }
 MFI_COMMAND(top, clear, clear_config);
 
-#define	MFI_ARRAY_SIZE		288
-#define	MAX_DRIVES_PER_ARRAY						\
-	((MFI_ARRAY_SIZE - sizeof(struct mfi_array)) / 8)
+#define MAX_DRIVES_PER_ARRAY MFI_MAX_ROW_SIZE
+#define MFI_ARRAY_SIZE sizeof(struct mfi_array)
 
 #define	RT_RAID0	0
 #define	RT_RAID1	1
@@ -305,7 +304,7 @@ parse_array(int fd, int raid_type, char 
 
 	/* Validate the number of drives for this array. */
 	if (count >= MAX_DRIVES_PER_ARRAY) {
-		warnx("Too many drives for a single array: max is %zu",
+		warnx("Too many drives for a single array: max is %d",
 		    MAX_DRIVES_PER_ARRAY);
 		return (EINVAL);
 	}

Modified: projects/head_mfi/usr.sbin/mfiutil/mfi_drive.c
==============================================================================
--- projects/head_mfi/usr.sbin/mfiutil/mfi_drive.c	Wed Mar 28 18:19:21 2012	(r233620)
+++ projects/head_mfi/usr.sbin/mfiutil/mfi_drive.c	Wed Mar 28 18:35:07 2012	(r233621)
@@ -149,7 +149,7 @@ mfi_pdstate(enum mfi_pd_state state)
 	case MFI_PD_STATE_COPYBACK:
 		return ("COPYBACK");
 	case MFI_PD_STATE_SYSTEM:
-		return ("SYSTEM");
+		return ("JBOD");
 	default:
 		sprintf(buf, "PSTATE 0x%04x", state);
 		return (buf);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203281835.q2SIZ7Jt049113>