Lines Matching refs:fcoe
38 #include "fcoe.h"
44 /* Performance tuning parameters for fcoe */
66 /* fcoe host list */
284 * @fcoe: The new FCoE interface
285 * @netdev: The net device that the fcoe interface is on
290 static int fcoe_interface_setup(struct fcoe_interface *fcoe,
293 struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe);
299 fcoe->netdev = netdev;
318 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);
478 fcoe->removed = 1;
484 * @fcoe: The FCoE interface to be cleaned up
486 static void fcoe_interface_cleanup(struct fcoe_interface *fcoe)
488 struct net_device *netdev = fcoe->netdev;
489 struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe);
513 struct fcoe_interface *fcoe;
516 fcoe = container_of(ptype, struct fcoe_interface, fip_packet_type);
517 ctlr = fcoe_to_ctlr(fcoe);
536 struct fcoe_interface *fcoe;
539 fcoe = container_of(ptype, struct fcoe_interface, fip_vlan_packet_type);
540 ctlr = fcoe_to_ctlr(fcoe);
565 struct fcoe_interface *fcoe = fcoe_from_ctlr(fip);
577 fcoe->realdev != fcoe->netdev)
578 skb->dev = fcoe->realdev;
580 skb->dev = fcoe->netdev;
595 struct fcoe_interface *fcoe = port->priv;
598 dev_uc_del(fcoe->netdev, port->data_src_addr);
600 dev_uc_add(fcoe->netdev, addr);
705 struct fcoe_interface *fcoe;
709 /* Setup lport private data to point to fcoe softc */
711 fcoe = port->priv;
712 ctlr = fcoe_to_ctlr(fcoe);
809 struct fcoe_interface *fcoe;
815 fcoe = port->priv;
816 realdev = fcoe->realdev;
831 printk(KERN_INFO "fcoe: Failed to retrieve FDMI "
874 printk(KERN_INFO "fcoe: No FDMI support.\n");
924 struct fcoe_interface *fcoe = port->priv;
944 if (is_vlan_dev(fcoe->netdev))
945 cur_real_dev = vlan_dev_real_dev(fcoe->netdev);
947 cur_real_dev = fcoe->netdev;
956 fcoe->oem = oldfcoe->oem;
961 if (fcoe->oem) {
962 if (!fc_exch_mgr_add(lport, fcoe->oem, fcoe_oem_match)) {
965 fcoe->oem, fcoe->netdev->name);
969 fcoe->oem = fc_exch_mgr_alloc(lport, FC_CLASS_3,
972 if (!fcoe->oem) {
975 fcoe->netdev->name);
988 "allocate em on interface %s\n", fcoe->netdev->name);
1005 struct fcoe_interface *fcoe = port->priv;
1006 struct net_device *netdev = fcoe->netdev;
1027 fcoe_interface_remove(fcoe);
1047 * master lport until it fcoe interface fully cleaned-up.
1115 * @fcoe: The FCoE interface to create a local port on
1123 static struct fc_lport *fcoe_if_create(struct fcoe_interface *fcoe,
1126 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);
1127 struct net_device *netdev = fcoe->netdev;
1152 port->priv = fcoe;
1242 * fcoe_if_init() - Initialization routine for fcoe.ko
1266 printk(KERN_ERR "fcoe: Failed to attach to the FC transport\n");
1271 * fcoe_if_exit() - Tear down fcoe.ko
1341 struct fcoe_interface *fcoe;
1347 fcoe = container_of(ptype, struct fcoe_interface, fcoe_packet_type);
1348 ctlr = fcoe_to_ctlr(fcoe);
1484 struct fcoe_interface *fcoe = port->priv;
1485 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);
1545 /* adjust skb network/transport offsets to match mac/fcoe/port */
1551 skb->priority = fcoe->priority;
1553 if (is_vlan_dev(fcoe->netdev) &&
1554 fcoe->realdev->features & NETIF_F_HW_VLAN_CTAG_TX) {
1556 skb->dev = fcoe->realdev;
1558 vlan_dev_vlan_id(fcoe->netdev));
1560 skb->dev = fcoe->netdev;
1562 /* fill up mac and fcoe headers */
1580 /* fcoe lso, mss is in max_payload which is non-zero for FCP data */
1601 * fcoe_filter_frames() - filter out bad fcoe frames, i.e. bad CRC
1611 struct fcoe_interface *fcoe;
1630 fcoe = ((struct fcoe_port *)lport_priv(lport))->priv;
1631 ctlr = fcoe_to_ctlr(fcoe);
1634 FCOE_DBG("fcoe: dropping FCoE lport LOGO in fip mode\n");
1647 printk(KERN_WARNING "fcoe: dropping frame with CRC error\n");
1692 printk(KERN_WARNING "fcoe: FCoE version "
1777 struct fcoe_interface *fcoe;
1780 list_for_each_entry(fcoe, &fcoe_hostlist, list) {
1781 if (is_vlan_dev(fcoe->netdev))
1782 real_dev = vlan_dev_real_dev(fcoe->netdev);
1784 real_dev = fcoe->netdev;
1787 return fcoe;
1797 struct fcoe_interface *fcoe;
1808 fcoe = fcoe_hostlist_lookup_realdev_port(netdev);
1810 if (!fcoe)
1813 ctlr = fcoe_to_ctlr(fcoe);
1828 fcoe->priority = prio;
1850 struct fcoe_interface *fcoe;
1856 list_for_each_entry(fcoe, &fcoe_hostlist, list) {
1857 if (fcoe->netdev == netdev) {
1858 ctlr = fcoe_to_ctlr(fcoe);
1887 list_del(&fcoe->list);
1891 if (!fcoe->removed)
1892 fcoe_interface_remove(fcoe);
1893 fcoe_interface_cleanup(fcoe);
1940 * Called from fcoe transport.
1949 struct fcoe_interface *fcoe;
1955 fcoe = fcoe_hostlist_lookup_port(netdev);
1958 if (fcoe) {
1959 ctlr = fcoe_to_ctlr(fcoe);
1973 * Called from fcoe transport.
1980 struct fcoe_interface *fcoe;
1985 fcoe = fcoe_hostlist_lookup_port(netdev);
1988 if (!fcoe) {
1993 ctlr = fcoe_to_ctlr(fcoe);
2041 struct fcoe_interface *fcoe = fcoe_ctlr_priv(ctlr);
2045 dev_mc_del(fcoe->netdev, FIP_ALL_ENODE_MACS);
2046 dev_mc_add(fcoe->netdev, FIP_ALL_VN2VN_MACS);
2047 dev_mc_add(fcoe->netdev, FIP_ALL_P2P_MACS);
2049 dev_mc_del(fcoe->netdev, FIP_ALL_VN2VN_MACS);
2050 dev_mc_del(fcoe->netdev, FIP_ALL_P2P_MACS);
2051 dev_mc_add(fcoe->netdev, FIP_ALL_ENODE_MACS);
2060 * Called from fcoe transport
2067 struct fcoe_interface *fcoe;
2074 fcoe = fcoe_hostlist_lookup_port(netdev);
2075 if (!fcoe) {
2079 ctlr = fcoe_to_ctlr(fcoe);
2082 list_del(&fcoe->list);
2099 struct fcoe_interface *fcoe;
2107 fcoe = port->priv;
2108 ctlr = fcoe_to_ctlr(fcoe);
2113 if (!fcoe->removed)
2114 fcoe_interface_remove(fcoe);
2116 fcoe_interface_cleanup(fcoe);
2127 * Called from fcoe transport.
2139 * @fcoe: The new FCoE interface
2141 static void fcoe_dcb_create(struct fcoe_interface *fcoe)
2145 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);
2149 struct net_device *netdev = fcoe->realdev;
2175 fcoe->priority = fcoe_prio;
2185 * _fcoe_create() - (internal) Create a fcoe interface
2203 struct fcoe_interface *fcoe;
2215 fcoe = fcoe_interface_create(netdev, fip_mode);
2216 if (IS_ERR(fcoe)) {
2217 rc = PTR_ERR(fcoe);
2221 ctlr = fcoe_to_ctlr(fcoe);
2223 lport = fcoe_if_create(fcoe, &ctlr_dev->dev, 0);
2225 printk(KERN_ERR "fcoe: Failed to create interface (%s)\n",
2228 if (!fcoe->removed)
2229 fcoe_interface_remove(fcoe);
2231 fcoe_interface_cleanup(fcoe);
2241 fcoe_dcb_create(fcoe);
2280 * fcoe_create() - Create a fcoe interface
2284 * Called from fcoe transport
2294 * fcoe_ctlr_alloc() - Allocate a fcoe interface from fcoe_sysfs
2358 struct fcoe_interface *fcoe = port->priv;
2359 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);
2382 struct fcoe_interface *fcoe;
2384 list_for_each_entry(fcoe, &fcoe_hostlist, list) {
2385 if (fcoe->netdev == netdev)
2386 return fcoe;
2403 struct fcoe_interface *fcoe;
2405 fcoe = fcoe_hostlist_lookup_port(netdev);
2406 ctlr = fcoe_to_ctlr(fcoe);
2407 return (fcoe) ? ctlr->lp : NULL;
2421 struct fcoe_interface *fcoe;
2424 fcoe = fcoe_hostlist_lookup_port(fcoe_netdev(lport));
2425 if (!fcoe) {
2427 fcoe = port->priv;
2428 list_add_tail(&fcoe->list, &fcoe_hostlist);
2443 struct fcoe_interface *fcoe;
2447 fcoe = port->priv;
2448 list_del(&fcoe->list);
2465 * fcoe_init() - Initialize fcoe.ko
2475 fcoe_wq = alloc_workqueue("fcoe", 0, 0);
2479 /* register as a fcoe transport */
2482 printk(KERN_ERR "failed to register an fcoe transport, check "
2515 * fcoe_exit() - Clean up fcoe.ko
2521 struct fcoe_interface *fcoe, *tmp;
2530 /* releases the associated fcoe hosts */
2532 list_for_each_entry_safe(fcoe, tmp, &fcoe_hostlist, list) {
2533 ctlr = fcoe_to_ctlr(fcoe);
2558 /* detach from fcoe transport */
2628 struct fcoe_interface *fcoe = port->priv;
2629 struct fcoe_ctlr *fip = fcoe_to_ctlr(fcoe);
2661 struct fcoe_interface *fcoe = port->priv;
2662 struct net_device *netdev = fcoe->netdev;
2670 printk(KERN_ERR "fcoe: Failed to create vport, "
2678 vn_port = fcoe_if_create(fcoe, &vport->dev, 1);
2683 printk(KERN_ERR "fcoe: fcoe_vport_create(%s) failed\n",
2811 struct fcoe_interface *fcoe = fcoe_ctlr_priv(ctlr);
2813 fcf_dev->vlan_id = vlan_dev_vlan_id(fcoe->netdev);
2832 struct fcoe_interface *fcoe = port->priv;
2833 struct fcoe_ctlr *ctlr = fcoe_to_ctlr(fcoe);