On Mon, Jul 24, 2017 at 12:10 AM, FUKAUMI Naoki <fuka...@soum.co.jp> wrote:

> Hi,
>
> From: Jibby Jeremiah <jibby.jerem...@gmail.com>
> Subject: Re: Getting Dell RAID status via SNMP
> Date: Wed, 19 Jul 2017 15:03:21 -0400
>
> > Darn.  Well if you need more testers let me know.
>
> It seems your RAID card doesn't have cache,
>
> > mfii0 at pci3 dev 0 function 0 "Symbios Logic MegaRAID SAS3008" rev 0x02:
> > msi
> > mfii0: "PERC H330 Adapter", firmware 25.5.0.0019
>
> then, I guess the "issue" will not happen.
>
> Here is new/WIP patch to support bio(4) for mfii(4). it doesn't fix the
> "issue" yet, but it includes hot swap support from my patch for mfi(4)
>  http://marc.info/?l=openbsd-tech&m=149872410222552&w=2
>
> Could you try attached patch?
>

Hi,

Thanks for the patch, but it fails to build (also, I had to use 'patch -l'
to get it to apply at all, due to ^M line endings, etc.):
====
/usr/src/sys/dev/pci/mfii.c: In function 'mfii_makegood':
/usr/src/sys/dev/pci/mfii.c:3068: error: 'MR_DCMD_CFG_FOREIGN_SCAN'
undeclared (first use in this function)
/usr/src/sys/dev/pci/mfii.c:3068: error: (Each undeclared identifier is
reported only once
/usr/src/sys/dev/pci/mfii.c:3068: error: for each function it appears in.)
/usr/src/sys/dev/pci/mfii.c:3073: error: 'MR_DCMD_CFG_FOREIGN_CLEAR'
undeclared (first use in this function)
/usr/src/sys/dev/pci/mfii.c: In function 'mfii_makespare':
/usr/src/sys/dev/pci/mfii.c:3125: error: 'MR_DCMD_CFG_MAKE_SPARE'
undeclared (first use in this function)
*** Error 1 in /usr/src/sys/arch/amd64/compile/GENERIC.MP (Makefile:947
'mfii.o')
====

I got around that by copying those definitions from the FreeBSD mfi driver
(patch is also attached, in case gmail decides to munge inline tabs):
====
Add MR_DCMD_CFG definitions for *_SPARE and FOREIGN_* (taken from
FreeBSD sys/dev/mfi/mfireg.h).
--- sys/dev/ic/mfireg.h.bak Fri Jul 28 12:43:41 2017
+++ sys/dev/ic/mfireg.h Fri Jul 28 12:47:19 2017
@@ -139,6 +139,13 @@
 #define MR_DCMD_CONF_GET 0x04010000
 #define MR_DCMD_CFG_ADD 0x04020000
 #define MR_DCMD_CFG_CLEAR 0x04030000
+#define MR_DCMD_CFG_MAKE_SPARE 0x04040000
+#define MR_DCMD_CFG_REMOVE_SPARE 0x04050000
+#define MR_DCMD_CFG_FOREIGN_SCAN 0x04060100
+#define MR_DCMD_CFG_FOREIGN_DISPLAY 0x04060200
+#define MR_DCMD_CFG_FOREIGN_PREVIEW 0x04060300
+#define MR_DCMD_CFG_FOREIGN_IMPORT 0x04060400
+#define MR_DCMD_CFG_FOREIGN_CLEAR 0x04060500
 #define MR_DCMD_BBU_GET_STATUS 0x05010000
 #define MR_DCMD_BBU_GET_CAPACITY_INFO 0x05020000
 #define MR_DCMD_BBU_GET_DESIGN_INFO 0x05030000
====
I'll leave it to the experts to determine whether the numbers for
MR_DCMD_CFG_MAKE_SPARE, etc. are in fact correct.

I have the same PERC H330 HBA, and temporarily have a rather unique disk
configuration in this server -- it has two disks, initially set up as
RAID-1.  For testing UEFI support, I broke the mirror, and configured the
second disk as a passthrough disk, so as to have one disk with MBR and one
with GPT.  (Unfortunately, OpenBSD still doesn't boot in EFI mode on this
server, only BIOS mode [1].  FreeBSD and Linux do work fine with EFI.)
 Right now it shows a degraded RAID-1 volume plus the passthrough disk.
Obviously I plan to make a normal healthy RAID-1 before going live with it.

After building a new kernel with the patch, I now have a new 'mfii0' entry
in hw.sensors:
====
hw.sensors.cpu0.temp0=26.00 degC
hw.sensors.mfii0.drive0=degraded (sd0), WARNING
hw.sensors.pchtemp0.temp0=26.50 degC
hw.sensors.sdtemp0.temp0=25.62 degC
hw.sensors.sdtemp1.temp0=26.25 degC
====
(sdtemp was already working previously)

Also bioctl works too, at least for reading status (haven't tried modifying
the array):
=== bioctl sd0 output ====
BEFORE
sd0: <DELL, PERC H330 Adp, 4.27>, serial 007bbdf6cecf3d461e00005c56708741

AFTER (bioctl -v)
Volume      Status               Size Device
    mfii0 0 Degraded     499558383616 sd0     RAID1 WT
          0 Failed                  0 0:0.0   noencl <>
                                                     'unknown serial'
          1 Online       500107862016 0:1.0   noencl <ATA     TOSHIBA
DT01ACA0A7S0>
                                                     'unknown serial'
====
Not sure about the 'unknown serial', but otherwise looks correct.


Nice work!  Sorry I don't have a card with cache (e.g. H730) to test on,
but I haven't hit any problems with my H330 yet.


-Andrew


[1] https://marc.info/?l=openbsd-misc&m=146343624320665&w=2
With more recent kernels, the numbers on the "entry point" line are
different, but the UEFI boot problem otherwise remains the same -- video
corruption, followed by a reboot 10-15 seconds later.  I just discovered
that serial console support has recently been added to the UEFI bootloader,
so I hopefully I'll be able to see boot messages from after the video goes
wonky, and submit a more useful bug report.


dmesg:
OpenBSD 6.1 (GENERIC.MP) #1: Fri Jul 28 12:51:53 CDT 2017
    andrew@obsd-r230:/usr/src/sys/arch/amd64/compile/GENERIC.MP
RTC BIOS diagnostic error 80<clock_battery>
real mem = 8395776000 (8006MB)
avail mem = 8136630272 (7759MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0x8ef68000 (43 entries)
bios0: vendor Dell Inc. version "1.4.5" date 08/09/2016
bios0: Dell Inc. PowerEdge R230
acpi0 at bios0: rev 2
acpi0: sleep states S0 S5
acpi0: tables DSDT FACP BOOT SSDT SLIC HPET LPIT APIC MCFG WDAT SSDT DBGP
DBG2 SSDT SSDT SSDT SSDT SSDT SSDT PRAD HEST BERT ERST EINJ DMAR FPDT SPCR
acpi0: wakeup devices PEGP(S0) PEG0(S0) PEGP(S0) PEG1(S0) PEGP(S0) PEG2(S0)
XHC_(S0) XDCI(S0) PXSX(S0) RP01(S0) PXSX(S0) RP02(S0) PXSX(S0) RP03(S0)
PXSX(S0) RP04(S0) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 23999999 Hz
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i3-6100 CPU @ 3.70GHz, 3696.00 MHz
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: TSC frequency 3696000000 Hz
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 24MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i3-6100 CPU @ 3.70GHz, 3696.00 MHz
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 1 (application processor)
cpu2: Intel(R) Core(TM) i3-6100 CPU @ 3.70GHz, 3696.00 MHz
cpu2:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 1, core 0, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Core(TM) i3-6100 CPU @ 3.70GHz, 3696.00 MHz
cpu3:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,SENSOR,ARAT
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 1, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt0: no apic found for irq 32
acpiprt0: no apic found for irq 33
acpiprt0: no apic found for irq 34
acpiprt1 at acpi0: bus 1 (PEG0)
acpiprt2 at acpi0: bus 2 (PEG1)
acpiprt3 at acpi0: bus -1 (PEG2)
acpiprt4 at acpi0: bus -1 (RP01)
acpiprt5 at acpi0: bus -1 (RP02)
acpiprt6 at acpi0: bus -1 (RP03)
acpiprt7 at acpi0: bus -1 (RP04)
acpiprt8 at acpi0: bus -1 (RP05)
acpiprt9 at acpi0: bus -1 (RP06)
acpiprt10 at acpi0: bus -1 (RP07)
acpiprt11 at acpi0: bus -1 (RP08)
acpiprt12 at acpi0: bus 3 (RP09)
acpiprt13 at acpi0: bus -1 (RP10)
acpiprt14 at acpi0: bus 4 (RP11)
acpiprt15 at acpi0: bus -1 (RP12)
acpiprt16 at acpi0: bus -1 (RP13)
acpiprt17 at acpi0: bus -1 (RP14)
acpiprt18 at acpi0: bus -1 (RP15)
acpiprt19 at acpi0: bus -1 (RP16)
acpiprt20 at acpi0: bus -1 (RP17)
acpiprt21 at acpi0: bus -1 (RP18)
acpiprt22 at acpi0: bus -1 (RP19)
acpiprt23 at acpi0: bus -1 (RP20)
acpicpu0 at acpi0: C1(@1 halt!)
acpicpu1 at acpi0: C1(@1 halt!)
acpicpu2 at acpi0: C1(@1 halt!)
acpicpu3 at acpi0: C1(@1 halt!)
"ACPI000D" at acpi0 not configured
"INT3F0D" at acpi0 not configured
"PNP0501" at acpi0 not configured
"PNP0501" at acpi0 not configured
"IPI0001" at acpi0 not configured
acpibtn0 at acpi0: SLPB
"PNP0C14" at acpi0 not configured
"PNP0C33" at acpi0 not configured
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD1F
ipmi at mainbus0 not configured
memory map conflict 0xe00fd000/0x1000
memory map conflict 0xfe000000/0x11000
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 vendor "Intel", unknown product 0x190f rev
0x07
ppb0 at pci0 dev 1 function 0 "Intel Core 6G PCIE" rev 0x07: msi
pci1 at ppb0 bus 1
mfii0 at pci1 dev 0 function 0 "Symbios Logic MegaRAID SAS3008" rev 0x02:
msi
mfii0: "PERC H330 Adapter", firmware 25.5.0.0019
scsibus1 at mfii0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <DELL, PERC H330 Adp, 4.27> SCSI3 0/direct
fixed naa.61418770565c00001e463dcfcef6bd7b
sd0: 476416MB, 512 bytes/sector, 975699968 sectors
scsibus2 at mfii0: 256 targets
sd1 at scsibus2 targ 0 lun 0: <ATA, TOSHIBA DT01ACA0, A7S0> SCSI4 0/direct
fixed naa.5000039fe4d115d9
sd1: 476940MB, 512 bytes/sector, 976773168 sectors
ppb1 at pci0 dev 1 function 1 "Intel Core 6G PCIE" rev 0x07: msi
pci2 at ppb1 bus 2
xhci0 at pci0 dev 20 function 0 "Intel 100 Series xHCI" rev 0x31: msi
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Intel xHCI root hub" rev
3.00/1.00 addr 1
pchtemp0 at pci0 dev 20 function 2 "Intel 100 Series Thermal" rev 0x31
"Intel 100 Series MEI" rev 0x31 at pci0 dev 22 function 0 not configured
"Intel 100 Series MEI" rev 0x31 at pci0 dev 22 function 1 not configured
ahci0 at pci0 dev 23 function 0 "Intel 100 Series AHCI" rev 0x31: msi, AHCI
1.3.1
ahci0: port 4: 1.5Gb/s
scsibus3 at ahci0: 32 targets
cd0 at scsibus3 targ 4 lun 0: <HL-DT-ST, DVD-ROM DU90N, D3B0> ATAPI 5/cdrom
removable
ppb2 at pci0 dev 29 function 0 "Intel 100 Series PCIE" rev 0xf1: msi
pci3 at ppb2 bus 3
3:0:0: mem address conflict 0xfffc0000/0x40000
3:0:1: mem address conflict 0xfffc0000/0x40000
bge0 at pci3 dev 0 function 0 "Broadcom BCM5720" rev 0x00, BCM5720 A0
(0x5720000), APE firmware NCSI 1.3.16.0: msi, address 34:17:eb:eb:31:5e
brgphy0 at bge0 phy 1: BCM5720C 10/100/1000baseT PHY, rev. 0
bge1 at pci3 dev 0 function 1 "Broadcom BCM5720" rev 0x00, BCM5720 A0
(0x5720000), APE firmware NCSI 1.3.16.0: msi, address 34:17:eb:eb:31:5f
brgphy1 at bge1 phy 2: BCM5720C 10/100/1000baseT PHY, rev. 0
ppb3 at pci0 dev 29 function 2 "Intel 100 Series PCIE" rev 0xf1: msi
pci4 at ppb3 bus 4
ppb4 at pci4 dev 0 function 0 "Renesas SH7758 PCIE Switch" rev 0x00
pci5 at ppb4 bus 5
ppb5 at pci5 dev 0 function 0 "Renesas SH7758 PCIE Switch" rev 0x00
pci6 at ppb5 bus 6
ppb6 at pci6 dev 0 function 0 "Renesas SH7758 PCIE-PCI" rev 0x00
pci7 at ppb6 bus 7
vga1 at pci7 dev 0 function 0 "Matrox MGA G200eR" rev 0x01
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
pcib0 at pci0 dev 31 function 0 "Intel C236 LPC" rev 0x31
"Intel 100 Series PMC" rev 0x31 at pci0 dev 31 function 2 not configured
ichiic0 at pci0 dev 31 function 4 "Intel 100 Series SMBus" rev 0x31: apic 2
int 16
iic0 at ichiic0
sdtemp0 at iic0 addr 0x19: at30tse004
sdtemp1 at iic0 addr 0x1b: at30tse004
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
com1: console
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vmm0 at mainbus0: VMX/EPT
uhidev0 at uhub0 port 2 configuration 1 interface 0 "Avocent APC AP5631"
rev 1.10/1.00 addr 2
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes, country code 33
wskbd0 at ukbd0: console keyboard, using wsdisplay0
uhidev1 at uhub0 port 2 configuration 1 interface 1 "Avocent APC AP5631"
rev 1.10/1.00 addr 2
uhidev1: iclass 3/1, 3 report ids
ums0 at uhidev1 reportid 1: 5 buttons, Z dir
wsmouse0 at ums0 mux 0
uhid0 at uhidev1 reportid 2: input=2, output=0, feature=0
uhid1 at uhidev1 reportid 3: input=1, output=0, feature=0
uhub1 at uhub0 port 3 configuration 1 interface 0 "no manufacturer Gadget
USB HUB" rev 2.00/0.00 addr 3
vscsi0 at root
scsibus4 at vscsi0: 256 targets
softraid0 at root
scsibus5 at softraid0: 256 targets
root on sd0a (e3e0fbacbddfdec2.a) swap on sd0b dump on sd0b
Add MR_DCMD_CFG definitions for *_SPARE and FOREIGN_* (taken from
FreeBSD sys/dev/mfi/mfireg.h).
--- sys/dev/ic/mfireg.h.bak     Fri Jul 28 12:43:41 2017
+++ sys/dev/ic/mfireg.h Fri Jul 28 12:47:19 2017
@@ -139,6 +139,13 @@
 #define MR_DCMD_CONF_GET                       0x04010000
 #define MR_DCMD_CFG_ADD                                0x04020000
 #define MR_DCMD_CFG_CLEAR                      0x04030000
+#define MR_DCMD_CFG_MAKE_SPARE                 0x04040000
+#define MR_DCMD_CFG_REMOVE_SPARE               0x04050000
+#define MR_DCMD_CFG_FOREIGN_SCAN               0x04060100
+#define MR_DCMD_CFG_FOREIGN_DISPLAY            0x04060200
+#define MR_DCMD_CFG_FOREIGN_PREVIEW            0x04060300
+#define MR_DCMD_CFG_FOREIGN_IMPORT             0x04060400
+#define MR_DCMD_CFG_FOREIGN_CLEAR              0x04060500
 #define MR_DCMD_BBU_GET_STATUS                 0x05010000
 #define MR_DCMD_BBU_GET_CAPACITY_INFO          0x05020000
 #define MR_DCMD_BBU_GET_DESIGN_INFO            0x05030000

Reply via email to