32 static const u8 loop_alpa_map[] = {
33 0x00, 0x00, 0x01, 0x02, 0x04, 0x08, 0x0F, 0x10,
34 0x17, 0x18, 0x1B, 0x1D, 0x1E, 0x1F, 0x23, 0x25,
35 0x26, 0x27, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E,
36 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x39, 0x3A,
38 0x3C, 0x43, 0x45, 0x46, 0x47, 0x49, 0x4A, 0x4B,
39 0x4C, 0x4D, 0x4E, 0x51, 0x52, 0x53, 0x54, 0x55,
40 0x56, 0x59, 0x5A, 0x5C, 0x63, 0x65, 0x66, 0x67,
41 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x71, 0x72,
43 0x73, 0x74, 0x75, 0x76, 0x79, 0x7A, 0x7C, 0x80,
44 0x81, 0x82, 0x84, 0x88, 0x8F, 0x90, 0x97, 0x98,
45 0x9B, 0x9D, 0x9E, 0x9F, 0xA3, 0xA5, 0xA6, 0xA7,
46 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xB1, 0xB2,
48 0xB3, 0xB4, 0xB5, 0xB6, 0xB9, 0xBA, 0xBC, 0xC3,
49 0xC5, 0xC6, 0xC7, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD,
50 0xCE, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD9,
51 0xDA, 0xDC, 0xE0, 0xE1, 0xE2, 0xE4, 0xE8, 0xEF,
92 bfa_fcs_lport_unknown_init, bfa_fcs_lport_unknown_online,
93 bfa_fcs_lport_unknown_offline}, {
94 bfa_fcs_lport_fab_init, bfa_fcs_lport_fab_online,
95 bfa_fcs_lport_fab_offline}, {
96 bfa_fcs_lport_n2n_init, bfa_fcs_lport_n2n_online,
97 bfa_fcs_lport_n2n_offline}, {
98 bfa_fcs_lport_loop_init, bfa_fcs_lport_loop_online,
99 bfa_fcs_lport_loop_offline},
129 bfa_fcs_lport_sm_uninit(
156 bfa_fcs_lport_online_actions(port);
161 bfa_fcs_lport_deleted(port);
169 bfa_wc_down(&(port->
fabric->stop_wc));
181 bfa_fcs_lport_sm_online(
194 bfa_fcs_lport_offline_actions(port);
198 __port_action[port->
fabric->fab_type].offline(port);
206 bfa_wc_down(&(port->
fabric->stop_wc));
218 __port_action[port->
fabric->fab_type].offline(port);
222 bfa_fcs_lport_deleted(port);
241 bfa_fcs_lport_sm_offline(
254 bfa_fcs_lport_online_actions(port);
264 bfa_wc_down(&(port->
fabric->stop_wc));
277 bfa_fcs_lport_deleted(port);
311 bfa_wc_down(&(port->
fabric->stop_wc));
321 bfa_fcs_lport_sm_deleting(
332 bfa_fcs_lport_deleted(port);
359 aen_entry->aen_data.lport.vf_id = port->
fabric->vf_id;
360 aen_entry->aen_data.lport.roles = port->
port_cfg.roles;
391 rx_fchs->
ox_id, reason_code, reason_code_expl);
403 struct fchs_s *rx_fchs,
u8 reason_code,
u8 reason_code_expl)
425 rx_fchs->
ox_id, reason_code, reason_code_expl);
457 bfa_fcs_lport_send_ls_rjt(port, rx_fchs,
471 bfa_fcs_lport_send_ls_rjt(port, rx_fchs,
563 pyld_len = rx_len -
sizeof(
struct fchs_s);
613 bfa_fs_port_get_gen_topo_data(port, &gen_topo_data);
626 rx_fchs->
ox_id, data_format, &common_id_data,
657 __port_action[port->
fabric->fab_type].init(port);
658 __port_action[port->
fabric->fab_type].online(port);
662 "Logical port online: WWN = %s Role = %s\n",
663 lpwwn_buf,
"Initiator");
679 __port_action[port->
fabric->fab_type].offline(port);
685 "Logical port lost fabric connectivity: WWN = %s Role = %s\n",
686 lpwwn_buf,
"Initiator");
690 "Logical port taken offline: WWN = %s Role = %s\n",
691 lpwwn_buf,
"Initiator");
749 "Logical port deleted: WWN = %s Role = %s\n",
750 lpwwn_buf,
"Initiator");
757 bfa_wc_down(&port->
fabric->wc);
788 bfa_fcs_lport_plogi(lport, fchs, (
struct fc_logi_s *) els_cmd);
796 bfa_fcs_lport_echo(lport, fchs,
805 bfa_fcs_lport_rnid(lport, fchs,
813 bfa_fcs_lport_abts_acc(lport, fchs);
890 if (rport->
pid == pid)
1062 lport->
vport = vport;
1063 lport->
lp_tag = (vport) ? vport->
lps->bfa_tag :
1064 lport->
fabric->lps->bfa_tag;
1066 INIT_LIST_HEAD(&lport->
rport_q);
1092 "New logical port created: WWN = %s Role = %s\n",
1093 lpwwn_buf,
"Initiator");
1110 port_attr->
pid = port->
pid;
1131 port->
vport->lps->lp_mac;
1134 port->
fabric->lps->lp_mac;
1212 sizeof(
wwn_t)) > 0) {
1261 int i = 0,
j = 0,
bit = 0, alpa_bit = 0;
1270 for (
j = 0, alpa_bit = 0;
j < 8;
j++, alpa_bit++) {
1272 bit = (fcport->
alpabm.alpa_bm[
i] & (1 << (7 -
j)));
1275 loop_alpa_map[(i * 8) + alpa_bit];
1314 if (alpabm_valid == 1) {
1315 for (i = 0; i < num_alpa; i++) {
1329 if (alpa_map[i] != port->
pid) {
1330 pid = loop_alpa_map[
i];
1350 #define BFA_FCS_FDMI_CMD_MAX_RETRIES 2
1355 static void bfa_fcs_lport_fdmi_send_rhba(
void *fdmi_cbarg,
1357 static void bfa_fcs_lport_fdmi_send_rprt(
void *fdmi_cbarg,
1359 static void bfa_fcs_lport_fdmi_send_rpa(
void *fdmi_cbarg,
1361 static void bfa_fcs_lport_fdmi_rhba_response(
void *fcsarg,
1367 struct fchs_s *rsp_fchs);
1368 static void bfa_fcs_lport_fdmi_rprt_response(
void *fcsarg,
1374 struct fchs_s *rsp_fchs);
1375 static void bfa_fcs_lport_fdmi_rpa_response(
void *fcsarg,
1381 struct fchs_s *rsp_fchs);
1382 static void bfa_fcs_lport_fdmi_timeout(
void *
arg);
1417 static void bfa_fcs_lport_fdmi_sm_sending_rhba(
1422 static void bfa_fcs_lport_fdmi_sm_rhba_retry(
1425 static void bfa_fcs_lport_fdmi_sm_sending_rprt(
1430 static void bfa_fcs_lport_fdmi_sm_rprt_retry(
1433 static void bfa_fcs_lport_fdmi_sm_sending_rpa(
1438 static void bfa_fcs_lport_fdmi_sm_rpa_retry(
1443 static void bfa_fcs_lport_fdmi_sm_disabled(
1467 bfa_fcs_lport_fdmi_sm_sending_rprt);
1468 bfa_fcs_lport_fdmi_send_rprt(fdmi,
NULL);
1476 bfa_fcs_lport_fdmi_sm_sending_rhba);
1477 bfa_fcs_lport_fdmi_send_rhba(fdmi,
NULL);
1531 bfa_fcs_lport_fdmi_sm_rhba_retry);
1534 bfa_fcs_lport_fdmi_timeout, fdmi,
1550 bfa_fcs_lport_fdmi_send_rpa(fdmi,
NULL);
1578 bfa_fcs_lport_fdmi_send_rhba(fdmi,
NULL);
1636 bfa_fcs_lport_fdmi_sm_rprt_retry);
1639 bfa_fcs_lport_fdmi_timeout, fdmi,
1681 bfa_fcs_lport_fdmi_send_rprt(fdmi,
NULL);
1741 bfa_fcs_lport_fdmi_timeout, fdmi,
1782 bfa_fcs_lport_fdmi_send_rpa(fdmi,
NULL);
1832 bfa_fcs_lport_fdmi_send_rhba(
void *fdmi_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
1843 fcxp = fcxp_alloced ? fcxp_alloced :
1847 bfa_fcs_lport_fdmi_send_rhba, fdmi,
BFA_TRUE);
1859 bfa_fcs_lport_fdmi_build_rhba_pyld(fdmi,
1865 bfa_fcs_lport_fdmi_rhba_response, (
void *)fdmi,
1886 bfa_fcs_fdmi_get_hbaattr(fdmi, fcs_hba_attr);
1907 templen =
sizeof(
wwn_t);
1909 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
1923 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
1937 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
1951 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
1965 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
1980 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
1995 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
2010 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
2022 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
2031 if (fcs_hba_attr->
os_name[0] !=
'\0') {
2037 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
2059 len += ((
sizeof(attr->
type) +
sizeof(attr->
len)) * count);
2066 bfa_fcs_lport_fdmi_rhba_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
2104 bfa_fcs_lport_fdmi_send_rprt(
void *fdmi_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
2115 fcxp = fcxp_alloced ? fcxp_alloced :
2119 bfa_fcs_lport_fdmi_send_rprt, fdmi,
BFA_TRUE);
2131 bfa_fcs_lport_fdmi_build_rprt_pyld(fdmi,
2137 bfa_fcs_lport_fdmi_rprt_response, (
void *)fdmi,
2161 bfa_fcs_fdmi_get_portattr(fdmi, &fcs_port_attr);
2175 templen =
sizeof(fcs_port_attr.supp_fc4_types);
2176 memcpy(attr->
value, fcs_port_attr.supp_fc4_types, templen);
2177 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
2189 templen =
sizeof(fcs_port_attr.supp_speed);
2190 memcpy(attr->
value, &fcs_port_attr.supp_speed, templen);
2191 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
2203 templen =
sizeof(fcs_port_attr.curr_speed);
2204 memcpy(attr->
value, &fcs_port_attr.curr_speed, templen);
2205 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
2216 templen =
sizeof(fcs_port_attr.max_frm_size);
2217 memcpy(attr->
value, &fcs_port_attr.max_frm_size, templen);
2218 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
2227 if (fcs_port_attr.os_device_name[0] !=
'\0') {
2230 templen = (
u16)
strlen(fcs_port_attr.os_device_name);
2231 memcpy(attr->
value, fcs_port_attr.os_device_name, templen);
2233 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
2242 if (fcs_port_attr.host_name[0] !=
'\0') {
2245 templen = (
u16)
strlen(fcs_port_attr.host_name);
2246 memcpy(attr->
value, fcs_port_attr.host_name, templen);
2248 curr_ptr +=
sizeof(attr->
type) +
sizeof(templen) + templen;
2259 len += ((
sizeof(attr->
type) +
sizeof(attr->
len)) * count);
2273 len = bfa_fcs_lport_fdmi_build_portattr_block(fdmi,
2282 bfa_fcs_lport_fdmi_rprt_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
2284 u32 rsp_len,
u32 resid_len,
2320 bfa_fcs_lport_fdmi_send_rpa(
void *fdmi_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
2331 fcxp = fcxp_alloced ? fcxp_alloced :
2335 bfa_fcs_lport_fdmi_send_rpa, fdmi,
BFA_TRUE);
2346 attr_len = bfa_fcs_lport_fdmi_build_rpa_pyld(fdmi,
2351 bfa_fcs_lport_fdmi_rpa_response, (
void *)fdmi,
2366 len = bfa_fcs_lport_fdmi_build_portattr_block(fdmi,
2375 bfa_fcs_lport_fdmi_rpa_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
2409 bfa_fcs_lport_fdmi_timeout(
void *
arg)
2459 bfa_fcs_fdmi_get_portattr(fdmi, &fcs_port_attr);
2460 hba_attr->
max_ct_pyld = fcs_port_attr.max_frm_size;
2486 switch (pport_attr.speed_supported) {
2544 switch (pport_speed) {
2578 if (ms->
port->fcs->fdmi_enabled)
2602 #define BFA_FCS_MS_CMD_MAX_RETRIES 2
2607 static void bfa_fcs_lport_ms_send_plogi(
void *ms_cbarg,
2609 static void bfa_fcs_lport_ms_timeout(
void *
arg);
2610 static void bfa_fcs_lport_ms_plogi_response(
void *fcsarg,
2616 struct fchs_s *rsp_fchs);
2618 static void bfa_fcs_lport_ms_send_gmal(
void *ms_cbarg,
2620 static void bfa_fcs_lport_ms_gmal_response(
void *fcsarg,
2626 struct fchs_s *rsp_fchs);
2627 static void bfa_fcs_lport_ms_send_gfn(
void *ms_cbarg,
2629 static void bfa_fcs_lport_ms_gfn_response(
void *fcsarg,
2635 struct fchs_s *rsp_fchs);
2688 bfa_fcs_lport_ms_send_plogi(ms,
NULL);
2735 ms->
port->stats.ms_retries++;
2737 &ms->
timer, bfa_fcs_lport_ms_timeout, ms,
2750 if (ms->
port->vport) {
2760 bfa_fcs_lport_ms_send_gmal(ms,
NULL);
2786 bfa_fcs_lport_ms_send_plogi(ms,
NULL);
2814 bfa_fcs_lport_ms_send_gfn(ms,
NULL);
2859 ms->
port->stats.ms_retries++;
2861 &ms->
timer, bfa_fcs_lport_ms_timeout, ms,
2865 bfa_fcs_lport_ms_send_gfn(ms,
NULL);
2872 bfa_fcs_lport_ms_send_gfn(ms,
NULL);
2898 bfa_fcs_lport_ms_send_gmal(ms,
NULL);
2915 bfa_fcs_lport_ms_send_gmal(
void *ms_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
2923 bfa_trc(port->fcs, port->pid);
2925 fcxp = fcxp_alloced ? fcxp_alloced :
2929 bfa_fcs_lport_ms_send_gmal, ms,
BFA_TRUE);
2936 port->fabric->lps->pr_nwwn);
2940 bfa_fcs_lport_ms_gmal_response, (
void *)ms,
2947 bfa_fcs_lport_ms_gmal_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
2949 u32 rsp_len,
u32 resid_len,
2960 bfa_trc(port->fcs, req_status);
2961 bfa_trc(port->fcs, port->port_cfg.pwwn);
2967 bfa_trc(port->fcs, req_status);
2979 if (num_entries == 0) {
2991 while (num_entries > 0) {
2994 sizeof(gmal_entry->
prefix)) == 0) {
3001 rsp_str = &(gmal_entry->
prefix[0]);
3002 if (rsp_str[gmal_entry->
len-1] ==
'/')
3003 rsp_str[gmal_entry->
len-1] = 0;
3062 ms->
port->stats.ms_retries++;
3064 &ms->
timer, bfa_fcs_lport_ms_timeout, ms,
3099 bfa_fcs_lport_ms_send_gfn(ms,
NULL);
3116 bfa_fcs_lport_ms_send_gfn(
void *ms_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
3124 bfa_trc(port->fcs, port->pid);
3126 fcxp = fcxp_alloced ? fcxp_alloced :
3130 bfa_fcs_lport_ms_send_gfn, ms,
BFA_TRUE);
3137 port->fabric->lps->pr_nwwn);
3141 bfa_fcs_lport_ms_gfn_response, (
void *)ms,
3148 bfa_fcs_lport_ms_gfn_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
3157 bfa_trc(port->fcs, req_status);
3158 bfa_trc(port->fcs, port->port_cfg.pwwn);
3164 bfa_trc(port->fcs, req_status);
3173 gfn_resp = (
wwn_t *)(cthdr + 1);
3176 gfn_resp,
sizeof(
wwn_t)) != 0)) {
3193 bfa_fcs_lport_ms_send_plogi(
void *ms_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
3203 fcxp = fcxp_alloced ? fcxp_alloced :
3206 port->
stats.ms_plogi_alloc_wait++;
3208 bfa_fcs_lport_ms_send_plogi, ms,
BFA_TRUE);
3222 bfa_fcs_lport_ms_plogi_response, (
void *)ms,
3225 port->
stats.ms_plogi_sent++;
3230 bfa_fcs_lport_ms_plogi_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
3246 port->
stats.ms_plogi_rsp_err++;
3257 if (rsp_len <
sizeof(
struct fc_logi_s)) {
3259 port->
stats.ms_plogi_acc_err++;
3263 port->
stats.ms_plogi_accepts++;
3273 port->
stats.ms_rejects++;
3278 port->
stats.ms_plogi_unknown_rsp++;
3285 bfa_fcs_lport_ms_timeout(
void *
arg)
3289 ms->
port->stats.ms_timeouts++;
3348 static void bfa_fcs_lport_ns_send_plogi(
void *ns_cbarg,
3350 static void bfa_fcs_lport_ns_send_rspn_id(
void *ns_cbarg,
3352 static void bfa_fcs_lport_ns_send_rft_id(
void *ns_cbarg,
3354 static void bfa_fcs_lport_ns_send_rff_id(
void *ns_cbarg,
3356 static void bfa_fcs_lport_ns_send_gid_ft(
void *ns_cbarg,
3358 static void bfa_fcs_lport_ns_send_rnn_id(
void *ns_cbarg,
3360 static void bfa_fcs_lport_ns_send_rsnn_nn(
void *ns_cbarg,
3362 static void bfa_fcs_lport_ns_timeout(
void *
arg);
3363 static void bfa_fcs_lport_ns_plogi_response(
void *fcsarg,
3369 struct fchs_s *rsp_fchs);
3370 static void bfa_fcs_lport_ns_rspn_id_response(
void *fcsarg,
3376 struct fchs_s *rsp_fchs);
3377 static void bfa_fcs_lport_ns_rft_id_response(
void *fcsarg,
3383 struct fchs_s *rsp_fchs);
3384 static void bfa_fcs_lport_ns_rff_id_response(
void *fcsarg,
3390 struct fchs_s *rsp_fchs);
3391 static void bfa_fcs_lport_ns_gid_ft_response(
void *fcsarg,
3397 struct fchs_s *rsp_fchs);
3398 static void bfa_fcs_lport_ns_rnn_id_response(
void *fcsarg,
3404 struct fchs_s *rsp_fchs);
3405 static void bfa_fcs_lport_ns_rsnn_nn_response(
void *fcsarg,
3411 struct fchs_s *rsp_fchs);
3412 static void bfa_fcs_lport_ns_process_gidft_pids(
3414 u32 *pid_buf,
u32 n_pids);
3448 static void bfa_fcs_lport_ns_sm_sending_rspn_id(
3455 static void bfa_fcs_lport_ns_sm_sending_rft_id(
3462 static void bfa_fcs_lport_ns_sm_sending_rff_id(
3469 static void bfa_fcs_lport_ns_sm_sending_gid_ft(
3478 static void bfa_fcs_lport_ns_sm_sending_rnn_id(
3485 static void bfa_fcs_lport_ns_sm_sending_rsnn_nn(
3490 static void bfa_fcs_lport_ns_sm_rsnn_nn_retry(
3506 bfa_fcs_lport_ns_send_plogi(ns,
NULL);
3553 ns->
port->stats.ns_retries++;
3555 &ns->
timer, bfa_fcs_lport_ns_timeout, ns,
3562 bfa_fcs_lport_ns_send_rnn_id(ns,
NULL);
3588 bfa_fcs_lport_ns_send_plogi(ns,
NULL);
3635 bfa_fcs_lport_ns_send_rsnn_nn(ns,
NULL);
3641 ns->
port->stats.ns_retries++;
3644 &ns->
timer, bfa_fcs_lport_ns_timeout, ns,
3648 bfa_fcs_lport_ns_sm_sending_rspn_id);
3649 bfa_fcs_lport_ns_send_rspn_id(ns,
NULL);
3673 bfa_fcs_lport_ns_send_rnn_id(ns,
NULL);
3720 bfa_fcs_lport_ns_send_rspn_id(ns,
NULL);
3726 ns->
port->stats.ns_retries++;
3729 &ns->
timer, bfa_fcs_lport_ns_timeout,
3733 bfa_fcs_lport_ns_sm_sending_rspn_id);
3734 bfa_fcs_lport_ns_send_rspn_id(ns,
NULL);
3758 bfa_fcs_lport_ns_send_rsnn_nn(ns,
NULL);
3807 ns->
port->stats.ns_retries++;
3809 &ns->
timer, bfa_fcs_lport_ns_timeout, ns,
3815 bfa_fcs_lport_ns_send_rft_id(ns,
NULL);
3841 bfa_fcs_lport_ns_send_rspn_id(ns,
NULL);
3888 bfa_fcs_lport_ns_send_rff_id(ns,
NULL);
3896 ns->
port->stats.ns_retries++;
3898 &ns->
timer, bfa_fcs_lport_ns_timeout, ns,
3922 bfa_fcs_lport_ns_send_rft_id(ns,
NULL);
3974 bfa_fcs_lport_ns_boot_target_disc(ns->
port);
3985 bfa_fcs_lport_ns_sm_sending_gid_ft);
3986 bfa_fcs_lport_ns_send_gid_ft(ns,
NULL);
3999 ns->
port->stats.ns_retries++;
4001 &ns->
timer, bfa_fcs_lport_ns_timeout, ns,
4025 bfa_fcs_lport_ns_send_rff_id(ns,
NULL);
4080 ns->
port->stats.ns_retries++;
4082 &ns->
timer, bfa_fcs_lport_ns_timeout, ns,
4109 bfa_fcs_lport_ns_send_gid_ft(ns,
NULL);
4141 bfa_fcs_lport_ns_sm_sending_gid_ft);
4142 bfa_fcs_lport_ns_send_gid_ft(ns,
NULL);
4158 bfa_fcs_lport_ns_send_plogi(
void *ns_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
4168 fcxp = fcxp_alloced ? fcxp_alloced :
4171 port->
stats.ns_plogi_alloc_wait++;
4173 bfa_fcs_lport_ns_send_plogi, ns,
BFA_TRUE);
4187 bfa_fcs_lport_ns_plogi_response, (
void *)ns,
4189 port->
stats.ns_plogi_sent++;
4195 bfa_fcs_lport_ns_plogi_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
4213 port->
stats.ns_plogi_rsp_err++;
4223 if (rsp_len <
sizeof(
struct fc_logi_s)) {
4225 port->
stats.ns_plogi_acc_err++;
4229 port->
stats.ns_plogi_accepts++;
4239 port->
stats.ns_rejects++;
4245 port->
stats.ns_plogi_unknown_rsp++;
4255 bfa_fcs_lport_ns_send_rnn_id(
void *ns_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
4265 fcxp = fcxp_alloced ? fcxp_alloced :
4268 port->
stats.ns_rnnid_alloc_wait++;
4270 bfa_fcs_lport_ns_send_rnn_id, ns,
BFA_TRUE);
4283 bfa_fcs_lport_ns_rnn_id_response, (
void *)ns,
4286 port->
stats.ns_rnnid_sent++;
4291 bfa_fcs_lport_ns_rnn_id_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
4293 u32 rsp_len,
u32 resid_len,
4308 port->
stats.ns_rnnid_rsp_err++;
4317 port->
stats.ns_rnnid_accepts++;
4322 port->
stats.ns_rnnid_rejects++;
4332 bfa_fcs_lport_ns_send_rsnn_nn(
void *ns_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
4343 fcxp = fcxp_alloced ? fcxp_alloced :
4346 port->
stats.ns_rsnn_nn_alloc_wait++;
4348 bfa_fcs_lport_ns_send_rsnn_nn, ns,
BFA_TRUE);
4362 bfa_fcs_lport_ns_rsnn_nn_response, (
void *)ns,
4365 port->
stats.ns_rsnn_nn_sent++;
4371 bfa_fcs_lport_ns_rsnn_nn_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
4373 u32 rsp_len,
u32 resid_len,
4387 port->
stats.ns_rsnn_nn_rsp_err++;
4396 port->
stats.ns_rsnn_nn_accepts++;
4401 port->
stats.ns_rsnn_nn_rejects++;
4411 bfa_fcs_lport_ns_send_rspn_id(
void *ns_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
4419 u8 *psymbl = &symbl[0];
4421 memset(symbl, 0,
sizeof(symbl));
4425 fcxp = fcxp_alloced ? fcxp_alloced :
4428 port->
stats.ns_rspnid_alloc_wait++;
4430 bfa_fcs_lport_ns_send_rspn_id, ns,
BFA_TRUE);
4453 ((
char *)psymbl)[
strlen((
char *) &
4468 bfa_fcs_lport_ns_rspn_id_response, (
void *)ns,
4471 port->
stats.ns_rspnid_sent++;
4477 bfa_fcs_lport_ns_rspn_id_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
4479 u32 rsp_len,
u32 resid_len,
4493 port->
stats.ns_rspnid_rsp_err++;
4502 port->
stats.ns_rspnid_accepts++;
4507 port->
stats.ns_rspnid_rejects++;
4517 bfa_fcs_lport_ns_send_rft_id(
void *ns_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
4527 fcxp = fcxp_alloced ? fcxp_alloced :
4530 port->
stats.ns_rftid_alloc_wait++;
4532 bfa_fcs_lport_ns_send_rft_id, ns,
BFA_TRUE);
4542 bfa_fcs_lport_ns_rft_id_response, (
void *)ns,
4545 port->
stats.ns_rftid_sent++;
4550 bfa_fcs_lport_ns_rft_id_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
4552 u32 rsp_len,
u32 resid_len,
4566 port->
stats.ns_rftid_rsp_err++;
4575 port->
stats.ns_rftid_accepts++;
4580 port->
stats.ns_rftid_rejects++;
4590 bfa_fcs_lport_ns_send_rff_id(
void *ns_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
4601 fcxp = fcxp_alloced ? fcxp_alloced :
4604 port->
stats.ns_rffid_alloc_wait++;
4606 bfa_fcs_lport_ns_send_rff_id, ns,
BFA_TRUE);
4620 bfa_fcs_lport_ns_rff_id_response, (
void *)ns,
4623 port->
stats.ns_rffid_sent++;
4628 bfa_fcs_lport_ns_rff_id_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
4630 u32 rsp_len,
u32 resid_len,
4644 port->
stats.ns_rffid_rsp_err++;
4653 port->
stats.ns_rffid_accepts++;
4658 port->
stats.ns_rffid_rejects++;
4675 bfa_fcs_lport_ns_send_gid_ft(
void *ns_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
4685 fcxp = fcxp_alloced ? fcxp_alloced :
4688 port->
stats.ns_gidft_alloc_wait++;
4690 bfa_fcs_lport_ns_send_gid_ft, ns,
BFA_TRUE);
4703 bfa_fcs_lport_ns_gid_ft_response, (
void *)ns,
4706 port->
stats.ns_gidft_sent++;
4712 bfa_fcs_lport_ns_gid_ft_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
4714 u32 rsp_len,
u32 resid_len,
4729 port->
stats.ns_gidft_rsp_err++;
4734 if (resid_len != 0) {
4751 port->
stats.ns_gidft_accepts++;
4752 n_pids = (fc_get_ctresp_pyld_len(rsp_len) /
sizeof(
u32));
4754 bfa_fcs_lport_ns_process_gidft_pids(port,
4755 (
u32 *) (cthdr + 1),
4766 port->
stats.ns_gidft_rejects++;
4783 port->
stats.ns_gidft_unknown_rsp++;
4802 bfa_fcs_lport_ns_timeout(
void *
arg)
4806 ns->
port->stats.ns_timeouts++;
4825 for (ii = 0; ii < n_pids; ii++) {
4828 if (gidft_entry->
pid == port->
pid)
4835 if (gidft_entry->
pid == fabric->
bport.pid)
4845 if (vport->
lport.pid == gidft_entry->
pid)
4858 if (rport ==
NULL) {
4875 if (gidft_entry->
last)
4936 for (ii = 0 ; ii < nwwns; ++ii) {
4950 u8 *psymbl = &symbl[0];
4964 memset(symbl, 0,
sizeof(symbl));
4967 fcxp = fcxp_alloced ? fcxp_alloced :
4970 port->
stats.ns_rspnid_alloc_wait++;
5003 port->
stats.ns_rspnid_sent++;
5010 #define FC_QOS_RSCN_EVENT 0x0c
5011 #define FC_FABRIC_NAME_RSCN_EVENT 0x0d
5016 static void bfa_fcs_lport_scn_send_scr(
void *scn_cbarg,
5018 static void bfa_fcs_lport_scn_scr_response(
void *fcsarg,
5024 struct fchs_s *rsp_fchs);
5025 static void bfa_fcs_lport_scn_send_ls_acc(
struct bfa_fcs_lport_s *port,
5027 static void bfa_fcs_lport_scn_timeout(
void *
arg);
5047 static void bfa_fcs_lport_scn_sm_sending_scr(
5067 bfa_fcs_lport_scn_send_scr(scn,
NULL);
5111 bfa_fcs_lport_scn_timeout, scn,
5132 bfa_fcs_lport_scn_send_scr(scn,
NULL);
5169 bfa_fcs_lport_scn_send_scr(
void *scn_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
5180 fcxp = fcxp_alloced ? fcxp_alloced :
5184 bfa_fcs_lport_scn_send_scr, scn,
BFA_TRUE);
5192 port->
fabric->lps->brcd_switch,
5202 bfa_fcs_lport_scn_scr_response,
5209 bfa_fcs_lport_scn_scr_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
5293 bfa_fcs_lport_scn_timeout(
void *
arg)
5351 if (rpid == fabric->
bport.pid)
5356 if (vport->
lport.pid == rpid)
5367 if (rport ==
NULL) {
5381 #define __fc_pid_match(__c0, __c1, __fmt) \
5382 (((__fmt) == FC_RSCN_FORMAT_FABRIC) || \
5383 (((__fmt) == FC_RSCN_FORMAT_DOMAIN) && \
5384 ((__c0)[0] == (__c1)[0])) || \
5385 (((__fmt) == FC_RSCN_FORMAT_AREA) && \
5386 ((__c0)[0] == (__c1)[0]) && \
5387 ((__c0)[1] == (__c1)[1])))
5401 c0 = (
u8 *) &rscn_pid;
5405 c1 = (
u8 *) &rport->
pid;
5424 sizeof(
u32)) /
sizeof(rscn->
event[0]);
5428 port->
stats.num_rscn++;
5430 bfa_fcs_lport_scn_send_ls_acc(port, fchs);
5433 rscn_pid = rscn->
event[
i].portid;
5440 for (
j = 0;
j <
i;
j++) {
5441 if (rscn->
event[
j].portid == rscn_pid) {
5453 switch (rscn->
event[i].format) {
5462 port->
stats.num_portid_rscn++;
5463 bfa_fcs_lport_scn_portid_rscn(port, rscn_pid);
5468 if (rscn->
event[i].qualifier ==
5478 bfa_fcs_lport_scn_multiport_rscn(port,
5479 rscn->
event[i].format,
5507 return &fcs->
fabric.bport;
5519 if (port ==
NULL || nrports == 0)
5529 while ((qe != qh) && (i < nrports)) {
5567 if (port ==
NULL || rports ==
NULL || *nrports == 0)
5577 while ((qe != qh) && (i < *nrports)) {
5587 if (!rport->
pwwn && !rport->
pid) {
5628 port_speed = port_attr.
speed;
5631 qh = &port->rport_q;
5643 rport_speed = rport->
rpf.rpsc_speed;
5644 if ((trl_enabled) && (rport_speed ==
5651 if (rport_speed > max_speed)
5652 max_speed = rport_speed;
5657 if (max_speed > port_speed)
5658 max_speed = port_speed;
5678 if (!lpwwn || (vf->bport.port_cfg.pwwn == lpwwn))
5683 return &vport->
lport;
5716 port->
fabric->num_vports;
5740 *port_stats = fcs_port->
stats;
5755 bfa_fcs_lport_loop_online(port);
5762 #define __vport_fcs(__vp) ((__vp)->lport.fcs)
5763 #define __vport_pwwn(__vp) ((__vp)->lport.port_cfg.pwwn)
5764 #define __vport_nwwn(__vp) ((__vp)->lport.port_cfg.nwwn)
5765 #define __vport_bfa(__vp) ((__vp)->lport.fcs->bfa)
5766 #define __vport_fcid(__vp) ((__vp)->lport.pid)
5767 #define __vport_fabric(__vp) ((__vp)->lport.fabric)
5768 #define __vport_vfid(__vp) ((__vp)->lport.fabric->vf_id)
5770 #define BFA_FCS_VPORT_MAX_RETRIES 5
5775 static void bfa_fcs_vport_timeout(
void *vport_arg);
5811 static void bfa_fcs_vport_sm_fdisc_retry(
struct bfa_fcs_vport_s *vport,
5813 static void bfa_fcs_vport_sm_fdisc_rsp_wait(
struct bfa_fcs_vport_s *vport,
5827 static void bfa_fcs_vport_sm_logo_for_stop(
struct bfa_fcs_vport_s *vport,
5881 bfa_fcs_vport_do_fdisc(vport);
5929 bfa_fcs_vport_do_fdisc(vport);
5981 bfa_fcs_vport_timeout, vport,
6024 bfa_fcs_vport_do_fdisc(vport);
6113 bfa_fcs_vport_do_logo(vport);
6142 bfa_fcs_vport_do_logo(vport);
6192 bfa_fcs_vport_free(vport);
6256 bfa_fcs_vport_free(vport);
6286 aen_entry->aen_data.lport.vf_id = port->
fabric->vf_id;
6287 aen_entry->aen_data.lport.roles = port->
port_cfg.roles;
6312 u8 lsrjt_rsn = vport->
lps->lsrjt_rsn;
6313 u8 lsrjt_expl = vport->
lps->lsrjt_expl;
6319 switch (vport->
lps->lsrjt_expl) {
6325 bfa_fcs_vport_aen_post(&vport->
lport,
6339 bfa_fcs_vport_aen_post(&vport->
lport,
6347 bfa_fcs_vport_aen_post(&vport->
lport,
6381 bfa_fcs_vport_timeout(
void *vport_arg)
6511 if (vport_cfg->
pwwn == 0)
6520 if (fcs->
fabric.num_vports ==
6580 if (vport && (vport->
lport.port_cfg.preboot_vp ==
BFA_TRUE))
6633 if (vport->
lport.port_cfg.preboot_vp)
6659 attr->
vport_state = bfa_sm_to_state(vport_sm_table, vport->
sm);
6714 switch (vport->
lps->ext_status) {
6732 bfa_fcs_vport_fdisc_rejected(vport);