OpenBSD Journal

Call For Testers - improvements to ami(4)

Contributed by jason on from the help-marco-help-you dept.

Marco Peereboom writes on tech:

I have had some inspiration and redid completely how ami discovers physical disks. This has been a source of very subtle bugs that I never could reproduce but understand how they happened now. What it basically comes down to is that the firmware lies about physical devices; these lies are unpredictable and the previous version of the code trusted by accident some of those lies.

Update (Tue Oct 28 13:18:00 CET 2008): Marco has just commited his changes to the source tree. If you follow -current, please test the improved ami(4)!

Read on for the rest of Marco's email.

While at it I made the interface way faster by only poking physical disks whenever something actually changes. So the first bioctl access takes a couple of seconds, the subsequent ones are instantaneous unless a disk is failed, inserted or removed.

The firmware would also sometimes lie about disk sizes so I actually ask the drive its size.

As a side effect roaming is now handled correctly too which suffered from lies as well.

All in all this makes the ami experience way better. I have tested this on PERC 4e/DC, 4/DC, 3/DCL & LSI MegaRAID Elite 1600.

Now that I have my head in this I'll go ahead and add more firmware commands like manually kick of rebuild. If you want that functionality please test this ASAP or else you'll miss the window of opportunity that I have to work on this.

Finally figured out the hot spare magic for these darned cards. To make it always work we need to issue the set hot spare command polled AND with command id 0xfe. To be able to do this I had to add a drain io mechanism. Not much performance impact besides the fact that setting a hot spare is pretty rare. So now when a disk fails and one assigns a new hot spare it starts the rebuild right away.

Test test test!

Editor's Note: You heard the man. If you have any ami equipment, now is the time to help out!

(Comments are closed)


Comments
  1. By J.C. Roberts (jcr) jcroberts@designtools.org on http://www.designtools.org

    Let's say you don't happen to own any of the specific LSI/AMI hardware improved by this patch... --You still want to test this on whatever LSI/AMI hardware that you do own!

  2. By Anonymous Coward (24.130.233.169) on

    Marco, would you recommend buying Areca 1210 or perhaps getting cheaper LSI MegaRAID SATA 150-4. I know areca cards are known to work pretty well on OpenBSD. My question is whether LSI MegaRAID becomes feasible to use after your hard work on fixing issues with ami(4). Are there any other known issues that still need work?
    Thanks

    Comments
    1. By Anonymous Coward (143.166.255.41) on

      ami works just fine with the new code. It works mostly with the old code minus some subtle bugs that can easily be worked around. I can't vouch for areca cards but some folks like them. The card you mentioned sounds more like a software raid thing; beware of those since those require software assist.

      -marco

      Comments
      1. By Anonymous Coward (66.240.25.23) on

        Thank you for your answer. The reason I picked LSI MegaRAID SATA 150-4 is because it's listed in ami(4). It's also not that cheap for a software RAID card, it's around $200. Are you saying some ami(4) devices are software RAID while other ami(4) devices aren't? I wish there was a way to distinguish. Thanks.

        Comments
        1. By Brad (2001:470:8802:3:20f:b5ff:fe45:7cfe) brad at comstyle dot com on

          > Thank you for your answer. The reason I picked LSI MegaRAID SATA 150-4 is because it's listed in ami(4). It's also not that cheap for a software RAID card, it's around $200. Are you saying some ami(4) devices are software RAID while other ami(4) devices aren't? I wish there was a way to distinguish. Thanks.

          No, none of the adapters supported by ami(4) are regular PATA/SATA/SCSI adapters.

        2. By J.C. Roberts (jcr) on http://www.designtools.org

          > Thank you for your answer. The reason I picked LSI
          > MegaRAID SATA 150-4 is because it's listed in ami(4). It's
          > also not that cheap for a software RAID card, it's around
          > $200. Are you saying some ami(4) devices are software RAID
          > while other ami(4) devices aren't? I wish there was a way
          > to distinguish. Thanks.

          The reason why the LSI MegaRAID SATA 150-4 is more expensive is because it's actually "Hardware RAID."

          All of the LSI/AMI cards I have here are "Hardware RAID" which is a nice way to say the card itself does the processing and has a little BIOS utility for setup and maintenance of the RAID. The "Software RAID Cards" are actually just normal adapters with some funky firmware and a proprietary driver.

          The term "Software RAID" is confusing because it has two conflicting definitions.

          1.) One definition is a piece of hardware with some strange firmware and a specialized proprietary driver. These cards typically will only run in MS-Windows (although a few also have closed source, proprietary drivers for linux). The driver is what does the real RAID work, and often it communicates with the strange firmware on the card for particular features.

          2.) The other definition is simply "RAID implemented in software" where you can use any available disks on the system and there is no requirement for particular adapter hardware to be present.

          If I'm reading what Brad said correctly, our ami(4) driver only supports the "Hardware RAID" cards, and does not support normal adapters, or the "Software RAID" cards (definition #1 above, i.e. they're basically just normal adapters with goofy firmware and proprietary MS-Windows drivers that do the RAID work).

          It's also very important not to confuse the "Software RAID" cards from hardware vendors that require a proprietary driver specific to the card, and the built-in "Software RAID support within OpenBSD.

          OpenBSD does have two ways to do "Software RAID" (definition #2) on any disks you happen to have. The first is called "RAIDframe" (see raid(4)) and the second is "SoftRAID" (see softraid(4)). Both of these will preform RAID across disks attached to any normal adapters.

          The supposed advantage of "Hardware RAID" is speed since the card itself deals with the processing. The problem is you've got countless types, versions, variations of firmware in the various cards, and all of the firmware is closed source. If something bad happens, you're stuck with the support provided by the card vendor.

          The advantage of using OpenBSD's built-in "Software RAID" (definition #2), is you actually know how your RAID really works (i.e. no mystery firmware), so when something goes bad, the source code doing the RAID "magic" is right there in front of you.

          At the moment, I'm building up a kernel to test Marco's new patch with a card similar to the one you want to buy, namely the LSI MegaRAID SATA 150-6. When I'm done with that one, I'll test the LSI MegaRAID 4i (PATA).

          Ohhhh my fresh new kernel is done baking, so it's time to get back to work. :-)

          -jon

          Comments
          1. By Anonymous Coward (67.164.52.35) on

            > > Thank you for your answer. The reason I picked LSI
            > > MegaRAID SATA 150-4 is because it's listed in ami(4). It's
            > > also not that cheap for a software RAID card, it's around
            > > $200. Are you saying some ami(4) devices are software RAID
            > > while other ami(4) devices aren't? I wish there was a way
            > > to distinguish. Thanks.
            >
            > The reason why the LSI MegaRAID SATA 150-4 is more expensive is because it's actually "Hardware RAID."
            >
            > All of the LSI/AMI cards I have here are "Hardware RAID" which is a nice way to say the card itself does the processing and has a little BIOS utility for setup and maintenance of the RAID. The "Software RAID Cards" are actually just normal adapters with some funky firmware and a proprietary driver.
            >
            > The term "Software RAID" is confusing because it has two conflicting definitions.
            >
            > 1.) One definition is a piece of hardware with some strange firmware and a specialized proprietary driver. These cards typically will only run in MS-Windows (although a few also have closed source, proprietary drivers for linux). The driver is what does the real RAID work, and often it communicates with the strange firmware on the card for particular features.
            >
            > 2.) The other definition is simply "RAID implemented in software" where you can use any available disks on the system and there is no requirement for particular adapter hardware to be present.
            >
            > If I'm reading what Brad said correctly, our ami(4) driver only supports the "Hardware RAID" cards, and does not support normal adapters, or the "Software RAID" cards (definition #1 above, i.e. they're basically just normal adapters with goofy firmware and proprietary MS-Windows drivers that do the RAID work).
            >
            > It's also very important not to confuse the "Software RAID" cards from hardware vendors that require a proprietary driver specific to the card, and the built-in "Software RAID support within OpenBSD.
            >
            > OpenBSD does have two ways to do "Software RAID" (definition #2) on any disks you happen to have. The first is called "RAIDframe" (see raid(4)) and the second is "SoftRAID" (see softraid(4)). Both of these will preform RAID across disks attached to any normal adapters.
            >
            > The supposed advantage of "Hardware RAID" is speed since the card itself deals with the processing. The problem is you've got countless types, versions, variations of firmware in the various cards, and all of the firmware is closed source. If something bad happens, you're stuck with the support provided by the card vendor.
            >
            > The advantage of using OpenBSD's built-in "Software RAID" (definition #2), is you actually know how your RAID really works (i.e. no mystery firmware), so when something goes bad, the source code doing the RAID "magic" is right there in front of you.
            >
            > At the moment, I'm building up a kernel to test Marco's new patch with a card similar to the one you want to buy, namely the LSI MegaRAID SATA 150-6. When I'm done with that one, I'll test the LSI MegaRAID 4i (PATA).
            >
            > Ohhhh my fresh new kernel is done baking, so it's time to get back to work. :-)
            >
            > -jon
            >
            >

            Thanks for your answer. I was able to pick up LSI MegaRAID SATA 150-6 on eBay for ~$60. Hopefully, it will serve me well.

            Comments
            1. By Anonymous Coward (208.124.37.81) on

              Do upgrade to the latest firmware.

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]