Blame SOURCES/fcoe-utils-v1.0.30-2-fcoemon-fix-IEEE-state-machine.patch

621f66
From 91c0c8c0a37af40b3fb4a37df6490a226348d152 Mon Sep 17 00:00:00 2001
621f66
From: Vasu Dev <vasu.dev@intel.com>
621f66
Date: Fri, 5 Jun 2015 14:52:10 -0700
621f66
Subject: [PATCH] fcoemon: fix IEEE state machine
621f66
621f66
Fix IEEE state machine for these issues:-
621f66
621f66
 - fcoeadm scan not working
621f66
 - fcoeadm reset not working
621f66
 - periodic fipvlan issuance even after fcoe instance created
621f66
621f66
These issues are due to current IEEE states are not correctly
621f66
handled. The validate_ieee_info() return either activate or
621f66
wait actions and out of that only activate is really used to
621f66
enable fcoe instance and none other action are applicable in
621f66
IEEE state machine, so reduced to only activate and then
621f66
advance the state machine to new IEEE_ACTIVE state to allow
621f66
processing of scan & reset command once interface activated.
621f66
621f66
This also fixes fipvlan issuance issue beside fixing scan and
621f66
reset fcoeadm commands.
621f66
621f66
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
621f66
Tested-By: Jack Morgan<jack.morgan@intel.com>
621f66
---
621f66
 fcoemon.c | 19 +++++++------------
621f66
 fcoemon.h |  1 +
621f66
 2 files changed, 8 insertions(+), 12 deletions(-)
621f66
621f66
diff --git a/fcoemon.c b/fcoemon.c
621f66
index c5edd1b..c0af99b 100644
621f66
--- a/fcoemon.c
621f66
+++ b/fcoemon.c
621f66
@@ -1341,6 +1341,7 @@ STR_ARR(ieee_states, "Unknown", "Out of range",
621f66
 	[IEEE_INIT] = "IEEE_INIT",
621f66
 	[IEEE_GET_STATE] = "IEEE_GET_STATE",
621f66
 	[IEEE_DONE] = "IEEE_DONE",
621f66
+	[IEEE_ACTIVE] = "IEEE_ACTIVE",
621f66
 );
621f66
 
621f66
 static void
621f66
@@ -3054,20 +3055,14 @@ static void fcm_netif_ieee_advance(struct fcm_netif *ff)
621f66
 		break;
621f66
 	case IEEE_DONE:
621f66
 		action = validate_ieee_info(ff);
621f66
-		switch (action) {
621f66
-		case FCP_DESTROY_IF:
621f66
-		case FCP_ENABLE_IF:
621f66
-		case FCP_ACTIVATE_IF:
621f66
+		if (action == FCP_ACTIVATE_IF) {
621f66
 			fcp_action_set(ff->ifname, action);
621f66
-			break;
621f66
-		case FCP_DISABLE_IF:
621f66
-		case FCP_ERROR:
621f66
-			fcp_action_set(ff->ifname, FCP_DISABLE_IF);
621f66
-			break;
621f66
-		case FCP_WAIT:
621f66
-		default:
621f66
-			break;
621f66
+			ieee_state_set(ff, IEEE_ACTIVE);
621f66
 		}
621f66
+		break;
621f66
+	case IEEE_ACTIVE:
621f66
+		/* TBD enable and disable if needed in IEEE mode */
621f66
+		break;
621f66
 	default:
621f66
 		break;
621f66
 	}
621f66
diff --git a/fcoemon.h b/fcoemon.h
621f66
index c2ed7b1..3869bae 100644
621f66
--- a/fcoemon.h
621f66
+++ b/fcoemon.h
621f66
@@ -80,6 +80,7 @@ enum ieee_state {
621f66
 	IEEE_INIT = 0,	/* Starting state */
621f66
 	IEEE_GET_STATE,	/* Getting IEEE DCB state */
621f66
 	IEEE_DONE,	/* Received IEEE DCB state */
621f66
+	IEEE_ACTIVE,	/* IEEE is in ACTIVE state */
621f66
 	IEEE_ERROR,	/* Error receiving IEEE DCB state */
621f66
 };
621f66
 
621f66
-- 
621f66
2.1.0
621f66