On a sparc64 T4-2 I boot OpenBSD from hardware RAID 1E using the
built-in controller:

        mpii0 at pci15 dev 0 function 0 "Symbios Logic SAS2008" rev 0x03: msi
        mpii0: Solana On-Board, firmware 9.0.0.0 IR, MPI 2.0
        scsibus1 at mpii0: 834 targets
        sd0 at scsibus1 targ 0 lun 0: <LSI, Logical Volume, 3000> 
naa.600508e0000000006cd1dcd59022a30a
        sd0: 713824MB, 512 bytes/sector, 1461911552 sectors
        root on sd0a (efde5b2c6ab7b8ac.a) swap on sd0b dump on sd0b

But OpenBSD shows it as RAID10, which is misleading:

        # bioctl mpii0
        Volume      Status               Size Device
            mpii0 0 Online       748498714112 sd0     RAID10
                  0 Online       500107861504 0:2.0   noencl <ATA 
CT500MX500SSD1>
                  1 Online       500107861504 0:1.0   noencl <ATA 
CT500MX500SSD1>
                  2 Online       500107861504 0:0.0   noencl <ATA 
CT500MX500SSD1>

Turns out the driver reports it like that and adapting the tool is
trivial.

Document 1E support, report 1E as 0x1E (like softraid(4) 1C being 0x1C)
and print it as such.

This merely supports printing it;  softraid code has nothing to do with
what hardware supports and the create/write path remains unchanged in
driver/softraid/bioctl land.

Format strings for different RAID levels start identical up to the level
specifics, so hoist the identical part while here to make this clearer
and simplify/shorten it.

        # ./obj/bioctl mpii0
        Volume      Status               Size Device
            mpii0 0 Online       748498714112 sd0     RAID1E
                  0 Online       500107861504 0:2.0   noencl <ATA 
CT500MX500SSD1>
                  1 Online       500107861504 0:1.0   noencl <ATA 
CT500MX500SSD1>
                  2 Online       500107861504 0:0.0   noencl <ATA 
CT500MX500SSD1>

Feedback? OK? (for after release)

diff --git a/sbin/bioctl/bioctl.c b/sbin/bioctl/bioctl.c
index 0abfa26fb74..50199c5b0a4 100644
--- a/sbin/bioctl/bioctl.c
+++ b/sbin/bioctl/bioctl.c
@@ -492,25 +492,24 @@ bio_inq(char *name)
                        else
                                snprintf(size, sizeof size, "%14llu",
                                    bv.bv_size);
+                       printf("%11s %-10s %14s %-7s ",
+                           volname, status, size, bv.bv_dev);
                        switch (bv.bv_level) {
                        case 'C':
-                               printf("%11s %-10s %14s %-7s CRYPTO%s%s\n",
-                                   volname, status, size, bv.bv_dev,
+                               printf("CRYPTO%s%s\n",
                                    percent, seconds);
                                break;
                        case 'c':
-                               printf("%11s %-10s %14s %-7s CONCAT%s%s\n",
-                                   volname, status, size, bv.bv_dev,
+                               printf("CONCAT%s%s\n",
                                    percent, seconds);
                                break;
                        case 0x1C:
-                               printf("%11s %-10s %14s %-7s RAID%X%s%s %s\n",
-                                   volname, status, size, bv.bv_dev,
+                       case 0x1E:
+                               printf("RAID%X%s%s %s\n",
                                    bv.bv_level, percent, seconds, cache);
                                break;
                        default:
-                               printf("%11s %-10s %14s %-7s RAID%u%s%s %s\n",
-                                   volname, status, size, bv.bv_dev,
+                               printf("RAID%u%s%s %s\n",
                                    bv.bv_level, percent, seconds, cache);
                                break;
                        }
diff --git a/share/man/man4/mpii.4 b/share/man/man4/mpii.4
index 766df72b96a..3f93449c1d7 100644
--- a/share/man/man4/mpii.4
+++ b/share/man/man4/mpii.4
@@ -59,11 +59,12 @@ Lenovo N2215, ThinkSystem 430
 LSI SAS 9200-8e, SAS 9207-8i, SAS 9211-4i, SAS 9211-8i
 .It
 Broadcom SAS 9300, HBA 9400
+.It
+Oracle SPARC T Series Platforms
 .El
 .Pp
 Some models of these controllers carry an Integrated RAID (IR) firmware
-providing support for RAID 0, RAID 1, RAID10 or RAID5 using SAS or SATA
-drives.
+providing support for RAID levels 0, 1, 1E, 5 or 10 using SAS or SATA drives.
 All RAID configuration is done through the controllers' BIOSes.
 .Sh SEE ALSO
 .Xr bio 4 ,
diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c
index 974ceb88ba7..39aa5fe5210 100644
--- a/sys/dev/pci/mpii.c
+++ b/sys/dev/pci/mpii.c
@@ -3423,6 +3423,8 @@ mpii_ioctl_vol(struct mpii_softc *sc, struct bioc_vol *bv)
                bv->bv_level = 1;
                break;
        case MPII_CFG_RAID_VOL_0_TYPE_RAID1E:
+               bv->bv_level = 0x1E;
+               break;
        case MPII_CFG_RAID_VOL_0_TYPE_RAID10:
                bv->bv_level = 10;
                break;

Reply via email to