check in missing patches

This commit is contained in:
Chris Leech 2015-06-16 18:24:01 -07:00
parent 1447cbc1c8
commit 6d59a5c320
3 changed files with 187 additions and 0 deletions

View File

@ -0,0 +1,78 @@
From f3af6bad75d7f6c90b9a170cbf9e4748ab4bb24e Mon Sep 17 00:00:00 2001
From: Johannes Thumshirn <jthumshirn@suse.de>
Date: Mon, 18 May 2015 17:02:59 +0000
Subject: [PATCH] fcoemon: Rework daemonizing and error handling
Rework error handling, which leads to daemonizing later in order to get the
error handling into effect.
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
---
fcoemon.c | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/fcoemon.c b/fcoemon.c
index 3b5210c..c5edd1b 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -3719,11 +3719,6 @@ int main(int argc, char **argv)
if (argc != optind)
fcm_usage();
- if (!fcm_fg && daemon(0, !fcoe_config.use_syslog)) {
- FCM_LOG("Starting daemon failed");
- exit(EXIT_FAILURE);
- }
-
umask(0);
/*
@@ -3770,22 +3765,40 @@ int main(int argc, char **argv)
}
fcm_fcoe_init();
- fcm_fc_events_init();
- fcm_link_init(); /* NETLINK_ROUTE protocol */
+ rc = fcm_fc_events_init();
+ if (rc != 0)
+ exit(1);
+
+ rc = fcm_link_init(); /* NETLINK_ROUTE protocol */
+ if (rc != 0)
+ goto err_cleanup;
+
fcm_dcbd_init();
- fcm_srv_create(&srv_info);
+ rc = fcm_srv_create(&srv_info);
+ if (rc != 0)
+ goto err_cleanup;
+
+ if (!fcm_fg && daemon(0, !fcoe_config.use_syslog)) {
+ FCM_LOG("Starting daemon failed");
+ goto err_cleanup;
+ }
+
sa_select_set_callback(fcm_handle_changes);
rc = sa_select_loop();
if (rc < 0) {
FCM_LOG_ERR(rc, "select error\n");
- exit(EXIT_FAILURE);
+ goto err_cleanup;
}
fcm_dcbd_shutdown();
fcm_srv_destroy(&srv_info);
if (rc == SIGHUP)
fcm_cleanup();
return 0;
+
+err_cleanup:
+ fcm_cleanup();
+ exit(1);
}
/*******************************************************
--
2.1.0

View File

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

View File

@ -0,0 +1,26 @@
From 8065e01707c3306380c684712e547fcf0e4e55da Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Thu, 5 Feb 2015 11:46:31 -0800
Subject: [PATCH] sanmac isn't required
Signed-off-by: Chris Leech <cleech@redhat.com>
---
lib/fip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/fip.c b/lib/fip.c
index 6657b61..5e5b179 100644
--- a/lib/fip.c
+++ b/lib/fip.c
@@ -215,7 +215,7 @@ int fip_socket(int ifindex, enum fip_multi multi)
return s;
rc = fip_socket_sanmac(s, ifindex, 1);
- if (rc < 0) {
+ if (rc < 0 && rc != -ENXIO) {
close(s);
return rc;
}
--
2.1.0