51 static void bfa_fcs_rport_timeout(
void *
arg);
52 static void bfa_fcs_rport_send_plogi(
void *rport_cbarg,
54 static void bfa_fcs_rport_send_plogiacc(
void *rport_cbarg,
56 static void bfa_fcs_rport_plogi_response(
void *fcsarg,
60 static void bfa_fcs_rport_send_adisc(
void *rport_cbarg,
62 static void bfa_fcs_rport_adisc_response(
void *fcsarg,
66 static void bfa_fcs_rport_send_nsdisc(
void *rport_cbarg,
68 static void bfa_fcs_rport_gidpn_response(
void *fcsarg,
72 static void bfa_fcs_rport_gpnid_response(
void *fcsarg,
76 static void bfa_fcs_rport_send_logo(
void *rport_cbarg,
78 static void bfa_fcs_rport_send_logo_acc(
void *rport_cbarg);
109 static void bfa_fcs_rport_sm_adisc_online_sending(
113 static void bfa_fcs_rport_sm_adisc_offline_sending(
struct bfa_fcs_rport_s
188 bfa_fcs_rport_send_plogi(rport,
NULL);
193 bfa_fcs_rport_fcs_online_action(rport);
198 bfa_fcs_rport_hal_online(rport);
205 bfa_fcs_rport_send_nsdisc(rport,
NULL);
231 bfa_fcs_rport_free(rport);
237 bfa_fcs_rport_send_plogiacc(rport,
NULL);
244 bfa_fcs_rport_timeout, rport,
245 bfa_fcs_rport_del_timeout);
255 bfa_fcs_rport_send_nsdisc(rport,
NULL);
263 bfa_fcs_rport_timeout, rport,
264 bfa_fcs_rport_del_timeout);
287 bfa_fcs_rport_fcs_online_action(rport);
293 bfa_fcs_rport_free(rport);
308 bfa_fcs_rport_timeout, rport,
309 bfa_fcs_rport_del_timeout);
316 bfa_fcs_rport_send_nsdisc(rport,
NULL);
324 bfa_fcs_rport_timeout, rport,
325 bfa_fcs_rport_del_timeout);
353 bfa_fcs_rport_send_plogi(rport,
NULL);
359 bfa_fcs_rport_free(rport);
369 bfa_fcs_rport_send_plogiacc(rport,
NULL);
376 bfa_fcs_rport_timeout, rport,
377 bfa_fcs_rport_del_timeout);
387 bfa_fcs_rport_send_nsdisc(rport,
NULL);
395 bfa_fcs_rport_timeout, rport,
396 bfa_fcs_rport_del_timeout);
402 bfa_fcs_rport_fcs_online_action(rport);
424 bfa_fcs_rport_fcs_online_action(rport);
428 bfa_fcs_rport_send_logo_acc(rport);
434 bfa_fcs_rport_send_prlo_acc(rport);
445 bfa_fcs_rport_timeout, rport,
453 bfa_fcs_rport_timeout, rport,
454 bfa_fcs_rport_del_timeout);
465 bfa_fcs_rport_timeout, rport,
466 bfa_fcs_rport_del_timeout);
473 bfa_fcs_rport_timeout, rport,
482 bfa_fcs_rport_timeout, rport,
483 bfa_fcs_rport_del_timeout);
493 bfa_fcs_rport_send_nsdisc(rport,
NULL);
499 bfa_fcs_rport_send_plogiacc(rport,
NULL);
505 bfa_fcs_rport_free(rport);
511 bfa_fcs_rport_fcs_online_action(rport);
545 bfa_fcs_rport_hal_online(rport);
548 bfa_fcs_rport_fcs_offline_action(rport);
555 bfa_fcs_rport_fcs_offline_action(rport);
564 bfa_fcs_rport_fcs_offline_action(rport);
570 bfa_fcs_rport_fcs_offline_action(rport);
575 bfa_fcs_rport_fcs_offline_action(rport);
599 bfa_fcs_rport_hal_online_action(rport);
608 bfa_fcs_rport_fcs_offline_action(rport);
616 bfa_fcs_rport_fcs_offline_action(rport);
622 bfa_fcs_rport_fcs_offline_action(rport);
627 bfa_fcs_rport_fcs_offline_action(rport);
649 bfa_fcs_rport_sm_nsquery_sending);
651 bfa_fcs_rport_send_nsdisc(rport,
NULL);
654 bfa_fcs_rport_sm_adisc_online_sending);
655 bfa_fcs_rport_send_adisc(rport,
NULL);
664 bfa_fcs_rport_hal_offline_action(rport);
669 bfa_fcs_rport_hal_offline_action(rport);
675 bfa_fcs_rport_hal_offline_action(rport);
707 bfa_fcs_rport_hal_offline_action(rport);
720 bfa_fcs_rport_hal_offline_action(rport);
729 bfa_fcs_rport_hal_offline_action(rport);
751 bfa_fcs_rport_send_adisc(rport,
NULL);
758 bfa_fcs_rport_sm_nsquery_sending);
759 bfa_fcs_rport_send_nsdisc(rport,
NULL);
762 bfa_fcs_rport_hal_offline_action(rport);
769 bfa_fcs_rport_hal_offline_action(rport);
779 bfa_fcs_rport_hal_offline_action(rport);
788 bfa_fcs_rport_hal_offline_action(rport);
816 bfa_fcs_rport_hal_offline_action(rport);
823 bfa_fcs_rport_hal_offline_action(rport);
830 bfa_fcs_rport_hal_offline_action(rport);
839 bfa_fcs_rport_hal_offline_action(rport);
877 bfa_fcs_rport_hal_offline_action(rport);
883 bfa_fcs_rport_hal_offline_action(rport);
895 bfa_fcs_rport_hal_offline_action(rport);
902 bfa_fcs_rport_hal_offline_action(rport);
936 bfa_fcs_rport_timeout, rport,
937 bfa_fcs_rport_del_timeout);
943 bfa_fcs_rport_send_plogiacc(rport,
NULL);
966 bfa_fcs_rport_hal_online(rport);
972 bfa_fcs_rport_send_plogiacc(rport,
NULL);
978 bfa_fcs_rport_timeout, rport,
979 bfa_fcs_rport_del_timeout);
990 bfa_fcs_rport_timeout, rport,
991 bfa_fcs_rport_del_timeout);
1013 bfa_fcs_rport_hal_offline(rport);
1018 bfa_fcs_rport_send_prlo_acc(rport);
1020 bfa_fcs_rport_send_logo_acc(rport);
1053 bfa_fcs_rport_hal_offline(rport);
1057 bfa_fcs_rport_send_logo_acc(rport);
1060 bfa_fcs_rport_send_prlo_acc(rport);
1088 bfa_fcs_rport_hal_offline(rport);
1097 bfa_fcs_rport_send_logo_acc(rport);
1101 bfa_fcs_rport_send_prlo_acc(rport);
1142 bfa_fcs_rport_sm_plogiacc_sending);
1143 bfa_fcs_rport_send_plogiacc(rport,
NULL);
1155 bfa_fcs_rport_timeout, rport,
1156 bfa_fcs_rport_del_timeout);
1161 bfa_fcs_rport_sm_nsdisc_sending);
1163 bfa_fcs_rport_send_nsdisc(rport,
NULL);
1168 bfa_fcs_rport_sm_adisc_offline_sending);
1169 bfa_fcs_rport_send_adisc(rport,
NULL);
1172 bfa_fcs_rport_sm_offline);
1174 bfa_fcs_rport_timeout, rport,
1175 bfa_fcs_rport_del_timeout);
1180 bfa_fcs_rport_send_plogi(rport,
NULL);
1186 bfa_fcs_rport_free(rport);
1222 bfa_fcs_rport_send_prlo_acc(rport);
1224 bfa_fcs_rport_send_logo_acc(rport);
1234 bfa_fcs_rport_sm_nsdisc_sending);
1236 bfa_fcs_rport_send_nsdisc(rport,
NULL);
1240 bfa_fcs_rport_sm_plogi_sending);
1242 bfa_fcs_rport_send_plogi(rport,
NULL);
1253 bfa_fcs_rport_timeout, rport,
1254 bfa_fcs_rport_del_timeout);
1261 bfa_fcs_rport_send_prlo_acc(rport);
1263 bfa_fcs_rport_send_logo_acc(rport);
1300 bfa_fcs_rport_send_logo(rport,
NULL);
1304 bfa_fcs_rport_send_logo_acc(rport);
1307 bfa_fcs_rport_send_prlo_acc(rport);
1337 bfa_fcs_rport_free(rport);
1347 bfa_fcs_rport_send_logo_acc(rport);
1350 bfa_fcs_rport_send_prlo_acc(rport);
1354 bfa_fcs_rport_free(rport);
1376 bfa_fcs_rport_free(rport);
1386 bfa_fcs_rport_send_nsdisc(rport,
NULL);
1392 bfa_fcs_rport_free(rport);
1398 bfa_fcs_rport_send_plogiacc(rport,
NULL);
1410 bfa_fcs_rport_fcs_online_action(rport);
1416 bfa_fcs_rport_send_plogi(rport,
NULL);
1423 bfa_fcs_rport_send_plogi(rport,
NULL);
1450 bfa_fcs_rport_free(rport);
1456 bfa_fcs_rport_send_plogiacc(rport,
NULL);
1473 bfa_fcs_rport_timeout, rport,
1474 bfa_fcs_rport_del_timeout);
1480 bfa_fcs_rport_fcs_online_action(rport);
1502 bfa_fcs_rport_send_nsdisc(rport,
NULL);
1510 bfa_fcs_rport_send_nsdisc(rport,
NULL);
1516 bfa_fcs_rport_free(rport);
1522 bfa_fcs_rport_send_plogiacc(rport,
NULL);
1530 bfa_fcs_rport_timeout, rport,
1531 bfa_fcs_rport_del_timeout);
1535 bfa_fcs_rport_send_logo_acc(rport);
1538 bfa_fcs_rport_send_prlo_acc(rport);
1544 bfa_fcs_rport_fcs_online_action(rport);
1568 bfa_fcs_rport_send_plogi(rport,
NULL);
1571 bfa_fcs_rport_sm_nsdisc_sending);
1573 bfa_fcs_rport_send_nsdisc(rport,
NULL);
1581 bfa_fcs_rport_sm_nsdisc_sending);
1582 bfa_fcs_rport_send_nsdisc(rport,
NULL);
1588 bfa_fcs_rport_timeout, rport,
1589 bfa_fcs_rport_del_timeout);
1596 bfa_fcs_rport_free(rport);
1602 bfa_fcs_rport_send_plogiacc(rport,
NULL);
1610 bfa_fcs_rport_timeout, rport,
1611 bfa_fcs_rport_del_timeout);
1616 bfa_fcs_rport_send_prlo_acc(rport);
1628 bfa_fcs_rport_send_logo_acc(rport);
1634 bfa_fcs_rport_fcs_online_action(rport);
1657 bfa_fcs_rport_hal_offline(rport);
1686 bfa_fcs_rport_free(rport);
1705 bfa_fcs_rport_send_plogi(
void *rport_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
1715 fcxp = fcxp_alloced ? fcxp_alloced :
1719 bfa_fcs_rport_send_plogi, rport,
BFA_TRUE);
1731 FC_CLASS_3, len, &fchs, bfa_fcs_rport_plogi_response,
1734 rport->
stats.plogis++;
1739 bfa_fcs_rport_plogi_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
void *cbarg,
1756 rport->
stats.plogi_failed++;
1774 rport->
stats.rjt_insuff_res++;
1779 rport->
stats.plogi_rejects++;
1798 twin->
stats.plogi_rejects +=
1799 rport->
stats.plogi_rejects;
1800 twin->
stats.plogi_timeouts +=
1801 rport->
stats.plogi_timeouts;
1802 twin->
stats.plogi_failed +=
1803 rport->
stats.plogi_failed;
1804 twin->
stats.plogi_rcvd += rport->
stats.plogi_rcvd;
1805 twin->
stats.plogi_accs++;
1809 bfa_fcs_rport_update(twin, plogi_rsp);
1819 rport->
stats.plogi_accs++;
1820 bfa_fcs_rport_update(rport, plogi_rsp);
1825 bfa_fcs_rport_send_plogiacc(
void *rport_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
1836 fcxp = fcxp_alloced ? fcxp_alloced :
1840 bfa_fcs_rport_send_plogiacc, rport,
BFA_FALSE);
1859 bfa_fcs_rport_send_adisc(
void *rport_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
1869 fcxp = fcxp_alloced ? fcxp_alloced :
1873 bfa_fcs_rport_send_adisc, rport,
BFA_TRUE);
1883 FC_CLASS_3, len, &fchs, bfa_fcs_rport_adisc_response,
1886 rport->
stats.adisc_sent++;
1891 bfa_fcs_rport_adisc_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
void *cbarg,
1901 rport->
stats.adisc_failed++;
1908 rport->
stats.adisc_accs++;
1913 rport->
stats.adisc_rejects++;
1922 bfa_fcs_rport_send_nsdisc(
void *rport_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
1933 fcxp = fcxp_alloced ? fcxp_alloced :
1937 bfa_fcs_rport_send_nsdisc, rport,
BFA_TRUE);
1945 cbfn = bfa_fcs_rport_gidpn_response;
1949 cbfn = bfa_fcs_rport_gpnid_response;
1960 bfa_fcs_rport_gidpn_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
void *cbarg,
1979 if (gidpn_rsp->
dap == rport->
pid) {
1993 if (gidpn_rsp->
dap == twin->
pid) {
2002 rport->
pid = gidpn_rsp->
dap;
2033 bfa_fcs_rport_gpnid_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
void *cbarg,
2078 bfa_fcs_rport_send_logo(
void *rport_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
2090 fcxp = fcxp_alloced ? fcxp_alloced :
2094 bfa_fcs_rport_send_logo, rport,
BFA_FALSE);
2107 rport->
stats.logos++;
2116 bfa_fcs_rport_send_logo_acc(
void *rport_cbarg)
2132 rport->
stats.logo_rcvd++;
2156 bfa_fcs_rport_timeout(
void *
arg)
2160 rport->
stats.plogi_timeouts++;
2177 rport->
stats.prli_rcvd++;
2182 prli = (
struct fc_prli_s *) (rx_fchs + 1);
2184 if (prli->
parampage.servparams.target) {
2224 rport->
stats.rpsc_rcvd++;
2225 speeds.port_speed_cap =
2234 speeds.port_op_speed = fc_bfa_speed_to_rpsc_operspeed(pport_attr.speed);
2242 rx_fchs->
ox_id, &speeds);
2260 rport->
stats.adisc_rcvd++;
2283 rport->
stats.adisc_rejected++;
2284 bfa_fcs_rport_send_ls_rjt(rport, rx_fchs,
2296 rport_info.
pid = rport->
pid;
2297 rport_info.local_pid = port->
pid;
2298 rport_info.lp_tag = port->
lp_tag;
2299 rport_info.vf_id = port->
fabric->vf_id;
2300 rport_info.vf_en = port->
fabric->is_vf;
2301 rport_info.fc_class = rport->
fc_cos;
2302 rport_info.cisc = rport->
cisc;
2303 rport_info.max_frmsz = rport->
maxfrsize;
2342 rport->
rp_drv = rport_drv;
2356 if (!rport->
itnim) {
2419 aen_entry->aen_data.rport.priv.qos = data->
priv.
qos;
2421 aen_entry->aen_data.rport.priv.qos = data->
priv.
qos;
2423 aen_entry->aen_data.rport.vf_id = rport->
port->fabric->vf_id;
2427 aen_entry->aen_data.rport.rpwwn = rport->
pwwn;
2437 if ((!rport->
pid) || (!rport->
pwwn)) {
2453 rport->
stats.onlines++;
2467 wwn2str(rpwwn_buf, rport->
pwwn);
2470 "Remote port (WWN = %s) online for logical port (WWN = %s)\n",
2471 rpwwn_buf, lpwwn_buf);
2494 bfa_fcs_rport_fcs_offline_action(rport);
2498 rport->
stats.offlines++;
2501 wwn2str(rpwwn_buf, rport->
pwwn);
2505 "Remote port (WWN = %s) connectivity lost for "
2506 "logical port (WWN = %s)\n",
2507 rpwwn_buf, lpwwn_buf);
2508 bfa_fcs_rport_aen_post(rport,
2512 "Remote port (WWN = %s) offlined by "
2513 "logical port (WWN = %s)\n",
2514 rpwwn_buf, lpwwn_buf);
2515 bfa_fcs_rport_aen_post(rport,
2546 if (plogi->
class3.class_valid)
2549 if (plogi->
class2.class_valid)
2556 rport->
cisc = plogi->
csp.cisc;
2563 bfa_trc(port->fcs, port->fabric->bb_credit);
2576 bfa_trc(port->fcs, port->fabric->bb_credit);
2580 port->fabric->bb_credit, 0);
2595 rport->
stats.logo_rcvd++;
2620 rport = bfa_fcs_rport_alloc(port,
WWN_NULL, rpid);
2641 rport = bfa_fcs_rport_alloc(port, rpwwn, 0);
2661 rport = bfa_fcs_rport_alloc(port,
WWN_NULL, fchs->
s_id);
2665 bfa_fcs_rport_update(rport, plogi);
2680 rport = bfa_fcs_rport_alloc(port, plogi->
port_name, fchs->
s_id);
2684 bfa_fcs_rport_update(rport, plogi);
2689 rport->
stats.plogi_rcvd++;
2705 bfa_fcs_rport_update(rport, plogi);
2713 rport->
stats.plogi_rcvd++;
2724 rport->
stats.rscns++;
2796 aen_data.
priv.
qos = new_qos_attr;
2865 aen_data.
priv.
qos = new_qos_attr;
2893 bfa_fcs_rport_process_logo(rport, fchs);
2898 bfa_fcs_rport_process_adisc(rport, fchs, len);
2909 bfa_fcs_rport_process_prli(rport, fchs, len);
2914 bfa_fcs_rport_process_rpsc(rport, fchs, len);
2919 bfa_fcs_rport_send_ls_rjt(rport, fchs,
2969 rx_fchs->
ox_id, reason_code, reason_code_expl);
2982 return bfa_sm_to_state(rport_sm_table, rport->
sm);
2999 bfa_fcs_rport_del_timeout = rport_tmo * 1000;
3019 bfa_fcs_rport_max_logins = max_logins;
3036 rport_attr->
pid = rport->
pid;
3082 if (rport ==
NULL) {
3097 if (rport ==
NULL) {
3110 #define BFA_FCS_RPF_RETRIES (3)
3111 #define BFA_FCS_RPF_RETRY_TIMEOUT (1000)
3113 static void bfa_fcs_rpf_send_rpsc2(
void *rport_cbarg,
3115 static void bfa_fcs_rpf_rpsc2_response(
void *fcsarg,
3121 struct fchs_s *rsp_fchs);
3123 static void bfa_fcs_rpf_timeout(
void *
arg);
3166 ((rport->
port->fabric->lps->brcd_switch) ||
3171 bfa_fcs_rpf_send_rpsc2(rpf,
NULL);
3233 bfa_fcs_rpf_timeout, rpf,
3264 bfa_fcs_rpf_send_rpsc2(rpf,
NULL);
3310 bfa_fcs_rpf_send_rpsc2(rpf,
NULL);
3360 rport->
rpf.rpsc_speed = 0;
3365 bfa_fcs_rpf_timeout(
void *
arg)
3375 bfa_fcs_rpf_send_rpsc2(
void *rpf_cbarg,
struct bfa_fcxp_s *fcxp_alloced)
3386 fcxp = fcxp_alloced ? fcxp_alloced :
3390 bfa_fcs_rpf_send_rpsc2, rpf,
BFA_TRUE);
3399 FC_CLASS_3, len, &fchs, bfa_fcs_rpf_rpsc2_response,
3401 rport->
stats.rpsc_sent++;
3407 bfa_fcs_rpf_rpsc2_response(
void *fcsarg,
struct bfa_fcxp_s *fcxp,
void *cbarg,
3422 rport->
stats.rpsc_failed++;
3429 rport->
stats.rpsc_accs++;
3443 if (rpsc2_acc->
port_info[0].speed == 0) {
3448 rpf->
rpsc_speed = fc_rpsc_operspeed_to_bfa_speed(
3457 rport->
stats.rpsc_rejects++;