View Source

h2. How to Configure Fibre Channel Ports

{toc:type=list|minlevel=3|maxlevel=3}

The Fibre Channel (FC) port provider can use the same HBAs that are used for the Fibre Channel initiators. A given Fibre Channel port can be used as an initiator or as a target, but not as both. You can also configure a dual or quad port FC HBA so that a subset of the HBA ports is in target mode and the rest of the ports are in initiator mode.

The procedures in this section are specific to QLogic HBAs. The driver to use with HBAs in initiator mode is {{qlc}}, which is a Qlogic driver. The {{qlc}} driver works only in initiator mode, and cannot be used for target mode. The COMSTAR driver for a target Qlogic 4G HBA is {{qlt}}.

Because initiator mode and target mode use different drivers, the driver you attach to an HBA port defines its function as a target or initiator. You can specify a driver for all the ports by specifying the PCI device ID of the HBA. Or, you can configure the driver on a port-by-port basis. Both methods are described in this section. Each of these procedures uses the {{update_drv}}(1M) command. For more information, see the [update_drv(1M)|http://docs.sun.com/app/docs/doc/819-2240/update-drv-1m?l=en&a=view&q=update_drv%281M%29] man page.

{anchor:VEPbindings}

h3. How to View Existing Port Bindings

Before making changes to the HBA ports, first check the existing port bindings.

# View what is currently bound to the port drivers.
In this example, the current binding is {{pciex1077,2432}}.
{code}
# mdb -k
{code}
{code}
Loading modules: [ unix krtld genunix specfs ...
> ::devbindings -q qlc
30001617a08 pciex1077,2432, instance #0 (driver name: qlc)
300016177e0 pciex1077,2432, instance #1 (driver name: qlc)
{code}
# Quit {{mdb}}.
{code}
> $q
{code}

{anchor:SAPSmode}

h3. How to Set All Ports to a Specific Mode

This procedure changes all ports on all HBAs of a specific PCI device ID to target mode. The PCI device ID number binds a driver to a port, thereby setting all the HBA ports with that PCI device ID, for example, all Qlogic 4G PCI express HBAs, to target mode.

# Remove the current binding, which in this example is {{qlc}}.
In this example, the {{qlc}} driver is actively bound to {{pciex1077,2432}}. You must remove the existing binding for {{qlc}} before you can add that binding to a new driver. Single quotes are required in this syntax.
{code}
# update_drv -d -i 'pciex1077,2432' qlc
{code}
{code}
Cannot unload module: qlc
Will be unloaded upon reboot.
{code}
This message does not indicate an error. The configuration files have been updated but the {{qlc}} driver remains bound to the port until reboot.
# Establish the new binding to {{qlt}}.
Single quotes are required in this syntax.
{code}
# update_drv -a -i 'pciex1077,2432' qlt
{code}
{code}
devfsadm: driver failed to attach: qlt
Warning: Driver (qlt) successfully added to system but failed to attach
{code}
This message does not indicate an error. The {{qlc}} driver remains bound to the port, until reboot. The {{qlt}} driver attaches when the system is rebooted.
# Reboot the system to attache the new driver, and then recheck the bindings.
{code}
# reboot
...
# mdb -k
{code}
{code}
Loading modules: [ unix krtld genunix specfs dtrace ...
> ::devbindings -q qlt
30001615a08 pciex1077,2432, instance #0 (driver name: qlt)
30001615e0 pciex1077,2432, instance #1 (driver name: qlt)
{code}
# Quit {{mdb}}.
{code}
> $q
{code}
# Verify that the target mode framework has access to the HBA ports.
{code}
# stmfadm list-target -v
{code}
{code}
Target: wwn.210100E08BA54E60
Operational Status : Offline
Provider Name : qlt(1)
Alias : -
Sessions : 0
Target: wwn.210100E08BA54E60
Operational Status : Offline
Provider Name : qlt(0)
Alias : -
Sessions : 0
{code}

{anchor:SSPmode}

h3. How to Set Selected Ports to a Mode

This procedure uses *path-based bindings*. It shows you how to use a specific device path to bind a port to a driver that is different from the one to which it is currently bound.

# View a list of the HBA ports and their respective device paths.
{code}
# luxadm -e port
{code}
{code}
/devices/pci@780/QLGC,qlc@0,1/fp@0,0:devctl CONNECTED
/devices/pci@780/QLGC,qlc@0/fp@0,0:devctl CONNECTED
{code}
This example shows the HBA ports' respective device paths for a single HBA with two ports.
# Set the top port to target mode and leave the bottom port in initiator mode.
{info:title=Note}
You drop the initial {{/devices}} portion of the path, and include everything up to {{/fp@0...}}. This is the path to which the system binds the {{qlt}} driver. Single quotes are required in this syntax.
{info}
{code}
# update_drv -a -i '/pci@780/QLGC,qlc@0,1' qlt
{code}
{code}
devfsadm: driver failed to attach: qlt
Warning: Driver (qlt) successfully added to system but failed to attach.
{code}
This message does not indicate an error. The {{qlc}} driver remains bound to the port until reboot. The {{qlt}} driver attaches during reboot.
# Reboot the system to attach the new driver, and then recheck the bindings.
{code}
# reboot
...
# mdb -k
{code}
You should see that the port changed from initiator mode ({{qlc}}) to target mode ({{qlt}}).
# Quit {{mdb}}.
{code}
> $q
{code}
# Verify that the target mode framework has access to the HBA ports.
{code}
# stmfadm list-target -v
{code}

h5. Where to Go Next

* [How to Make Logical Units Available for FC and FCoE|How to Make Logical Units Available for FC and FCoE]

The individuals who post here are part of the extended Sun Microsystems community and they might not be employed or in any way formally affiliated with Sun Microsystems. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Sun nor any other party necessarily agrees with them.

Copyright 1994-2009 Sun Microsystems, Inc.
Powered by Atlassian Confluence
Sun Guidelines on Public Discourse Privacy Policy Terms of Use Trademarks Site Map Employment Investor Relations Contact