2 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
19 * bfa_fcs.c BFA FCS main
23 #include "bfa_fcbuild.h"
26 BFA_TRC_FILE(FCS, FCS);
31 struct bfa_fcs_mod_s {
32 void (*attach) (struct bfa_fcs_s *fcs);
33 void (*modinit) (struct bfa_fcs_s *fcs);
34 void (*modexit) (struct bfa_fcs_s *fcs);
37 #define BFA_FCS_MODULE(_mod) { _mod ## _modinit, _mod ## _modexit }
39 static struct bfa_fcs_mod_s fcs_modules[] = {
40 { bfa_fcs_port_attach, NULL, NULL },
41 { bfa_fcs_uf_attach, NULL, NULL },
42 { bfa_fcs_fabric_attach, bfa_fcs_fabric_modinit,
43 bfa_fcs_fabric_modexit },
51 bfa_fcs_exit_comp(void *fcs_cbarg)
53 struct bfa_fcs_s *fcs = fcs_cbarg;
54 struct bfad_s *bfad = fcs->bfad;
56 complete(&bfad->comp);
66 * fcs attach -- called once to initialize data structures at driver attach time
69 bfa_fcs_attach(struct bfa_fcs_s *fcs, struct bfa_s *bfa, struct bfad_s *bfad,
70 bfa_boolean_t min_cfg)
73 struct bfa_fcs_mod_s *mod;
77 fcs->min_cfg = min_cfg;
82 for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
83 mod = &fcs_modules[i];
90 * fcs initialization, called once after bfa initialization is complete
93 bfa_fcs_init(struct bfa_fcs_s *fcs)
96 struct bfa_fcs_mod_s *mod;
97 struct bfi_pbc_vport_s pbc_vports[BFI_PBC_MAX_VPORTS];
99 for (i = 0; i < sizeof(fcs_modules) / sizeof(fcs_modules[0]); i++) {
100 mod = &fcs_modules[i];
104 /* Initialize pbc vports */
107 bfa_iocfc_get_pbc_vports(fcs->bfa, pbc_vports);
108 for (i = 0; i < npbc_vports; i++)
109 bfa_fcb_pbc_vport_create(fcs->bfa->bfad, pbc_vports[i]);
114 * Start FCS operations.
117 bfa_fcs_start(struct bfa_fcs_s *fcs)
119 bfa_fcs_fabric_modstart(fcs);
124 * FCS driver details initialization.
126 * param[in] fcs FCS instance
127 * param[in] driver_info Driver Details
132 bfa_fcs_driver_info_init(struct bfa_fcs_s *fcs,
133 struct bfa_fcs_driver_info_s *driver_info)
136 fcs->driver_info = *driver_info;
138 bfa_fcs_fabric_psymb_init(&fcs->fabric);
143 * FCS FDMI Driver Parameter Initialization
145 * param[in] fcs FCS instance
146 * param[in] fdmi_enable TRUE/FALSE
151 bfa_fcs_set_fdmi_param(struct bfa_fcs_s *fcs, bfa_boolean_t fdmi_enable)
154 fcs->fdmi_enabled = fdmi_enable;
159 * FCS instance cleanup and exit.
161 * param[in] fcs FCS instance
165 bfa_fcs_exit(struct bfa_fcs_s *fcs)
167 struct bfa_fcs_mod_s *mod;
170 bfa_wc_init(&fcs->wc, bfa_fcs_exit_comp, fcs);
172 nmods = sizeof(fcs_modules) / sizeof(fcs_modules[0]);
174 for (i = 0; i < nmods; i++) {
176 mod = &fcs_modules[i];
183 bfa_wc_wait(&fcs->wc);
188 bfa_fcs_trc_init(struct bfa_fcs_s *fcs, struct bfa_trc_mod_s *trcmod)
190 fcs->trcmod = trcmod;
194 bfa_fcs_modexit_comp(struct bfa_fcs_s *fcs)
196 bfa_wc_down(&fcs->wc);
200 * Fabric module implementation.
203 #define BFA_FCS_FABRIC_RETRY_DELAY (2000) /* Milliseconds */
204 #define BFA_FCS_FABRIC_CLEANUP_DELAY (10000) /* Milliseconds */
206 #define bfa_fcs_fabric_set_opertype(__fabric) do { \
207 if (bfa_fcport_get_topology((__fabric)->fcs->bfa) \
208 == BFA_PORT_TOPOLOGY_P2P) \
209 (__fabric)->oper_type = BFA_PORT_TYPE_NPORT; \
211 (__fabric)->oper_type = BFA_PORT_TYPE_NLPORT; \
215 * forward declarations
217 static void bfa_fcs_fabric_init(struct bfa_fcs_fabric_s *fabric);
218 static void bfa_fcs_fabric_login(struct bfa_fcs_fabric_s *fabric);
219 static void bfa_fcs_fabric_notify_online(struct bfa_fcs_fabric_s *fabric);
220 static void bfa_fcs_fabric_notify_offline(struct bfa_fcs_fabric_s *fabric);
221 static void bfa_fcs_fabric_delay(void *cbarg);
222 static void bfa_fcs_fabric_delete(struct bfa_fcs_fabric_s *fabric);
223 static void bfa_fcs_fabric_delete_comp(void *cbarg);
224 static void bfa_fcs_fabric_process_uf(struct bfa_fcs_fabric_s *fabric,
225 struct fchs_s *fchs, u16 len);
226 static void bfa_fcs_fabric_process_flogi(struct bfa_fcs_fabric_s *fabric,
227 struct fchs_s *fchs, u16 len);
228 static void bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric);
229 static void bfa_fcs_fabric_flogiacc_comp(void *fcsarg,
230 struct bfa_fcxp_s *fcxp, void *cbarg,
234 struct fchs_s *rspfchs);
236 * fcs_fabric_sm fabric state machine functions
240 * Fabric state machine events
242 enum bfa_fcs_fabric_event {
243 BFA_FCS_FABRIC_SM_CREATE = 1, /* create from driver */
244 BFA_FCS_FABRIC_SM_DELETE = 2, /* delete from driver */
245 BFA_FCS_FABRIC_SM_LINK_DOWN = 3, /* link down from port */
246 BFA_FCS_FABRIC_SM_LINK_UP = 4, /* link up from port */
247 BFA_FCS_FABRIC_SM_CONT_OP = 5, /* flogi/auth continue op */
248 BFA_FCS_FABRIC_SM_RETRY_OP = 6, /* flogi/auth retry op */
249 BFA_FCS_FABRIC_SM_NO_FABRIC = 7, /* from flogi/auth */
250 BFA_FCS_FABRIC_SM_PERF_EVFP = 8, /* from flogi/auth */
251 BFA_FCS_FABRIC_SM_ISOLATE = 9, /* from EVFP processing */
252 BFA_FCS_FABRIC_SM_NO_TAGGING = 10, /* no VFT tagging from EVFP */
253 BFA_FCS_FABRIC_SM_DELAYED = 11, /* timeout delay event */
254 BFA_FCS_FABRIC_SM_AUTH_FAILED = 12, /* auth failed */
255 BFA_FCS_FABRIC_SM_AUTH_SUCCESS = 13, /* auth successful */
256 BFA_FCS_FABRIC_SM_DELCOMP = 14, /* all vports deleted event */
257 BFA_FCS_FABRIC_SM_LOOPBACK = 15, /* Received our own FLOGI */
258 BFA_FCS_FABRIC_SM_START = 16, /* from driver */
261 static void bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric,
262 enum bfa_fcs_fabric_event event);
263 static void bfa_fcs_fabric_sm_created(struct bfa_fcs_fabric_s *fabric,
264 enum bfa_fcs_fabric_event event);
265 static void bfa_fcs_fabric_sm_linkdown(struct bfa_fcs_fabric_s *fabric,
266 enum bfa_fcs_fabric_event event);
267 static void bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,
268 enum bfa_fcs_fabric_event event);
269 static void bfa_fcs_fabric_sm_flogi_retry(struct bfa_fcs_fabric_s *fabric,
270 enum bfa_fcs_fabric_event event);
271 static void bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric,
272 enum bfa_fcs_fabric_event event);
273 static void bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric,
274 enum bfa_fcs_fabric_event event);
275 static void bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric,
276 enum bfa_fcs_fabric_event event);
277 static void bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric,
278 enum bfa_fcs_fabric_event event);
279 static void bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric,
280 enum bfa_fcs_fabric_event event);
281 static void bfa_fcs_fabric_sm_evfp(struct bfa_fcs_fabric_s *fabric,
282 enum bfa_fcs_fabric_event event);
283 static void bfa_fcs_fabric_sm_evfp_done(struct bfa_fcs_fabric_s *fabric,
284 enum bfa_fcs_fabric_event event);
285 static void bfa_fcs_fabric_sm_isolated(struct bfa_fcs_fabric_s *fabric,
286 enum bfa_fcs_fabric_event event);
287 static void bfa_fcs_fabric_sm_deleting(struct bfa_fcs_fabric_s *fabric,
288 enum bfa_fcs_fabric_event event);
290 * Beginning state before fabric creation.
293 bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric,
294 enum bfa_fcs_fabric_event event)
296 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
297 bfa_trc(fabric->fcs, event);
300 case BFA_FCS_FABRIC_SM_CREATE:
301 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_created);
302 bfa_fcs_fabric_init(fabric);
303 bfa_fcs_lport_init(&fabric->bport, &fabric->bport.port_cfg);
306 case BFA_FCS_FABRIC_SM_LINK_UP:
307 case BFA_FCS_FABRIC_SM_LINK_DOWN:
311 bfa_sm_fault(fabric->fcs, event);
316 * Beginning state before fabric creation.
319 bfa_fcs_fabric_sm_created(struct bfa_fcs_fabric_s *fabric,
320 enum bfa_fcs_fabric_event event)
322 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
323 bfa_trc(fabric->fcs, event);
326 case BFA_FCS_FABRIC_SM_START:
327 if (bfa_fcport_is_linkup(fabric->fcs->bfa)) {
328 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi);
329 bfa_fcs_fabric_login(fabric);
331 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
334 case BFA_FCS_FABRIC_SM_LINK_UP:
335 case BFA_FCS_FABRIC_SM_LINK_DOWN:
338 case BFA_FCS_FABRIC_SM_DELETE:
339 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit);
340 bfa_fcs_modexit_comp(fabric->fcs);
344 bfa_sm_fault(fabric->fcs, event);
349 * Link is down, awaiting LINK UP event from port. This is also the
350 * first state at fabric creation.
353 bfa_fcs_fabric_sm_linkdown(struct bfa_fcs_fabric_s *fabric,
354 enum bfa_fcs_fabric_event event)
356 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
357 bfa_trc(fabric->fcs, event);
360 case BFA_FCS_FABRIC_SM_LINK_UP:
361 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi);
362 bfa_fcs_fabric_login(fabric);
365 case BFA_FCS_FABRIC_SM_RETRY_OP:
368 case BFA_FCS_FABRIC_SM_DELETE:
369 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
370 bfa_fcs_fabric_delete(fabric);
374 bfa_sm_fault(fabric->fcs, event);
379 * FLOGI is in progress, awaiting FLOGI reply.
382 bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,
383 enum bfa_fcs_fabric_event event)
385 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
386 bfa_trc(fabric->fcs, event);
389 case BFA_FCS_FABRIC_SM_CONT_OP:
391 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa,
393 fabric->fab_type = BFA_FCS_FABRIC_SWITCHED;
395 if (fabric->auth_reqd && fabric->is_auth) {
396 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth);
397 bfa_trc(fabric->fcs, event);
399 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_online);
400 bfa_fcs_fabric_notify_online(fabric);
404 case BFA_FCS_FABRIC_SM_RETRY_OP:
405 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi_retry);
406 bfa_timer_start(fabric->fcs->bfa, &fabric->delay_timer,
407 bfa_fcs_fabric_delay, fabric,
408 BFA_FCS_FABRIC_RETRY_DELAY);
411 case BFA_FCS_FABRIC_SM_LOOPBACK:
412 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_loopback);
413 bfa_lps_discard(fabric->lps);
414 bfa_fcs_fabric_set_opertype(fabric);
417 case BFA_FCS_FABRIC_SM_NO_FABRIC:
418 fabric->fab_type = BFA_FCS_FABRIC_N2N;
419 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa,
421 bfa_fcs_fabric_notify_online(fabric);
422 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_nofabric);
425 case BFA_FCS_FABRIC_SM_LINK_DOWN:
426 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
427 bfa_lps_discard(fabric->lps);
430 case BFA_FCS_FABRIC_SM_DELETE:
431 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
432 bfa_lps_discard(fabric->lps);
433 bfa_fcs_fabric_delete(fabric);
437 bfa_sm_fault(fabric->fcs, event);
443 bfa_fcs_fabric_sm_flogi_retry(struct bfa_fcs_fabric_s *fabric,
444 enum bfa_fcs_fabric_event event)
446 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
447 bfa_trc(fabric->fcs, event);
450 case BFA_FCS_FABRIC_SM_DELAYED:
451 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi);
452 bfa_fcs_fabric_login(fabric);
455 case BFA_FCS_FABRIC_SM_LINK_DOWN:
456 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
457 bfa_timer_stop(&fabric->delay_timer);
460 case BFA_FCS_FABRIC_SM_DELETE:
461 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
462 bfa_timer_stop(&fabric->delay_timer);
463 bfa_fcs_fabric_delete(fabric);
467 bfa_sm_fault(fabric->fcs, event);
472 * Authentication is in progress, awaiting authentication results.
475 bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric,
476 enum bfa_fcs_fabric_event event)
478 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
479 bfa_trc(fabric->fcs, event);
482 case BFA_FCS_FABRIC_SM_AUTH_FAILED:
483 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed);
484 bfa_lps_discard(fabric->lps);
487 case BFA_FCS_FABRIC_SM_AUTH_SUCCESS:
488 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_online);
489 bfa_fcs_fabric_notify_online(fabric);
492 case BFA_FCS_FABRIC_SM_PERF_EVFP:
493 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_evfp);
496 case BFA_FCS_FABRIC_SM_LINK_DOWN:
497 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
498 bfa_lps_discard(fabric->lps);
501 case BFA_FCS_FABRIC_SM_DELETE:
502 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
503 bfa_fcs_fabric_delete(fabric);
507 bfa_sm_fault(fabric->fcs, event);
512 * Authentication failed
515 bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric,
516 enum bfa_fcs_fabric_event event)
518 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
519 bfa_trc(fabric->fcs, event);
522 case BFA_FCS_FABRIC_SM_LINK_DOWN:
523 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
524 bfa_fcs_fabric_notify_offline(fabric);
527 case BFA_FCS_FABRIC_SM_DELETE:
528 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
529 bfa_fcs_fabric_delete(fabric);
533 bfa_sm_fault(fabric->fcs, event);
538 * Port is in loopback mode.
541 bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric,
542 enum bfa_fcs_fabric_event event)
544 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
545 bfa_trc(fabric->fcs, event);
548 case BFA_FCS_FABRIC_SM_LINK_DOWN:
549 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
550 bfa_fcs_fabric_notify_offline(fabric);
553 case BFA_FCS_FABRIC_SM_DELETE:
554 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
555 bfa_fcs_fabric_delete(fabric);
559 bfa_sm_fault(fabric->fcs, event);
564 * There is no attached fabric - private loop or NPort-to-NPort topology.
567 bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric,
568 enum bfa_fcs_fabric_event event)
570 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
571 bfa_trc(fabric->fcs, event);
574 case BFA_FCS_FABRIC_SM_LINK_DOWN:
575 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
576 bfa_lps_discard(fabric->lps);
577 bfa_fcs_fabric_notify_offline(fabric);
580 case BFA_FCS_FABRIC_SM_DELETE:
581 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
582 bfa_fcs_fabric_delete(fabric);
585 case BFA_FCS_FABRIC_SM_NO_FABRIC:
586 bfa_trc(fabric->fcs, fabric->bb_credit);
587 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa,
592 bfa_sm_fault(fabric->fcs, event);
597 * Fabric is online - normal operating state.
600 bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric,
601 enum bfa_fcs_fabric_event event)
603 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
604 bfa_trc(fabric->fcs, event);
607 case BFA_FCS_FABRIC_SM_LINK_DOWN:
608 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown);
609 bfa_lps_discard(fabric->lps);
610 bfa_fcs_fabric_notify_offline(fabric);
613 case BFA_FCS_FABRIC_SM_DELETE:
614 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting);
615 bfa_fcs_fabric_delete(fabric);
618 case BFA_FCS_FABRIC_SM_AUTH_FAILED:
619 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed);
620 bfa_lps_discard(fabric->lps);
623 case BFA_FCS_FABRIC_SM_AUTH_SUCCESS:
627 bfa_sm_fault(fabric->fcs, event);
632 * Exchanging virtual fabric parameters.
635 bfa_fcs_fabric_sm_evfp(struct bfa_fcs_fabric_s *fabric,
636 enum bfa_fcs_fabric_event event)
638 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
639 bfa_trc(fabric->fcs, event);
642 case BFA_FCS_FABRIC_SM_CONT_OP:
643 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_evfp_done);
646 case BFA_FCS_FABRIC_SM_ISOLATE:
647 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_isolated);
651 bfa_sm_fault(fabric->fcs, event);
656 * EVFP exchange complete and VFT tagging is enabled.
659 bfa_fcs_fabric_sm_evfp_done(struct bfa_fcs_fabric_s *fabric,
660 enum bfa_fcs_fabric_event event)
662 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
663 bfa_trc(fabric->fcs, event);
667 * Port is isolated after EVFP exchange due to VF_ID mismatch (N and F).
670 bfa_fcs_fabric_sm_isolated(struct bfa_fcs_fabric_s *fabric,
671 enum bfa_fcs_fabric_event event)
673 struct bfad_s *bfad = (struct bfad_s *)fabric->fcs->bfad;
674 char pwwn_ptr[BFA_STRING_32];
676 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
677 bfa_trc(fabric->fcs, event);
678 wwn2str(pwwn_ptr, fabric->bport.port_cfg.pwwn);
680 BFA_LOG(KERN_INFO, bfad, bfa_log_level,
681 "Port is isolated due to VF_ID mismatch. "
682 "PWWN: %s Port VF_ID: %04x switch port VF_ID: %04x.",
683 pwwn_ptr, fabric->fcs->port_vfid,
684 fabric->event_arg.swp_vfid);
688 * Fabric is being deleted, awaiting vport delete completions.
691 bfa_fcs_fabric_sm_deleting(struct bfa_fcs_fabric_s *fabric,
692 enum bfa_fcs_fabric_event event)
694 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
695 bfa_trc(fabric->fcs, event);
698 case BFA_FCS_FABRIC_SM_DELCOMP:
699 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit);
700 bfa_fcs_modexit_comp(fabric->fcs);
703 case BFA_FCS_FABRIC_SM_LINK_UP:
706 case BFA_FCS_FABRIC_SM_LINK_DOWN:
707 bfa_fcs_fabric_notify_offline(fabric);
711 bfa_sm_fault(fabric->fcs, event);
718 * fcs_fabric_private fabric private functions
722 bfa_fcs_fabric_init(struct bfa_fcs_fabric_s *fabric)
724 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg;
726 port_cfg->roles = BFA_LPORT_ROLE_FCP_IM;
727 port_cfg->nwwn = bfa_ioc_get_nwwn(&fabric->fcs->bfa->ioc);
728 port_cfg->pwwn = bfa_ioc_get_pwwn(&fabric->fcs->bfa->ioc);
732 * Port Symbolic Name Creation for base port.
735 bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric)
737 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg;
738 char model[BFA_ADAPTER_MODEL_NAME_LEN] = {0};
739 struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info;
741 bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model);
743 /* Model name/number */
744 strncpy((char *)&port_cfg->sym_name, model,
745 BFA_FCS_PORT_SYMBNAME_MODEL_SZ);
746 strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
747 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
750 strncat((char *)&port_cfg->sym_name, (char *)driver_info->version,
751 BFA_FCS_PORT_SYMBNAME_VERSION_SZ);
752 strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
753 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
755 /* Host machine name */
756 strncat((char *)&port_cfg->sym_name,
757 (char *)driver_info->host_machine_name,
758 BFA_FCS_PORT_SYMBNAME_MACHINENAME_SZ);
759 strncat((char *)&port_cfg->sym_name, BFA_FCS_PORT_SYMBNAME_SEPARATOR,
760 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
764 * If OS Patch Info is not there, do not truncate any bytes from the
765 * OS name string and instead copy the entire OS info string (64 bytes).
767 if (driver_info->host_os_patch[0] == '\0') {
768 strncat((char *)&port_cfg->sym_name,
769 (char *)driver_info->host_os_name,
771 strncat((char *)&port_cfg->sym_name,
772 BFA_FCS_PORT_SYMBNAME_SEPARATOR,
773 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
775 strncat((char *)&port_cfg->sym_name,
776 (char *)driver_info->host_os_name,
777 BFA_FCS_PORT_SYMBNAME_OSINFO_SZ);
778 strncat((char *)&port_cfg->sym_name,
779 BFA_FCS_PORT_SYMBNAME_SEPARATOR,
780 sizeof(BFA_FCS_PORT_SYMBNAME_SEPARATOR));
782 /* Append host OS Patch Info */
783 strncat((char *)&port_cfg->sym_name,
784 (char *)driver_info->host_os_patch,
785 BFA_FCS_PORT_SYMBNAME_OSPATCH_SZ);
789 port_cfg->sym_name.symname[BFA_SYMNAME_MAXLEN - 1] = 0;
793 * bfa lps login completion callback
796 bfa_cb_lps_flogi_comp(void *bfad, void *uarg, bfa_status_t status)
798 struct bfa_fcs_fabric_s *fabric = uarg;
800 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
801 bfa_trc(fabric->fcs, status);
805 fabric->stats.flogi_accepts++;
808 case BFA_STATUS_INVALID_MAC:
810 fabric->stats.flogi_acc_err++;
811 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP);
815 case BFA_STATUS_EPROTOCOL:
816 switch (bfa_lps_get_extstatus(fabric->lps)) {
817 case BFA_EPROTO_BAD_ACCEPT:
818 fabric->stats.flogi_acc_err++;
821 case BFA_EPROTO_UNKNOWN_RSP:
822 fabric->stats.flogi_unknown_rsp++;
828 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP);
832 case BFA_STATUS_FABRIC_RJT:
833 fabric->stats.flogi_rejects++;
834 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP);
838 fabric->stats.flogi_rsp_err++;
839 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP);
843 fabric->bb_credit = bfa_lps_get_peer_bbcredit(fabric->lps);
844 bfa_trc(fabric->fcs, fabric->bb_credit);
846 if (!bfa_lps_is_brcd_fabric(fabric->lps))
847 fabric->fabric_name = bfa_lps_get_peer_nwwn(fabric->lps);
850 * Check port type. It should be 1 = F-port.
852 if (bfa_lps_is_fport(fabric->lps)) {
853 fabric->bport.pid = bfa_lps_get_pid(fabric->lps);
854 fabric->is_npiv = bfa_lps_is_npiv_en(fabric->lps);
855 fabric->is_auth = bfa_lps_is_authreq(fabric->lps);
856 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_CONT_OP);
859 * Nport-2-Nport direct attached
861 fabric->bport.port_topo.pn2n.rem_port_wwn =
862 bfa_lps_get_peer_pwwn(fabric->lps);
863 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC);
866 bfa_trc(fabric->fcs, fabric->bport.pid);
867 bfa_trc(fabric->fcs, fabric->is_npiv);
868 bfa_trc(fabric->fcs, fabric->is_auth);
871 * Allocate and send FLOGI.
874 bfa_fcs_fabric_login(struct bfa_fcs_fabric_s *fabric)
876 struct bfa_s *bfa = fabric->fcs->bfa;
877 struct bfa_lport_cfg_s *pcfg = &fabric->bport.port_cfg;
880 if (bfa_fcport_get_topology(bfa) == BFA_PORT_TOPOLOGY_LOOP)
881 alpa = bfa_fcport_get_myalpa(bfa);
883 bfa_lps_flogi(fabric->lps, fabric, alpa, bfa_fcport_get_maxfrsize(bfa),
884 pcfg->pwwn, pcfg->nwwn, fabric->auth_reqd);
886 fabric->stats.flogi_sent++;
890 bfa_fcs_fabric_notify_online(struct bfa_fcs_fabric_s *fabric)
892 struct bfa_fcs_vport_s *vport;
893 struct list_head *qe, *qen;
895 bfa_trc(fabric->fcs, fabric->fabric_name);
897 bfa_fcs_fabric_set_opertype(fabric);
898 fabric->stats.fabric_onlines++;
901 * notify online event to base and then virtual ports
903 bfa_fcs_lport_online(&fabric->bport);
905 list_for_each_safe(qe, qen, &fabric->vport_q) {
906 vport = (struct bfa_fcs_vport_s *) qe;
907 bfa_fcs_vport_online(vport);
912 bfa_fcs_fabric_notify_offline(struct bfa_fcs_fabric_s *fabric)
914 struct bfa_fcs_vport_s *vport;
915 struct list_head *qe, *qen;
917 bfa_trc(fabric->fcs, fabric->fabric_name);
918 fabric->stats.fabric_offlines++;
921 * notify offline event first to vports and then base port.
923 list_for_each_safe(qe, qen, &fabric->vport_q) {
924 vport = (struct bfa_fcs_vport_s *) qe;
925 bfa_fcs_vport_offline(vport);
928 bfa_fcs_lport_offline(&fabric->bport);
930 fabric->fabric_name = 0;
931 fabric->fabric_ip_addr[0] = 0;
935 bfa_fcs_fabric_delay(void *cbarg)
937 struct bfa_fcs_fabric_s *fabric = cbarg;
939 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELAYED);
943 * Delete all vports and wait for vport delete completions.
946 bfa_fcs_fabric_delete(struct bfa_fcs_fabric_s *fabric)
948 struct bfa_fcs_vport_s *vport;
949 struct list_head *qe, *qen;
951 list_for_each_safe(qe, qen, &fabric->vport_q) {
952 vport = (struct bfa_fcs_vport_s *) qe;
953 bfa_fcs_vport_fcs_delete(vport);
956 bfa_fcs_lport_delete(&fabric->bport);
957 bfa_wc_wait(&fabric->wc);
961 bfa_fcs_fabric_delete_comp(void *cbarg)
963 struct bfa_fcs_fabric_s *fabric = cbarg;
965 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELCOMP);
969 * fcs_fabric_public fabric public functions
973 * Attach time initialization.
976 bfa_fcs_fabric_attach(struct bfa_fcs_s *fcs)
978 struct bfa_fcs_fabric_s *fabric;
980 fabric = &fcs->fabric;
981 memset(fabric, 0, sizeof(struct bfa_fcs_fabric_s));
984 * Initialize base fabric.
987 INIT_LIST_HEAD(&fabric->vport_q);
988 INIT_LIST_HEAD(&fabric->vf_q);
989 fabric->lps = bfa_lps_alloc(fcs->bfa);
990 bfa_assert(fabric->lps);
993 * Initialize fabric delete completion handler. Fabric deletion is
994 * complete when the last vport delete is complete.
996 bfa_wc_init(&fabric->wc, bfa_fcs_fabric_delete_comp, fabric);
997 bfa_wc_up(&fabric->wc); /* For the base port */
999 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit);
1000 bfa_fcs_lport_attach(&fabric->bport, fabric->fcs, FC_VF_ID_NULL, NULL);
1004 bfa_fcs_fabric_modinit(struct bfa_fcs_s *fcs)
1006 bfa_sm_send_event(&fcs->fabric, BFA_FCS_FABRIC_SM_CREATE);
1014 bfa_fcs_fabric_modexit(struct bfa_fcs_s *fcs)
1016 struct bfa_fcs_fabric_s *fabric;
1021 * Cleanup base fabric.
1023 fabric = &fcs->fabric;
1024 bfa_lps_delete(fabric->lps);
1025 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELETE);
1029 * Fabric module start -- kick starts FCS actions
1032 bfa_fcs_fabric_modstart(struct bfa_fcs_s *fcs)
1034 struct bfa_fcs_fabric_s *fabric;
1037 fabric = &fcs->fabric;
1038 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_START);
1042 * Suspend fabric activity as part of driver suspend.
1045 bfa_fcs_fabric_modsusp(struct bfa_fcs_s *fcs)
1050 bfa_fcs_fabric_is_loopback(struct bfa_fcs_fabric_s *fabric)
1052 return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_loopback);
1056 bfa_fcs_fabric_is_auth_failed(struct bfa_fcs_fabric_s *fabric)
1058 return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_auth_failed);
1062 bfa_fcs_fabric_port_type(struct bfa_fcs_fabric_s *fabric)
1064 return fabric->oper_type;
1068 * Link up notification from BFA physical port module.
1071 bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric)
1073 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
1074 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_UP);
1078 * Link down notification from BFA physical port module.
1081 bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric)
1083 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn);
1084 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_DOWN);
1088 * A child vport is being created in the fabric.
1090 * Call from vport module at vport creation. A list of base port and vports
1091 * belonging to a fabric is maintained to propagate link events.
1093 * param[in] fabric - Fabric instance. This can be a base fabric or vf.
1094 * param[in] vport - Vport being created.
1096 * @return None (always succeeds)
1099 bfa_fcs_fabric_addvport(struct bfa_fcs_fabric_s *fabric,
1100 struct bfa_fcs_vport_s *vport)
1103 * - add vport to fabric's vport_q
1105 bfa_trc(fabric->fcs, fabric->vf_id);
1107 list_add_tail(&vport->qe, &fabric->vport_q);
1108 fabric->num_vports++;
1109 bfa_wc_up(&fabric->wc);
1113 * A child vport is being deleted from fabric.
1115 * Vport is being deleted.
1118 bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric,
1119 struct bfa_fcs_vport_s *vport)
1121 list_del(&vport->qe);
1122 fabric->num_vports--;
1123 bfa_wc_down(&fabric->wc);
1127 * Base port is deleted.
1130 bfa_fcs_fabric_port_delete_comp(struct bfa_fcs_fabric_s *fabric)
1132 bfa_wc_down(&fabric->wc);
1137 * Check if fabric is online.
1139 * param[in] fabric - Fabric instance. This can be a base fabric or vf.
1141 * @return TRUE/FALSE
1144 bfa_fcs_fabric_is_online(struct bfa_fcs_fabric_s *fabric)
1146 return bfa_sm_cmp_state(fabric, bfa_fcs_fabric_sm_online);
1154 bfa_fcs_fabric_addvf(struct bfa_fcs_fabric_s *vf, struct bfa_fcs_s *fcs,
1155 struct bfa_lport_cfg_s *port_cfg, struct bfad_vf_s *vf_drv)
1157 bfa_sm_set_state(vf, bfa_fcs_fabric_sm_uninit);
1158 return BFA_STATUS_OK;
1162 * Lookup for a vport withing a fabric given its pwwn
1164 struct bfa_fcs_vport_s *
1165 bfa_fcs_fabric_vport_lookup(struct bfa_fcs_fabric_s *fabric, wwn_t pwwn)
1167 struct bfa_fcs_vport_s *vport;
1168 struct list_head *qe;
1170 list_for_each(qe, &fabric->vport_q) {
1171 vport = (struct bfa_fcs_vport_s *) qe;
1172 if (bfa_fcs_lport_get_pwwn(&vport->lport) == pwwn)
1180 * In a given fabric, return the number of lports.
1182 * param[in] fabric - Fabric instance. This can be a base fabric or vf.
1184 * @return : 1 or more.
1187 bfa_fcs_fabric_vport_count(struct bfa_fcs_fabric_s *fabric)
1189 return fabric->num_vports;
1193 * Get OUI of the attached switch.
1195 * Note : Use of this function should be avoided as much as possible.
1196 * This function should be used only if there is any requirement
1197 * to check for FOS version below 6.3.
1198 * To check if the attached fabric is a brocade fabric, use
1199 * bfa_lps_is_brcd_fabric() which works for FOS versions 6.3
1204 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric)
1210 fab_nwwn = bfa_lps_get_peer_nwwn(fabric->lps);
1212 tmp = (u8 *)&fab_nwwn;
1213 oui = (tmp[3] << 8) | tmp[4];
1218 * Unsolicited frame receive handling.
1221 bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
1224 u32 pid = fchs->d_id;
1225 struct bfa_fcs_vport_s *vport;
1226 struct list_head *qe;
1227 struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1);
1228 struct fc_logi_s *flogi = (struct fc_logi_s *) els_cmd;
1230 bfa_trc(fabric->fcs, len);
1231 bfa_trc(fabric->fcs, pid);
1234 * Look for our own FLOGI frames being looped back. This means an
1235 * external loopback cable is in place. Our own FLOGI frames are
1236 * sometimes looped back when switch port gets temporarily bypassed.
1238 if ((pid == bfa_os_ntoh3b(FC_FABRIC_PORT)) &&
1239 (els_cmd->els_code == FC_ELS_FLOGI) &&
1240 (flogi->port_name == bfa_fcs_lport_get_pwwn(&fabric->bport))) {
1241 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LOOPBACK);
1246 * FLOGI/EVFP exchanges should be consumed by base fabric.
1248 if (fchs->d_id == bfa_os_hton3b(FC_FABRIC_PORT)) {
1249 bfa_trc(fabric->fcs, pid);
1250 bfa_fcs_fabric_process_uf(fabric, fchs, len);
1254 if (fabric->bport.pid == pid) {
1256 * All authentication frames should be routed to auth
1258 bfa_trc(fabric->fcs, els_cmd->els_code);
1259 if (els_cmd->els_code == FC_ELS_AUTH) {
1260 bfa_trc(fabric->fcs, els_cmd->els_code);
1264 bfa_trc(fabric->fcs, *(u8 *) ((u8 *) fchs));
1265 bfa_fcs_lport_uf_recv(&fabric->bport, fchs, len);
1270 * look for a matching local port ID
1272 list_for_each(qe, &fabric->vport_q) {
1273 vport = (struct bfa_fcs_vport_s *) qe;
1274 if (vport->lport.pid == pid) {
1275 bfa_fcs_lport_uf_recv(&vport->lport, fchs, len);
1279 bfa_trc(fabric->fcs, els_cmd->els_code);
1280 bfa_fcs_lport_uf_recv(&fabric->bport, fchs, len);
1284 * Unsolicited frames to be processed by fabric.
1287 bfa_fcs_fabric_process_uf(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs,
1290 struct fc_els_cmd_s *els_cmd = (struct fc_els_cmd_s *) (fchs + 1);
1292 bfa_trc(fabric->fcs, els_cmd->els_code);
1294 switch (els_cmd->els_code) {
1296 bfa_fcs_fabric_process_flogi(fabric, fchs, len);
1301 * need to generate a LS_RJT
1308 * Process incoming FLOGI
1311 bfa_fcs_fabric_process_flogi(struct bfa_fcs_fabric_s *fabric,
1312 struct fchs_s *fchs, u16 len)
1314 struct fc_logi_s *flogi = (struct fc_logi_s *) (fchs + 1);
1315 struct bfa_fcs_lport_s *bport = &fabric->bport;
1317 bfa_trc(fabric->fcs, fchs->s_id);
1319 fabric->stats.flogi_rcvd++;
1321 * Check port type. It should be 0 = n-port.
1323 if (flogi->csp.port_type) {
1325 * @todo: may need to send a LS_RJT
1327 bfa_trc(fabric->fcs, flogi->port_name);
1328 fabric->stats.flogi_rejected++;
1332 fabric->bb_credit = be16_to_cpu(flogi->csp.bbcred);
1333 bport->port_topo.pn2n.rem_port_wwn = flogi->port_name;
1334 bport->port_topo.pn2n.reply_oxid = fchs->ox_id;
1339 bfa_fcs_fabric_send_flogi_acc(fabric);
1340 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC);
1344 bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric)
1346 struct bfa_lport_cfg_s *pcfg = &fabric->bport.port_cfg;
1347 struct bfa_fcs_lport_n2n_s *n2n_port = &fabric->bport.port_topo.pn2n;
1348 struct bfa_s *bfa = fabric->fcs->bfa;
1349 struct bfa_fcxp_s *fcxp;
1353 fcxp = bfa_fcs_fcxp_alloc(fabric->fcs);
1355 * Do not expect this failure -- expect remote node to retry
1360 reqlen = fc_flogi_acc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp),
1361 bfa_os_hton3b(FC_FABRIC_PORT),
1362 n2n_port->reply_oxid, pcfg->pwwn,
1364 bfa_fcport_get_maxfrsize(bfa),
1365 bfa_fcport_get_rx_bbcredit(bfa));
1367 bfa_fcxp_send(fcxp, NULL, fabric->vf_id, bfa_lps_get_tag(fabric->lps),
1368 BFA_FALSE, FC_CLASS_3,
1369 reqlen, &fchs, bfa_fcs_fabric_flogiacc_comp, fabric,
1374 * Flogi Acc completion callback.
1377 bfa_fcs_fabric_flogiacc_comp(void *fcsarg, struct bfa_fcxp_s *fcxp, void *cbarg,
1378 bfa_status_t status, u32 rsp_len,
1379 u32 resid_len, struct fchs_s *rspfchs)
1381 struct bfa_fcs_fabric_s *fabric = cbarg;
1383 bfa_trc(fabric->fcs, status);
1388 * @param[in] fabric - fabric
1389 * @param[in] wwn_t - new fabric name
1394 bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric,
1397 struct bfad_s *bfad = (struct bfad_s *)fabric->fcs->bfad;
1398 char pwwn_ptr[BFA_STRING_32];
1399 char fwwn_ptr[BFA_STRING_32];
1401 bfa_trc(fabric->fcs, fabric_name);
1403 if (fabric->fabric_name == 0) {
1405 * With BRCD switches, we don't get Fabric Name in FLOGI.
1406 * Don't generate a fabric name change event in this case.
1408 fabric->fabric_name = fabric_name;
1410 fabric->fabric_name = fabric_name;
1411 wwn2str(pwwn_ptr, bfa_fcs_lport_get_pwwn(&fabric->bport));
1413 bfa_fcs_lport_get_fabric_name(&fabric->bport));
1414 BFA_LOG(KERN_WARNING, bfad, bfa_log_level,
1415 "Base port WWN = %s Fabric WWN = %s\n",
1416 pwwn_ptr, fwwn_ptr);
1421 * Returns FCS vf structure for a given vf_id.
1423 * param[in] vf_id - VF_ID
1426 * If lookup succeeds, retuns fcs vf object, otherwise returns NULL
1429 bfa_fcs_vf_lookup(struct bfa_fcs_s *fcs, u16 vf_id)
1431 bfa_trc(fcs, vf_id);
1432 if (vf_id == FC_VF_ID_NULL)
1433 return &fcs->fabric;
1439 * BFA FCS PPORT ( physical port)
1442 bfa_fcs_port_event_handler(void *cbarg, enum bfa_port_linkstate event)
1444 struct bfa_fcs_s *fcs = cbarg;
1446 bfa_trc(fcs, event);
1449 case BFA_PORT_LINKUP:
1450 bfa_fcs_fabric_link_up(&fcs->fabric);
1453 case BFA_PORT_LINKDOWN:
1454 bfa_fcs_fabric_link_down(&fcs->fabric);
1463 bfa_fcs_port_attach(struct bfa_fcs_s *fcs)
1465 bfa_fcport_event_register(fcs->bfa, bfa_fcs_port_event_handler, fcs);
1469 * BFA FCS UF ( Unsolicited Frames)
1473 * BFA callback for unsolicited frame receive handler.
1475 * @param[in] cbarg callback arg for receive handler
1476 * @param[in] uf unsolicited frame descriptor
1481 bfa_fcs_uf_recv(void *cbarg, struct bfa_uf_s *uf)
1483 struct bfa_fcs_s *fcs = (struct bfa_fcs_s *) cbarg;
1484 struct fchs_s *fchs = bfa_uf_get_frmbuf(uf);
1485 u16 len = bfa_uf_get_frmlen(uf);
1486 struct fc_vft_s *vft;
1487 struct bfa_fcs_fabric_s *fabric;
1490 * check for VFT header
1492 if (fchs->routing == FC_RTG_EXT_HDR &&
1493 fchs->cat_info == FC_CAT_VFT_HDR) {
1494 bfa_stats(fcs, uf.tagged);
1495 vft = bfa_uf_get_frmbuf(uf);
1496 if (fcs->port_vfid == vft->vf_id)
1497 fabric = &fcs->fabric;
1499 fabric = bfa_fcs_vf_lookup(fcs, (u16) vft->vf_id);
1502 * drop frame if vfid is unknown
1506 bfa_stats(fcs, uf.vfid_unknown);
1514 fchs = (struct fchs_s *) (vft + 1);
1515 len -= sizeof(struct fc_vft_s);
1517 bfa_trc(fcs, vft->vf_id);
1519 bfa_stats(fcs, uf.untagged);
1520 fabric = &fcs->fabric;
1523 bfa_trc(fcs, ((u32 *) fchs)[0]);
1524 bfa_trc(fcs, ((u32 *) fchs)[1]);
1525 bfa_trc(fcs, ((u32 *) fchs)[2]);
1526 bfa_trc(fcs, ((u32 *) fchs)[3]);
1527 bfa_trc(fcs, ((u32 *) fchs)[4]);
1528 bfa_trc(fcs, ((u32 *) fchs)[5]);
1531 bfa_fcs_fabric_uf_recv(fabric, fchs, len);
1536 bfa_fcs_uf_attach(struct bfa_fcs_s *fcs)
1538 bfa_uf_recv_register(fcs->bfa, bfa_fcs_uf_recv, fcs);