Browse Source

fcoe: handle CNAs with DCB firmware support

Some Combined Network Adapters(CNAs) implement DCB protocol
in firmware, it is recommended that do not run software-based
DCB or LLDP on CNAs that implement DCB, but we have to start
the lldpad service anyway(there might be other software DCB).

If the network interface provides hardware DCB/DCBX capabilities,
the field DCB_REQUIRED in "/etc/fcoe/cfg-xxx" is expected to
be set to "no".

We met an issue on "QLogic BCM57810" with DCB firmware support,
and found dracut still generated "fcoe=<mac>:dcb" which caused
kdump boot failure when using that fcoe dump target.

This patch parses /etc/fcoe/cfg-xxx to detect DCB_REQUIRED="no",
and force "nodcb" if it is the case.

Also improved some coding style in passing.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
master
Xunlei Pang 8 years ago
parent
commit
795256bbb1
  1. 26
      modules.d/95fcoe/module-setup.sh

26
modules.d/95fcoe/module-setup.sh

@ -51,16 +51,30 @@ cmdline() {
read mac < ${i}/address read mac < ${i}/address
s=$(dcbtool gc ${i##*/} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p') s=$(dcbtool gc ${i##*/} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
if [ -z "$s" ] ; then if [ -z "$s" ] ; then
p=$(get_vlan_parent ${i}) p=$(get_vlan_parent ${i})
if [ "$p" ] ; then if [ "$p" ] ; then
s=$(dcbtool gc ${p} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p') s=$(dcbtool gc ${p} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
fi fi
fi fi
if [ "$s" = "on" ] ; then if [ "$s" = "on" ] ; then
dcb="dcb" dcb="dcb"
else else
dcb="nodcb" dcb="nodcb"
fi fi

# Some Combined Network Adapters(CNAs) implement DCB in firmware.
# Do not run software-based DCB or LLDP on CNAs that implement DCB.
# If the network interface provides hardware DCB/DCBX capabilities,
# DCB_REQUIRED in "/etc/fcoe/cfg-xxx" is expected to set to "no".
#
# Force "nodcb" if there's any DCB_REQUIRED="no"(child or vlan parent).
grep -q "^[[:blank:]]*DCB_REQUIRED=\"no\"" /etc/fcoe/cfg-${i##*/} &>/dev/null
[ $? -eq 0 ] && dcb="nodcb"
if [ "$p" ] ; then
grep -q "^[[:blank:]]*DCB_REQUIRED=\"no\"" /etc/fcoe/cfg-${p} &>/dev/null
[ $? -eq 0 ] && dcb="nodcb"
fi

echo "fcoe=${mac}:${dcb}" echo "fcoe=${mac}:${dcb}"
done done
} }

Loading…
Cancel
Save