[Open-FCoE] [fcoemon PATCH v2 10/11] Remove FCoE interface management from service start script

Eric Multanen eric.w.multanen at intel.com
Tue Dec 15 05:01:23 UTC 2009


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 <eric.w.multanen at intel.com>
---

 etc/initd/initd.fedora |   66 +++++-------------------------------------------
 etc/initd/initd.suse   |   37 +--------------------------
 2 files changed, 8 insertions(+), 95 deletions(-)

diff --git a/etc/initd/initd.fedora b/etc/initd/initd.fedora
index 629fc76..412b2de 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
 }
diff --git a/etc/initd/initd.suse b/etc/initd/initd.suse
index 6840d44..6efb88c 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




More information about the devel mailing list