Adds a debug/ directory in the source tree intended to contain debugging tools.
The first debugging tool, that this patch also adds, is dcbcheck.sh. This script will use 'dcbtool' to check if DCB is configured correctly for FCoE traffic. If some criteria is not met the script will suggest commands to run to get to the user to a correctly configured state. Signed-off-by: Robert Love <[email protected]> --- debug/dcbcheck.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 52 insertions(+), 0 deletions(-) create mode 100755 debug/dcbcheck.sh diff --git a/debug/dcbcheck.sh b/debug/dcbcheck.sh new file mode 100755 index 0000000..b479a6a --- /dev/null +++ b/debug/dcbcheck.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# $1 = ethX +# return 0 on success +# return 1 on failure + +IFNAME=$1 +ret=0 + +# Ensure that a value was passed in for the interface name +if [ "${IFNAME}" == "" ] ; then + echo "Please provide the interface name to check." >&2 + exit 1 +fi + +# Ensure that the interface name provided is valid +if ifconfig ${IFNAME} 2>&1 | grep -q "Device not found" ; then + echo "Please provide a valid interface name." >&2 + exit 1 +fi + +# Determine if we can communicate with DCBD +if dcbtool gc ${IFNAME} dcb | grep Status | grep -q Failed ; then + echo "Unable to communicate with the dcb daemon 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 + echo "DCB is not on, exectue the following command to turn it on" >&2 + echo "dcbtool sc ${IFNAME} dcb on" >&2 + ret=1 +fi + +# Determine if PFC is enabled +if dcbtool gc ${IFNAME} pfc | grep Enable | grep -q false ; then + echo "PFC is not enabled, exectue the following command to turn it on" >&2 + echo "dcbtool sc ${IFNAME} 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 + echo "The FCoE APP TLV is not enabled, exectue the following command to turn it on" >&2 + echo "dcbtool sc ${IFNAME} app:fcoe e:1" >&2 + ret=1 +fi + +if [ ${ret} -eq 0 ] ; then + echo "DCB is correctly configured for FCoE" +fi + +exit ${ret} _______________________________________________ devel mailing list [email protected] http://www.open-fcoe.org/mailman/listinfo/devel
