Patchwork [Open-FCoE,08/10] fcoemon: Check fcoe-enabled before setting create action

login
register
mail settings
Submitter Mark Rustad
Date March 19, 2013, 11:33 p.m.
Message ID <20130319233359.3241.17250.stgit@host1-mdrustad.localdomain>
Download mbox | patch
Permalink /patch/25/
State Accepted
Headers show

Comments

Mark Rustad - March 19, 2013, 11:33 p.m.
Check fcoe_enable before setting the state machine action
to FCP_CREATE_IF to avoid creating interfaces that are not
wanted.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Jack Morgan <jack.morgan@intel.com>
---

 fcoemon.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Patch

diff --git a/fcoemon.c b/fcoemon.c
index f6e7318..558e2c0 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -1136,8 +1136,10 @@  static void fcp_set_next_action(struct fcoe_port *p, enum fcp_action action)
 		case FCP_ENABLE_IF:
 			if (p->auto_vlan)
 				p->action = FCP_VLAN_DISC;
-			else
+			else if (p->fcoe_enable)
 				p->action = FCP_CREATE_IF;
+			else
+				p->action = FCP_WAIT;
 			break;
 		default:
 			p->action = FCP_WAIT;
@@ -1201,8 +1203,10 @@  static void fcp_set_next_action(struct fcoe_port *p, enum fcp_action action)
 		case FCP_ACTIVATE_IF:
 			if (p->auto_vlan)
 				p->action = FCP_VLAN_DISC;
-			else
+			else if (p->fcoe_enable)
 				p->action = FCP_CREATE_IF;
+			else
+				p->action = FCP_WAIT;
 			break;
 		case FCP_DESTROY_IF:
 		case FCP_DISABLE_IF: