OCS Linux iSCSI Ramdisk

Updated: 05-Mar-14

Description

    The OCS Linux iSCSI Ramdisk (ocs_iscsi_ramd) driver is a target driver that implements a
    non persistant Ram Disk backing store.   Support is included for a number of
    SCSI command, sufficient to allow most FC initiators/hosts to log into and access
    data.

Unpack and build

    Perform the following steps:

        # create a build directory
        mkdir build_dir
        cd build_dir
        # extract tar file
        tar xfv <tarfile>

    Compilation

        # move to directory containing makefile
        cd driver/linux/ocs_iscsi_ramd
        # build it
        make

Install driver

    Load driver

        # as root use insmod to install the driver
        insmod ocs_iscsi_ramd.ko # parameters here

    Summary of module parameters

        initiator enable initiator functionality (default is 0)

        target enable target functionality (default is 1)

        ctrlmask (default 0)
           bit[4] Tgt Always verify DIF (clear AT/ATRT)
           bit[5] Tgt set ref tag and CRC on format
           bit[7] Enable iSNS discovery and registration

        enable_sgl_chaining   enable sgl chaining functionality (default is 1)

        enable_immediate_data enable immediate data support (default is 1)

        enable_hdr_digest     enable header digest support (default is 1)

        enable_data_digest    enable data digest support (default is 1)

        enable_jumbo_frame    enable jumbo frame support (default is 1)

        hal_war_version       Use this as f/w version for HAL workaround matching

        num_scsi_ios        Number of SCSI IOs to allocate

        max_sge_size        The maximum size when building SGEs. (default 65536)
                            Must be in the range of 1024-65536.
                            Used for testing purposes only.

        post_sgl_config     Determines the number and version of the POST_SGL
                            ioctl. The following values are supported:
                              0 - Use default config for chip - See below
                              1 - 32  SGEs per ICD Version 0 (default BE3)
                              2 - 256 SGEs per ICD Version 0
                              3 - 32  SGEs per ICD Version 1 (default Skyhawk)
                              4 - 256 SGEs per ICD Version 1

        num_tgts            Number of targets per port (default is 1)

        global_ramdisc      use global ramdiscs (default is 1)
                            A value of 0 will create that many ramdiscs on each
                            port.  The target names will be:
                            iqn.tgt[device instance].ramdisc[ramdisc instance]

        ramdisc_blocksize   disk block size(default is 512)

        ramdisc_size        value as <number>[k|K|m|M|g|G] (default is 50M)

        p_type              protection type for T10 DIF.  Default is 0.

        num_luns            number of LUNs within a ramdisc (default is 1)

        local_ip      The IP address of the target, DHCP or AutoV6.
                      (default is 192.168.0.106)

                      Note: For static addresses, the IP address will be
                            incremented for each adapter that is found.

        local_subnet  The subnet for a statically assigned address
                      (default is 255.255.255.0)

        gateway       The IP address of the gateway if the local IP is not DHCP
                      or AutoV6. (default is no gateway)

        tcp_window_size The TCP Window size to set in bytes. (default is 65536)
                        Note: This value is shifted based on the
                              tcp_window_scale value.

        tcp_window_scale The TCP window scaling value to use when establishing
                         new connections (default is 4)

        logdest             logging destination bit[0] = system log default 1), bit[1] = ram log (default 0)

        ramlog_size         size of ram logging buffer (default 1M)

        ddump_saved_size    size of saved ddump (default 0)

        hw_cmpl_context     Indicates where the driver processes hardware completions:
                            0 - use tasklet, 1 - use kernel threads (default 1)

    Example: create two 100mb luns

        insmod ocs_iscsi_ramd.ko ramdisc_size=100m num_luns=2


Supported SCSI commands

    WRITE6, WRITE10, WRITE12, WRITE16 and WRITE32
    WRITE_LONG10, WRITE_LONG16
    WRITE_SAME10, WRITE_SAME16, WRITE_SAME32
    WRITE_AND_VERIFY10, WRITE_AND_VERIFY_12, WRITE_AND_VERIFY16
    READ6, READ10, READ12, READ16, READ32, READ_LONG10, READ_LONG16
    READ CAPACITY10 and READ CAPACITY16
    INQUIRY (Standard Inquiry, VPD pages 0x00, x80, x83, x86)
    TEST UNIT READY
    REPORT LUNS
    MODE SENSE6 (limited pages)
    MODE SENSE10 (limited pages)
    MODE SELECT6, MODE SELECT10 (for setting block size)
    FORMAT UNIT
    REQUEST SENSE

Using CHAP

    The driver is currently configured with two hardcoded CHAP secrets. There
    is a management API to add/remove CHAP secrets, but it is not currently
    attached to any tools. Only the MD5 algorithm for CHAP is supported.

    CHAP secrets are:

    User Name         Password
    ---------    -----------------
    EmulexTgt    ElxTgtPassword
    EmulexIni    ElxIniPassword

    To enable CHAP on Linux using open-iscsi:

        1. Edit /etc/iscsi/iscsid.conf and change the following lines:

           # *************
           # CHAP Settings
           # *************

           # To enable CHAP authentication set node.session.auth.authmethod
           # to CHAP. The default is None.
           node.session.auth.authmethod = CHAP

           # To set a CHAP username and password for initiator
           # authentication by the target(s), uncomment the following lines:
           node.session.auth.username = EmulexIni
           node.session.auth.password = ElxIniPassword

           # To set a CHAP username and password for target(s)
           # authentication by the initiator, uncomment the following lines:
           node.session.auth.username_in = EmulexTgt
           node.session.auth.password_in = ElxTgtPassword

        2. Restart the iSCSI service
