DCB settings are specified per physical device. This patch enables dcbcheck to accept a virtual LAN device and check the parameters for the physical device when necessary.
Signed-off-by: John Fastabend <[email protected]> --- debug/dcbcheck.sh | 21 ++++++++++++++------- 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/debug/dcbcheck.sh b/debug/dcbcheck.sh index 05bc88a..5f30bd0 100755 --- a/debug/dcbcheck.sh +++ b/debug/dcbcheck.sh @@ -4,6 +4,13 @@ # return 1 on failure IFNAME=$1 + +if [ -r /proc/net/vlan/$IFNAME ] ; then + PHYSDEV=$(grep '^Device:' /proc/net/vlan/$IFNAME | awk '{print $2}') +else + PHYSDEV=$IFNAME +fi + ret=0 # check for DCB netlink symbols @@ -26,29 +33,29 @@ if ifconfig ${IFNAME} 2>&1 | grep -q "Device not found" ; then fi # Determine if we can communicate with DCBD -if dcbtool gc ${IFNAME} dcb | grep Status | grep -q Failed ; then +if dcbtool gc ${PHYSDEV} dcb | grep Status | grep -q Failed ; then echo "Unable to communicate with the DCB daemon (dcbd) or DCB capable driver." >&2 exit 1 fi # Determine if DCB is on -if dcbtool gc ${IFNAME} dcb | grep 'DCB State' | grep -q off ; then +if dcbtool gc ${PHYSDEV} dcb | grep 'DCB State' | grep -q off ; then echo "DCB is not on, execute the following command to turn it on" >&2 - echo "dcbtool sc ${IFNAME} dcb on" >&2 + echo "dcbtool sc ${PHYSDEV} dcb on" >&2 ret=1 fi # Determine if PFC is enabled -if dcbtool gc ${IFNAME} pfc | grep Enable | grep -q false ; then +if dcbtool gc ${PHYSDEV} pfc | grep Enable | grep -q false ; then echo "PFC is not enabled, execute the following command to turn it on" >&2 - echo "dcbtool sc ${IFNAME} pfc e:1" >&2 + echo "dcbtool sc ${PHYSDEV} pfc e:1" >&2 ret=1 fi # Determine if the FCoE APP TLV is enabled -if dcbtool gc ${IFNAME} app:fcoe | grep Enable | grep -q false ; then +if dcbtool gc ${PHYSDEV} app:fcoe | grep Enable | grep -q false ; then echo "The FCoE APP TLV is not enabled, execute the following command to turn it on" >&2 - echo "dcbtool sc ${IFNAME} app:fcoe e:1" >&2 + echo "dcbtool sc ${PHYSDEV} app:fcoe e:1" >&2 ret=1 fi _______________________________________________ devel mailing list [email protected] http://www.open-fcoe.org/mailman/listinfo/devel
