When switch leaves fcoe mode 'no fcoe mode' fcoemon does not detect that app
config operational state is false 'dcbtool go eth2 app:0'.  In this case I
would expect that fcoemon removes the interface it does not.

This patch also fixed a few logging messages and inhibits the pinging messages
to the dcbd.

Signed-off-by: Steve Ma <[email protected]>
---

 usr/tools/fcoemon/fcoemon.c |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/usr/tools/fcoemon/fcoemon.c b/usr/tools/fcoemon/fcoemon.c
index 84fb5de..376405e 100644
--- a/usr/tools/fcoemon/fcoemon.c
+++ b/usr/tools/fcoemon/fcoemon.c
@@ -925,7 +925,7 @@ fcm_dcbd_rx(void *arg)
                buf[rc] = '\0';
                len = strlen(buf);
                ASSERT(len <= rc);
-               if (fcm_dcbd_debug)
+               if (fcm_dcbd_debug && len > 8)
                        SA_LOG("received len %d buf '%s'", len, buf);
 
                switch (buf[CLIF_RSP_MSG_OFF]) {
@@ -1004,7 +1004,7 @@ fcm_dcbd_request(char *req)
                return;
        }
 
-       if (fcm_dcbd_debug)
+       if (fcm_dcbd_debug && rc > 1)
                SA_LOG("sent '%s', rc=%d bytes succeeded", req, rc);
        return;
 }
@@ -1164,18 +1164,20 @@ static int
 validating_app_pfc(struct fcm_fcoe *ff)
 {
        if (fcm_dcbd_debug) {
+               SA_LOG("\tff_app_info.op_mode=%d\n",
+                       ff->ff_app_info.op_mode);
                SA_LOG("\tff_app_info.enable=%d\n",
                        ff->ff_app_info.enable);
                SA_LOG("\tff_app_info.willing=%d\n",
-                       ff->ff_app_info.op_mode);
-               SA_LOG("\tff_app_info.willing=%d\n",
-                       ff->ff_app_info.op_mode);
+                       ff->ff_app_info.willing);
+               SA_LOG("\tff_app_info.advertise=%d\n",
+                       ff->ff_app_info.advertise);
+               SA_LOG("\tff_app_info.u.appcfg=0x%02x\n",
+                       ff->ff_app_info.u.appcfg);
                SA_LOG("\tff_pfc_info.op_mode=%d\n",
                        ff->ff_pfc_info.op_mode);
                SA_LOG("\tff_pfc_info.u.pfcup=0x%02x\n",
                        ff->ff_pfc_info.u.pfcup);
-               SA_LOG("\tff_app_info.u.appcfg=0x%02x\n",
-                       ff->ff_app_info.u.appcfg);
        }
 
        if (!ff->ff_app_info.willing ||
@@ -1432,10 +1434,10 @@ fcm_dcbd_cmd_resp(char *resp, cmd_status st)
                }
                if (val != 0) {
                        if (fcm_dcbd_debug) {
-                               SA_LOG("resp:%s\n", orig_resp);
+                               SA_LOG("val=0x%x resp:%s\n", val, orig_resp);
                                print_errors("", val);
                        }
-                       /* fcm_dcbd_setup(ff, 0); */
+                       fcm_dcbd_setup(ff, ADM_DESTROY);
                        fcm_dcbd_state_set(ff, FCD_DONE);
                        return;
                }
@@ -1563,10 +1565,10 @@ fcm_dcbd_cmd_resp(char *resp, cmd_status st)
                }
                if (val != 0) {
                        if (fcm_dcbd_debug) {
-                               SA_LOG("resp:%s\n", orig_resp);
+                               SA_LOG("val=0x%x resp:%s\n", val, orig_resp);
                                print_errors("", val);
                        }
-                       /* fcm_dcbd_setup(ff, ADM_DESTROY); */
+                       fcm_dcbd_setup(ff, ADM_DESTROY);
                        fcm_dcbd_state_set(ff, FCD_DONE);
                        return;
                }

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

Reply via email to