FCoE
~~~~
-**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__::
+**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__:__{fabric|vn2vn}__::
Try to connect to a FCoE SAN through the NIC specified by _<interface>_ or
- _<MAC>_ or EDD settings. For the second argument, currently only nodcb is
- supported. This parameter can be specified multiple times.
+ _<MAC>_ or EDD settings. The second argument specifies if DCB
+ should be used. The optional third argument specifies whether
+ fabric or VN2VN mode should be used.
+ This parameter can be specified multiple times.
+
NOTE: letters in the MAC-address must be lowercase!
# Write udev rules
{
if [ -n "$fcoe_mac" ] ; then
- printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_mac" "$fcoe_dcb"
+ printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode"
else
- printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_interface" "$fcoe_dcb"
+ printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode"
fi
} >> /etc/udev/rules.d/92-fcoe.rules
#!/bin/sh
#
# We get called like this:
-# fcoe-up <network-device> <dcb|nodcb>
+# fcoe-up <network-device> <dcb|nodcb> <fabric|vn2vn>
#
# Note currently only nodcb is supported, the dcb option is reserved for
# future use.
netif=$1
dcb=$2
+mode=$3
vlan="yes"
iflink=$(cat /sys/class/net/$netif/iflink)
else
echo AUTO_VLAN=\"no\" >> /etc/fcoe/cfg-$netif
fi
- echo MODE=\"fabric\" >> /etc/fcoe/cfg-$netif
+ if [ "$mode" = "vn2vn" ] ; then
+ echo MODE=\"vn2vn\" >> /etc/fcoe/cfg-$netif
+ else
+ echo MODE=\"fabric\" >> /etc/fcoe/cfg-$netif
+ fi
}
if [ "$netdriver" = "bnx2x" ]; then
for c in /sys/bus/fcoe/devices/ctlr_* ; do
[ -L $c ] || continue
read enabled < $c/enabled
+ read mode < $c/mode
[ $enabled -eq 0 ] && continue
+ if [ $mode = "VN2VN" ] ; then
+ mode="vn2vn"
+ else
+ mode="fabric"
+ fi
d=$(cd -P $c; echo $PWD)
i=${d%/*}
read mac < ${i}/address
[ $? -eq 0 ] && dcb="nodcb"
fi
- echo "fcoe=${mac}:${dcb}"
+ echo "fcoe=${mac}:${dcb}:${mode}"
done
}
#!/bin/sh
#
# Supported formats:
-# fcoe=<networkdevice>:<dcb|nodcb>
-# fcoe=<macaddress>:<dcb|nodcb>
+# fcoe=<networkdevice>:<dcb|nodcb>:<fabric|vn2vn>
+# fcoe=<macaddress>:<dcb|nodcb>:<fabric|vn2vn>
#
# Note currently only nodcb is supported, the dcb option is reserved for
# future use.
# Note letters in the macaddress must be lowercase!
#
# Examples:
-# fcoe=eth0:nodcb
-# fcoe=4a:3f:4c:04:f8:d7:nodcb
+# fcoe=eth0:nodcb:vn2vn
+# fcoe=4a:3f:4c:04:f8:d7:nodcb:fabric
[ -z "$fcoe" ] && fcoe=$(getarg fcoe=)
2)
fcoe_interface=$1
fcoe_dcb=$2
+ fcoe_mode="fabric"
+ return 0
+ ;;
+ 3)
+ fcoe_interface=$1
+ fcoe_dcb=$2
+ fcoe_mode=$3
return 0
;;
7)
fcoe_mac=$1:$2:$3:$4:$5:$6
fcoe_dcb=$7
+ fcoe_mode="fabric"
+ return 0
+ ;;
+ 8)
+ fcoe_mac=$1:$2:$3:$4:$5:$6
+ fcoe_dcb=$7
+ fcoe_mode=$8
return 0
;;
*)