XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    HowTo: Compile Latest Adaptec Driver for Adaptec ASR-8405E on XCP-NG 8.2

    Scheduled Pinned Locked Moved Development
    3 Posts 1 Posters 2.1k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 0nelight0 Offline
      0nelight
      last edited by 0nelight

      Hi everyone!

      This is work in progress! May not work for everybody.

      See story below!

      1. Install Buildtools:
      yum install make gcc kernel-devel
      
      1. Download latest driver for your Card - maybe works also for other Adaptec Cards:
        https://storage.microsemi.com/en-us/support/raid/
        --> Linux Driver Source

      2. Unpack the Sourcefolder

      3. For the compilation to work for XCP-NG you have to specifiy the C-Preprocessor-Definition: "AAC_CITRIX"! (add "#define AAC_CITRIX" to the beginning of the aacraid.h-File.)

      sed -i '1s/^/#define AAC_CITRIX\n/' ~/aacraid-1.2.1-60001/aacraid.h
      
      1. Compile
      make
      
      1. Copy resulting Kernel-Module into the Place where it is called.
      
      cp aacraid.ko /lib/modules/4.19.0+1/updates/
      
      depmod -a
      modprobe -v aacraid
      dracut -f /boot/initrd-4.19.0+1.img 4.19.0+1
      
      1. To check initramfs:
      lsinitrd /boot/initrd-4.19.0+1.img | grep aacraid
      

      Reboot and be Happy - hopefully 🙂


      Story:

      I replaced my Adaptec ASR-6405E PCI-Raid-Controller-Card with the ASR-8405E.

      Getting the Adaptec ASR-6405E to run was quite a challange for me, see this forum-post how to do it.

      With the Kernel and the ALT-Kernel I got no connection to the controller -> If I remember correctly; Maybe I failed to Update Initramfs from my old raid-card-driver which caused this - I am not sure because I am still learning how linux works.

      I got the following following Error during boot (and dmesg | head) - not sure anymore what driver was loaded:

      AAC0: fib_map_alloc:pci_alloc_consistent failed
      

      After a lot of involvment with the Source-Code of the Driver of Adaptech my insight was that there are two Driver Branches of the so called "aacraid" driver.
      One is maintained from Linux Kernel Team (https://www.kernel.org/) and the other from the manufacturer Adaptec (https://storage.microsemi.com/en-us/support/raid/).

      XCP-NG 8.2 uses at the moment of this writing the Driver Version from the Linux Branch:

      microsemi-aacraid: (built-in) 1.2.1[50877]-custom
      Source1: https://github.com/xcp-ng/xcp/wiki/Drivers
      https://github.com/torvalds/linux/commit/1cdb74b80f93343d7b44b5d99b28d9b0c46375ba <--???
      

      I don't know how PCI works and I am not a Driver-Developer but the following code-area here is the source of the fib_map_alloc error. It seems that Xenserver has other restrictions on some pci-parameters than the normal Linux kernel - therfore it's necessary to give the Compiler the Preprocessor-Definition "AAC_CITRIX" so that some allocated Memory gets properly managed by the driver to work with XCP-NG.

      Filename: comminit.c (Driver Version 56008 from Adaptec-Website)
      
      ...
      if (aac_is_src(dev)) {
      #if(defined(AAC_CITRIX)) /*<------ /*
        if (host -> can_queue > 248)
          host -> can_queue = 248;
      #elif(defined(CONFIG_XEN) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
        if (host -> can_queue > 128)
          host -> can_queue = 128;
      #else
        if (host -> can_queue > (status[3] >> 16) - AAC_NUM_MGT_FIB)
          host -> can_queue = (status[3] >> 16) - AAC_NUM_MGT_FIB;
      #endif
      } else if (host -> can_queue > (status[3] & 0xFFFF) - AAC_NUM_MGT_FIB)
        host -> can_queue = (status[3] & 0xFFFF) - AAC_NUM_MGT_FIB;
      dev -> max_num_aif = status[4] & 0xFFFF;
      }
      else
        aac_info(dev,
          "Driver Init: GET_COMM_PREFERRED_SETTINGS 0x%lx failed\n",
          (unsigned long) status[0]);
      ...
      

      Now the Adapter is working on the latest Adaptec-Driver :-).

      Thank You all being a part of this wounderful project!

      0 committed to torvalds/linux
      scsi: aacraid: Update driver version to 50877
      
      Update driver Version to 50877
      
      Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@microsemi.com>
      Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
      1 Reply Last reply Reply Quote 1
      • 0nelight0 Offline
        0nelight
        last edited by 0nelight

        turned out that this is not necessary. An easier option is to simply add the bootparameter

        aacraid.numacb=1000
        

        before booting into xcp-ng.

        As of my current understanding this makes sure that the xen-specific larger management fib size of 16 is taken into account (the driver default is 8).

        Only tested on Version 8.2.1

        0nelight0 1 Reply Last reply Reply Quote 0
        • 0nelight0 Offline
          0nelight @0nelight
          last edited by

          My current findings regarding this:
          https://github.com/xcp-ng-rpms/microsemi-aacraid/issues/2

          0nelight created this issue in xcp-ng-rpms/microsemi-aacraid

          open Microsemi Adaptec Series-8 Card not working in XCP-NG 8.3 #2

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post