]> Pileus Git - ~andy/linux/blobdiff - drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
bridge: Add vlan support to static neighbors
[~andy/linux] / drivers / net / ethernet / intel / ixgbe / ixgbe_main.c
index 4c2e9d6564ad7cf1ff1892c6e846f465959dd490..1c0efcb7920f18053129c67b9a27998616841401 100644 (file)
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel 10 Gigabit PCI Express Linux driver
-  Copyright(c) 1999 - 2012 Intel Corporation.
+  Copyright(c) 1999 - 2013 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
@@ -66,7 +66,7 @@ static char ixgbe_default_device_descr[] =
 #define DRV_VERSION "3.11.33-k"
 const char ixgbe_driver_version[] = DRV_VERSION;
 static const char ixgbe_copyright[] =
-                               "Copyright (c) 1999-2012 Intel Corporation.";
+                               "Copyright (c) 1999-2013 Intel Corporation.";
 
 static const struct ixgbe_info *ixgbe_info_tbl[] = {
        [board_82598] = &ixgbe_82598_info,
@@ -803,6 +803,7 @@ static void ixgbe_tx_timeout_reset(struct ixgbe_adapter *adapter)
        /* Do the reset outside of interrupt context */
        if (!test_bit(__IXGBE_DOWN, &adapter->state)) {
                adapter->flags2 |= IXGBE_FLAG2_RESET_REQUESTED;
+               e_warn(drv, "initiating reset due to tx timeout\n");
                ixgbe_service_event_schedule(adapter);
        }
 }
@@ -837,7 +838,7 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
                        break;
 
                /* prevent any other reads prior to eop_desc */
-               rmb();
+               read_barrier_depends();
 
                /* if DD is not set pending work has not been completed */
                if (!(eop_desc->wb.status & cpu_to_le32(IXGBE_TXD_STAT_DD)))
@@ -1398,6 +1399,7 @@ static void ixgbe_set_rsc_gso_size(struct ixgbe_ring *ring,
        /* set gso_size to avoid messing up TCP MSS */
        skb_shinfo(skb)->gso_size = DIV_ROUND_UP((skb->len - hdr_len),
                                                 IXGBE_CB(skb)->append_cnt);
+       skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4;
 }
 
 static void ixgbe_update_rsc_stats(struct ixgbe_ring *rx_ring,
@@ -2177,10 +2179,10 @@ static void ixgbe_check_overtemp_subtask(struct ixgbe_adapter *adapter)
                        return;
 
                if (!(eicr & IXGBE_EICR_LSC) && hw->mac.ops.check_link) {
-                       u32 autoneg;
+                       u32 speed;
                        bool link_up = false;
 
-                       hw->mac.ops.check_link(hw, &autoneg, &link_up, false);
+                       hw->mac.ops.check_link(hw, &speed, &link_up, false);
 
                        if (link_up)
                                return;
@@ -3993,25 +3995,25 @@ static void ixgbe_sfp_link_config(struct ixgbe_adapter *adapter)
  **/
 static int ixgbe_non_sfp_link_config(struct ixgbe_hw *hw)
 {
-       u32 autoneg;
-       bool negotiation, link_up = false;
+       u32 speed;
+       bool autoneg, link_up = false;
        u32 ret = IXGBE_ERR_LINK_SETUP;
 
        if (hw->mac.ops.check_link)
-               ret = hw->mac.ops.check_link(hw, &autoneg, &link_up, false);
+               ret = hw->mac.ops.check_link(hw, &speed, &link_up, false);
 
        if (ret)
                goto link_cfg_out;
 
-       autoneg = hw->phy.autoneg_advertised;
-       if ((!autoneg) && (hw->mac.ops.get_link_capabilities))
-               ret = hw->mac.ops.get_link_capabilities(hw, &autoneg,
-                                                       &negotiation);
+       speed = hw->phy.autoneg_advertised;
+       if ((!speed) && (hw->mac.ops.get_link_capabilities))
+               ret = hw->mac.ops.get_link_capabilities(hw, &speed,
+                                                       &autoneg);
        if (ret)
                goto link_cfg_out;
 
        if (hw->mac.ops.setup_link)
-               ret = hw->mac.ops.setup_link(hw, autoneg, negotiation, link_up);
+               ret = hw->mac.ops.setup_link(hw, speed, link_up);
 link_cfg_out:
        return ret;
 }
@@ -4868,7 +4870,7 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu)
         */
        if ((adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) &&
            (adapter->hw.mac.type == ixgbe_mac_82599EB) &&
-           (max_frame > MAXIMUM_ETHERNET_VLAN_SIZE))
+           (max_frame > (ETH_FRAME_LEN + ETH_FCS_LEN)))
                e_warn(probe, "Setting MTU > 1500 will disable legacy VFs\n");
 
        e_info(probe, "changing MTU from %d to %d\n", netdev->mtu, new_mtu);
@@ -5613,6 +5615,7 @@ static void ixgbe_watchdog_flush_tx(struct ixgbe_adapter *adapter)
                         * to get done, so reset controller to flush Tx.
                         * (Do the reset outside of interrupt context).
                         */
+                       e_warn(drv, "initiating reset to clear Tx work after link loss\n");
                        adapter->flags2 |= IXGBE_FLAG2_RESET_REQUESTED;
                }
        }
@@ -5737,8 +5740,8 @@ sfp_out:
 static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter)
 {
        struct ixgbe_hw *hw = &adapter->hw;
-       u32 autoneg;
-       bool negotiation;
+       u32 speed;
+       bool autoneg = false;
 
        if (!(adapter->flags & IXGBE_FLAG_NEED_LINK_CONFIG))
                return;
@@ -5749,11 +5752,11 @@ static void ixgbe_sfp_link_config_subtask(struct ixgbe_adapter *adapter)
 
        adapter->flags &= ~IXGBE_FLAG_NEED_LINK_CONFIG;
 
-       autoneg = hw->phy.autoneg_advertised;
-       if ((!autoneg) && (hw->mac.ops.get_link_capabilities))
-               hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation);
+       speed = hw->phy.autoneg_advertised;
+       if ((!speed) && (hw->mac.ops.get_link_capabilities))
+               hw->mac.ops.get_link_capabilities(hw, &speed, &autoneg);
        if (hw->mac.ops.setup_link)
-               hw->mac.ops.setup_link(hw, autoneg, negotiation, true);
+               hw->mac.ops.setup_link(hw, speed, true);
 
        adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE;
        adapter->link_check_timeout = jiffies;
@@ -6834,6 +6837,26 @@ int ixgbe_setup_tc(struct net_device *dev, u8 tc)
 }
 
 #endif /* CONFIG_IXGBE_DCB */
+#ifdef CONFIG_PCI_IOV
+void ixgbe_sriov_reinit(struct ixgbe_adapter *adapter)
+{
+       struct net_device *netdev = adapter->netdev;
+
+       rtnl_lock();
+#ifdef CONFIG_IXGBE_DCB
+       ixgbe_setup_tc(netdev, netdev_get_num_tc(netdev));
+#else
+       if (netif_running(netdev))
+               ixgbe_close(netdev);
+       ixgbe_clear_interrupt_scheme(adapter);
+       ixgbe_init_interrupt_scheme(adapter);
+       if (netif_running(netdev))
+               ixgbe_open(netdev);
+#endif
+       rtnl_unlock();
+}
+
+#endif
 void ixgbe_do_reset(struct net_device *netdev)
 {
        struct ixgbe_adapter *adapter = netdev_priv(netdev);
@@ -6979,7 +7002,7 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
        return err;
 }
 
-static int ixgbe_ndo_fdb_del(struct ndmsg *ndm,
+static int ixgbe_ndo_fdb_del(struct ndmsg *ndm, struct nlattr *tb[],
                             struct net_device *dev,
                             const unsigned char *addr)
 {
@@ -7056,7 +7079,8 @@ static int ixgbe_ndo_bridge_setlink(struct net_device *dev,
 }
 
 static int ixgbe_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
-                                   struct net_device *dev)
+                                   struct net_device *dev,
+                                   u32 filter_mask)
 {
        struct ixgbe_adapter *adapter = netdev_priv(dev);
        u16 mode;
@@ -7360,7 +7384,15 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        }
 
 #ifdef CONFIG_PCI_IOV
-       ixgbe_enable_sriov(adapter, ii);
+       /* SR-IOV not supported on the 82598 */
+       if (adapter->hw.mac.type == ixgbe_mac_82598EB)
+               goto skip_sriov;
+       /* Mailbox */
+       ixgbe_init_mbx_params_pf(hw);
+       memcpy(&hw->mbx.ops, ii->mbx_ops, sizeof(hw->mbx.ops));
+       ixgbe_enable_sriov(adapter);
+       pci_sriov_set_totalvfs(pdev, 63);
+skip_sriov:
 
 #endif
        netdev->features = NETIF_F_SG |
@@ -7616,8 +7648,14 @@ static void ixgbe_remove(struct pci_dev *pdev)
        if (netdev->reg_state == NETREG_REGISTERED)
                unregister_netdev(netdev);
 
-       ixgbe_disable_sriov(adapter);
-
+#ifdef CONFIG_PCI_IOV
+       /*
+        * Only disable SR-IOV on unload if the user specified the now
+        * deprecated max_vfs module parameter.
+        */
+       if (max_vfs)
+               ixgbe_disable_sriov(adapter);
+#endif
        ixgbe_clear_interrupt_scheme(adapter);
 
        ixgbe_release_hw_control(adapter);
@@ -7722,6 +7760,8 @@ static pci_ers_result_t ixgbe_io_error_detected(struct pci_dev *pdev,
                if (vfdev) {
                        e_dev_err("Issuing VFLR to VF %d\n", vf);
                        pci_write_config_dword(vfdev, 0xA8, 0x00008000);
+                       /* Free device reference count */
+                       pci_dev_put(vfdev);
                }
 
                pci_cleanup_aer_uncorrect_error_status(pdev);
@@ -7831,6 +7871,7 @@ static struct pci_driver ixgbe_driver = {
        .resume   = ixgbe_resume,
 #endif
        .shutdown = ixgbe_shutdown,
+       .sriov_configure = ixgbe_pci_sriov_configure,
        .err_handler = &ixgbe_err_handler
 };