Lines Matching refs:fcf
133 * @fcf: The FCF to check
137 static inline int fcoe_ctlr_mtu_valid(const struct fcoe_fcf *fcf)
139 return (fcf->flags & FIP_FL_SOL) != 0;
144 * @fcf: The FCF to check
148 static inline int fcoe_ctlr_fcf_usable(struct fcoe_fcf *fcf)
152 return (fcf->flags & flags) == flags;
195 struct fcoe_fcf *fcf;
199 list_for_each_entry_safe(fcf, next, &fip->fcfs, list) {
200 list_del(&fcf->list);
201 kfree(fcf);
254 * @fcf: The destination FCF (if NULL, a multicast solicitation is sent)
256 static void fcoe_ctlr_solicit(struct fcoe_ctlr *fip, struct fcoe_fcf *fcf)
277 memcpy(sol->eth.h_dest, fcf ? fcf->fcf_mac : fcoe_all_fcfs, ETH_ALEN);
308 if (!fcf)
418 struct fcoe_fcf *fcf;
420 fcf = fip->sel_fcf;
422 if (!fcf || (ports && !lp->port_id))
432 memcpy(kal->eth.h_dest, fcf->fcf_mac, ETH_ALEN);
488 struct fcoe_fcf *fcf;
504 fcf = fip->sel_fcf;
505 if (!fcf)
507 fip_flags = fcf->flags;
512 memcpy(cap->eth.h_dest, fcf->fcf_mac, ETH_ALEN);
682 struct fcoe_fcf *fcf;
691 list_for_each_entry_safe(fcf, next, &fip->fcfs, list) {
692 deadline = fcf->time + fcf->fka_period + fcf->fka_period / 2;
693 if (fip->sel_fcf == fcf) {
699 fip->lp->host->host_no, fcf->fabric_name,
705 deadline += fcf->fka_period;
707 if (fip->sel_fcf == fcf)
709 list_del(&fcf->list);
712 kfree(fcf);
717 if (fcoe_ctlr_mtu_valid(fcf) &&
718 (!sel_time || time_before(sel_time, fcf->time)))
719 sel_time = fcf->time;
735 * @fcf: The resulting FCF entry
741 struct sk_buff *skb, struct fcoe_fcf *fcf)
753 memset(fcf, 0, sizeof(*fcf));
754 fcf->fka_period = msecs_to_jiffies(FCOE_CTLR_DEF_FKA);
757 fcf->flags = ntohs(fiph->fip_flags);
785 fcf->pri = ((struct fip_pri_desc *)desc)->fd_pri;
791 memcpy(fcf->fcf_mac,
794 if (!is_valid_ether_addr(fcf->fcf_mac)) {
797 fcf->fcf_mac);
806 fcf->switch_name = get_unaligned_be64(&wwn->fd_wwn);
813 fcf->fabric_name = get_unaligned_be64(&fab->fd_wwn);
814 fcf->vfid = ntohs(fab->fd_vfid);
815 fcf->fc_map = ntoh24(fab->fd_map);
823 fcf->fd_flags = 1;
826 fcf->fka_period = msecs_to_jiffies(t);
846 if (!fcf->fc_map || (fcf->fc_map & 0x10000))
848 if (!fcf->switch_name)
870 struct fcoe_fcf *fcf;
883 list_for_each_entry(fcf, &fip->fcfs, list) {
884 if (fcf->switch_name == new.switch_name &&
885 fcf->fabric_name == new.fabric_name &&
886 fcf->fc_map == new.fc_map &&
887 compare_ether_addr(fcf->fcf_mac, new.fcf_mac) == 0) {
888 found = fcf;
896 fcf = kmalloc(sizeof(*fcf), GFP_ATOMIC);
897 if (!fcf)
901 memcpy(fcf, &new, sizeof(new));
902 list_add(&fcf->list, &fip->fcfs);
910 fcf->fd_flags = new.fd_flags;
911 if (!fcoe_ctlr_fcf_usable(fcf))
912 fcf->flags = new.flags;
914 if (fcf == fip->sel_fcf && !fcf->fd_flags) {
915 fip->ctlr_ka_time -= fcf->fka_period;
920 fcf->fka_period = new.fka_period;
921 memcpy(fcf->fcf_mac, new.fcf_mac, ETH_ALEN);
923 mtu_valid = fcoe_ctlr_mtu_valid(fcf);
924 fcf->time = jiffies;
928 fcf->fabric_name, fcf->fc_map, mtu_valid);
936 fcoe_ctlr_solicit(fip, fcf);
951 if (mtu_valid && !fip->sel_fcf && fcoe_ctlr_fcf_usable(fcf)) {
1129 struct fcoe_fcf *fcf = fip->sel_fcf;
1137 if (!fcf || !lport->port_id)
1163 if (compare_ether_addr(mp->fd_mac, fcf->fcf_mac))
1171 if (get_unaligned_be64(&wp->fd_wwn) != fcf->switch_name)
1335 struct fcoe_fcf *fcf;
1338 list_for_each_entry(fcf, &fip->fcfs, list) {
1341 fcf->fabric_name, fcf->vfid,
1342 fcf->fc_map, fcoe_ctlr_mtu_valid(fcf));
1343 if (!fcoe_ctlr_fcf_usable(fcf)) {
1346 fcf->fabric_name, fcf->fc_map,
1347 (fcf->flags & FIP_FL_SOL) ? "" : "in",
1348 (fcf->flags & FIP_FL_AVAIL) ?
1353 best = fcf;
1356 if (fcf->fabric_name != best->fabric_name ||
1357 fcf->vfid != best->vfid ||
1358 fcf->fc_map != best->fc_map) {
1363 if (fcf->pri < best->pri)
1364 best = fcf;
1396 struct fcoe_fcf *fcf;
1408 fcf = fip->sel_fcf;
1421 if (sel != fcf) {
1422 fcf = sel; /* the old FCF may have been freed */