Lines Matching refs:lport

551 		fcoe_check_wait_queue(port->lport, skb);  in fcoe_port_send()
553 fcoe_check_wait_queue(port->lport, skb); in fcoe_port_send()
590 static void fcoe_update_src_mac(struct fc_lport *lport, u8 *addr) in fcoe_update_src_mac() argument
592 struct fcoe_port *port = lport_priv(lport); in fcoe_update_src_mac()
606 static u8 *fcoe_get_src_mac(struct fc_lport *lport) in fcoe_get_src_mac() argument
608 struct fcoe_port *port = lport_priv(lport); in fcoe_get_src_mac()
619 static int fcoe_lport_config(struct fc_lport *lport) in fcoe_lport_config() argument
621 lport->link_up = 0; in fcoe_lport_config()
622 lport->qfull = 0; in fcoe_lport_config()
623 lport->max_retry_count = 3; in fcoe_lport_config()
624 lport->max_rport_retry_count = 3; in fcoe_lport_config()
625 lport->e_d_tov = fcoe_e_d_tov; in fcoe_lport_config()
626 lport->r_a_tov = fcoe_r_a_tov; in fcoe_lport_config()
627 lport->service_params = (FCP_SPPF_INIT_FCN | FCP_SPPF_RD_XRDY_DIS | in fcoe_lport_config()
629 lport->does_npiv = 1; in fcoe_lport_config()
631 fc_lport_init_stats(lport); in fcoe_lport_config()
634 fc_lport_config(lport); in fcoe_lport_config()
637 lport->crc_offload = 0; in fcoe_lport_config()
638 lport->seq_offload = 0; in fcoe_lport_config()
639 lport->lro_enabled = 0; in fcoe_lport_config()
640 lport->lro_xid = 0; in fcoe_lport_config()
641 lport->lso_max = 0; in fcoe_lport_config()
650 static void fcoe_netdev_features_change(struct fc_lport *lport, in fcoe_netdev_features_change() argument
653 mutex_lock(&lport->lp_mutex); in fcoe_netdev_features_change()
656 lport->sg_supp = 1; in fcoe_netdev_features_change()
658 lport->sg_supp = 0; in fcoe_netdev_features_change()
661 lport->crc_offload = 1; in fcoe_netdev_features_change()
664 lport->crc_offload = 0; in fcoe_netdev_features_change()
668 lport->seq_offload = 1; in fcoe_netdev_features_change()
669 lport->lso_max = netdev->gso_max_size; in fcoe_netdev_features_change()
671 lport->lso_max); in fcoe_netdev_features_change()
673 lport->seq_offload = 0; in fcoe_netdev_features_change()
674 lport->lso_max = 0; in fcoe_netdev_features_change()
678 lport->lro_enabled = 1; in fcoe_netdev_features_change()
679 lport->lro_xid = netdev->fcoe_ddp_xid; in fcoe_netdev_features_change()
681 lport->lro_xid); in fcoe_netdev_features_change()
683 lport->lro_enabled = 0; in fcoe_netdev_features_change()
684 lport->lro_xid = 0; in fcoe_netdev_features_change()
687 mutex_unlock(&lport->lp_mutex); in fcoe_netdev_features_change()
699 static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev) in fcoe_netdev_config() argument
708 port = lport_priv(lport); in fcoe_netdev_config()
714 lport->vlan = vlan_dev_vlan_id(netdev); in fcoe_netdev_config()
716 lport->vlan = 0; in fcoe_netdev_config()
729 if (fc_set_mfs(lport, mfs)) in fcoe_netdev_config()
733 fcoe_netdev_features_change(lport, netdev); in fcoe_netdev_config()
739 fcoe_link_speed_update(lport); in fcoe_netdev_config()
741 if (!lport->vport) { in fcoe_netdev_config()
744 fc_set_wwnn(lport, wwnn); in fcoe_netdev_config()
748 fc_set_wwpn(lport, wwpn); in fcoe_netdev_config()
763 static int fcoe_shost_config(struct fc_lport *lport, struct device *dev) in fcoe_shost_config() argument
768 lport->host->max_lun = FCOE_MAX_LUN; in fcoe_shost_config()
769 lport->host->max_id = FCOE_MAX_FCP_TARGET; in fcoe_shost_config()
770 lport->host->max_channel = 0; in fcoe_shost_config()
771 lport->host->max_cmd_len = FCOE_MAX_CMD_LEN; in fcoe_shost_config()
773 if (lport->vport) in fcoe_shost_config()
774 lport->host->transportt = fcoe_vport_scsi_transport; in fcoe_shost_config()
776 lport->host->transportt = fcoe_nport_scsi_transport; in fcoe_shost_config()
779 rc = scsi_add_host(lport->host, dev); in fcoe_shost_config()
781 FCOE_NETDEV_DBG(fcoe_netdev(lport), "fcoe_shost_config: " in fcoe_shost_config()
786 if (!lport->vport) in fcoe_shost_config()
787 fc_host_max_npiv_vports(lport->host) = USHRT_MAX; in fcoe_shost_config()
789 snprintf(fc_host_symbolic_name(lport->host), FC_SYMBOLIC_NAME_SIZE, in fcoe_shost_config()
791 fcoe_netdev(lport)->name); in fcoe_shost_config()
805 static void fcoe_fdmi_info(struct fc_lport *lport, struct net_device *netdev) in fcoe_fdmi_info() argument
812 port = lport_priv(lport); in fcoe_fdmi_info()
817 if (lport->vport) in fcoe_fdmi_info()
834 snprintf(fc_host_serial_number(lport->host), in fcoe_fdmi_info()
838 snprintf(fc_host_manufacturer(lport->host), in fcoe_fdmi_info()
842 snprintf(fc_host_model(lport->host), in fcoe_fdmi_info()
846 snprintf(fc_host_model_description(lport->host), in fcoe_fdmi_info()
850 snprintf(fc_host_hardware_version(lport->host), in fcoe_fdmi_info()
854 snprintf(fc_host_driver_version(lport->host), in fcoe_fdmi_info()
858 snprintf(fc_host_optionrom_version(lport->host), in fcoe_fdmi_info()
862 snprintf(fc_host_firmware_version(lport->host), in fcoe_fdmi_info()
868 lport->fdmi_enabled = 1; in fcoe_fdmi_info()
871 lport->fdmi_enabled = 0; in fcoe_fdmi_info()
919 static inline int fcoe_em_config(struct fc_lport *lport) in fcoe_em_config() argument
921 struct fcoe_port *port = lport_priv(lport); in fcoe_em_config()
932 if (!lport->lro_enabled || !lport->lro_xid || in fcoe_em_config()
933 (lport->lro_xid >= max_xid)) { in fcoe_em_config()
934 lport->lro_xid = 0; in fcoe_em_config()
960 if (!fc_exch_mgr_add(lport, fcoe->oem, fcoe_oem_match)) { in fcoe_em_config()
967 fcoe->oem = fc_exch_mgr_alloc(lport, FC_CLASS_3, in fcoe_em_config()
968 FCOE_MIN_XID, lport->lro_xid, in fcoe_em_config()
981 min_xid += lport->lro_xid + 1; in fcoe_em_config()
984 if (!fc_exch_mgr_alloc(lport, FC_CLASS_3, min_xid, max_xid, NULL)) { in fcoe_em_config()
1000 static void fcoe_if_destroy(struct fc_lport *lport) in fcoe_if_destroy() argument
1002 struct fcoe_port *port = lport_priv(lport); in fcoe_if_destroy()
1009 fc_fabric_logoff(lport); in fcoe_if_destroy()
1012 fc_lport_destroy(lport); in fcoe_if_destroy()
1018 fcoe_clean_pending_queue(lport); in fcoe_if_destroy()
1022 if (lport->vport) in fcoe_if_destroy()
1028 fcoe_percpu_clean(lport); in fcoe_if_destroy()
1031 fc_remove_host(lport->host); in fcoe_if_destroy()
1032 scsi_remove_host(lport->host); in fcoe_if_destroy()
1035 fc_fcp_destroy(lport); in fcoe_if_destroy()
1038 fc_exch_mgr_free(lport); in fcoe_if_destroy()
1041 fc_lport_free_stats(lport); in fcoe_if_destroy()
1047 if (lport->vport) in fcoe_if_destroy()
1048 scsi_host_put(lport->host); in fcoe_if_destroy()
1060 static int fcoe_ddp_setup(struct fc_lport *lport, u16 xid, in fcoe_ddp_setup() argument
1063 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_setup()
1082 static int fcoe_ddp_target(struct fc_lport *lport, u16 xid, in fcoe_ddp_target() argument
1085 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_target()
1102 static int fcoe_ddp_done(struct fc_lport *lport, u16 xid) in fcoe_ddp_done() argument
1104 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_done()
1126 struct fc_lport *lport, *n_port; in fcoe_if_create() local
1139 lport = libfc_host_alloc(&fcoe_shost_template, sizeof(*port)); in fcoe_if_create()
1141 lport = libfc_vport_create(vport, sizeof(*port)); in fcoe_if_create()
1143 if (!lport) { in fcoe_if_create()
1148 port = lport_priv(lport); in fcoe_if_create()
1149 port->lport = lport; in fcoe_if_create()
1160 fcoe_hostlist_add(lport); in fcoe_if_create()
1163 rc = fcoe_lport_config(lport); in fcoe_if_create()
1174 fc_set_wwnn(lport, vport->node_name); in fcoe_if_create()
1175 fc_set_wwpn(lport, vport->port_name); in fcoe_if_create()
1179 rc = fcoe_netdev_config(lport, netdev); in fcoe_if_create()
1187 rc = fcoe_shost_config(lport, parent); in fcoe_if_create()
1195 rc = fcoe_libfc_config(lport, ctlr, &fcoe_libfc_fcn_templ, 1); in fcoe_if_create()
1203 fcoe_fdmi_info(lport, netdev); in fcoe_if_create()
1216 rc = fcoe_em_config(lport); in fcoe_if_create()
1220 rc = fc_exch_mgr_list_clone(n_port, lport); in fcoe_if_create()
1228 return lport; in fcoe_if_create()
1231 fc_exch_mgr_free(lport); in fcoe_if_create()
1233 fcoe_hostlist_del(lport); in fcoe_if_create()
1234 scsi_host_put(lport->host); in fcoe_if_create()
1336 struct fc_lport *lport; in fcoe_rcv() local
1347 lport = ctlr->lp; in fcoe_rcv()
1348 if (unlikely(!lport)) { in fcoe_rcv()
1352 if (!lport->link_up) in fcoe_rcv()
1394 fr->fr_dev = lport; in fcoe_rcv()
1436 per_cpu_ptr(lport->stats, get_cpu())->ErrorFrames++; in fcoe_rcv()
1469 static int fcoe_xmit(struct fc_lport *lport, struct fc_frame *fp) in fcoe_xmit() argument
1481 struct fcoe_port *port = lport_priv(lport); in fcoe_xmit()
1493 if (!lport->link_up) { in fcoe_xmit()
1499 fcoe_ctlr_els_send(ctlr, lport, skb)) in fcoe_xmit()
1511 if (likely(lport->crc_offload)) { in fcoe_xmit()
1579 if (lport->seq_offload && fr_max_payload(fp)) { in fcoe_xmit()
1587 stats = per_cpu_ptr(lport->stats, get_cpu()); in fcoe_xmit()
1593 fr_dev(fp) = lport; in fcoe_xmit()
1605 static inline int fcoe_filter_frames(struct fc_lport *lport, in fcoe_filter_frames() argument
1619 if (lport->crc_offload && skb->ip_summed == CHECKSUM_UNNECESSARY) in fcoe_filter_frames()
1628 fcoe = ((struct fcoe_port *)lport_priv(lport))->priv; in fcoe_filter_frames()
1642 stats = per_cpu_ptr(lport->stats, get_cpu()); in fcoe_filter_frames()
1657 struct fc_lport *lport; in fcoe_recv_frame() local
1665 lport = fr->fr_dev; in fcoe_recv_frame()
1666 if (unlikely(!lport)) { in fcoe_recv_frame()
1687 stats = per_cpu_ptr(lport->stats, get_cpu()); in fcoe_recv_frame()
1707 fr_dev(fp) = lport; in fcoe_recv_frame()
1718 if (!fcoe_filter_frames(lport, fp)) { in fcoe_recv_frame()
1720 fc_exch_recv(lport, fp); in fcoe_recv_frame()
1845 struct fc_lport *lport = NULL; in fcoe_device_notification() local
1857 lport = ctlr->lp; in fcoe_device_notification()
1861 if (!lport) { in fcoe_device_notification()
1880 fc_set_mfs(lport, mfs); in fcoe_device_notification()
1886 fcoe_vport_remove(lport); in fcoe_device_notification()
1888 fcoe_if_destroy(lport); in fcoe_device_notification()
1896 fcoe_netdev_features_change(lport, netdev); in fcoe_device_notification()
1903 fcoe_link_speed_update(lport); in fcoe_device_notification()
1907 if (link_possible && !fcoe_link_ok(lport)) { in fcoe_device_notification()
1923 stats = per_cpu_ptr(lport->stats, get_cpu()); in fcoe_device_notification()
1926 fcoe_clean_pending_queue(lport); in fcoe_device_notification()
2013 struct fc_lport *lport = ctlr->lp; in fcoe_ctlr_enabled() local
2014 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ctlr_enabled()
2065 struct fc_lport *lport; in fcoe_destroy() local
2077 lport = ctlr->lp; in fcoe_destroy()
2078 port = lport_priv(lport); in fcoe_destroy()
2100 fcoe_vport_remove(port->lport); in fcoe_destroy_work()
2109 fcoe_if_destroy(port->lport); in fcoe_destroy_work()
2201 struct fc_lport *lport; in _fcoe_create() local
2220 lport = fcoe_if_create(fcoe, &ctlr_dev->dev, 0); in _fcoe_create()
2221 if (IS_ERR(lport)) { in _fcoe_create()
2235 ctlr->lp = lport; in _fcoe_create()
2241 lport->boot_time = jiffies; in _fcoe_create()
2242 fc_fabric_login(lport); in _fcoe_create()
2262 !fcoe_link_ok(lport)) { in _fcoe_create()
2314 static int fcoe_link_ok(struct fc_lport *lport) in fcoe_link_ok() argument
2316 struct net_device *netdev = fcoe_netdev(lport); in fcoe_link_ok()
2333 static void fcoe_percpu_clean(struct fc_lport *lport) in fcoe_percpu_clean() argument
2353 struct fc_lport *lport = shost_priv(shost); in fcoe_reset() local
2354 struct fcoe_port *port = lport_priv(lport); in fcoe_reset()
2416 static int fcoe_hostlist_add(const struct fc_lport *lport) in fcoe_hostlist_add() argument
2421 fcoe = fcoe_hostlist_lookup_port(fcoe_netdev(lport)); in fcoe_hostlist_add()
2423 port = lport_priv(lport); in fcoe_hostlist_add()
2438 static void fcoe_hostlist_del(const struct fc_lport *lport) in fcoe_hostlist_del() argument
2443 port = lport_priv(lport); in fcoe_hostlist_del()
2531 fcoe_hostlist_del(port->lport); in fcoe_exit()
2572 struct fc_lport *lport = exch->lp; in fcoe_flogi_resp() local
2581 fcoe_ctlr_recv_flogi(fip, lport, fp); in fcoe_flogi_resp()
2583 fcoe_update_src_mac(lport, mac); in fcoe_flogi_resp()
2585 fc_lport_flogi_resp(seq, fp, lport); in fcoe_flogi_resp()
2599 struct fc_lport *lport = arg; in fcoe_logo_resp() local
2603 fcoe_update_src_mac(lport, zero_mac); in fcoe_logo_resp()
2604 fc_lport_logo_resp(seq, fp, lport); in fcoe_logo_resp()
2616 static struct fc_seq *fcoe_elsct_send(struct fc_lport *lport, u32 did, in fcoe_elsct_send() argument
2623 struct fcoe_port *port = lport_priv(lport); in fcoe_elsct_send()
2631 if (lport->point_to_multipoint) in fcoe_elsct_send()
2633 return fc_elsct_send(lport, did, fp, op, fcoe_flogi_resp, in fcoe_elsct_send()
2639 return fc_elsct_send(lport, did, fp, op, fcoe_logo_resp, in fcoe_elsct_send()
2640 lport, timeout); in fcoe_elsct_send()
2642 return fc_elsct_send(lport, did, fp, op, resp, arg, timeout); in fcoe_elsct_send()
2723 static void fcoe_vport_remove(struct fc_lport *lport) in fcoe_vport_remove() argument
2731 shost = lport->host; in fcoe_vport_remove()
2757 struct fc_lport *lport = vport->dd_data; in fcoe_vport_disable() local
2761 fc_fabric_logoff(lport); in fcoe_vport_disable()
2763 lport->boot_time = jiffies; in fcoe_vport_disable()
2764 fc_fabric_login(lport); in fcoe_vport_disable()
2765 fc_vport_setlink(lport); in fcoe_vport_disable()
2781 struct fc_lport *lport = vport->dd_data; in fcoe_set_vport_symbolic_name() local
2785 snprintf(fc_host_symbolic_name(lport->host), FC_SYMBOLIC_NAME_SIZE, in fcoe_set_vport_symbolic_name()
2787 fcoe_netdev(lport)->name, vport->symbolic_name); in fcoe_set_vport_symbolic_name()
2789 if (lport->state != LPORT_ST_READY) in fcoe_set_vport_symbolic_name()
2792 len = strnlen(fc_host_symbolic_name(lport->host), 255); in fcoe_set_vport_symbolic_name()
2793 fp = fc_frame_alloc(lport, in fcoe_set_vport_symbolic_name()
2798 lport->tt.elsct_send(lport, FC_FID_DIR_SERV, fp, FC_NS_RSPN_ID, in fcoe_set_vport_symbolic_name()
2799 NULL, NULL, 3 * lport->r_a_tov); in fcoe_set_vport_symbolic_name()
2824 static void fcoe_set_port_id(struct fc_lport *lport, in fcoe_set_port_id() argument
2827 struct fcoe_port *port = lport_priv(lport); in fcoe_set_port_id()
2832 fcoe_ctlr_recv_flogi(ctlr, lport, fp); in fcoe_set_port_id()