Lines Matching refs:fcoe
38 #include "fcoe.h"
44 /* Performance tuning parameters for fcoe */
66 /* fcoe host list */
285 * @fcoe: The new FCoE interface
286 * @netdev: The net device that the fcoe interface is on
291 static int fcoe_interface_setup(struct fcoe_interface *fcoe,
294 struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe);
300 fcoe->netdev = netdev;
319 fcoe->realdev = real_dev;
353 fcoe->fcoe_packet_type.func = fcoe_rcv;
354 fcoe->fcoe_packet_type.type = htons(ETH_P_FCOE);
355 fcoe->fcoe_packet_type.dev = netdev;
356 dev_add_pack(&fcoe->fcoe_packet_type);
358 fcoe->fip_packet_type.func = fcoe_fip_recv;
359 fcoe->fip_packet_type.type = htons(ETH_P_FIP);
360 fcoe->fip_packet_type.dev = netdev;
361 dev_add_pack(&fcoe->fip_packet_type);
364 fcoe->fip_vlan_packet_type.func = fcoe_fip_vlan_recv;
365 fcoe->fip_vlan_packet_type.type = htons(ETH_P_FIP);
366 fcoe->fip_vlan_packet_type.dev = real_dev;
367 dev_add_pack(&fcoe->fip_vlan_packet_type);
384 struct fcoe_interface *fcoe;
391 fcoe = ERR_PTR(-EBUSY);
400 fcoe = ERR_PTR(-ENOMEM);
406 fcoe = fcoe_ctlr_priv(ctlr);
418 err = fcoe_interface_setup(fcoe, netdev);
423 fcoe = ERR_PTR(err);
432 return fcoe;
437 * @fcoe: The FCoE interface to be cleaned up
441 static void fcoe_interface_remove(struct fcoe_interface *fcoe)
443 struct net_device *netdev = fcoe->netdev;
444 struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe);
454 __dev_remove_pack(&fcoe->fcoe_packet_type);
455 __dev_remove_pack(&fcoe->fip_packet_type);
456 if (netdev != fcoe->realdev)
457 __dev_remove_pack(&fcoe->fip_vlan_packet_type);
477 fcoe->removed = 1;
483 * @fcoe: The FCoE interface to be cleaned up
485 static void fcoe_interface_cleanup(struct fcoe_interface *fcoe)
487 struct net_device *netdev = fcoe->netdev;
488 struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe);
512 struct fcoe_interface *fcoe;
515 fcoe = container_of(ptype, struct fcoe_interface, fip_packet_type);
516 ctlr = fcoe_to_ctlr(fcoe);
535 struct fcoe_interface *fcoe;
538 fcoe = container_of(ptype, struct fcoe_interface, fip_vlan_packet_type);
539 ctlr = fcoe_to_ctlr(fcoe);
564 struct fcoe_interface *fcoe = fcoe_from_ctlr(fip);
576 fcoe->realdev != fcoe->netdev)
577 skb->dev = fcoe->realdev;
579 skb->dev = fcoe->netdev;
594 struct fcoe_interface *fcoe = port->priv;
597 dev_uc_del(fcoe->netdev, port->data_src_addr);
599 dev_uc_add(fcoe->netdev, addr);
704 struct fcoe_interface *fcoe;
708 /* Setup lport private data to point to fcoe softc */
710 fcoe = port->priv;
711 ctlr = fcoe_to_ctlr(fcoe);
808 struct fcoe_interface *fcoe;
814 fcoe = port->priv;
815 realdev = fcoe->realdev;
830 printk(KERN_INFO "fcoe: Failed to retrieve FDMI "
873 printk(KERN_INFO "fcoe: No FDMI support.\n");
923 struct fcoe_interface *fcoe = port->priv;
943 if (is_vlan_dev(fcoe->netdev))
944 cur_real_dev = vlan_dev_real_dev(fcoe->netdev);
946 cur_real_dev = fcoe->netdev;
955 fcoe->oem = oldfcoe->oem;
960 if (fcoe->oem) {
961 if (!fc_exch_mgr_add(lport, fcoe->oem, fcoe_oem_match)) {
964 fcoe->oem, fcoe->netdev->name);
968 fcoe->oem = fc_exch_mgr_alloc(lport, FC_CLASS_3,
971 if (!fcoe->oem) {
974 fcoe->netdev->name);
987 "allocate em on interface %s\n", fcoe->netdev->name);
1004 struct fcoe_interface *fcoe = port->priv;
1005 struct net_device *netdev = fcoe->netdev;
1026 fcoe_interface_remove(fcoe);
1046 * master lport until it fcoe interface fully cleaned-up.
1114 * @fcoe: The FCoE interface to create a local port on
1122 static struct fc_lport *fcoe_if_create(struct fcoe_interface *fcoe,
1125 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);
1126 struct net_device *netdev = fcoe->netdev;
1151 port->priv = fcoe;
1241 * fcoe_if_init() - Initialization routine for fcoe.ko
1265 printk(KERN_ERR "fcoe: Failed to attach to the FC transport\n");
1270 * fcoe_if_exit() - Tear down fcoe.ko
1340 struct fcoe_interface *fcoe;
1346 fcoe = container_of(ptype, struct fcoe_interface, fcoe_packet_type);
1347 ctlr = fcoe_to_ctlr(fcoe);
1482 struct fcoe_interface *fcoe = port->priv;
1483 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);
1542 /* adjust skb network/transport offsets to match mac/fcoe/port */
1548 skb->priority = fcoe->priority;
1550 if (is_vlan_dev(fcoe->netdev) &&
1551 fcoe->realdev->features & NETIF_F_HW_VLAN_CTAG_TX) {
1553 skb->dev = fcoe->realdev;
1555 vlan_dev_vlan_id(fcoe->netdev));
1557 skb->dev = fcoe->netdev;
1559 /* fill up mac and fcoe headers */
1577 /* fcoe lso, mss is in max_payload which is non-zero for FCP data */
1596 * fcoe_filter_frames() - filter out bad fcoe frames, i.e. bad CRC
1606 struct fcoe_interface *fcoe;
1624 fcoe = ((struct fcoe_port *)lport_priv(lport))->priv;
1625 ctlr = fcoe_to_ctlr(fcoe);
1628 FCOE_DBG("fcoe: dropping FCoE lport LOGO in fip mode\n");
1639 printk(KERN_WARNING "fcoe: dropping frame with CRC error\n");
1684 printk(KERN_WARNING "fcoe: FCoE version "
1767 struct fcoe_interface *fcoe;
1770 list_for_each_entry(fcoe, &fcoe_hostlist, list) {
1771 if (is_vlan_dev(fcoe->netdev))
1772 real_dev = vlan_dev_real_dev(fcoe->netdev);
1774 real_dev = fcoe->netdev;
1777 return fcoe;
1787 struct fcoe_interface *fcoe;
1798 fcoe = fcoe_hostlist_lookup_realdev_port(netdev);
1800 if (!fcoe)
1803 ctlr = fcoe_to_ctlr(fcoe);
1818 fcoe->priority = prio;
1840 struct fcoe_interface *fcoe;
1845 list_for_each_entry(fcoe, &fcoe_hostlist, list) {
1846 if (fcoe->netdev == netdev) {
1847 ctlr = fcoe_to_ctlr(fcoe);
1876 list_del(&fcoe->list);
1880 if (!fcoe->removed)
1881 fcoe_interface_remove(fcoe);
1882 fcoe_interface_cleanup(fcoe);
1926 * Called from fcoe transport.
1935 struct fcoe_interface *fcoe;
1941 fcoe = fcoe_hostlist_lookup_port(netdev);
1944 if (fcoe) {
1945 ctlr = fcoe_to_ctlr(fcoe);
1959 * Called from fcoe transport.
1966 struct fcoe_interface *fcoe;
1971 fcoe = fcoe_hostlist_lookup_port(netdev);
1974 if (!fcoe) {
1979 ctlr = fcoe_to_ctlr(fcoe);
2027 struct fcoe_interface *fcoe = fcoe_ctlr_priv(ctlr);
2031 dev_mc_del(fcoe->netdev, FIP_ALL_ENODE_MACS);
2032 dev_mc_add(fcoe->netdev, FIP_ALL_VN2VN_MACS);
2033 dev_mc_add(fcoe->netdev, FIP_ALL_P2P_MACS);
2035 dev_mc_del(fcoe->netdev, FIP_ALL_VN2VN_MACS);
2036 dev_mc_del(fcoe->netdev, FIP_ALL_P2P_MACS);
2037 dev_mc_add(fcoe->netdev, FIP_ALL_ENODE_MACS);
2046 * Called from fcoe transport
2053 struct fcoe_interface *fcoe;
2060 fcoe = fcoe_hostlist_lookup_port(netdev);
2061 if (!fcoe) {
2065 ctlr = fcoe_to_ctlr(fcoe);
2068 list_del(&fcoe->list);
2085 struct fcoe_interface *fcoe;
2093 fcoe = port->priv;
2094 ctlr = fcoe_to_ctlr(fcoe);
2099 if (!fcoe->removed)
2100 fcoe_interface_remove(fcoe);
2102 fcoe_interface_cleanup(fcoe);
2113 * Called from fcoe transport.
2125 * @fcoe: The new FCoE interface
2127 static void fcoe_dcb_create(struct fcoe_interface *fcoe)
2131 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);
2135 struct net_device *netdev = fcoe->realdev;
2161 fcoe->priority = fcoe_prio;
2171 * _fcoe_create() - (internal) Create a fcoe interface
2189 struct fcoe_interface *fcoe;
2201 fcoe = fcoe_interface_create(netdev, fip_mode);
2202 if (IS_ERR(fcoe)) {
2203 rc = PTR_ERR(fcoe);
2207 ctlr = fcoe_to_ctlr(fcoe);
2209 lport = fcoe_if_create(fcoe, &ctlr_dev->dev, 0);
2211 printk(KERN_ERR "fcoe: Failed to create interface (%s)\n",
2214 if (!fcoe->removed)
2215 fcoe_interface_remove(fcoe);
2217 fcoe_interface_cleanup(fcoe);
2227 fcoe_dcb_create(fcoe);
2266 * fcoe_create() - Create a fcoe interface
2270 * Called from fcoe transport
2280 * fcoe_ctlr_alloc() - Allocate a fcoe interface from fcoe_sysfs
2344 struct fcoe_interface *fcoe = port->priv;
2345 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);
2368 struct fcoe_interface *fcoe;
2370 list_for_each_entry(fcoe, &fcoe_hostlist, list) {
2371 if (fcoe->netdev == netdev)
2372 return fcoe;
2389 struct fcoe_interface *fcoe;
2391 fcoe = fcoe_hostlist_lookup_port(netdev);
2392 ctlr = fcoe_to_ctlr(fcoe);
2393 return (fcoe) ? ctlr->lp : NULL;
2407 struct fcoe_interface *fcoe;
2410 fcoe = fcoe_hostlist_lookup_port(fcoe_netdev(lport));
2411 if (!fcoe) {
2413 fcoe = port->priv;
2414 list_add_tail(&fcoe->list, &fcoe_hostlist);
2429 struct fcoe_interface *fcoe;
2433 fcoe = port->priv;
2434 list_del(&fcoe->list);
2451 * fcoe_init() - Initialize fcoe.ko
2461 fcoe_wq = alloc_workqueue("fcoe", 0, 0);
2465 /* register as a fcoe transport */
2468 printk(KERN_ERR "failed to register an fcoe transport, check "
2502 * fcoe_exit() - Clean up fcoe.ko
2508 struct fcoe_interface *fcoe, *tmp;
2517 /* releases the associated fcoe hosts */
2519 list_for_each_entry_safe(fcoe, tmp, &fcoe_hostlist, list) {
2520 ctlr = fcoe_to_ctlr(fcoe);
2545 /* detach from fcoe transport */
2615 struct fcoe_interface *fcoe = port->priv;
2616 struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe);
2648 struct fcoe_interface *fcoe = port->priv;
2649 struct net_device *netdev = fcoe->netdev;
2657 printk(KERN_ERR "fcoe: Failed to create vport, "
2665 vn_port = fcoe_if_create(fcoe, &vport->dev, 1);
2670 printk(KERN_ERR "fcoe: fcoe_vport_create(%s) failed\n",
2798 struct fcoe_interface *fcoe = fcoe_ctlr_priv(ctlr);
2800 fcf_dev->vlan_id = vlan_dev_vlan_id(fcoe->netdev);
2819 struct fcoe_interface *fcoe = port->priv;
2820 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);