[SCSI] bfa: Add support to register node symbolic name with name server
authorKrishna Gudipati <kgudipat@brocade.com>
Thu, 23 Aug 2012 02:52:43 +0000 (19:52 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 24 Sep 2012 08:10:57 +0000 (12:10 +0400)
- Changes to register node symbolic name with name server on the fabric
  by sending CT commands RNN_ID and RSNN_NN.

Signed-off-by: Vijaya Mohan Guvva <vmohan@brocade.com>
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/bfa/bfa_defs_fcs.h
drivers/scsi/bfa/bfa_fc.h
drivers/scsi/bfa/bfa_fcbuild.c
drivers/scsi/bfa/bfa_fcbuild.h
drivers/scsi/bfa/bfa_fcs.c
drivers/scsi/bfa/bfa_fcs.h
drivers/scsi/bfa/bfa_fcs_lport.c

index 5871a1b6e2bce36d88a3ec176331aa7ad3e6e382..06f0a163ca35bd87a854dd0ea0861a4bb35c9e29 100644 (file)
@@ -93,6 +93,7 @@ struct bfa_lport_cfg_s {
        wwn_t          pwwn;       /*  port wwn */
        wwn_t          nwwn;       /*  node wwn */
        struct bfa_lport_symname_s  sym_name;   /*  vm port symbolic name */
+       struct bfa_lport_symname_s node_sym_name; /* Node symbolic name */
        enum bfa_lport_role roles;      /* FCS port roles */
        u32     rsvd;
        bfa_boolean_t   preboot_vp;  /*  vport created from PBC */
@@ -192,6 +193,18 @@ struct bfa_lport_stats_s {
        u32     ns_gidft_unknown_rsp;
        u32     ns_gidft_alloc_wait;
 
+       u32     ns_rnnid_sent;
+       u32     ns_rnnid_accepts;
+       u32     ns_rnnid_rsp_err;
+       u32     ns_rnnid_rejects;
+       u32     ns_rnnid_alloc_wait;
+
+       u32     ns_rsnn_nn_sent;
+       u32     ns_rsnn_nn_accepts;
+       u32     ns_rsnn_nn_rsp_err;
+       u32     ns_rsnn_nn_rejects;
+       u32     ns_rsnn_nn_alloc_wait;
+
        /*
         * Mgmt Server stats
         */
index 8d0b88f67a382e3582c40382d7dfe3892a19f3c8..e0beb4d7e26443c8881abc3ba66f59b7ac773f87 100644 (file)
@@ -1279,6 +1279,7 @@ enum {
        GS_GSPN_ID      = 0x0118,       /* Get symbolic PN on ID */
        GS_RFT_ID       = 0x0217,       /* Register fc4type on ID */
        GS_RSPN_ID      = 0x0218,       /* Register symbolic PN on ID */
+       GS_RSNN_NN      = 0x0239,       /* Register symbolic NN on NN */
        GS_RPN_ID       = 0x0212,       /* Register port name */
        GS_RNN_ID       = 0x0213,       /* Register node name */
        GS_RCS_ID       = 0x0214,       /* Register class of service */
@@ -1356,6 +1357,15 @@ struct fcgs_rspnid_req_s {
        u8      spn[256];       /* symbolic port name */
 };
 
+/*
+ * RSNN_NN
+ */
+struct fcgs_rsnn_nn_req_s {
+       wwn_t   node_name;      /* Node name */
+       u8      snn_len;        /* symbolic node name length */
+       u8      snn[256];       /* symbolic node name */
+};
+
 /*
  * RPN_ID
  */
index 17b59b8b564425fc0a8bc38dcf25f2af08f780a9..273cee90b3b429166ef8259a81a60aad0a865dc4 100644 (file)
@@ -1251,6 +1251,27 @@ fc_rspnid_build(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id,
        return sizeof(struct fcgs_rspnid_req_s) + sizeof(struct ct_hdr_s);
 }
 
+u16
+fc_rsnn_nn_build(struct fchs_s *fchs, void *pyld, u32 s_id,
+                       wwn_t node_name, u8 *name)
+{
+       struct ct_hdr_s *cthdr = (struct ct_hdr_s *) pyld;
+       struct fcgs_rsnn_nn_req_s *rsnn_nn =
+               (struct fcgs_rsnn_nn_req_s *) (cthdr + 1);
+       u32     d_id = bfa_hton3b(FC_NAME_SERVER);
+
+       fc_gs_fchdr_build(fchs, d_id, s_id, 0);
+       fc_gs_cthdr_build(cthdr, s_id, GS_RSNN_NN);
+
+       memset(rsnn_nn, 0, sizeof(struct fcgs_rsnn_nn_req_s));
+
+       rsnn_nn->node_name = node_name;
+       rsnn_nn->snn_len = (u8) strlen((char *)name);
+       strncpy((char *)rsnn_nn->snn, (char *)name, rsnn_nn->snn_len);
+
+       return sizeof(struct fcgs_rsnn_nn_req_s) + sizeof(struct ct_hdr_s);
+}
+
 u16
 fc_gid_ft_build(struct fchs_s *fchs, void *pyld, u32 s_id, u8 fc4_type)
 {
index 42cd9d4da697b767eb66601644b155b4d2162bcd..03c753d1e548949573a785463f203c685e1936b4 100644 (file)
@@ -166,6 +166,8 @@ enum fc_parse_status fc_rrq_rsp_parse(struct fchs_s *buf, int len);
 
 u16        fc_rspnid_build(struct fchs_s *fchs, void *pld, u32 s_id,
                                u16 ox_id, u8 *name);
+u16    fc_rsnn_nn_build(struct fchs_s *fchs, void *pld, u32 s_id,
+                               wwn_t node_name, u8 *name);
 
 u16        fc_rftid_build(struct fchs_s *fchs, void *pld, u32 s_id,
                               u16 ox_id, enum bfa_lport_role role);
index 671a1a227f94a6729869baa12377f8d9cc5ade55..2139592aca5ed61365b72a765d13bdb5d5a7b544 100644 (file)
@@ -165,6 +165,7 @@ bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
        fcs->driver_info = *driver_info;
 
        bfa_fcs_fabric_psymb_init(&fcs->fabric);
+       bfa_fcs_fabric_nsymb_init(&fcs->fabric);
 }
 
 /*
@@ -842,6 +843,44 @@ bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
        port_cfg->sym_name.symname[BFA_SYMNAME_MAXLEN - 1] = 0;
 }
 
+/*
+ * Node Symbolic Name Creation for base port and all vports
+ */
+void
+bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric)
+{
+       struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg;
+       char model[BFA_ADAPTER_MODEL_NAME_LEN] = {0};
+       struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info;
+
+       bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model);
+
+       /* Model name/number */
+       strncpy((char *)&port_cfg->node_sym_name, model,
+               BFA_FCS_PORT_SYMBNAME_MODEL_SZ);
+       strncat((char *)&port_cfg->node_sym_name,
+                       BFA_FCS_PORT_SYMBNAME_SEPARATOR,
+                       sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
+
+       /* Driver Version */
+       strncat((char *)&port_cfg->node_sym_name, (char *)driver_info->version,
+               BFA_FCS_PORT_SYMBNAME_VERSION_SZ);
+       strncat((char *)&port_cfg->node_sym_name,
+                       BFA_FCS_PORT_SYMBNAME_SEPARATOR,
+                       sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
+
+       /* Host machine name */
+       strncat((char *)&port_cfg->node_sym_name,
+               (char *)driver_info->host_machine_name,
+               BFA_FCS_PORT_SYMBNAME_MACHINENAME_SZ);
+       strncat((char *)&port_cfg->node_sym_name,
+                       BFA_FCS_PORT_SYMBNAME_SEPARATOR,
+                       sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
+
+       /* null terminate */
+       port_cfg->node_sym_name.symname[BFA_SYMNAME_MAXLEN - 1] = 0;
+}
+
 /*
  * bfa lps login completion callback
  */
index b64ca35bf6fe3c500aa1bc07a6d5e8ec07dfbf32..2b35f1b6e4f4b3164e612a80eb87cc293556c26f 100644 (file)
@@ -62,6 +62,7 @@ struct bfa_fcs_s;
 #define N2N_LOCAL_PID      0x010000
 #define N2N_REMOTE_PID         0x020000
 #define        BFA_FCS_RETRY_TIMEOUT 2000
+#define BFA_FCS_MAX_NS_RETRIES 5
 #define BFA_FCS_PID_IS_WKA(pid)  ((bfa_ntoh3b(pid) > 0xFFF000) ?  1 : 0)
 
 
@@ -72,6 +73,8 @@ struct bfa_fcs_lport_ns_s {
        struct bfa_fcs_lport_s *port;   /*  parent port */
        struct bfa_fcxp_s *fcxp;
        struct bfa_fcxp_wqe_s fcxp_wqe;
+       u8      num_rnnid_retries;
+       u8      num_rsnn_nn_retries;
 };
 
 
@@ -265,6 +268,7 @@ struct bfa_fcs_fabric_s;
 #define bfa_fcs_lport_get_pwwn(_lport) ((_lport)->port_cfg.pwwn)
 #define bfa_fcs_lport_get_nwwn(_lport) ((_lport)->port_cfg.nwwn)
 #define bfa_fcs_lport_get_psym_name(_lport)    ((_lport)->port_cfg.sym_name)
+#define bfa_fcs_lport_get_nsym_name(_lport) ((_lport)->port_cfg.node_sym_name)
 #define bfa_fcs_lport_is_initiator(_lport)                     \
        ((_lport)->port_cfg.roles & BFA_LPORT_ROLE_FCP_IM)
 #define bfa_fcs_lport_get_nrports(_lport)      \
@@ -780,6 +784,7 @@ void bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs);
 void bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric,
                struct fchs_s *fchs, u16 len);
 void   bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric);
+void   bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric);
 void bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
               wwn_t fabric_name);
 u16 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric);
index 3c9bde9a8080cd490c9b3d38bced2eff6fcfd540..d4a4d534843de5bbf8f83aae3824e58891b96304 100644 (file)
@@ -3229,6 +3229,10 @@ static void     bfa_fcs_lport_ns_send_rff_id(void *ns_cbarg,
                                            struct bfa_fcxp_s *fcxp_alloced);
 static void     bfa_fcs_lport_ns_send_gid_ft(void *ns_cbarg,
                                            struct bfa_fcxp_s *fcxp_alloced);
+static void    bfa_fcs_lport_ns_send_rnn_id(void *ns_cbarg,
+                                       struct bfa_fcxp_s *fcxp_alloced);
+static void    bfa_fcs_lport_ns_send_rsnn_nn(void *ns_cbarg,
+                                       struct bfa_fcxp_s *fcxp_alloced);
 static void     bfa_fcs_lport_ns_timeout(void *arg);
 static void     bfa_fcs_lport_ns_plogi_response(void *fcsarg,
                                               struct bfa_fcxp_s *fcxp,
@@ -3265,6 +3269,20 @@ static void     bfa_fcs_lport_ns_gid_ft_response(void *fcsarg,
                                                u32 rsp_len,
                                                u32 resid_len,
                                                struct fchs_s *rsp_fchs);
+static void     bfa_fcs_lport_ns_rnn_id_response(void *fcsarg,
+                                               struct bfa_fcxp_s *fcxp,
+                                               void *cbarg,
+                                               bfa_status_t req_status,
+                                               u32 rsp_len,
+                                               u32 resid_len,
+                                               struct fchs_s *rsp_fchs);
+static void     bfa_fcs_lport_ns_rsnn_nn_response(void *fcsarg,
+                                               struct bfa_fcxp_s *fcxp,
+                                               void *cbarg,
+                                               bfa_status_t req_status,
+                                               u32 rsp_len,
+                                               u32 resid_len,
+                                               struct fchs_s *rsp_fchs);
 static void     bfa_fcs_lport_ns_process_gidft_pids(
                                struct bfa_fcs_lport_s *port,
                                u32 *pid_buf, u32 n_pids);
@@ -3289,6 +3307,8 @@ enum vport_ns_event {
        NSSM_EVENT_RFTID_SENT = 9,
        NSSM_EVENT_RFFID_SENT = 10,
        NSSM_EVENT_GIDFT_SENT = 11,
+       NSSM_EVENT_RNNID_SENT = 12,
+       NSSM_EVENT_RSNN_NN_SENT = 13,
 };
 
 static void     bfa_fcs_lport_ns_sm_offline(struct bfa_fcs_lport_ns_s *ns,
@@ -3329,6 +3349,21 @@ static void     bfa_fcs_lport_ns_sm_gid_ft_retry(struct bfa_fcs_lport_ns_s *ns,
                                                enum vport_ns_event event);
 static void     bfa_fcs_lport_ns_sm_online(struct bfa_fcs_lport_ns_s *ns,
                                          enum vport_ns_event event);
+static void     bfa_fcs_lport_ns_sm_sending_rnn_id(
+                                       struct bfa_fcs_lport_ns_s *ns,
+                                       enum vport_ns_event event);
+static void     bfa_fcs_lport_ns_sm_rnn_id(struct bfa_fcs_lport_ns_s *ns,
+                                       enum vport_ns_event event);
+static void     bfa_fcs_lport_ns_sm_rnn_id_retry(struct bfa_fcs_lport_ns_s *ns,
+                                               enum vport_ns_event event);
+static void     bfa_fcs_lport_ns_sm_sending_rsnn_nn(
+                                       struct bfa_fcs_lport_ns_s *ns,
+                                       enum vport_ns_event event);
+static void     bfa_fcs_lport_ns_sm_rsnn_nn(struct bfa_fcs_lport_ns_s *ns,
+                                               enum vport_ns_event event);
+static void     bfa_fcs_lport_ns_sm_rsnn_nn_retry(
+                                       struct bfa_fcs_lport_ns_s *ns,
+                                       enum vport_ns_event event);
 /*
  *     Start in offline state - awaiting linkup
  */
@@ -3396,8 +3431,9 @@ bfa_fcs_lport_ns_sm_plogi(struct bfa_fcs_lport_ns_s *ns,
                break;
 
        case NSSM_EVENT_RSP_OK:
-               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_sending_rspn_id);
-               bfa_fcs_lport_ns_send_rspn_id(ns, NULL);
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_sending_rnn_id);
+               ns->num_rnnid_retries = 0;
+               bfa_fcs_lport_ns_send_rnn_id(ns, NULL);
                break;
 
        case NSSM_EVENT_PORT_OFFLINE:
@@ -3436,6 +3472,176 @@ bfa_fcs_lport_ns_sm_plogi_retry(struct bfa_fcs_lport_ns_s *ns,
        }
 }
 
+static void
+bfa_fcs_lport_ns_sm_sending_rnn_id(struct bfa_fcs_lport_ns_s *ns,
+                                       enum vport_ns_event event)
+{
+       bfa_trc(ns->port->fcs, ns->port->port_cfg.pwwn);
+       bfa_trc(ns->port->fcs, event);
+
+       switch (event) {
+       case NSSM_EVENT_RNNID_SENT:
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_rnn_id);
+               break;
+
+       case NSSM_EVENT_PORT_OFFLINE:
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_offline);
+               bfa_fcxp_walloc_cancel(BFA_FCS_GET_HAL_FROM_PORT(ns->port),
+                                               &ns->fcxp_wqe);
+               break;
+       default:
+               bfa_sm_fault(ns->port->fcs, event);
+       }
+}
+
+static void
+bfa_fcs_lport_ns_sm_rnn_id(struct bfa_fcs_lport_ns_s *ns,
+                               enum vport_ns_event event)
+{
+       bfa_trc(ns->port->fcs, ns->port->port_cfg.pwwn);
+       bfa_trc(ns->port->fcs, event);
+
+       switch (event) {
+       case NSSM_EVENT_RSP_OK:
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_sending_rsnn_nn);
+               ns->num_rnnid_retries = 0;
+               ns->num_rsnn_nn_retries = 0;
+               bfa_fcs_lport_ns_send_rsnn_nn(ns, NULL);
+               break;
+
+       case NSSM_EVENT_RSP_ERROR:
+               if (ns->num_rnnid_retries < BFA_FCS_MAX_NS_RETRIES) {
+                       bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_rnn_id_retry);
+                       ns->port->stats.ns_retries++;
+                       ns->num_rnnid_retries++;
+                       bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ns->port),
+                               &ns->timer, bfa_fcs_lport_ns_timeout, ns,
+                               BFA_FCS_RETRY_TIMEOUT);
+               } else {
+                       bfa_sm_set_state(ns,
+                               bfa_fcs_lport_ns_sm_sending_rspn_id);
+                       bfa_fcs_lport_ns_send_rspn_id(ns, NULL);
+               }
+               break;
+
+       case NSSM_EVENT_PORT_OFFLINE:
+               bfa_fcxp_discard(ns->fcxp);
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_offline);
+               break;
+
+       default:
+               bfa_sm_fault(ns->port->fcs, event);
+       }
+}
+
+static void
+bfa_fcs_lport_ns_sm_rnn_id_retry(struct bfa_fcs_lport_ns_s *ns,
+                               enum vport_ns_event event)
+{
+       bfa_trc(ns->port->fcs, ns->port->port_cfg.pwwn);
+       bfa_trc(ns->port->fcs, event);
+
+       switch (event) {
+       case NSSM_EVENT_TIMEOUT:
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_sending_rnn_id);
+               bfa_fcs_lport_ns_send_rnn_id(ns, NULL);
+               break;
+
+       case NSSM_EVENT_PORT_OFFLINE:
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_offline);
+               bfa_timer_stop(&ns->timer);
+               break;
+
+       default:
+               bfa_sm_fault(ns->port->fcs, event);
+       }
+}
+
+static void
+bfa_fcs_lport_ns_sm_sending_rsnn_nn(struct bfa_fcs_lport_ns_s *ns,
+                                       enum vport_ns_event event)
+{
+       bfa_trc(ns->port->fcs, ns->port->port_cfg.pwwn);
+       bfa_trc(ns->port->fcs, event);
+
+       switch (event) {
+       case NSSM_EVENT_RSNN_NN_SENT:
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_rsnn_nn);
+               break;
+
+       case NSSM_EVENT_PORT_OFFLINE:
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_offline);
+               bfa_fcxp_walloc_cancel(BFA_FCS_GET_HAL_FROM_PORT(ns->port),
+                       &ns->fcxp_wqe);
+               break;
+
+       default:
+               bfa_sm_fault(ns->port->fcs, event);
+       }
+}
+
+static void
+bfa_fcs_lport_ns_sm_rsnn_nn(struct bfa_fcs_lport_ns_s *ns,
+                               enum vport_ns_event event)
+{
+       bfa_trc(ns->port->fcs, ns->port->port_cfg.pwwn);
+       bfa_trc(ns->port->fcs, event);
+
+       switch (event) {
+       case NSSM_EVENT_RSP_OK:
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_sending_rspn_id);
+               ns->num_rsnn_nn_retries = 0;
+               bfa_fcs_lport_ns_send_rspn_id(ns, NULL);
+               break;
+
+       case NSSM_EVENT_RSP_ERROR:
+               if (ns->num_rsnn_nn_retries < BFA_FCS_MAX_NS_RETRIES) {
+                       bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_rsnn_nn_retry);
+                       ns->port->stats.ns_retries++;
+                       ns->num_rsnn_nn_retries++;
+                       bfa_timer_start(BFA_FCS_GET_HAL_FROM_PORT(ns->port),
+                                       &ns->timer, bfa_fcs_lport_ns_timeout,
+                                       ns, BFA_FCS_RETRY_TIMEOUT);
+               } else {
+                       bfa_sm_set_state(ns,
+                               bfa_fcs_lport_ns_sm_sending_rspn_id);
+                       bfa_fcs_lport_ns_send_rspn_id(ns, NULL);
+               }
+               break;
+
+       case NSSM_EVENT_PORT_OFFLINE:
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_offline);
+               bfa_fcxp_discard(ns->fcxp);
+               break;
+
+       default:
+               bfa_sm_fault(ns->port->fcs, event);
+       }
+}
+
+static void
+bfa_fcs_lport_ns_sm_rsnn_nn_retry(struct bfa_fcs_lport_ns_s *ns,
+                                       enum vport_ns_event event)
+{
+       bfa_trc(ns->port->fcs, ns->port->port_cfg.pwwn);
+       bfa_trc(ns->port->fcs, event);
+
+       switch (event) {
+       case NSSM_EVENT_TIMEOUT:
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_sending_rsnn_nn);
+               bfa_fcs_lport_ns_send_rsnn_nn(ns, NULL);
+               break;
+
+       case NSSM_EVENT_PORT_OFFLINE:
+               bfa_sm_set_state(ns, bfa_fcs_lport_ns_sm_offline);
+               bfa_timer_stop(&ns->timer);
+               break;
+
+       default:
+               bfa_sm_fault(ns->port->fcs, event);
+       }
+}
+
 static void
 bfa_fcs_lport_ns_sm_sending_rspn_id(struct bfa_fcs_lport_ns_s *ns,
                                   enum vport_ns_event event)
@@ -3916,6 +4122,162 @@ bfa_fcs_lport_ns_plogi_response(void *fcsarg, struct bfa_fcxp_s *fcxp,
        }
 }
 
+/*
+ * Register node name for port_id
+ */
+static void
+bfa_fcs_lport_ns_send_rnn_id(void *ns_cbarg, struct bfa_fcxp_s *fcxp_alloced)
+{
+       struct bfa_fcs_lport_ns_s *ns = ns_cbarg;
+       struct bfa_fcs_lport_s *port = ns->port;
+       struct fchs_s  fchs;
+       int     len;
+       struct bfa_fcxp_s *fcxp;
+
+       bfa_trc(port->fcs, port->port_cfg.pwwn);
+
+       fcxp = fcxp_alloced ? fcxp_alloced :
+                       bfa_fcs_fcxp_alloc(port->fcs, BFA_TRUE);
+       if (!fcxp) {
+               port->stats.ns_rnnid_alloc_wait++;
+               bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &ns->fcxp_wqe,
+                               bfa_fcs_lport_ns_send_rnn_id, ns, BFA_TRUE);
+               return;
+       }
+
+       ns->fcxp = fcxp;
+
+       len = fc_rnnid_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
+                               bfa_fcs_lport_get_fcid(port),
+                               bfa_fcs_lport_get_fcid(port),
+                               bfa_fcs_lport_get_nwwn(port));
+
+       bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
+                         FC_CLASS_3, len, &fchs,
+                         bfa_fcs_lport_ns_rnn_id_response, (void *)ns,
+                         FC_MAX_PDUSZ, FC_FCCT_TOV);
+
+       port->stats.ns_rnnid_sent++;
+       bfa_sm_send_event(ns, NSSM_EVENT_RNNID_SENT);
+}
+
+static void
+bfa_fcs_lport_ns_rnn_id_response(void *fcsarg, struct bfa_fcxp_s *fcxp,
+                               void *cbarg, bfa_status_t req_status,
+                               u32 rsp_len, u32 resid_len,
+                               struct fchs_s *rsp_fchs)
+
+{
+       struct bfa_fcs_lport_ns_s *ns = (struct bfa_fcs_lport_ns_s *) cbarg;
+       struct bfa_fcs_lport_s *port = ns->port;
+       struct ct_hdr_s *cthdr = NULL;
+
+       bfa_trc(port->fcs, port->port_cfg.pwwn);
+
+       /*
+        * Sanity Checks
+        */
+       if (req_status != BFA_STATUS_OK) {
+               bfa_trc(port->fcs, req_status);
+               port->stats.ns_rnnid_rsp_err++;
+               bfa_sm_send_event(ns, NSSM_EVENT_RSP_ERROR);
+               return;
+       }
+
+       cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp);
+       cthdr->cmd_rsp_code = be16_to_cpu(cthdr->cmd_rsp_code);
+
+       if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) {
+               port->stats.ns_rnnid_accepts++;
+               bfa_sm_send_event(ns, NSSM_EVENT_RSP_OK);
+               return;
+       }
+
+       port->stats.ns_rnnid_rejects++;
+       bfa_trc(port->fcs, cthdr->reason_code);
+       bfa_trc(port->fcs, cthdr->exp_code);
+       bfa_sm_send_event(ns, NSSM_EVENT_RSP_ERROR);
+}
+
+/*
+ * Register the symbolic node name for a given node name.
+ */
+static void
+bfa_fcs_lport_ns_send_rsnn_nn(void *ns_cbarg, struct bfa_fcxp_s *fcxp_alloced)
+{
+       struct bfa_fcs_lport_ns_s *ns = ns_cbarg;
+       struct bfa_fcs_lport_s *port = ns->port;
+       struct fchs_s  fchs;
+       int     len;
+       struct bfa_fcxp_s *fcxp;
+       u8 *nsymbl;
+
+       bfa_trc(port->fcs, port->port_cfg.pwwn);
+
+       fcxp = fcxp_alloced ? fcxp_alloced :
+                       bfa_fcs_fcxp_alloc(port->fcs, BFA_TRUE);
+       if (!fcxp) {
+               port->stats.ns_rsnn_nn_alloc_wait++;
+               bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &ns->fcxp_wqe,
+                               bfa_fcs_lport_ns_send_rsnn_nn, ns, BFA_TRUE);
+               return;
+       }
+       ns->fcxp = fcxp;
+
+       nsymbl = (u8 *) &(bfa_fcs_lport_get_nsym_name(
+                                       bfa_fcs_get_base_port(port->fcs)));
+
+       len = fc_rsnn_nn_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
+                               bfa_fcs_lport_get_fcid(port),
+                               bfa_fcs_lport_get_nwwn(port), nsymbl);
+
+       bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE,
+                         FC_CLASS_3, len, &fchs,
+                         bfa_fcs_lport_ns_rsnn_nn_response, (void *)ns,
+                         FC_MAX_PDUSZ, FC_FCCT_TOV);
+
+       port->stats.ns_rsnn_nn_sent++;
+
+       bfa_sm_send_event(ns, NSSM_EVENT_RSNN_NN_SENT);
+}
+
+static void
+bfa_fcs_lport_ns_rsnn_nn_response(void *fcsarg, struct bfa_fcxp_s *fcxp,
+                               void *cbarg, bfa_status_t req_status,
+                               u32 rsp_len, u32 resid_len,
+                               struct fchs_s *rsp_fchs)
+{
+       struct bfa_fcs_lport_ns_s *ns = (struct bfa_fcs_lport_ns_s *) cbarg;
+       struct bfa_fcs_lport_s *port = ns->port;
+       struct ct_hdr_s *cthdr = NULL;
+
+       bfa_trc(port->fcs, port->port_cfg.pwwn);
+
+       /*
+        * Sanity Checks
+        */
+       if (req_status != BFA_STATUS_OK) {
+               bfa_trc(port->fcs, req_status);
+               port->stats.ns_rsnn_nn_rsp_err++;
+               bfa_sm_send_event(ns, NSSM_EVENT_RSP_ERROR);
+               return;
+       }
+
+       cthdr = (struct ct_hdr_s *) BFA_FCXP_RSP_PLD(fcxp);
+       cthdr->cmd_rsp_code = be16_to_cpu(cthdr->cmd_rsp_code);
+
+       if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) {
+               port->stats.ns_rsnn_nn_accepts++;
+               bfa_sm_send_event(ns, NSSM_EVENT_RSP_OK);
+               return;
+       }
+
+       port->stats.ns_rsnn_nn_rejects++;
+       bfa_trc(port->fcs, cthdr->reason_code);
+       bfa_trc(port->fcs, cthdr->exp_code);
+       bfa_sm_send_event(ns, NSSM_EVENT_RSP_ERROR);
+}
+
 /*
  * Register the symbolic port name.
  */