Lines Matching refs:node
8 * This file implements remote node state machines for:
24 efc_fabric_initiate_shutdown(struct efc_node *node)
26 struct efc *efc = node->efc;
28 node->els_io_enabled = false;
30 if (node->attached) {
33 /* issue hw node free; don't care if succeeds right away
34 * or sometime later, will check node->attached later in
37 rc = efc_cmd_node_detach(efc, &node->rnode);
39 node_printf(node, "Failed freeing HW node, rc=%d\n",
44 * node has either been detached or is in the process of being detached,
45 * call common node's initiate cleanup function
47 efc_node_initiate_cleanup(node);
54 struct efc_node *node = NULL;
56 node = ctx->app;
62 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT;
63 efc_fabric_initiate_shutdown(node);
76 struct efc_node *node = ctx->app;
77 struct efc *efc = node->efc;
90 efc_send_flogi(node);
91 efc_node_transition(node, __efc_fabric_flogi_wait_rsp, NULL);
100 efc_fabric_set_topology(struct efc_node *node,
103 node->nport->topology = topology;
107 efc_fabric_notify_topology(struct efc_node *node)
116 xa_for_each(&node->nport->lookup, index, tmp_node) {
117 if (tmp_node != node) {
120 &node->nport->topology);
135 struct efc_node *node = ctx->app;
147 WARN_ON(!node->els_req_cnt);
148 node->els_req_cnt--;
150 memcpy(node->nport->domain->flogi_service_params,
158 efc_fabric_set_topology(node, EFC_NPORT_TOPO_FABRIC);
159 efc_fabric_notify_topology(node);
160 WARN_ON(node->nport->domain->attached);
161 efc_domain_attach(node->nport->domain,
163 efc_node_transition(node,
170 efc_fabric_set_topology(node, EFC_NPORT_TOPO_P2P);
171 if (efc_p2p_setup(node->nport)) {
172 node_printf(node,
173 "p2p setup failed, shutting down node\n");
174 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT;
175 efc_fabric_initiate_shutdown(node);
179 if (node->nport->p2p_winner) {
180 efc_node_transition(node,
183 if (node->nport->domain->attached &&
184 !node->nport->domain->domain_notify_pend) {
189 node_printf(node,
191 efc_node_post_event(node,
199 * remote SID=1 node;
200 * this node has served its purpose
202 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT;
203 efc_fabric_initiate_shutdown(node);
212 struct efc_nport *nport = node->nport;
222 node_printf(node,
225 WARN_ON(!node->els_req_cnt);
226 node->els_req_cnt--;
240 struct efc_node *node = ctx->app;
249 efc_send_fdisc(node);
250 efc_node_transition(node, __efc_fabric_fdisc_wait_rsp, NULL);
263 struct efc_node *node = ctx->app;
277 WARN_ON(!node->els_req_cnt);
278 node->els_req_cnt--;
280 efc_nport_attach(node->nport, cbdata->ext_status);
281 efc_node_transition(node, __efc_fabric_wait_domain_attach,
292 WARN_ON(!node->els_req_cnt);
293 node->els_req_cnt--;
294 efc_log_err(node->efc, "FDISC failed, shutting down nport\n");
296 efc_sm_post_event(&node->nport->sm, EFC_EVT_SHUTDOWN, NULL);
310 /* Instantiate a name services node */
356 struct efc_node *node = ctx->app;
364 efc_node_hold_frames(node);
368 efc_node_accept_frames(node);
374 rc = efc_start_ns_node(node->nport);
378 /* sm: if enable_ini / start fabctl node */
380 if (node->nport->enable_rscn) {
381 rc = efc_start_fabctl_node(node->nport);
385 efc_node_transition(node, __efc_fabric_idle, NULL);
397 struct efc_node *node = ctx->app;
414 struct efc_node *node = ctx->app;
423 efc_send_plogi(node);
424 efc_node_transition(node, __efc_ns_plogi_wait_rsp, NULL);
436 struct efc_node *node = ctx->app;
451 WARN_ON(!node->els_req_cnt);
452 node->els_req_cnt--;
454 efc_node_save_sparms(node, cbdata->els_rsp.virt);
455 rc = efc_node_attach(node);
456 efc_node_transition(node, __efc_ns_wait_node_attach, NULL);
458 efc_node_post_event(node, EFC_EVT_NODE_ATTACH_FAIL,
471 struct efc_node *node = ctx->app;
479 efc_node_hold_frames(node);
483 efc_node_accept_frames(node);
487 node->attached = true;
489 efc_ns_send_rftid(node);
490 efc_node_transition(node, __efc_ns_rftid_wait_rsp, NULL);
494 /* node attach failed, shutdown the node */
495 node->attached = false;
496 node_printf(node, "Node attach failed\n");
497 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT;
498 efc_fabric_initiate_shutdown(node);
502 node_printf(node, "Shutdown event received\n");
503 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT;
504 efc_node_transition(node,
511 * we haven't sent GID_PT yet (ACC sent by fabctl node)
525 struct efc_node *node = ctx->app;
533 efc_node_hold_frames(node);
537 efc_node_accept_frames(node);
542 node->attached = true;
543 node_printf(node, "Attach evt=%s, proceed to shutdown\n",
545 efc_fabric_initiate_shutdown(node);
549 node->attached = false;
550 node_printf(node, "Attach evt=%s, proceed to shutdown\n",
552 efc_fabric_initiate_shutdown(node);
557 node_printf(node, "Shutdown event received\n");
569 struct efc_node *node = ctx->app;
581 WARN_ON(!node->els_req_cnt);
582 node->els_req_cnt--;
584 efc_ns_send_rffid(node);
585 efc_node_transition(node, __efc_ns_rffid_wait_rsp, NULL);
590 * we haven't sent GID_PT yet (ACC sent by fabctl node)
604 struct efc_node *node = ctx->app;
620 WARN_ON(!node->els_req_cnt);
621 node->els_req_cnt--;
622 if (node->nport->enable_rscn) {
624 efc_ns_send_gidpt(node);
626 efc_node_transition(node, __efc_ns_gidpt_wait_rsp,
630 efc_node_transition(node, __efc_ns_idle, NULL);
636 * we haven't sent GID_PT yet (ACC sent by fabctl node)
647 efc_process_gidpt_payload(struct efc_node *node,
652 struct efc_nport *nport = node->nport;
653 struct efc *efc = node->efc;
670 efc_log_debug(node->efc, "residual is %u words\n", residual);
673 node_printf(node,
690 node_printf(node, "efc_malloc failed\n");
728 * if we're an initiator and the remote node
729 * is a target, then post the node missing event.
731 * target RSCN, then post the node missing event.
736 if ((node->nport->enable_ini && active_nodes[i]->targ) ||
737 (node->nport->enable_tgt && enable_target_rscn(efc))) {
741 node_printf(node,
751 /* Don't create node for ourselves */
752 if (port_id == node->rnode.nport->fc_id) {
760 if (!node->nport->enable_ini)
775 if (node->nport->enable_ini && newnode->targ) {
791 struct efc_node *node = ctx->app;
807 WARN_ON(!node->els_req_cnt);
808 node->els_req_cnt--;
810 efc_process_gidpt_payload(node, cbdata->els_rsp.virt,
812 efc_node_transition(node, __efc_ns_idle, NULL);
818 node_printf(node, "GID_PT failed to complete\n");
819 WARN_ON(!node->els_req_cnt);
820 node->els_req_cnt--;
821 efc_node_transition(node, __efc_ns_idle, NULL);
827 node_printf(node, "RSCN received during GID_PT processing\n");
828 node->rscn_pending = true;
840 struct efc_node *node = ctx->app;
841 struct efc *efc = node->efc;
854 if (!node->rscn_pending)
857 node_printf(node, "RSCN pending, restart discovery\n");
858 node->rscn_pending = false;
870 !node->nport->enable_ini && node->nport->enable_tgt &&
872 efc_node_transition(node, __efc_ns_gidpt_delay, NULL);
874 efc_ns_send_gidpt(node);
875 efc_node_transition(node, __efc_ns_gidpt_wait_rsp,
889 struct efc_node *node = from_timer(node, t, gidpt_delay_timer);
891 del_timer(&node->gidpt_delay_timer);
893 efc_node_post_event(node, EFC_EVT_GIDPT_DELAY_EXPIRED, NULL);
900 struct efc_node *node = ctx->app;
901 struct efc *efc = node->efc;
917 tmp = jiffies_to_msecs(jiffies) - node->time_last_gidpt_msec;
921 timer_setup(&node->gidpt_delay_timer, &gidpt_delay_timer_cb,
923 mod_timer(&node->gidpt_delay_timer,
930 node->time_last_gidpt_msec = jiffies_to_msecs(jiffies);
932 efc_ns_send_gidpt(node);
933 efc_node_transition(node, __efc_ns_gidpt_wait_rsp, NULL);
951 struct efc_node *node = ctx->app;
958 efc_send_scr(node);
959 efc_node_transition(node, __efc_fabctl_wait_scr_rsp, NULL);
963 node->attached = true;
975 struct efc_node *node = ctx->app;
982 * Fabric controller node state machine:
991 WARN_ON(!node->els_req_cnt);
992 node->els_req_cnt--;
993 efc_node_transition(node, __efc_fabctl_ready, NULL);
1002 efc_process_rscn(struct efc_node *node, struct efc_node_cb *cbdata)
1004 struct efc *efc = node->efc;
1005 struct efc_nport *nport = node->nport;
1008 /* Forward this event to the name-services node */
1013 efc_log_warn(efc, "can't find name server node\n");
1021 struct efc_node *node = ctx->app;
1028 * Fabric controller node state machine: Ready.
1030 * by this node and is forwarded to the name services node object; and
1038 * sm: / process RSCN (forward to name services node),
1041 efc_process_rscn(node, cbdata);
1042 efc_send_ls_acc(node, be16_to_cpu(hdr->fh_ox_id));
1043 efc_node_transition(node, __efc_fabctl_wait_ls_acc_cmpl,
1057 struct efc_node *node = ctx->app;
1065 efc_node_hold_frames(node);
1069 efc_node_accept_frames(node);
1073 WARN_ON(!node->els_cmpl_cnt);
1074 node->els_cmpl_cnt--;
1075 efc_node_transition(node, __efc_fabctl_ready, NULL);
1108 "WWPN of remote node [%08x %08x] matches local WWPN\n",
1121 struct efc_node *node = ctx->app;
1122 struct efc *efc = node->efc;
1130 efc_node_hold_frames(node);
1134 efc_node_accept_frames(node);
1138 struct efc_nport *nport = node->nport;
1142 * this transient node (SID=0 (recv'd FLOGI)
1144 * is the p2p winner, will use a separate node
1147 WARN_ON(!node->nport->p2p_winner);
1149 rnode = efc_node_find(nport, node->nport->p2p_remote_port_id);
1152 * the "other" transient p2p node has
1154 * new node from which PLOGI is sent
1156 node_printf(node,
1161 * create new node (SID=1, DID=2)
1168 efc_log_err(efc, "node alloc failed\n");
1172 efc_fabric_notify_topology(node);
1173 /* sm: / allocate p2p remote node */
1179 * the transient node (SID=0 or DID=fabric)
1182 if (node->rnode.fc_id == 0) {
1184 * if this is the SID=0 node,
1189 efc_node_init_device(node, false);
1192 * if this is the DID=fabric node
1195 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT;
1196 efc_fabric_initiate_shutdown(node);
1211 struct efc_node *node = ctx->app;
1220 efc_send_plogi(node);
1221 efc_node_transition(node, __efc_p2p_wait_plogi_rsp, NULL);
1226 efc_send_bls_acc(node, cbdata->header->dma.virt);
1240 struct efc_node *node = ctx->app;
1248 efc_node_hold_frames(node);
1252 efc_node_accept_frames(node);
1256 WARN_ON(!node->els_cmpl_cnt);
1257 node->els_cmpl_cnt--;
1260 if (node->nport->p2p_winner) {
1261 efc_node_transition(node,
1264 if (!node->nport->domain->attached) {
1265 node_printf(node, "Domain not attached\n");
1266 efc_domain_attach(node->nport->domain,
1267 node->nport->p2p_port_id);
1269 node_printf(node, "Domain already attached\n");
1270 efc_node_post_event(node,
1275 /* this node has served its purpose;
1277 * node (remote SID=0x1); return this node
1283 efc_node_init_device(node, false);
1290 * shutdown node and wait
1293 node_printf(node, "FLOGI LS_ACC failed, shutting down\n");
1294 WARN_ON(!node->els_cmpl_cnt);
1295 node->els_cmpl_cnt--;
1296 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT;
1297 efc_fabric_initiate_shutdown(node);
1302 efc_send_bls_acc(node, cbdata->header->dma.virt);
1316 struct efc_node *node = ctx->app;
1330 WARN_ON(!node->els_req_cnt);
1331 node->els_req_cnt--;
1333 efc_node_save_sparms(node, cbdata->els_rsp.virt);
1334 rc = efc_node_attach(node);
1335 efc_node_transition(node, __efc_p2p_wait_node_attach, NULL);
1337 efc_node_post_event(node, EFC_EVT_NODE_ATTACH_FAIL,
1346 node_printf(node, "PLOGI failed, shutting down\n");
1347 WARN_ON(!node->els_req_cnt);
1348 node->els_req_cnt--;
1349 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT;
1350 efc_fabric_initiate_shutdown(node);
1357 if (node->efc->external_loopback) {
1358 efc_send_plogi_acc(node, be16_to_cpu(hdr->fh_ox_id));
1371 * PRLI from the remote node (WCQEs and RCQEs come in on
1376 efc_process_prli_payload(node, cbdata->payload->dma.virt);
1377 efc_send_ls_acc_after_attach(node,
1380 efc_node_transition(node, __efc_p2p_wait_plogi_rsp_recvd_prli,
1393 struct efc_node *node = ctx->app;
1403 * just need to wait for the PLOGI response to do the node
1412 efc_node_hold_frames(node);
1416 efc_node_accept_frames(node);
1427 WARN_ON(!node->els_req_cnt);
1428 node->els_req_cnt--;
1430 efc_node_save_sparms(node, cbdata->els_rsp.virt);
1431 rc = efc_node_attach(node);
1432 efc_node_transition(node, __efc_p2p_wait_node_attach, NULL);
1434 efc_node_post_event(node, EFC_EVT_NODE_ATTACH_FAIL,
1440 /* PLOGI failed, shutdown the node */
1445 WARN_ON(!node->els_req_cnt);
1446 node->els_req_cnt--;
1447 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT;
1448 efc_fabric_initiate_shutdown(node);
1461 struct efc_node *node = ctx->app;
1469 efc_node_hold_frames(node);
1473 efc_node_accept_frames(node);
1477 node->attached = true;
1478 switch (node->send_ls_acc) {
1480 efc_d_send_prli_rsp(node->ls_acc_io,
1481 node->ls_acc_oxid);
1482 node->send_ls_acc = EFC_NODE_SEND_LS_ACC_NONE;
1483 node->ls_acc_io = NULL;
1491 efc_node_transition(node, __efc_d_port_logged_in,
1498 /* node attach failed, shutdown the node */
1499 node->attached = false;
1500 node_printf(node, "Node attach failed\n");
1501 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT;
1502 efc_fabric_initiate_shutdown(node);
1506 node_printf(node, "%s received\n", efc_sm_event_name(evt));
1507 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT;
1508 efc_node_transition(node,
1513 node_printf(node, "%s: PRLI received before node is attached\n",
1515 efc_process_prli_payload(node, cbdata->payload->dma.virt);
1516 efc_send_ls_acc_after_attach(node,
1548 * local nport and remote node