Lines Matching refs:fcf
112 static inline int fcoe_ctlr_mtu_valid(const struct fcoe_fcf *fcf) in fcoe_ctlr_mtu_valid() argument
114 return (fcf->flags & FIP_FL_SOL) != 0; in fcoe_ctlr_mtu_valid()
123 static inline int fcoe_ctlr_fcf_usable(struct fcoe_fcf *fcf) in fcoe_ctlr_fcf_usable() argument
127 return (fcf->flags & flags) == flags; in fcoe_ctlr_fcf_usable()
171 struct fcoe_fcf *fcf; in fcoe_ctlr_reset_fcfs() local
175 list_for_each_entry_safe(fcf, next, &fip->fcfs, list) { in fcoe_ctlr_reset_fcfs()
176 list_del(&fcf->list); in fcoe_ctlr_reset_fcfs()
177 kfree(fcf); in fcoe_ctlr_reset_fcfs()
220 struct fcoe_fcf *fcf; in fcoe_ctlr_announce() local
227 list_for_each_entry(fcf, &fip->fcfs, list) in fcoe_ctlr_announce()
228 fcf->flogi_sent = 0; in fcoe_ctlr_announce()
275 static void fcoe_ctlr_solicit(struct fcoe_ctlr *fip, struct fcoe_fcf *fcf) in fcoe_ctlr_solicit() argument
296 memcpy(sol->eth.h_dest, fcf ? fcf->fcf_mac : fcoe_all_fcfs, ETH_ALEN); in fcoe_ctlr_solicit()
328 if (!fcf) in fcoe_ctlr_solicit()
438 struct fcoe_fcf *fcf; in fcoe_ctlr_send_keep_alive() local
440 fcf = fip->sel_fcf; in fcoe_ctlr_send_keep_alive()
442 if (!fcf || (ports && !lp->port_id)) in fcoe_ctlr_send_keep_alive()
452 memcpy(kal->eth.h_dest, fcf->fcf_mac, ETH_ALEN); in fcoe_ctlr_send_keep_alive()
509 struct fcoe_fcf *fcf; in fcoe_ctlr_encaps() local
525 fcf = fip->sel_fcf; in fcoe_ctlr_encaps()
526 if (!fcf) in fcoe_ctlr_encaps()
528 fip_flags = fcf->flags; in fcoe_ctlr_encaps()
533 memcpy(cap->eth.h_dest, fcf->fcf_mac, ETH_ALEN); in fcoe_ctlr_encaps()
715 struct fcoe_fcf *fcf; in fcoe_ctlr_age_fcfs() local
724 list_for_each_entry_safe(fcf, next, &fip->fcfs, list) { in fcoe_ctlr_age_fcfs()
725 deadline = fcf->time + fcf->fka_period + fcf->fka_period / 2; in fcoe_ctlr_age_fcfs()
726 if (fip->sel_fcf == fcf) { in fcoe_ctlr_age_fcfs()
732 fip->lp->host->host_no, fcf->fabric_name, in fcoe_ctlr_age_fcfs()
738 deadline += fcf->fka_period; in fcoe_ctlr_age_fcfs()
740 if (fip->sel_fcf == fcf) in fcoe_ctlr_age_fcfs()
742 list_del(&fcf->list); in fcoe_ctlr_age_fcfs()
745 kfree(fcf); in fcoe_ctlr_age_fcfs()
750 if (fcoe_ctlr_mtu_valid(fcf) && in fcoe_ctlr_age_fcfs()
751 (!sel_time || time_before(sel_time, fcf->time))) in fcoe_ctlr_age_fcfs()
752 sel_time = fcf->time; in fcoe_ctlr_age_fcfs()
774 struct sk_buff *skb, struct fcoe_fcf *fcf) in fcoe_ctlr_parse_adv() argument
786 memset(fcf, 0, sizeof(*fcf)); in fcoe_ctlr_parse_adv()
787 fcf->fka_period = msecs_to_jiffies(FCOE_CTLR_DEF_FKA); in fcoe_ctlr_parse_adv()
790 fcf->flags = ntohs(fiph->fip_flags); in fcoe_ctlr_parse_adv()
818 fcf->pri = ((struct fip_pri_desc *)desc)->fd_pri; in fcoe_ctlr_parse_adv()
824 memcpy(fcf->fcf_mac, in fcoe_ctlr_parse_adv()
827 memcpy(fcf->fcoe_mac, fcf->fcf_mac, ETH_ALEN); in fcoe_ctlr_parse_adv()
828 if (!is_valid_ether_addr(fcf->fcf_mac)) { in fcoe_ctlr_parse_adv()
831 fcf->fcf_mac); in fcoe_ctlr_parse_adv()
840 fcf->switch_name = get_unaligned_be64(&wwn->fd_wwn); in fcoe_ctlr_parse_adv()
847 fcf->fabric_name = get_unaligned_be64(&fab->fd_wwn); in fcoe_ctlr_parse_adv()
848 fcf->vfid = ntohs(fab->fd_vfid); in fcoe_ctlr_parse_adv()
849 fcf->fc_map = ntoh24(fab->fd_map); in fcoe_ctlr_parse_adv()
857 fcf->fd_flags = 1; in fcoe_ctlr_parse_adv()
860 fcf->fka_period = msecs_to_jiffies(t); in fcoe_ctlr_parse_adv()
880 if (!fcf->fc_map || (fcf->fc_map & 0x10000)) in fcoe_ctlr_parse_adv()
882 if (!fcf->switch_name) in fcoe_ctlr_parse_adv()
904 struct fcoe_fcf *fcf; in fcoe_ctlr_recv_adv() local
917 list_for_each_entry(fcf, &fip->fcfs, list) { in fcoe_ctlr_recv_adv()
918 if (fcf->switch_name == new.switch_name && in fcoe_ctlr_recv_adv()
919 fcf->fabric_name == new.fabric_name && in fcoe_ctlr_recv_adv()
920 fcf->fc_map == new.fc_map && in fcoe_ctlr_recv_adv()
921 compare_ether_addr(fcf->fcf_mac, new.fcf_mac) == 0) { in fcoe_ctlr_recv_adv()
922 found = fcf; in fcoe_ctlr_recv_adv()
930 fcf = kmalloc(sizeof(*fcf), GFP_ATOMIC); in fcoe_ctlr_recv_adv()
931 if (!fcf) in fcoe_ctlr_recv_adv()
935 memcpy(fcf, &new, sizeof(new)); in fcoe_ctlr_recv_adv()
936 list_add(&fcf->list, &fip->fcfs); in fcoe_ctlr_recv_adv()
944 fcf->fd_flags = new.fd_flags; in fcoe_ctlr_recv_adv()
945 if (!fcoe_ctlr_fcf_usable(fcf)) in fcoe_ctlr_recv_adv()
946 fcf->flags = new.flags; in fcoe_ctlr_recv_adv()
948 if (fcf == fip->sel_fcf && !fcf->fd_flags) { in fcoe_ctlr_recv_adv()
949 fip->ctlr_ka_time -= fcf->fka_period; in fcoe_ctlr_recv_adv()
954 fcf->fka_period = new.fka_period; in fcoe_ctlr_recv_adv()
955 memcpy(fcf->fcf_mac, new.fcf_mac, ETH_ALEN); in fcoe_ctlr_recv_adv()
957 mtu_valid = fcoe_ctlr_mtu_valid(fcf); in fcoe_ctlr_recv_adv()
958 fcf->time = jiffies; in fcoe_ctlr_recv_adv()
961 fcf->fabric_name, fcf->fcf_mac); in fcoe_ctlr_recv_adv()
968 fcoe_ctlr_solicit(fip, fcf); in fcoe_ctlr_recv_adv()
986 list_move(&fcf->list, &fip->fcfs); in fcoe_ctlr_recv_adv()
992 if (mtu_valid && !fip->sel_fcf && fcoe_ctlr_fcf_usable(fcf)) { in fcoe_ctlr_recv_adv()
1193 struct fcoe_fcf *fcf = fip->sel_fcf; in fcoe_ctlr_recv_clr_vlink() local
1203 if (!fcf || !lport->port_id) in fcoe_ctlr_recv_clr_vlink()
1244 if (compare_ether_addr(mp->fd_mac, fcf->fcf_mac)) in fcoe_ctlr_recv_clr_vlink()
1252 if (get_unaligned_be64(&wp->fd_wwn) != fcf->switch_name) in fcoe_ctlr_recv_clr_vlink()
1451 struct fcoe_fcf *fcf; in fcoe_ctlr_select() local
1457 list_for_each_entry(fcf, &fip->fcfs, list) { in fcoe_ctlr_select()
1461 fcf->fabric_name, fcf->vfid, fcf->fcf_mac, in fcoe_ctlr_select()
1462 fcf->fc_map, fcoe_ctlr_mtu_valid(fcf), in fcoe_ctlr_select()
1463 fcf->flogi_sent, fcf->pri); in fcoe_ctlr_select()
1464 if (fcf->fabric_name != first->fabric_name || in fcoe_ctlr_select()
1465 fcf->vfid != first->vfid || in fcoe_ctlr_select()
1466 fcf->fc_map != first->fc_map) { in fcoe_ctlr_select()
1471 if (fcf->flogi_sent) in fcoe_ctlr_select()
1473 if (!fcoe_ctlr_fcf_usable(fcf)) { in fcoe_ctlr_select()
1476 fcf->fabric_name, fcf->fc_map, in fcoe_ctlr_select()
1477 (fcf->flags & FIP_FL_SOL) ? "" : "in", in fcoe_ctlr_select()
1478 (fcf->flags & FIP_FL_AVAIL) ? in fcoe_ctlr_select()
1482 if (!best || fcf->pri < best->pri || best->flogi_sent) in fcoe_ctlr_select()
1483 best = fcf; in fcoe_ctlr_select()
1546 struct fcoe_fcf *fcf; in fcoe_ctlr_flogi_retry() local
1552 fcf = fcoe_ctlr_select(fip); in fcoe_ctlr_flogi_retry()
1553 if (!fcf || fcf->flogi_sent) { in fcoe_ctlr_flogi_retry()
1577 struct fcoe_fcf *fcf; in fcoe_ctlr_flogi_send() local
1580 fcf = fip->sel_fcf; in fcoe_ctlr_flogi_send()
1581 if (!fcf || !fip->flogi_req_send) in fcoe_ctlr_flogi_send()
1590 if (fcf->flogi_sent) { in fcoe_ctlr_flogi_send()
1592 fcf = fcoe_ctlr_select(fip); in fcoe_ctlr_flogi_send()
1593 if (!fcf || fcf->flogi_sent) { in fcoe_ctlr_flogi_send()
1595 list_for_each_entry(fcf, &fip->fcfs, list) in fcoe_ctlr_flogi_send()
1596 fcf->flogi_sent = 0; in fcoe_ctlr_flogi_send()
1597 fcf = fcoe_ctlr_select(fip); in fcoe_ctlr_flogi_send()
1600 if (fcf) { in fcoe_ctlr_flogi_send()
1636 struct fcoe_fcf *fcf; in fcoe_ctlr_timer_work() local
1648 fcf = fip->sel_fcf; in fcoe_ctlr_timer_work()
1662 else if (!sel && fcf) in fcoe_ctlr_timer_work()