UFS mrsas and the mystery of lost speed

Hi Storage. My adventures with Dell PowerEdge R730, PERC 730 SAS-3 controller (aka LSI aka Avago aka Broadcom SAS3108) and SAS-3 SSD drives continues. In our last episode we switched driver from mfi(4)() to mrsas(4)() since the former was causing kernel panic and the abovementioned controller requires the latter anyway IIUC. Sadly, this led me to some rather puzzling and unpleasant discoveries. So, here goes.

By way of setting the stage and giving you enough context:
- PERC 730 above is SAS-3 capable of 12Gbps transfers, based on LSI SAS 2108 12Gbps ROC,
- SSDs connected to the backplane are these HGST also 12Gbps SAS

Now that we've switched over to `mrsas` driver and managed to install FreeBSD and boot off of one of them, time to look ad `dmesg`:

Ok, I mean its probably not wrong, but I've no clue why it says Avago Invader there. FWIW the very first Google hit leads to Broadcom SAS3108 which never actually mentions Invader anything but I guess its correctly identified:
Code:
  AVAGO MegaRAID SAS FreeBSD mrsas driver version: 07.709.04.00-fbsd
  mrsas0: <AVAGO Invader SAS Controller> port 0x2000-0x20ff mem 0x96200000-0x9620ffff,0x96100000-0x961fffff irq 26 at device 0.0 numa-domain 0 on pci3
  mrsas0: FW now in Ready state
  mrsas0: Using MSI-X with 72 number of vectors
  mrsas0: FW supports <96> MSIX vector,Online CPU 72 Current MSIX <72>
  mrsas0: max sge: 0x46, max chain frame size: 0x400, max fw cmd: 0x39f
  mrsas0: Issuing IOC INIT command to FW.
  mrsas0: IOC INIT response received from FW.

I also expose enclosures via BIOS so we should see some `ses` items and hopefully `da` drives:
Code:
  Root mount waiting for: CAM usbus0 usbus1 usbus2
  ses0 at mrsas0 bus 1 scbus1 target 32 lun 0
  ses0: <DP BP13G+EXP 3.35> Fixed Enclosure Services SPC-4 SCSI device
  ses0: Serial Number 500056b3f4cbeefe
  ses0: 150.000MB/s transfers
  ses0: SES Device
  ses1 at ahciem0 bus 0 scbus6 target 0 lun 0
  ses1: <AHCI SGPIO Enclosure 2.00 0001> SEMB S-E-S 2.00 device
  ses1: SEMB SES Device
  ses2 at ahciem1 bus 0 scbus13 target 0 lun 0
  ses2: <AHCI SGPIO Enclosure 2.00 0001> SEMB S-E-S 2.00 device
  ses2: SEMB SES Device
  da0 at mrsas0 bus 1 scbus1 target 0 lun 0
  da0: <HITACHI HUSMM141CLAR1600 C342> Fixed Direct Access SPC-4 SCSI device
  da0: Serial Number 0SYBE15A      
  da0: 150.000MB/s transfers
  da0: 1526185MB (3125627568 512 byte sectors)
  ses0: pass0,da0 in 'Drive Slot 00', SAS Slot: 2 phys at slot 0
  ses0:  phy 0: SAS device type 1 phy 0 Target ( SSP )
  ses0:  phy 0: parent 500056b3f4cbeeff addr 5000cca050bdde25
  ses0:  phy 1: SAS device type 0 phy 0
  ses0:  phy 1: parent 0 addr 0

wait ... wat
Why is it measly 150MB/s? And does this line ses0: phy 0: SAS device type 1 claim its SAS-1 (ses0 is our backplane)? That transfer rate there also suggests that it ids the link as SAS-1 1Gbps.
What is going on here?
Eh, maybe its just talk and real perf will be up to standard?

Lets run hopefully realistic test with fio:
Code:
  $ fio --name=random-write --ioengine=posixaio --rw=randwrite --bs=1m --numjobs=1 --size=4g --iodepth=1 --runtime=60 --time_based --end_fsync=1

  ...
  Run status group 0 (all jobs):
  WRITE: bw=157MiB/s (165MB/s), 157MiB/s-157MiB/s (165MB/s-165MB/s), io=9443MiB (9902MB), run=60187-60187msec
that's not encouraging, right?

Lets straight up write:
Code:
  $ touch test.file
  $ gshred -n 1 -s 10G test.file

  # don't worry, source and dest are on separate drives here each HGST SAS-3
  $ rsync -v -W --info=progress2 test.file da1/
  test.file
   10,737,418,240 100%  340.98MB/s    0:00:30 (xfr#1, to-chk=0/1)

  sent 10,740,039,762 bytes  received 35 bytes  352,132,452.36 bytes/sec
  total size is 10,737,418,240  speedup is 1.00

I must mention that PERC controller BIOS reports "negotiated speed" with those drives as 6Gbps. That in itself is also a mystery to me. I've no idea why this is so, but even then, shouldn't we be faster? I swear I was getting better perf with this same drive on Dell R720 - previous generation server with PERC 710 re-flashed to work as HBA - and that controller was SAS-2 capped at 6Gbps.

I am a bit lost here. Have my expectations missed the mark yet again?
Is there some voodoo magic device hinting I must do to fix that link speed and gain perf back?

In the immortal words of Dr Seuss "well, what would you do if your mother ... wait ... that happened to you"?

EDIT: for anyone with trust issues (aka me)
Code:
  $ sudo smartctl -a /dev/da1

  ... ommitted ...

  Transport protocol:   SAS (SPL-3)
 
Ok, I mean its probably not wrong, but I've no clue why it says Avago Invader there. FWIW the very first Google hit leads to Broadcom SAS3108 which never actually mentions Invader anything but I guess its correctly identified
If I recall correctly that Avago Invader is the card that had a LSI SAS3108 chip set. These chips and the cards changed hands a few times, it used to be LSI, then Avago and now Broadcom owns the IP. A lot of Dell's PERC and HP Smart Array cards are rebranded LSI/Avago/Broadcom cards. The driver just detects the chip set, not the actual brand.
 
FWIW here are the results on the same system booted off Fedora Live USB

Code:
[liveuser@localhost-live ~]$ uname -a
Linux localhost-live 5.8.15-301.fc33.x86_64 #1 SMP Thu Oct 15 16:58:06 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux


[liveuser@localhost-live fiotest]$ fio --name=random-write --ioengine=posixaio --rw=randwrite --bs=1m --numjobs=1 --size=4g --iodepth=1 --runtime=60 --time_based --end_fsync=1
random-write: (g=0): rw=randwrite, bs=(R) 1024KiB-1024KiB, (W) 1024KiB-1024KiB, (T) 1024KiB-1024KiB, ioengine=posixaio, iodepth=1
fio-3.21
Starting 1 process

 ... ommitted ...

Run status group 0 (all jobs):
  WRITE: bw=368MiB/s (386MB/s), 368MiB/s-368MiB/s (386MB/s-386MB/s), io=24.0GiB (25.8GB), run=66713-66713msec

So random writes with FIO are twice as fast compared to FreeBSD.
Interestingly bulk write with `rsync` shows result similar to FreeBSD above - although I don't know maybe I was reading funny - IIUC I was reading off of `tmpfs` ... so I'm thinking from RAM.

Not great. Not great at all.
I'm not happy with that Linux result, but I am extremely puzzled by FreeBSD.

WTF why am I only getting 300+MiB/s best on Linux???
Why the hell does FreeBSD tops at 150MB/s?
 
Here is the similar issue for AVAGO LSI 3108 which detect data rate at 150MB/s So most likely you will get better help on the mailing list regarding mrsas and PERC 730 SAS
 
Here is the similar issue for AVAGO LSI 3108 which detect data rate at 150MB/s So most likely you will get better help on the mailing list regarding mrsas and PERC 730 SAS
thank you for the linked convo. Which list should I hit? There's a gazzillion of them. freebsd-scsi?
 
Try with freebsd-questions or freebsd-performance
the freebsd-scsi and freebsd-drivers are for the devs.

Maybe https://lists.freebsd.org/mailman/listinfo/freebsd-hardware also
reported to -questions and -performance since I've been subscribed already :)

I would consider doing what the other person had done: buying another 12Gbps HBA altogether and pulling that PERC out (money lost ...) but I'm not at all certain Dell's expander backplane would play ball with e.g. LSI 9300. What pain
 
here's another hilarious result. Same `fio` random write test ... 2x as performant on Dell R720 with SAS-2 HBA (6Gbps) with the exact same SSD drive:
Code:
Run status group 0 (all jobs):
  WRITE: bw=342MiB/s (359MB/s), 342MiB/s-342MiB/s (359MB/s-359MB/s), io=20.1GiB (21.5GB), run=60092-60092msec
 
According to the docs, 3108 should use mpr(4)
https://www.freebsd.org/releases/12.2R/hardware/

I have a couple of boxes with similar controller.

Code:
$ pciconf -lv | grep -A 4  mrsas
mrsas0@pci0:1:0:0:    class=0x010400 card=0x12111734 chip=0x005f1000 rev=0x02 hdr=0x00
    vendor     = 'LSI Logic / Symbios Logic'
    device     = 'MegaRAID SAS-3 3008 [Fury]'
    class      = mass storage
    subclass   = RAID
--
mrsas1@pci0:129:0:0:    class=0x010400 card=0x12121734 chip=0x005d1000 rev=0x02 hdr=0x00
    vendor     = 'LSI Logic / Symbios Logic'
    device     = 'MegaRAID SAS-3 3108 [Invader]'
    class      = mass storage
    subclass   = RAID

Code:
grep ^mrsas /var/run/dmesg.boot
mrsas0: <AVAGO Fury SAS Controller> port 0x6000-0x60ff mem 0xc7b00000-0xc7b0ffff,0xc7a00000-0xc7afffff irq 26 at device 0.0 numa-domain 0 on pci3
mrsas0: FW now in Ready state
mrsas0: Using MSI-X with 24 number of vectors
mrsas0: FW supports <96> MSIX vector,Online CPU 24 Current MSIX <24>
mrsas0: max sge: 0x46, max chain frame size: 0x400, max fw cmd: 0xef
mrsas0: Issuing IOC INIT command to FW.
mrsas0: IOC INIT response received from FW.
mrsas0: FW supports SED
mrsas0: System PD created target ID: 0x9
mrsas0: System PD created target ID: 0xa
mrsas0: System PD created target ID: 0xb
mrsas0: System PD created target ID: 0xc
mrsas0: System PD created target ID: 0xd
mrsas0: System PD created target ID: 0xe
mrsas0: System PD created target ID: 0xf
mrsas0: System PD created target ID: 0x10
mrsas0: System PD created target ID: 0x11
mrsas0: System PD created target ID: 0x12
mrsas0: System PD created target ID: 0x13
mrsas0: System PD created target ID: 0x14
mrsas0: max_fw_cmds: 239  max_scsi_cmds: 223
mrsas0: MSI-x interrupts setup success
mrsas0: mrsas_ocr_thread
mrsas1: <AVAGO Invader SAS Controller> port 0xf000-0xf0ff mem 0xfbe00000-0xfbe0ffff,0xfbd00000-0xfbdfffff irq 50 at device 0.0 numa-domain 1 on pci10
mrsas1: FW now in Ready state
mrsas1: Using MSI-X with 24 number of vectors
mrsas1: FW supports <96> MSIX vector,Online CPU 24 Current MSIX <24>
mrsas1: max sge: 0x46, max chain frame size: 0x400, max fw cmd: 0x39f
mrsas1: Issuing IOC INIT command to FW.
mrsas1: IOC INIT response received from FW.
mrsas1: FW supports SED
mrsas1: FW supports JBOD Map
mrsas1: Jbod map is supported
mrsas1: System PD created target ID: 0x0
mrsas1: System PD created target ID: 0x1
mrsas1: max_fw_cmds: 927  max_scsi_cmds: 911
mrsas1: MSI-x interrupts setup success
mrsas1: mrsas_ocr_thread
mrsas0: Disestablish mrsas intr hook
mrsas1: Disestablish mrsas intr hook

With that said, I see we are using mrsas on that box. Actually, we had great troubles with one of the machines after upgrading from FreeBSD-11.2 to 12.1 (IIRC). In 11.2, the driver chosen per default was not mrsas(4) but mfi(4). After upgrading to 12.1, we got massive problems with checksum errors in the large ZFS zpool. I the end, the hardware support at Fujitsu helped us and found some blog post about using mrsas instead of the default driver. (They didn't know much about FreeBSD, naturally, but they did help us. Kudos to them!). By setting
Code:
hw.mfi.mrsas_enable=1
in /boot/loader.conf we managed to get a working system without generating new checksum errors. Hence I have similar experience that mfi(4) is bad for you. Sadly, the kernel choses mfi(4) unless you force it to something else, which I think is really bad. From what I understand, it is somehow a hard problem to solve.

Anyway, I see the same error as you do. Low transer rates:
Code:
$ grep ^da0 /var/run/dmesg.boot
da0 at mrsas0 bus 1 scbus1 target 9 lun 0
da0: <WD WD4001FYYG-50SL3 VF08> Fixed Direct Access SPC-4 SCSI device
da0: Serial Number WMC1F1702523
da0: 150.000MB/s transfers
da0: 3815447MB (7814037168 512 byte sectors)

Same for all 14 disks.

Can you force using the driver that is recommended for your hardware? Again, according the hardware docs, LSI 2108 should use mps(4). Are you sure mrsas(4) is the right driver to use? I must admit I am confused as to which driver to use. See if you can find a way to force it to use something else than mfi or mrsas. If it is a LSI 2108, mps should be the way to go, or if it is indeed a 3108, mpr should be used if the HARDWARE list should be trusted.
 
HARDWARE list should be trusted
that list also specifically mentions PERC H730 under mrsas driver. That card uses that chip underneath but hell if I know what else it adds. Maybe worth a try. Suddenly finding myself with hands full ... might try but no promises.
 
I've got two machines with the H730 - a T330 and an R430 - and both show 150 MB/s.

Code:
AVAGO MegaRAID SAS FreeBSD mrsas driver version: 07.709.04.00-fbsd
mrsas0: <AVAGO Invader SAS Controller> port 0x3000-0x30ff mem 0x92c00000-0x92c0ffff,0x92b00000-0x92bfffff at device 0.0 on pci1
...
da0 at mrsas0 bus 0 scbus0 target 0 lun 0
da0: <DELL PERC H730 Adp 4.30> Fixed Direct Access SPC-3 SCSI device
da0: Serial Number 00c3701c099d8d4d2500eb9261a06d86
da0: 150.000MB/s transfers
da0: 5721600MB (11717836800 512 byte sectors)
ses0 at ahciem0 bus 0 scbus8 target 0 lun 0
ses0: <AHCI SGPIO Enclosure 2.00 0001> SEMB S-E-S 2.00 device
ses0: SEMB SES Device

That was such a vast improvement (especially with writing using RAID1 and RAID5) on the original H330s that I had in both machines that I didn't think further about 150 MB/s not being that great.

The drives I have in both machines aren't great, so not sure what improvements (if any) I could get.

Have you installed MegaCli from ports? That might be useful e.g. here showing my drives should be able to do 6 Gb/s (about 600 MB/s, I think?) But I've not done much in the way of timing tests other than noting iostat for a large cp was showing about 150-160 MB/s.

Code:
# MegaCli -PDList -aALL
                                     
Adapter #0

Enclosure Device ID: 32
Slot Number: 0
Drive's position: DiskGroup: 0, Span: 0, Arm: 0
Enclosure position: 1
Device Id: 0
WWN: 5000c500b0e94139
Sequence Number: 2
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SATA

Raw Size: 1.819 TB [0xe8e088b0 Sectors]
Non Coerced Size: 1.818 TB [0xe8d088b0 Sectors]
Coerced Size: 1.818 TB [0xe8d00000 Sectors]
Sector Size:  512
Logical Sector Size:  512
Physical Sector Size:  512
Firmware state: Online, Spun Up
Device Firmware Level: EA04
Shield Counter: 0
Successful diagnostics completion on :  N/A
SAS Address(0): 0x4433221106000000
Connected Port Number: 3(path0) 
Inquiry Data:             ZDS0E5V1ST2000NM0018-2F3130                         EA04
FDE Capable: Not Capable
FDE Enable: Disable
Secured: Unsecured
Locked: Unlocked
Needs EKM Attention: No
Foreign State: None 
Device Speed: 6.0Gb/s 
Link Speed: 6.0Gb/s 
Media Type: Hard Disk Device
Drive Temperature :34C (93.20 F)
PI Eligibility:  No 
Drive is formatted for PI information:  No
PI: No PI
Drive's NCQ setting : N/A
Port-0 :
Port status: Active
Port's Linkspeed: 6.0Gb/s 
Drive has flagged a S.M.A.R.T alert : No
 
Not sure I'm adding much in the way of answers - but that "150.000 MB/s transfers" message might be hard-coded?
Code:
da0: 150.000MB/s transfers
Code:
ccb->cpi.base_transfer_speed = 150000;
strlcpy(ccb->cpi.sim_vid, "FreeBSD", SIM_IDLEN);
strlcpy(ccb->cpi.hba_vid, "AVAGO", HBA_IDLEN);
If you look at other drivers e.g. mpr, they seem to be trying a bit harder to interrogate the system, and there's also one telling comment in the code:
Code:
/*
 * XXXSLM-I think this needs to change based on config page or
 * something instead of hardcoded to 150000.
 */
cpi->base_transfer_speed = 150000;
... (further down in some code to do with SAS):
switch (targ->linkrate) {
    case 0x08:
        sas->bitrate = 150000;
        break;
    case 0x09:
        sas->bitrate = 300000;
        break;
    case 0x0a:
        sas->bitrate = 600000;
        break;
    case 0x0b:
        sas->bitrate = 1200000;
        break;
    default:
        sas->valid = 0;
    }
Could be a complete red herring - I've just gone hunting for 150000 in likely looking places!
 
Thought I would share my findings.
I have 4x SATA 1Tb SSD's in a RAID10 configuration:
Code:
pciconf -lv | grep -A 4 mrsas
mrsas0@pci0:101:0:0:    class=0x010400 rev=0x01 hdr=0x00 vendor=0x1000 device=0x0017 subvendor=0x17aa subdevice=0x103a
    vendor     = 'Broadcom / LSI'
    device     = 'MegaRAID Tri-Mode SAS3408'
    class      = mass storage
    subclass   = RAID

Getting errors:
Code:
mrsas0: Initiating Target RESET because of SCSI IO timeout!
mrsas0: Task management NOT SUPPORTED for CAM target:69
mrsas0: target reset FAIL!!
mrsas0: Initiaiting OCR because of TM FAILURE!
mrsas0: [ 0]waiting for 1 commands to complete
mrsas0: Reset Exit with 0.
ses0 at ahciem0 bus 0 scbus1 target 0 lun 0
ses0: <AHCI SGPIO Enclosure 2.00 0001> SEMB S-E-S 2.00 device
ses0: SEMB SES Device
ses1 at ahciem1 bus 0 scbus8 target 0 lun 0
ses1: <AHCI SGPIO Enclosure 2.00 0001> SEMB S-E-S 2.00 device
ses1: SEMB SES Device
ses2 at mrsas0 bus 1 scbus10 target 69 lun 0
ses2: <LSI VirtualSES 03> Fixed Enclosure Services SPC-5 SCSI device
ses2: Serial Number 300605B00E09B9C0
ses2: 150.000MB/s transfers
ses2: SES Device
da0 at mrsas0 bus 0 scbus9 target 0 lun 0
da0: <Lenovo 9440-8i 5.15> Fixed Direct Access SPC-3 SCSI device
da0: Serial Number 007ab725b9f68d2e28c0b97d0eb00506
da0: 150.000MB/s transfers
da0: 1952448MB (3998613504 512 byte sectors)

Tried to test the write speed, getting around 450-470MB/s. (uncencrypted UFS)
As it's the first time with this card, not sure what's causing the error and how to resolve it for a use in production.
 
Hello,

I'm running on MegaRAID SAS-3 3008 and I have upgraded from FreeBSD-12 to FreeBSD-13.0
Using the default mfi(4) driver resultet into lots of checksum, read and write errors in my pool, also started logging lots of zfs and mfi I/O errors in dmesg.

So I switched driver from mfi(4)to mrsas(4).
There are no ZFS errors, still just started a zfs scrub just in case.
Did I haven't run a performance test, will do it after the scrub is done but checked both boot log and smartctl, they do not show the same result:
Code:
root@datacore3:~ # grep -i da3 /var/run/dmesg.boot
da3 at mrsas0 bus 1 scbus1 target 3 lun 0
da3: <ATA TOSHIBA MG04ACA6 FS7D> Fixed Direct Access SPC-4 SCSI device
da3: Serial Number 76U7K5FRFE1C
da3: 150.000MB/s transfers
da3: 5723166MB (11721045168 512 byte sectors)

And
Code:
root@datacore3:~ # smartctl -a /dev/da3 |grep -i sata
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
root@datacore3:~ #

Not sure which is right. On the smartctl I would assume it's just the interface version of the drive, but there's also this one "(current: 6.0 Gb/s)", which looks like current speed of the link.

It will take another few days to finish the scrub, then I will run a performance test and will post here which looks like the true link speed to me.
 
… boot log and smartctl, they do not show the same result: …

I should not expect the same.

Here, for example:

Code:
% grep da3 /var/log/messages | tail -n 4
Mar 27 11:07:43 mowa219-gjp4-8570p-freebsd kernel: da3: <StoreJet Transcend 0> Fixed Direct Access SPC-4 SCSI device
Mar 27 11:07:43 mowa219-gjp4-8570p-freebsd kernel: da3: 400.000MB/s transfers
Mar 27 11:07:43 mowa219-gjp4-8570p-freebsd kernel: da3: 476940MB (976773168 512 byte sectors)
Mar 27 11:07:43 mowa219-gjp4-8570p-freebsd kernel: da3: quirks=0x2<NO_6_BYTE>
% sudo smartctl -a /dev/da3 | grep -i sata
grahamperrin's password:
SATA Version is:  SATA 2.6, 3.0 Gb/s (current: 3.0 Gb/s)
% geom disk list da3
Geom name: da3
Providers:
1. Name: da3
   Mediasize: 500107862016 (466G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e3
   descr: StoreJet Transcend
   lunid: 5000000000000001
   ident: (null)
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

%
 
I should not expect the same.

Here, for example:

Code:
% grep da3 /var/log/messages | tail -n 4
Mar 27 11:07:43 mowa219-gjp4-8570p-freebsd kernel: da3: <StoreJet Transcend 0> Fixed Direct Access SPC-4 SCSI device
Mar 27 11:07:43 mowa219-gjp4-8570p-freebsd kernel: da3: 400.000MB/s transfers
Mar 27 11:07:43 mowa219-gjp4-8570p-freebsd kernel: da3: 476940MB (976773168 512 byte sectors)
Mar 27 11:07:43 mowa219-gjp4-8570p-freebsd kernel: da3: quirks=0x2<NO_6_BYTE>
% sudo smartctl -a /dev/da3 | grep -i sata
grahamperrin's password:
SATA Version is:  SATA 2.6, 3.0 Gb/s (current: 3.0 Gb/s)
% geom disk list da3
Geom name: da3
Providers:
1. Name: da3
   Mediasize: 500107862016 (466G)
   Sectorsize: 512
   Stripesize: 4096
   Stripeoffset: 0
   Mode: r1w1e3
   descr: StoreJet Transcend
   lunid: 5000000000000001
   ident: (null)
   rotationrate: unknown
   fwsectors: 63
   fwheads: 255

%
That's fine and I see difference in the speed too.

But now which one is correct?

From my tests it appears that my drives speed caps at about 3Gbps, even the SSD ones.
On theory if I have to point one of the values I would go for 6Gbps instead of 150.000MB/s, however I have the strong feeling that my drives are actually working on 3Gbps.

Also discovered another bug with the mrsas driver - when operating on blocks larger than 278k the controller fails, please check this one:

Code:
root@datacore3:~ # dd if=/dev/da1 of=/dev/null bs=278k count=1024000 status=progress
^C
8710109184 bytes (8710 MB, 8307 MiB) transferred 24.005s, 363 MB/s
31624+0 records in
31624+0 records out
9002467328 bytes transferred in 24.737290 secs (363922946 bytes/sec)
root@datacore3:~ # dd if=/dev/da0 of=/dev/null bs=279k count=1024000 status=progress
dd: /dev/da0: Input/output error
0+0 records in
0+0 records out
0 bytes transferred in 0.000518 secs (0 bytes/sec)
root@datacore3:~ # tail /var/log/messages
Apr  5 17:12:42 datacore3 kernel: mrsas0: Build SYSPDIO failed.
Apr  5 17:12:42 datacore3 kernel: (da0:mrsas0:1:0:0): READ(10). CDB: 28 00 00 00 00 00 00 02 2e 00 
Apr  5 17:12:42 datacore3 kernel: (da0:mrsas0:1:0:0): CAM status: SMP Status Error
Apr  5 17:12:42 datacore3 kernel: (da0:mrsas0:1:0:0): Retrying command, 0 more tries remain
Apr  5 17:12:42 datacore3 kernel: mrsas0: mrsas_data_load_cb_prp: error=27
Apr  5 17:12:42 datacore3 kernel: mrsas0: Data map/load failed.
Apr  5 17:12:42 datacore3 kernel: mrsas0: Build SYSPDIO failed.
Apr  5 17:12:42 datacore3 kernel: (da0:mrsas0:1:0:0): READ(10). CDB: 28 00 00 00 00 00 00 02 2e 00 
Apr  5 17:12:42 datacore3 kernel: (da0:mrsas0:1:0:0): CAM status: SMP Status Error
Apr  5 17:12:42 datacore3 kernel: (da0:mrsas0:1:0:0): Error 5, Retries exhausted
root@datacore3:~ #

The bug is also described here https://jira.ixsystems.com/browse/NAS-111242 and they say it's fixed but on my system 13.0-RELEASE it does not appear to be fixed.

Still I wonder what is the most correct way to determine the link speed of your drives.
 
Also discovered another bug with the mrsas driver - when operating on blocks larger than 278k the controller fails, please check this one
Seems to be fixed in 13.1 - see

 
Why is it measly 150MB/s? And does this line ses0: phy 0: SAS device type 1 claim its SAS-1 (ses0 is our backplane)? That transfer rate there also suggests that it ids the link as SAS-1 1Gbps.
What is going on here?
Eh, maybe its just talk and real perf will be up to standard?
Exactly - the transport rate is sometimes reported as the lowest speed supported by the particular technology if the driver doesn't know how to query the actual rate. Years (decades!) ago, I went through the BSD/OS sources and fixed all of them to report the actual port speed. It was a huge effort, considering the number of different controller architectures back then. And not all controllers supported querying the link speed - in those cases I left the speed out of the report.

Even with a smaller number of commonly-used controller architectures used today, it is rather complex. Consider a controller-based RAID device - should we report the combined transfer rate of all of the member drives? What if it is a mirror? I'd like to see FreeBSD adopt the "if you don't know, don't report it" model. In particular, physical device passthru on RAID controllers can report inaccurate transfer rates.

As far as your ses(4) device, even SAS-1 is vast overkill. You could probably use a 9600 baud serial port to talk to it and not lose any performance.

Use a benchmarking tool of your choice (anything from dd(1), iozone(1), etc.) to see what actual transfer rate you can achieve. As an example, this is a lot faster than the reported "600.000MB/s transfers":
Code:
(0:4) rz1:/sysprog/terry# dd if=/dev/label/ssd0 of=/dev/null bs=1m count=8192
8192+0 records in
8192+0 records out
8589934592 bytes transferred in 8.350911 secs (1028622425 bytes/sec)
 
This is still an issue under FreeBSD 13.2 - however, my testing has alleviated my concerns. I also think this issue was raised at $WORK.

Code:
[0:08 r730-01 dvl /tmp] % sudo dd if=/tmp/DD.test.deleteme3 of=/var/db/mkjail/DD.test.deleteme3 bs=128K count=10000000
78125+0 records in
78125+0 records out
10240000000 bytes transferred in 6.981907 secs (1466648082 bytes/sec)

That's 1466 MB/s.

src: ZFS mirror of two drives like this:

Code:
ada0 at ahcich1 bus 0 scbus3 target 0 lun 0
ada0: <INTEL SSDSC2BB480G6K G201CS01> ACS-2 ATA SATA 3.x device
ada0: Serial Number [redacted]
ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes)
ada0: Command Queueing enabled
ada0: 457862MB (937703088 512 byte sectors)

dst: 8 drive raidz2 consisting of drives like this:

Code:
da3 at mrsas0 bus 1 scbus1 target 3 lun 0
da3: <TOSHIBA PX05SMB080Y AS0B> Fixed Direct Access SPC-4 SCSI device
da3: Serial Number Y7P0A022TEVE
da3: 150.000MB/s transfers
da3: 763097MB (1562824368 512 byte sectors)
 
Back
Top