OneCore Storage profile management utility

Updated: 1-May-2015

Description

      This tool provides the ability to manage profiles and link configuration
      on the OCe14 and LPe series of network adapters.  

      The tool is able to use a variety of interfaces to query and configure
      the devices.  These include:
      - The Configuration Space IOCTL Interface (CSII) along with sysfs access
        to the PCI configuration space.
      - The mailbox passthrough capability of the OCS SDK drivers.
      - The mailbox passthrough capability of the be2net NIC driver.
      - The mailbox passthrough capability provided by the elx_pt driver, included
        with this tool.
 
      Because of this, the tool is able to query and configure the device
      in many cases where the usual methods don't work.

Usage
      The syntax for using the tool is:
          elxocsutil <command> [options]
      
      Currently supported commands are "list", "get-profile-list", 
      "get-active-profile", "set-active-profile", "get-linkcfg", 
      "set-linkcfg", "version", and "help".

      The tool addresses an individual HBA by using a device index 
      number.  The "list" command provides a list of discovered 
      devices along with the device's ID.  For example:

          # ./elxocsutil list
          ID|Vendor|Device|PCI Address |           Driver|CSII|be PT|OCS PT|elx_pt
           0|  10df|  0720|0000:10:00.0|           be2net| 1  |  0  |   0  |  0
           1|  10df|  0723|0000:10:00.1|           elx_pt| 1  |  0  |   0  |  1
           2|  10df|  e200|0000:24:00.0|      ocs_fc_ramd| 1  |  0  |   1  |  0
           3|  10df|  e200|0000:24:00.1|      ocs_fc_ramd| 0  |  0  |   1  |  0
           4|  10df|  e220|0000:0d:00.0|           be2net| 1  |  0  |   0  |  0
           5|  10df|  e220|0000:0d:00.1|           be2net| 0  |  0  |   0  |  0
           6|  10df|  e220|0000:0d:00.2|           be2net| 0  |  0  |   0  |  0
           7|  10df|  e220|0000:0d:00.3|           be2net| 0  |  0  |   0  |  0
           8|  10df|  0720|0000:1e:00.0|           be2net| 1  |  0  |   0  |  0
           9|  10df|  0720|0000:1e:00.1|           be2net| 1  |  0  |   0  |  0
          10|  10df|  0723|0000:1e:00.2|           elx_pt| 1  |  0  |   0  |  1
          11|  10df|  0723|0000:1e:00.3|           elx_pt| 1  |  0  |   0  |  1

      This output shows each PCI function found.  The PCI Address can be used
      to determine which functions belong to which HBAs.  The output also shows
      which device driver, if any, has currently claimed the PCI function.  It
      also shows which mailbox interface methods are supported for that device.

      Note that there are two versions of be2net - the "in-box" driver that 
      is included in the Linux kernel and the "out-of-box" driver that is 
      available from emulex.com.  Passthrough is supported only on the 
      out-of-box driver.  In the example above, the in-box be2net driver is
      loaded, so the "be PT" column shows zeroes.
      
      For example, in the above list, device ID 0 is a NIC function at PCI bus
      address 0000:10:00, controlled by the be2net driver, and the only passthrough
      method for that device is CSII.

      The passthrough method used is automatically selected from those supported.
      The tool will use elx_pt if available, followed by OCS SDK, be2net, and CSII
      methods.  The exception to this rule is the get-linkcfg and set-linkcfg
      commands.  Those will only work with the elx_pt method so the other methods
      will not be attempted.

      For commands directed to a device, the device can be specified with the
      -d option.  For example:

          # elxocsutil get-profile-list -d 9
          Profile ID  Description
                0x03  FCOE initiator + Target, no DIF - 8K XRIs
                0x04  SURF
                0x05  ROCE SRIOV
                0x06  FCOE initiator + Target, with DIF, TEMPORARY
                0x0b  SuperNIC
                0x10  NIC
                0x12  ISCSI initiator + Target, with DIF
                0x13  FCOE initiator + Target, with DIF
                0x14  ROCE-1
                0x15  ROCE-2
                0x17  FCOE initiator + Target, no DIF

          # elxocsutil get-active-profile -d 9
          Active profile is 0x12: ISCSI initiator + Target, with DIF

Setting profile IDs
      When setting a new profile the profile ID should be give after
      the command and before the device ID:

          # elxocsutil set-active-profile 0x13 -d 9
          Active profile for device 0 set to 0x13
          New profile will be in effect after reboot

      Because changing profiles may change PCI function assignments, the
      system must be rebooted after a change in profile.  This will allow
      the device to activate the new profile and will allow the OS to
      discover the changed PCI assignments.

Getting and setting Link Config
      On the LPe series of devices the configuration of ports is managed with the
      get-linkcfg and set-linkcfg commands.  The commands only work on PCI functions
      managed by the elx_pt driver.

      get-linkcfg displays the current link configuration.  Example:
          # ./elxocsutil get-linkcfg -d 6
          Link config: ELX_4x10G
      
      set-linkcfg allows changing the current link configuration.  Example:
          # ./elxocsutil set-linkcfg elx_2x10g_2x8g -d 6
          Link config changed

      The new link configuration will take effect after a system reboot.
      The "elxocsutil help set-linkcfg" command will give a list of possible link
      configurations.  Not all configurations are supported on all devices,
      so setting the link configuration may fail if the particular device doesn't
      support the requested configuration.

      Note:  Link configuration for LPe devices requires firmware version 1.1.65.35 or later.

The elx_pt driver module
      Because of the design of the mailbox commands, the get-linkcfg and set-linkcfg
      commands can not be used through CSII, OCS SDK, or be2net passthrough interfaces.
      For these commands the elx_pt driver module must be used.

      The driver source is located in the "driver" subdirectory, and can be built by
      typing "make".  Once built, the driver can be loaded with "insmod elx_pt.ko"
      and unloaded with "rmmod elx_pt".

      The driver will bind to all PCI functions with a vendor ID of 0x10df (Emulex) which 
      have not already been bound to another driver.  You may need to unload other 
      drivers prior to loading the elx_pt driver.  The "elxocsutil list" command will show
      you which drivers are bound to which devices.
