aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/igb/igb_main.c
AgeCommit message (Collapse)AuthorFilesLines
2013-11-14Merge branch 'core-locking-for-linus' of ↵Linus Torvalds1-0/+5
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull core locking changes from Ingo Molnar: "The biggest changes: - add lockdep support for seqcount/seqlocks structures, this unearthed both bugs and required extra annotation. - move the various kernel locking primitives to the new kernel/locking/ directory" * 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits) block: Use u64_stats_init() to initialize seqcounts locking/lockdep: Mark __lockdep_count_forward_deps() as static lockdep/proc: Fix lock-time avg computation locking/doc: Update references to kernel/mutex.c ipv6: Fix possible ipv6 seqlock deadlock cpuset: Fix potential deadlock w/ set_mems_allowed seqcount: Add lockdep functionality to seqcount/seqlock structures net: Explicitly initialize u64_stats_sync structures for lockdep locking: Move the percpu-rwsem code to kernel/locking/ locking: Move the lglocks code to kernel/locking/ locking: Move the rwsem code to kernel/locking/ locking: Move the rtmutex code to kernel/locking/ locking: Move the semaphore core to kernel/locking/ locking: Move the spinlock code to kernel/locking/ locking: Move the lockdep code to kernel/locking/ locking: Move the mutex code to kernel/locking/ hung_task debugging: Add tracepoint to report the hang x86/locking/kconfig: Update paravirt spinlock Kconfig description lockstat: Report avg wait and hold times lockdep, x86/alternatives: Drop ancient lockdep fixup message ...
2013-11-14Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-armLinus Torvalds1-12/+6
Pull DMA mask updates from Russell King: "This series cleans up the handling of DMA masks in a lot of drivers, fixing some bugs as we go. Some of the more serious errors include: - drivers which only set their coherent DMA mask if the attempt to set the streaming mask fails. - drivers which test for a NULL dma mask pointer, and then set the dma mask pointer to a location in their module .data section - which will cause problems if the module is reloaded. To counter these, I have introduced two helper functions: - dma_set_mask_and_coherent() takes care of setting both the streaming and coherent masks at the same time, with the correct error handling as specified by the API. - dma_coerce_mask_and_coherent() which resolves the problem of drivers forcefully setting DMA masks. This is more a marker for future work to further clean these locations up - the code which creates the devices really should be initialising these, but to fix that in one go along with this change could potentially be very disruptive. The last thing this series does is prise away some of Linux's addition to "DMA addresses are physical addresses and RAM always starts at zero". We have ARM LPAE systems where all system memory is above 4GB physical, hence having DMA masks interpreted by (eg) the block layers as describing physical addresses in the range 0..DMAMASK fails on these platforms. Santosh Shilimkar addresses this in this series; the patches were copied to the appropriate people multiple times but were ignored. Fixing this also gets rid of some ARM weirdness in the setup of the max*pfn variables, and brings ARM into line with every other Linux architecture as far as those go" * 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm: (52 commits) ARM: 7805/1: mm: change max*pfn to include the physical offset of memory ARM: 7797/1: mmc: Use dma_max_pfn(dev) helper for bounce_limit calculations ARM: 7796/1: scsi: Use dma_max_pfn(dev) helper for bounce_limit calculations ARM: 7795/1: mm: dma-mapping: Add dma_max_pfn(dev) helper function ARM: 7794/1: block: Rename parameter dma_mask to max_addr for blk_queue_bounce_limit() ARM: DMA-API: better handing of DMA masks for coherent allocations ARM: 7857/1: dma: imx-sdma: setup dma mask DMA-API: firmware/google/gsmi.c: avoid direct access to DMA masks DMA-API: dcdbas: update DMA mask handing DMA-API: dma: edma.c: no need to explicitly initialize DMA masks DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks DMA-API: crypto: remove last references to 'static struct device *dev' DMA-API: crypto: fix ixp4xx crypto platform device support DMA-API: others: use dma_set_coherent_mask() DMA-API: staging: use dma_set_coherent_mask() DMA-API: usb: use new dma_coerce_mask_and_coherent() DMA-API: usb: use dma_set_coherent_mask() DMA-API: parport: parport_pc.c: use dma_coerce_mask_and_coherent() DMA-API: net: octeon: use dma_coerce_mask_and_coherent() DMA-API: net: nxp/lpc_eth: use dma_coerce_mask_and_coherent() ...
2013-11-06net: Explicitly initialize u64_stats_sync structures for lockdepJohn Stultz1-0/+5
In order to enable lockdep on seqcount/seqlock structures, we must explicitly initialize any locks. The u64_stats_sync structure, uses a seqcount, and thus we need to introduce a u64_stats_init() function and use it to initialize the structure. This unfortunately adds a lot of fairly trivial initialization code to a number of drivers. But the benefit of ensuring correctness makes this worth while. Because these changes are required for lockdep to be enabled, and the changes are quite trivial, I've not yet split this patch out into 30-some separate patches, as I figured it would be better to get the various maintainers thoughts on how to best merge this change along with the seqcount lockdep enablement. Feedback would be appreciated! Signed-off-by: John Stultz <[email protected]> Acked-by: Julian Anastasov <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: Alexey Kuznetsov <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Eric Dumazet <[email protected]> Cc: Hideaki YOSHIFUJI <[email protected]> Cc: James Morris <[email protected]> Cc: Jesse Gross <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: "Michael S. Tsirkin" <[email protected]> Cc: Mirko Lindner <[email protected]> Cc: Patrick McHardy <[email protected]> Cc: Roger Luethi <[email protected]> Cc: Rusty Russell <[email protected]> Cc: Simon Horman <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Thomas Petazzoni <[email protected]> Cc: Wensong Zhang <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2013-10-24igb: fix driver reload with VF assigned to guestStefan Assmann1-21/+16
commit fa44f2f185f7f9da19d331929bb1b56c1ccd1d93 broke reloading of igb, when VFs are assigned to a guest, in several ways. 1. on module load adapter->vf_data does not get properly allocated, resulting in a null pointer exception when accessing adapter->vf_data in igb_reset() on module reload. modprobe -r igb ; modprobe igb max_vfs=7 [ 215.215837] igb 0000:01:00.1: removed PHC on eth1 [ 216.932072] igb 0000:01:00.1: IOV Disabled [ 216.937038] igb 0000:01:00.0: removed PHC on eth0 [ 217.127032] igb 0000:01:00.0: Cannot deallocate SR-IOV virtual functions while they are assigned - VFs will not be deallocated [ 217.146178] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.0.5-k [ 217.154050] igb: Copyright (c) 2007-2013 Intel Corporation. [ 217.160688] igb 0000:01:00.0: Enabling SR-IOV VFs using the module parameter is deprecated - please use the pci sysfs interface. [ 217.173703] igb 0000:01:00.0: irq 103 for MSI/MSI-X [ 217.179227] igb 0000:01:00.0: irq 104 for MSI/MSI-X [ 217.184735] igb 0000:01:00.0: irq 105 for MSI/MSI-X [ 217.220082] BUG: unable to handle kernel NULL pointer dereference at 0000000000000048 [ 217.228846] IP: [<ffffffffa007c5e5>] igb_reset+0xc5/0x4b0 [igb] [ 217.235472] PGD 3607ec067 PUD 36170b067 PMD 0 [ 217.240461] Oops: 0002 [#1] SMP [ 217.244085] Modules linked in: igb(+) igbvf mptsas mptscsih mptbase scsi_transport_sas [last unloaded: igb] [ 217.255040] CPU: 4 PID: 4833 Comm: modprobe Not tainted 3.11.0+ #46 [...] [ 217.390007] [<ffffffffa007fab2>] igb_probe+0x892/0xfd0 [igb] [ 217.396422] [<ffffffff81470b3e>] local_pci_probe+0x1e/0x40 [ 217.402641] [<ffffffff81472029>] pci_device_probe+0xf9/0x110 [...] 2. A follow up issue, pci_enable_sriov() should only be called if no VFs were still allocated on module unload. Otherwise pci_enable_sriov() gets called multiple times in a row rendering the NIC unusable until reset. 3. simply calling igb_enable_sriov() in igb_probe_vfs() is not enough as the interrupts need to be re-setup. Switching that to igb_pci_enable_sriov(). Signed-off-by: Stefan Assmann <[email protected]> Tested-by: Aaron Brown <[email protected]> Tested-by: Sibai Li <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-10-02net:drivers/net: Miscellaneous conversions to ETH_ALENJoe Perches1-1/+1
Convert the memset/memcpy uses of 6 to ETH_ALEN where appropriate. Also convert some struct definitions and u8 array declarations of [6] to ETH_ALEN. Signed-off-by: Joe Perches <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-10-01igb: Add ethtool support to configure number of channelsLaura Mihaela Vasilescu1-0/+22
This patch adds the ethtool callbacks necessary to configure the number of RSS queues. The maximum number of queues is in accordance with the datasheets. Signed-off-by: Laura Mihaela Vasilescu <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-09-21DMA-API: net: intel/igb: fix 32-bit DMA mask handlingRussell King1-12/+6
The fallback to 32-bit DMA mask is rather odd: err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); if (!err) { err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64)); if (!err) pci_using_dac = 1; } else { err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)); if (err) { err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); if (err) { dev_err(&pdev->dev, "No usable DMA configuration, aborting\n"); goto err_dma; } } } This means we only set the coherent DMA mask in the fallback path if the DMA mask set failed, which is silly. This fixes it to set the coherent DMA mask only if dma_set_mask() succeeded, and to error out if either fails. Acked-by: Jeff Kirsher <[email protected]> Signed-off-by: Russell King <[email protected]>
2013-09-04igb: Update version numberAkeem G Abodunrin1-1/+1
This patch updates igb driver version to 5.0.5 Signed-off-by: Akeem G Abodunrin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-09-04igb: Implementation of 1-sec delay for i210 devicesAkeem G Abodunrin1-3/+29
This patch adds 1 sec delay mechanism to i210 device family, in order to avoid erroneous link issue with the link partner. Signed-off-by: Akeem G Abodunrin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-09-04igb: Don't look for a PBA in the iNVM when flashlessTodd Fujinaka1-1/+8
When a part is flashless, do not look for a PBA in the iNVM. Signed-off-by: Todd Fujinaka <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-08-22igb: Expose RSS indirection table for ethtoolLaura Mihaela Vasilescu1-21/+7
This patch adds the ethtool callbacks necessary to change the RETA indirection table from userspace. In order to achieve this, we add the indirection table field (rss_indir_tbl) in the board specific data structure (struct igb_adapter) to preserve the values across hardware resets. The indirection table must be initialized with default values in the following cases: * at module init time * when the number of RX queues changes. For this reason we add a new field (rss_indir_tbl_init) in igb_adapter that keeps track of the number of RX queues. Whenever the number of RX queues changes, the rss_indir_tbl is modified and initialized with default values. The rss_indir_tbl_init is updated accordingly. CC: Ben Hutchings <[email protected]> Signed-off-by: Laura Mihaela Vasilescu <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-08-22igb: Add macro for size of RETA indirection tableLaura Mihaela Vasilescu1-1/+1
RETA indirection table is used to assign the received data to a CPU in order to maintain an efficient distribution of network receive processing across multiple CPUs. This patch removes the hard-coded value for the size of the indirection table and defines a new macro. Signed-off-by: Laura Mihaela Vasilescu <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-08-22igb: Fix get_fw_version function for all partsCarolyn Wyborny1-9/+19
This patch fixes issues found with older parts and older NVM tools in the display of the version in ethtool. Signed-off-by: Carolyn Wyborny <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-08-22igb: Add device support for flashless SKU of i210 deviceCarolyn Wyborny1-0/+2
This patch adds the specific device id support for versions of i210 that do not have flash installed. Signed-off-by: Carolyn Wyborny <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-08-22igb: Refactor NVM read functions to accommodate devices with no flashCarolyn Wyborny1-3/+16
This patch refactors NVM read functions in order to accommodate i210 devices that do not have a flash. Previously, this was not supported on i210 devices. Signed-off-by: Carolyn Wyborny <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-08-22igb: Update MTU so that it is always at least a standard frame sizeAlexander Duyck1-0/+4
This change makes it so that we limit the lower bound for max_frame_size to the size of a standard Ethernet frame. This allows for feature parity with other Intel based drivers such as ixgbe. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-08-22igb: don't allow SR-IOV without MSI-XMitch A Williams1-0/+5
MSI-X interrupts are required for SR-IOV operation. Check to make sure they're enabled before allowing the user to turn on VFs. Signed-off-by: Mitch Williams <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-08-22igb: Added rcu_lock to avoid raceAkeem G Abodunrin1-1/+4
This patch adds rcu_lock to avoid possible race condition with igb_update_stats function accessing the rings in free_ q_vector. CC: Eric Dumazet <[email protected]> Signed-off-by: Akeem G Abodunrin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-08-22igb: Read register for latch_on without return valueAkeem G Abodunrin1-10/+4
This patch changes register read to "just-read" without returning a value for hardware to accurately latch the register value. Signed-off-by: Akeem G Abodunrin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-07-28igb: fix vlan filtering in promisc mode when not in VT modeEmil Tantilov1-2/+1
This patch fixes a VT mode check to make sure VLAN filters are disabled when in promisc mode and VT is not enabled. The problem with the previous check was that: E1000_MRQC_ENABLE_VMDQ is defined as 0x00000003 but when not in VT mode: mrqc |= E1000_MRQC_ENABLE_RSS_4Q (0x00000002) So the above check will trigger regardless if VT mode is being used or not. Signed-off-by: Emil Tantilov <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-05-21igb: Fix possible panic caused by Rx traffic arrival while interface is downCarolyn Wyborny1-2/+5
This patch reorders disabling napi and irqs during igb_down. This is done to avoid possible panic's found in other Intel drivers when Rx traffic arrives while interface is going down. Signed-off-by: Carolyn Wyborny <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-05-21igb: Add update to last_rx_timestamp in Rx ringsMatthew Vick1-1/+1
In order to support a more accurate check for a PTP Rx hang where the device can no longer timestamp received packets, we need to update, per ring, when the last Rx timestamp was. Because of how the PTP Rx hang logic works, the current logic is valid, but properly updating the ring variable increases the accuracy of the check. Signed-off-by: Matthew Vick <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-24igb: Bump version of driverCarolyn Wyborny1-3/+3
Signed-off-by: Carolyn Wyborny <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-24igb: Retain HW VLAN filtering while in promiscuous + VT modeGreg Rose1-1/+68
When using the new bridge FDB interface to allow SR-IOV virtual function network devices to communicate with SW bridged network devices the physical function is placed into promiscuous mode and hardware VLAN filtering is disabled. This defeats the ability to use VLAN tagging to isolate user networks. When the device is in promiscuous mode and VT mode simultaneously ensure that VLAN hardware filtering remains enabled. Signed-off-by: Greg Rose <[email protected]> Tested-by: Sibai Li <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-24igb: display a warning message when SmartSpeed worksKoki Sanagi1-0/+6
Current igb driver doesn't tell nothing when Link Speed is downgraded due to SmartSpeed. As a result, users suspect that there is something wrong with NIC. If the cause of it is SmartSpeed, there is no means to replace NIC. This patch make igb notify users that SmartSpeed worked. Signed-off-by: Koki Sanagi <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-24igb: Use pci_vfs_assigned instead of igb_vfs_are_assignedAlexander Duyck1-35/+1
This change makes it so that the igb driver uses the generic helper pci_vfs_assigned instead of the igb specific function igb_vfs_are_assigned. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Sibai Li <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-22Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-106/+4
Conflicts: drivers/net/ethernet/emulex/benet/be_main.c drivers/net/ethernet/intel/igb/igb_main.c drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c include/net/scm.h net/batman-adv/routing.c net/ipv4/tcp_input.c The e{uid,gid} --> {uid,gid} credentials fix conflicted with the cleanup in net-next to now pass cred structs around. The be2net driver had a bug fix in 'net' that overlapped with the VLAN interface changes by Patrick McHardy in net-next. An IGB conflict existed because in 'net' the build_skb() support was reverted, and in 'net-next' there was a comment style fix within that code. Several batman-adv conflicts were resolved by making sure that all calls to batadv_is_my_mac() are changed to have a new bat_priv first argument. Eric Dumazet's TS ECR fix in TCP in 'net' conflicted with the F-RTO rewrite in 'net-next', mostly overlapping changes. Thanks to Stephen Rothwell and Antonio Quartulli for help with several of these merge resolutions. Signed-off-by: David S. Miller <[email protected]>
2013-04-19net: vlan: add protocol argument to packet tagging functionsPatrick McHardy1-1/+1
Add a protocol argument to the VLAN packet tagging functions. In case of HW tagging, we need that protocol available in the ndo_start_xmit functions, so it is stored in a new field in the skb. The new field fits into a hole (on 64 bit) and doesn't increase the sks's size. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-04-19net: vlan: prepare for 802.1ad VLAN filtering offloadPatrick McHardy1-5/+7
Change the rx_{add,kill}_vid callbacks to take a protocol argument in preparation of 802.1ad support. The protocol argument used so far is always htons(ETH_P_8021Q). Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-04-19net: vlan: rename NETIF_F_HW_VLAN_* feature flags to NETIF_F_HW_VLAN_CTAG_*Patrick McHardy1-9/+9
Rename the hardware VLAN acceleration features to include "CTAG" to indicate that they only support CTAGs. Follow up patches will introduce 802.1ad server provider tagging (STAGs) and require the distinction for hardware not supporting acclerating both. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-04-18igb: Add support for i354 devicesCarolyn Wyborny1-13/+36
This patch adds base support for new i354 devices. Loopback test is unsupported for this release. Signed-off-by: Carolyn Wyborny <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-18igb: add support for spoofchk configLior Levy1-0/+34
Add support for spoofchk configuration per VF via iproute2 tool. Signed-off-by: Lior Levy <[email protected]> Tested-by: Sibai Li <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-18igb: Fix code comments and whitespaceJeff Kirsher1-575/+564
Aligns the multi-line code comments with the desired style for the networking tree. Also cleaned up whitespace issues found during the cleanup of code comments (i.e. remove unnecessary blank lines, use tabs where possible, properly wrap lines and keep strings on a single line) Signed-off-by: Jeff Kirsher <[email protected]> Tested-by: Aaron Brown <[email protected]>
2013-04-18igb: Use rx/tx_itr_setting when setting up initial value of itrAlexander Duyck1-0/+11
It turns out that the InterruptThrottleRate module parameter was only having the effect of locking the ITR at the starting ITR value. This was because the values stored in rx_itr_setting and tx_itr_setting were being ignored when configuring the initial itr_val of the q_vector. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-18igb: Pull adapter out of main path in igb_xmit_frame_ringAlexander Duyck1-9/+11
We only need the adapter pointer in the case of ptp. As such we can pull the adapter out of the main path and place it inside the if statement to avoid the temptation of accessing the adapter pointer in the fast path. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-18igb: Mask off check of frag_off as we only want fragment offsetAlexander Duyck1-1/+1
We were incorrectly checking the entire frag_off field when we only wanted the fragment offset. As a result we were not pulling in TCP headers when the DNF flag was set. To correct that we will now check for frag off using the IP_OFFSET mask. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-18igb: random code and comments fixAkeem G. Abodunrin1-2/+1
This patch fixes code and comments as identified in the driver. Signed-off-by: Akeem G Abodunrin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-18igb: Support for 100base-fx SFPAkeem G. Abodunrin1-5/+13
This patch adds support for 100base-fx SFP and report proper link speed/duplex via Ethtool. v2: fix smatch warnings CC: Dan Carpenter <[email protected]> Signed-off-by: Akeem G Abodunrin <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-04-18igb: Revert support for build_skb in igbAlexander Duyck1-106/+4
This patch actually reverts: igb: Support using build_skb in the case that jumbo frames are disabled The reason for reverting this patch is that it can lead to data corruption. The following flow was pointed out by Ben Hutchings: 1. skb is forwarded to another device 2. Packet headers are modified and it's put into a queue 3. Second packet is received into the other half of this page 4. Page cannot be reused, so is DMA-unmapped 5. The DMA mapping was non-coherent, so unmap copies or invalidates cache The headers added in step 2 get trashed in step 5. Reported-by: Ben Hutchings <[email protected]> Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-03-26igb: SR-IOV init reorderingAlex Williamson1-1/+1
igb is ineffective at setting a lower total VFs because: int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) { ... /* Shouldn't change if VFs already enabled */ if (dev->sriov->ctrl & PCI_SRIOV_CTRL_VFE) return -EBUSY; Swap init ordering. Signed-off-by: Alex Williamson <[email protected]> Acked-by: Greg Rose <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-26igb: Fix null pointer dereferenceAlex Williamson1-1/+1
The max_vfs= option has always been self limiting to the number of VFs supported by the device. fa44f2f1 added SR-IOV configuration via sysfs, but in the process broke this self correction factor. The failing path is: igb_probe igb_sw_init if (max_vfs > 7) { adapter->vfs_allocated_count = 7; ... igb_probe_vfs igb_enable_sriov(, max_vfs) if (num_vfs > 7) { err = -EPERM; ... This leaves vfs_allocated_count = 7 and vf_data = NULL, so we bomb out when igb_probe finally calls igb_reset. It seems like a really bad idea, and somewhat pointless, to set vfs_allocated_count separate from vf_data, but limiting max_vfs is enough to avoid the null pointer. Signed-off-by: Alex Williamson <[email protected]> Acked-by: Greg Rose <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-05igb: Fix for lockdep issue in igb_get_i2c_clientCarolyn Wyborny1-67/+2
This patch fixes a lockdep warning in igb_get_i2c_client by refactoring the initialization and usage of the i2c_client completely. There is no on the fly allocation of the single client needed today. Signed-off-by: Carolyn Wyborny <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-05igb: Drop BUILD_BUG_ON check from igb_build_rx_bufferAlexander Duyck1-7/+0
On s390 the igb driver was throwing a build error due to the fact that a frame built using build_skb would be larger than 2K. Since this is not likely to change at any point in the future we are better off just dropping the check since we already had a check in igb_set_rx_buffer_len that will just disable the usage of build_skb anyway. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-02-15igb: Update igb to use a path similar to ixgbe to determine when to stop TxAlexander Duyck1-13/+17
After reviewing the igb and ixgbe code I realized there are a few issues in how the code is structured. Specifically we are not checking the size of the buffers being used in transmits and we are not using the same value to determine when to stop or start a Tx queue. As such the code is prone to be buggy. This patch makes it so that we have one value DESC_NEEDED that we will use for starting and stopping the queue. In addition we will check the size of buffers being used when setting up a transmit so as to avoid a possible buffer overrun if we were to receive a frame with a block of data larger than 32K in skb->data. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-02-15igb: Refix sparse warning in igb_get_i2c_clientCarolyn Wyborny1-1/+1
This patch correctly resolves the sparse warnings found with this function. Signed-off-by: Carolyn Wyborny <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-02-15igb: Fix for improper allocation flag in igb_get_i2c_clientCarolyn Wyborny1-1/+1
This patch fixes the allocation function in igb_get_i2c_client to use GFP_ATOMIC instead of GFP_KERNEL because we have a spinlock. Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Carolyn Wyborny <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-02-15igb: Fix for improper exit in igb_get_i2c_clientCarolyn Wyborny1-6/+1
This patch fixes an issue where we check for irq's disabled then exit after explicitly disabling them with spin_lock_irqsave. Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Carolyn Wyborny <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-02-15igb: Support using build_skb in the case that jumbo frames are disabledAlexander Duyck1-34/+153
This change makes it so that we can enable the use of build_skb for cases where jumbo frames are disabled. The advantage to this is that we do not have to perform a memcpy to populate the header and as a result we see a significant performance improvement. Signed-off-by: Alexander Duyck <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-02-04ethernet: Remove unnecessary alloc/OOM messages, alloc cleanupsJoe Perches1-3/+2
alloc failures already get standardized OOM messages and a dump_stack. Convert kzalloc's with multiplies to kcalloc. Convert kmalloc's with multiplies to kmalloc_array. Fix a few whitespace defects. Convert a constant 6 to ETH_ALEN. Use parentheses around sizeof. Convert vmalloc/memset to vzalloc. Remove now unused size variables. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2013-01-28igb: Don't give VFs random MAC addressesMitch A Williams1-3/+3
If the user has not assigned a MAC address to a VM, then don't give it a random one. Instead, just give it zeros and let it figure out what to do with them. Signed-off-by: Mitch Williams <[email protected]> CC: Andy Gospodarek <[email protected]> CC: Stefan Assmann <[email protected]> Tested-by: Aaron Brown <[email protected]> Tested-by: Stefan Assmann <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>