fcoemon now manages all configured FCoE interfaces - whether DCB
is required or not.  Therefore, the code in the service start script which
created FCoE interfaces for ports which did not require DCB can be removed.

Signed-off-by:  Eric Multanen <[email protected]>
---

 etc/initd/initd.fedora |   82 ++++--------------------------------------------
 etc/initd/initd.suse   |   53 +------------------------------
 2 files changed, 8 insertions(+), 127 deletions(-)

diff --git a/etc/initd/initd.fedora b/etc/initd/initd.fedora
index 629fc76..67c3e5f 100755
--- a/etc/initd/initd.fedora
+++ b/etc/initd/initd.fedora
@@ -118,72 +118,20 @@ test -x $FCOEMON || {
        fi
 }
 
-validate_link_flow_control()
-{
-       ifname=$1
-
-       retry_count=1
-       while true
-       do
-               TX_STATUS=`ethtool -a $ifname 2>&1 | awk '/TX:/{print $2}'`
-               RX_STATUS=`ethtool -a $ifname 2>&1 | awk '/RX:/{print $2}'`
-
-               if [ "$TX_STATUS" = "on" ] && [ "$RX_STATUS" = "on" ]; then
-                       return 0
-               fi
-
-               ethtool -A $ifname rx on tx on
-               [ $retry_count -eq 0 ] && return 0
-               retry_count=$(($retry_count-1))
-               usleep 500000
-       done
-       $LOGGER "Warning: Failed to bring up link flow control of $ifname."
-       return 1
-}
-
 service_start()
 {
+       pidof $FCOEMON
+       if [ $? -eq 0 ]; then
+               $LOGGER "Warning: daemon already running."
+               return
+       fi
+
        rm -f /var/run/fcoemon.*
 
        modprobe -q libfc
        modprobe -q fcoe
 
-       HAS_DCB_IF="false"
-       for ifcfg_file in `ls $CONFIG_DIR/cfg-eth*`
-       do
-               ifname=`basename $ifcfg_file | cut -d"-" -f2`
-               . $ifcfg_file
-               [ "$FCOE_ENABLE" != "yes" ] &&
-               [ "$FCOE_ENABLE" != "YES" ] && continue
-
-               if [ "$DCB_REQUIRED" != "yes" ] &&
-                  [ "$DCB_REQUIRED" != "YES" ]; then
-                       #
-                       # DCB is not required, we nee to validate the
-                       # link flow control of the Ethernet port
-                       #
-                       validate_link_flow_control $ifname
-                       [ $? -ne 0 ] && continue
-                       #
-                       # Create the FCoE interface
-                       #
-                       $FCOEADM -c $ifname
-               else
-                       #
-                       # Configure the DCB for the Ethernet
-                       # port if DCB is required
-                       #
-                       HAS_DCB_IF="true"
-               fi
-       done
-
-       #
-       # If DCB-required Ethernet port exists, then start the fcoemon
-       # daemon to create the FCoE interfaces for these ports.
-       #
-       if [ "$HAS_DCB_IF" = "true" ]; then
-           daemon --pidfile ${PID_FILE} ${FCOEMON} ${FCOEMON_OPTS}
-       fi
+       daemon --pidfile ${PID_FILE} ${FCOEMON} ${FCOEMON_OPTS}
 
        return
 }
@@ -193,22 +141,6 @@ service_stop()
        pidof $FCOEMON
        [ $? -eq 0 ] && kill -TERM `pidof $FCOEMON`
 
-       for ifcfg_file in `ls $CONFIG_DIR/cfg-eth*`
-       do
-               ifname=`basename $ifcfg_file | cut -d"-" -f2`
-               . $ifcfg_file
-               [ "$FCOE_ENABLE" != "yes" ] &&
-               [ "$FCOE_ENABLE" != "YES" ] && continue
-               if [ "$DCB_REQUIRED" != "yes" ] &&
-                  [ "$DCB_REQUIRED" != "YES" ]; then
-                       STATUS=`$FCOEADM -i $ifname 2>&1 | \
-                               awk '/Symbolic Name:/{print $6}'`
-                       if [ "$STATUS" = "$ifname" ]; then
-                               $FCOEADM -d $ifname
-                       fi
-               fi
-       done
-
        retry_count=5
        while true
        do
diff --git a/etc/initd/initd.suse b/etc/initd/initd.suse
index 6840d44..b4b1b76 100755
--- a/etc/initd/initd.suse
+++ b/etc/initd/initd.suse
@@ -189,42 +189,7 @@ service_start()
 
        startup_fcoe_modules
 
-       HAS_DCB_IF="false"
-       for ifcfg_file in `ls $CONFIG_DIR/cfg-eth*`
-       do
-               ifname=`basename $ifcfg_file | cut -d"-" -f2`
-               . $ifcfg_file
-               [ "$FCOE_ENABLE" != "yes" ] &&
-               [ "$FCOE_ENABLE" != "YES" ] && continue
-
-               if [ "$DCB_REQUIRED" != "yes" ] &&
-                  [ "$DCB_REQUIRED" != "YES" ]; then
-                       #
-                       # DCB is not required, we nee to validate the
-                       # link flow control of the Ethernet port
-                       #
-                       validate_link_flow_control $ifname
-                       [ $? -ne 0 ] && continue
-                       #
-                       # Create the FCoE interface
-                       #
-                       $FCOEADM -c $ifname
-               else
-                       #
-                       # Configure the DCB for the Ethernet
-                       # port if DCB is required
-                       #
-                       HAS_DCB_IF="true"
-               fi
-       done
-
-       #
-       # If DCB-required Ethernet port exists, then start the fcoemon
-       # daemon to create the FCoE interfaces for these ports.
-       #
-       if [ "$HAS_DCB_IF" = "true" ]; then
-               startproc -l ${LOG_FILE} -p ${PID_FILE} ${FCOEMON} 
${FCOEMON_OPTS}
-       fi
+       startproc -l ${LOG_FILE} -p ${PID_FILE} ${FCOEMON} ${FCOEMON_OPTS}
 
        rc_status -v
        return
@@ -235,22 +200,6 @@ service_stop()
        checkproc $FCOEMON
        [ $? -eq 0 ] && killproc -TERM $FCOEMON
 
-       for ifcfg_file in `ls $CONFIG_DIR/cfg-eth*`
-       do
-               ifname=`basename $ifcfg_file | cut -d"-" -f2`
-               . $ifcfg_file
-               [ "$FCOE_ENABLE" != "yes" ] &&
-               [ "$FCOE_ENABLE" != "YES" ] && continue
-               if [ "$DCB_REQUIRED" != "yes" ] &&
-                  [ "$DCB_REQUIRED" != "YES" ]; then
-                       STATUS=`$FCOEADM -i $ifname 2>&1 | \
-                               awk '/Symbolic Name:/{print $6}'`
-                       if [ "$STATUS" = "$ifname" ]; then
-                               $FCOEADM -d $ifname
-                       fi
-               fi
-       done
-
        retry_count=5
        while true
        do

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to