From 6e97c170db3878695cb48b5021fffe442ec0aeb0 Mon Sep 17 00:00:00 2001 From: Tushar Dave Date: Fri, 14 Sep 2012 02:21:37 +0000 Subject: e1000e: Minimum packet size must be 17 bytes This is a HW requirement. Although a buffer as short as 1 byte is allowed, the total length of packet before, padding and CRC insertion, must be at least 17 bytes. So pad all small packets manually up to 17 bytes before delivering them to HW. Signed-off-by: Tushar Dave Tested-by: Jeff Pieper Signed-off-by: Jeff Kirsher diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index f444eb0..dadb13b 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -5067,6 +5067,17 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb, return NETDEV_TX_OK; } + /* + * The minimum packet size with TCTL.PSP set is 17 bytes so + * pad skb in order to meet this minimum size requirement + */ + if (unlikely(skb->len < 17)) { + if (skb_pad(skb, 17 - skb->len)) + return NETDEV_TX_OK; + skb->len = 17; + skb_set_tail_pointer(skb, 17); + } + mss = skb_shinfo(skb)->gso_size; if (mss) { u8 hdr_len; -- cgit v0.10.2 From f6fde11a9dbcf27a2766a1ea0fb5d6267c45af02 Mon Sep 17 00:00:00 2001 From: Jesse Brandeburg Date: Tue, 9 Oct 2012 02:52:14 +0000 Subject: maintainers: update with official intel support link, new maintainer Add an official link which is designed to guide the user to the appropriate support resource (be it community, OEM, Intel phone, Intel email, etc) Add the current e1000 maintainer to the list of Intel maintainers. Signed-off-by: Jesse Brandeburg Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher diff --git a/MAINTAINERS b/MAINTAINERS index 41c5349..5655bcc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3869,7 +3869,9 @@ M: Greg Rose M: Peter P Waskiewicz Jr M: Alex Duyck M: John Ronciak +M: Tushar Dave L: e1000-devel@lists.sourceforge.net +W: http://www.intel.com/support/feedback.htm W: http://e1000.sourceforge.net/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next.git -- cgit v0.10.2 From 59f301046b276f87483b3afa3201a4273def06a9 Mon Sep 17 00:00:00 2001 From: Carolyn Wyborny Date: Wed, 10 Oct 2012 04:42:59 +0000 Subject: igb: Update get cable length function for i210/i211 There was a problem in the initial implementation of the get cable length function for i210 and it did not work properly. This patch fixes that problem for i210/i211 devices. Signed-off-by: Carolyn Wyborny Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c b/drivers/net/ethernet/intel/igb/e1000_phy.c index 3404bc7..c62a4c3 100644 --- a/drivers/net/ethernet/intel/igb/e1000_phy.c +++ b/drivers/net/ethernet/intel/igb/e1000_phy.c @@ -1710,6 +1710,26 @@ s32 igb_get_cable_length_m88_gen2(struct e1000_hw *hw) switch (hw->phy.id) { case I210_I_PHY_ID: + /* Get cable length from PHY Cable Diagnostics Control Reg */ + ret_val = phy->ops.read_reg(hw, (0x7 << GS40G_PAGE_SHIFT) + + (I347AT4_PCDL + phy->addr), + &phy_data); + if (ret_val) + return ret_val; + + /* Check if the unit of cable length is meters or cm */ + ret_val = phy->ops.read_reg(hw, (0x7 << GS40G_PAGE_SHIFT) + + I347AT4_PCDC, &phy_data2); + if (ret_val) + return ret_val; + + is_cm = !(phy_data2 & I347AT4_PCDC_CABLE_LENGTH_UNIT); + + /* Populate the phy structure with cable length in meters */ + phy->min_cable_length = phy_data / (is_cm ? 100 : 1); + phy->max_cable_length = phy_data / (is_cm ? 100 : 1); + phy->cable_length = phy_data / (is_cm ? 100 : 1); + break; case I347AT4_E_PHY_ID: /* Remember the original page select and set it to 7 */ ret_val = phy->ops.read_reg(hw, I347AT4_PAGE_SELECT, -- cgit v0.10.2 From 3db73804cc814579b5ad72a7ee326c2ae2dcd1e0 Mon Sep 17 00:00:00 2001 From: Carolyn Wyborny Date: Wed, 17 Oct 2012 07:01:56 +0000 Subject: igb: Update version This patch updates the igb driver version to 4.0.17. Signed-off-by: Carolyn Wyborny Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 87abb57..b07d679 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -61,7 +61,7 @@ #define MAJ 4 #define MIN 0 -#define BUILD 1 +#define BUILD 17 #define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \ __stringify(BUILD) "-k" char igb_driver_name[] = "igb"; -- cgit v0.10.2 From f44777024c9147932c0ec2af41ed2cd50ac151c3 Mon Sep 17 00:00:00 2001 From: John Fastabend Date: Sun, 16 Sep 2012 08:19:46 +0000 Subject: ixgbevf: make netif_napi_add and netif_napi_del symmetric ixgbevf_alloc_q_vectors() calls netif_napi_add for each qvector where qvectors is determined by the number of msix vectors. This makes perfect sense. However on cleanup when ixgbevf_free_q_vectors() is called and for each qvector we should call netif_napi_del there is some extra logic to add a dependency on RX queues. This patch makes the add/del operations symmetric by removing the RX queues dependency. Without this if free_netdev() is called we see the general protection fault below in netif_napi_del when list_del_init() is called. # addr2line -e ./vmlinux ffffffff8140810c net-next/include/linux/list.h:88 general protection fault: 0000 [#1] SMP Modules linked in: bonding ixgbevf ixgbe(-) mdio libfc scsi_transport_fc scsi_tgt 8021q garp stp llc cpufreq_ondemand acpi_cpufreq freq_table mperf ipv6 uinput coretemp lpc_ich i2c_i801 shpchp hwmon i2c_core serio_raw crc32c_intel mfd_core joydev pcspkr microcode ioatdma igb dca pata_acpi ata_generic usb_storage pata_jmicron [last unloaded: bonding] CPU 10 Pid: 4174, comm: rmmod Tainted: G W 3.6.0-rc3jk-net-next+ #104 Supermicro X8DTN/X8DTN RIP: 0010:[] [] netif_napi_del+0x24/0x87 RSP: 0018:ffff88027f5e9b48 EFLAGS: 00010293 RAX: ffff8806224b4768 RBX: ffff8806224b46e8 RCX: 6b6b6b6b6b6b6b6b RDX: 6b6b6b6b6b6b6b6b RSI: ffffffff810bf6c5 RDI: ffff8806224b46e8 RBP: ffff88027f5e9b58 R08: ffff88033200b180 R09: ffff88027f5e98a8 R10: ffff88033320b000 R11: ffff88027f5e9ae8 R12: 6b6b6b6b6b6b6aeb R13: ffff8806221d11c0 R14: 0000000000000000 R15: ffff88027f5e9cf8 FS: 00007f5e58b9b700(0000) GS:ffff880333200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: 00000000010ef2b8 CR3: 0000000281fff000 CR4: 00000000000007e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process rmmod (pid: 4174, threadinfo ffff88027f5e8000, task ffff88032f888000) Stack: ffff8806221d1160 6b6b6b6b6b6b6aeb ffff88027f5e9b88 ffffffff81408e46 ffff8806221d1160 ffff8806221d1160 ffff8806221d1ae0 ffff8806221d5668 ffff88027f5e9bb8 ffffffffa009153c ffffffffa0092a30 ffff8806221d5700 Call Trace: [] free_netdev+0x64/0xd7 [] ixgbevf_remove+0xa6/0xbc [ixgbevf] [] pci_device_remove+0x2d/0x51 [] __device_release_driver+0x6c/0xc2 [] device_release_driver+0x25/0x32 [] bus_remove_device+0x148/0x15d [] device_del+0x130/0x1a4 [] device_unregister+0x4b/0x57 [] pci_stop_bus_device+0x63/0x85 [...] Signed-off-by: John Fastabend Acked-by: Greg Rose Acked-by: Alexander Duyck Tested-by: Sibai Li Signed-off-by: Jeff Kirsher diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 33444b5..537ed19 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c @@ -1912,18 +1912,13 @@ err_out: **/ static void ixgbevf_free_q_vectors(struct ixgbevf_adapter *adapter) { - int q_idx, num_q_vectors; - int napi_vectors; - - num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; - napi_vectors = adapter->num_rx_queues; + int q_idx, num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; for (q_idx = 0; q_idx < num_q_vectors; q_idx++) { struct ixgbevf_q_vector *q_vector = adapter->q_vector[q_idx]; adapter->q_vector[q_idx] = NULL; - if (q_idx < napi_vectors) - netif_napi_del(&q_vector->napi); + netif_napi_del(&q_vector->napi); kfree(q_vector); } } -- cgit v0.10.2 From 6132ee8a3f123bdaf8682ede07c17b294ecbd255 Mon Sep 17 00:00:00 2001 From: Greg Rose Date: Fri, 21 Sep 2012 00:14:14 +0000 Subject: ixgbevf: Check for error on dma_map_single call Ignoring the return value from a call to the kernel dma_map API functions can cause data corruption and system instability. Check the return value and take appropriate action. Signed-off-by: Greg Rose Tested-by: Phil Schmitt Tested-by: Sibai Li Signed-off-by: Jeff Kirsher diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 537ed19..805e02c 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c @@ -359,6 +359,12 @@ static void ixgbevf_alloc_rx_buffers(struct ixgbevf_adapter *adapter, bi->dma = dma_map_single(&pdev->dev, skb->data, rx_ring->rx_buf_len, DMA_FROM_DEVICE); + if (dma_mapping_error(&pdev->dev, bi->dma)) { + dev_kfree_skb(skb); + bi->skb = NULL; + dev_err(&pdev->dev, "RX DMA map failed\n"); + break; + } } rx_desc->read.pkt_addr = cpu_to_le64(bi->dma); @@ -2817,10 +2823,10 @@ static int ixgbevf_tx_map(struct ixgbevf_ring *tx_ring, tx_buffer_info->dma = skb_frag_dma_map(tx_ring->dev, frag, offset, size, DMA_TO_DEVICE); - tx_buffer_info->mapped_as_page = true; if (dma_mapping_error(tx_ring->dev, tx_buffer_info->dma)) goto dma_error; + tx_buffer_info->mapped_as_page = true; tx_buffer_info->next_to_watch = i; len -= size; -- cgit v0.10.2 From 55fdd45bcf02565b8764c0e036fa752c1f854966 Mon Sep 17 00:00:00 2001 From: John Fastabend Date: Mon, 1 Oct 2012 14:52:20 +0000 Subject: ixgbevf: fix softirq-safe to unsafe splat on internal mbx_lock The lockdep splat below identifies a case where irq safe to unsafe lock order is detected. Resolved by making mbx_lock bh. ====================================================== [ INFO: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected ] 3.6.0-rc5jk-net-next+ #119 Not tainted ------------------------------------------------------ ip/2608 [HC0[0]:SC0[2]:HE1:SE0] is trying to acquire: (&(&adapter->mbx_lock)->rlock){+.+...}, at: [] ixgbevf_set_rx_mode+0x36/0xd2 [ixgbevf] and this task is already holding: (_xmit_ETHER){+.....}, at: [] dev_set_rx_mode+0x1e/0x33 which would create a new lock dependency: (_xmit_ETHER){+.....} -> (&(&adapter->mbx_lock)->rlock){+.+...} but this new dependency connects a SOFTIRQ-irq-safe lock: (&(&mc->mca_lock)->rlock){+.-...} ... which became SOFTIRQ-irq-safe at: [] __lock_acquire+0x2f2/0xdf3 [] lock_acquire+0x12b/0x158 [] _raw_spin_lock_bh+0x4a/0x7d [] mld_ifc_timer_expire+0x1b2/0x282 [ipv6] [] run_timer_softirq+0x2a2/0x3ee [] __do_softirq+0x161/0x2b9 [] call_softirq+0x1c/0x30 [] do_softirq+0x4b/0xa3 [] irq_exit+0x53/0xd7 [] do_IRQ+0x9d/0xb4 [] ret_from_intr+0x0/0x1a [] cpuidle_enter+0x12/0x14 [] cpuidle_enter_state+0x17/0x3f [] cpuidle_idle_call+0x140/0x21c [] cpu_idle+0x79/0xcd [] rest_init+0x149/0x150 [] start_kernel+0x37c/0x389 [] x86_64_start_reservations+0xb8/0xbd [] x86_64_start_kernel+0x101/0x110 to a SOFTIRQ-irq-unsafe lock: (&(&adapter->mbx_lock)->rlock){+.+...} ... which became SOFTIRQ-irq-unsafe at: ... [] __lock_acquire+0x366/0xdf3 [] lock_acquire+0x12b/0x158 [] _raw_spin_lock+0x45/0x7a [] ixgbevf_negotiate_api+0x3d/0x6d [ixgbevf] [] ixgbevf_open+0x6c/0x43e [ixgbevf] [] __dev_open+0xa0/0xe6 [] __dev_change_flags+0xbe/0x142 [] dev_change_flags+0x21/0x57 [] do_setlink+0x2e2/0x7f4 [] rtnl_newlink+0x277/0x4bb [] rtnetlink_rcv_msg+0x236/0x253 [] netlink_rcv_skb+0x43/0x94 [] rtnetlink_rcv+0x26/0x2d [] netlink_unicast+0xee/0x174 [] netlink_sendmsg+0x26a/0x288 [] __sock_sendmsg_nosec+0x58/0x61 [] __sock_sendmsg+0x3d/0x48 [] sock_sendmsg+0x6e/0x87 [] __sys_sendmsg+0x206/0x288 [] sys_sendmsg+0x42/0x60 [] system_call_fastpath+0x16/0x1b other info that might help us debug this: Chain exists of: &(&mc->mca_lock)->rlock --> _xmit_ETHER --> &(&adapter->mbx_lock)->rlock Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&(&adapter->mbx_lock)->rlock); local_irq_disable(); lock(&(&mc->mca_lock)->rlock); lock(_xmit_ETHER); lock(&(&mc->mca_lock)->rlock); *** DEADLOCK *** Signed-off-by: John Fastabend Acked-by: Greg Rose Tested-by: Sibai Li Signed-off-by: Jeff Kirsher diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 805e02c..846ac51 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c @@ -1138,12 +1138,12 @@ static int ixgbevf_vlan_rx_add_vid(struct net_device *netdev, u16 vid) if (!hw->mac.ops.set_vfta) return -EOPNOTSUPP; - spin_lock(&adapter->mbx_lock); + spin_lock_bh(&adapter->mbx_lock); /* add VID to filter table */ err = hw->mac.ops.set_vfta(hw, vid, 0, true); - spin_unlock(&adapter->mbx_lock); + spin_unlock_bh(&adapter->mbx_lock); /* translate error return types so error makes sense */ if (err == IXGBE_ERR_MBX) @@ -1163,13 +1163,13 @@ static int ixgbevf_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) struct ixgbe_hw *hw = &adapter->hw; int err = -EOPNOTSUPP; - spin_lock(&adapter->mbx_lock); + spin_lock_bh(&adapter->mbx_lock); /* remove VID from filter table */ if (hw->mac.ops.set_vfta) err = hw->mac.ops.set_vfta(hw, vid, 0, false); - spin_unlock(&adapter->mbx_lock); + spin_unlock_bh(&adapter->mbx_lock); clear_bit(vid, adapter->active_vlans); @@ -1225,7 +1225,7 @@ static void ixgbevf_set_rx_mode(struct net_device *netdev) struct ixgbevf_adapter *adapter = netdev_priv(netdev); struct ixgbe_hw *hw = &adapter->hw; - spin_lock(&adapter->mbx_lock); + spin_lock_bh(&adapter->mbx_lock); /* reprogram multicast list */ if (hw->mac.ops.update_mc_addr_list) @@ -1233,7 +1233,7 @@ static void ixgbevf_set_rx_mode(struct net_device *netdev) ixgbevf_write_uc_addr_list(netdev); - spin_unlock(&adapter->mbx_lock); + spin_unlock_bh(&adapter->mbx_lock); } static void ixgbevf_napi_enable_all(struct ixgbevf_adapter *adapter) @@ -1347,7 +1347,7 @@ static void ixgbevf_negotiate_api(struct ixgbevf_adapter *adapter) ixgbe_mbox_api_unknown }; int err = 0, idx = 0; - spin_lock(&adapter->mbx_lock); + spin_lock_bh(&adapter->mbx_lock); while (api[idx] != ixgbe_mbox_api_unknown) { err = ixgbevf_negotiate_api_version(hw, api[idx]); @@ -1356,7 +1356,7 @@ static void ixgbevf_negotiate_api(struct ixgbevf_adapter *adapter) idx++; } - spin_unlock(&adapter->mbx_lock); + spin_unlock_bh(&adapter->mbx_lock); } static void ixgbevf_up_complete(struct ixgbevf_adapter *adapter) @@ -1397,7 +1397,7 @@ static void ixgbevf_up_complete(struct ixgbevf_adapter *adapter) ixgbevf_configure_msix(adapter); - spin_lock(&adapter->mbx_lock); + spin_lock_bh(&adapter->mbx_lock); if (hw->mac.ops.set_rar) { if (is_valid_ether_addr(hw->mac.addr)) @@ -1406,7 +1406,7 @@ static void ixgbevf_up_complete(struct ixgbevf_adapter *adapter) hw->mac.ops.set_rar(hw, 0, hw->mac.perm_addr, 0); } - spin_unlock(&adapter->mbx_lock); + spin_unlock_bh(&adapter->mbx_lock); clear_bit(__IXGBEVF_DOWN, &adapter->state); ixgbevf_napi_enable_all(adapter); @@ -1430,12 +1430,12 @@ static int ixgbevf_reset_queues(struct ixgbevf_adapter *adapter) unsigned int num_rx_queues = 1; int err, i; - spin_lock(&adapter->mbx_lock); + spin_lock_bh(&adapter->mbx_lock); /* fetch queue configuration from the PF */ err = ixgbevf_get_queues(hw, &num_tcs, &def_q); - spin_unlock(&adapter->mbx_lock); + spin_unlock_bh(&adapter->mbx_lock); if (err) return err; @@ -1694,14 +1694,14 @@ void ixgbevf_reset(struct ixgbevf_adapter *adapter) struct ixgbe_hw *hw = &adapter->hw; struct net_device *netdev = adapter->netdev; - spin_lock(&adapter->mbx_lock); + spin_lock_bh(&adapter->mbx_lock); if (hw->mac.ops.reset_hw(hw)) hw_dbg(hw, "PF still resetting\n"); else hw->mac.ops.init_hw(hw); - spin_unlock(&adapter->mbx_lock); + spin_unlock_bh(&adapter->mbx_lock); if (is_valid_ether_addr(adapter->hw.mac.addr)) { memcpy(netdev->dev_addr, adapter->hw.mac.addr, @@ -2195,12 +2195,12 @@ static void ixgbevf_watchdog_task(struct work_struct *work) if (hw->mac.ops.check_link) { s32 need_reset; - spin_lock(&adapter->mbx_lock); + spin_lock_bh(&adapter->mbx_lock); need_reset = hw->mac.ops.check_link(hw, &link_speed, &link_up, false); - spin_unlock(&adapter->mbx_lock); + spin_unlock_bh(&adapter->mbx_lock); if (need_reset) { adapter->link_up = link_up; @@ -2468,12 +2468,12 @@ static int ixgbevf_setup_queues(struct ixgbevf_adapter *adapter) unsigned int num_rx_queues = 1; int err, i; - spin_lock(&adapter->mbx_lock); + spin_lock_bh(&adapter->mbx_lock); /* fetch queue configuration from the PF */ err = ixgbevf_get_queues(hw, &num_tcs, &def_q); - spin_unlock(&adapter->mbx_lock); + spin_unlock_bh(&adapter->mbx_lock); if (err) return err; @@ -3047,12 +3047,12 @@ static int ixgbevf_set_mac(struct net_device *netdev, void *p) memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len); - spin_lock(&adapter->mbx_lock); + spin_lock_bh(&adapter->mbx_lock); if (hw->mac.ops.set_rar) hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0); - spin_unlock(&adapter->mbx_lock); + spin_unlock_bh(&adapter->mbx_lock); return 0; } -- cgit v0.10.2 From 1b3d2d77af39cb928d6ca738cb612a0b40e02857 Mon Sep 17 00:00:00 2001 From: Greg Rose Date: Thu, 4 Oct 2012 02:10:53 +0000 Subject: ixgbevf: Update version string Signed-off-by: Greg Rose Tested-by: Sibai Li Signed-off-by: Jeff Kirsher diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 846ac51..07d7eab 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c @@ -58,7 +58,7 @@ const char ixgbevf_driver_name[] = "ixgbevf"; static const char ixgbevf_driver_string[] = "Intel(R) 10 Gigabit PCI Express Virtual Function Network Driver"; -#define DRV_VERSION "2.6.0-k" +#define DRV_VERSION "2.7.12-k" const char ixgbevf_driver_version[] = DRV_VERSION; static char ixgbevf_copyright[] = "Copyright (c) 2009 - 2012 Intel Corporation."; -- cgit v0.10.2