[Open-FCoE] [PATCH] fcoe-utils: Add debug/ directory and dcbcheck.sh script

Robert Love robert.w.love at intel.com
Mon Apr 13 19:02:24 UTC 2009


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 <robert.w.love at intel.com>
---

 debug/dcbcheck.sh |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 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..b05bf2f
--- /dev/null
+++ b/debug/dcbcheck.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+# $1 = ethX
+IFNAME=${1}
+
+failure=0
+
+# Ensure that a value was passed in for the interface name
+if [ "${IFNAME}" == "" ] ; then
+    echo "Please provide the interface name to check."
+    exit
+fi
+
+# Ensure that the interface name provided is valid
+if [ `ifconfig ${IFNAME} 2>&1 | grep -c "Device not found"` -eq 1 ] ; then
+    echo "Please provide a valid interface name."
+    exit
+fi
+
+# Determine if we can communicate with DCBD
+if [ `dcbtool gc ${IFNAME} dcb | grep Status | grep -c Successful` -lt 1 ] ; then
+    echo "Unable to communicate with the dcb daemon or DCB capable driver."
+    exit
+fi
+
+# Determine if DCB is on
+if [ `dcbtool gc ${IFNAME} dcb | grep 'DCB State' | grep -c on` -ne 1 ] ; then
+    echo "DCB is not on, exectue the following to turn it on"
+    echo "dcbtool sc ${IFNAME} dcb on"
+    failure=1
+fi
+
+# Determine if PFC is enabled
+if [ `dcbtool gc ${IFNAME} pfc | grep Enable | grep -c true` -ne 1 ] ; then
+    echo "PFC is not enabled, exectue the following to turn it on"
+    echo "dcbtool sc ${IFNAME} pfc e:1"
+    failure=1
+fi
+
+# Determine if the FCoE APP TLV is enabled 
+if [ `dcbtool gc ${IFNAME} app:0 | grep Enable | grep -c true` -ne 1 ] ; then
+    echo "The FCoE APP TLV is not enabled, exectue the following to turn it on"
+    echo "dcbtool sc ${IFNAME} app:0 e:1"
+    failure=1
+fi
+
+if [ ${failure} -eq 0 ] ; then
+    echo "DCB is correctly configured for FCoE"
+fi




More information about the devel mailing list