aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-02-12tg3: Turn off multiple DMA reads for 5717Matt Carlson1-0/+3
The 5717's DMA read engine has a bug when initiating multiple DMA reads across the PCIe bus. This patch disables the feature. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12tg3: Fix 57765 A0 bootcode race conditionMatt Carlson1-0/+7
On A0 revision of 57765 asic rev devices, the bootcode will perform some hardware operations, after the magic signature is presented, that will collide with setup operations performed by the driver. The best way to avoid the contention is to have the driver delay an additional 10 milliseconds. B0 revisions of the chip will make this workaround unnecessary. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12tg3: Unwedge stuck MSI-X vectorsMatt Carlson1-10/+19
The previous patch changed the code so that new rx buffer submissions to the hardware stall if a new submission would overwrite data needed by an unserviced rx packet. On very busy 5717 and 57765 asic rev devices, there is a corner case where the hardware will fail to assert an MSI-X interrupt for rx traffic. If that vector's interrupt never has another reason to assert, any rx buffers held will never be serviced. If the buffers are never serviced and the hardware consumes all the available rx packets for other rx rings, deadlock will result. The most reliable and least intrusive way to work around the problem is to detect the case where new submissions would overwrite existing data and force all rx interrupt vectors to fire. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12tg3: Prevent rx producer ring overrunsMatt Carlson1-0/+38
When operating in RSS mode, it is possible for one rx return ring to submit enough rx buffers back to the hardware such that it inadvertently overwrites data needed by another rx return ring. This patch addresses the problem by looking for non-NULL skb pointers in the rx_[std|jmb]_buffers rings that parallel the rx producer rings. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12tg3: Give MSI-X vec 1 rx backlog spaceMatt Carlson1-25/+21
RSS ring 1 is responsible for submitting new rx buffers to the hardware on behalf of all the other RSS rx return rings. Up until now this ring submitted its new rx buffers to the producer ring directly. The following patch will require that this ring have a place to put backlogged rx packets. As a consequence, it can no longer submit new buffers to the producer ring. This patch adds code to allocate an extra shadow producer ring for this RSS ring and adds RSS ring 1 to the list of rings needing buffer transfers. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12net: use netdev_mc_count and netdev_mc_empty when appropriateJiri Pirko1-2/+2
This patch replaces dev->mc_count in all drivers (hopefully I didn't miss anything). Used spatch and did small tweaks and conding style changes when it was suitable. Jirka Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-23Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-8/+19
2010-01-20tg3: Add 57765 phy ID and enable devices.Matt Carlson1-0/+7
This patch rounds out the 57765 asic rev support by adding the 57765 phy ID and entering the 57765 device IDs in the pci table. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-20tg3: Bypass power source switching for 57765Matt Carlson1-1/+3
The 57765 repurposes all the GPIOs normally used to switch power sources when configured as a NIC device. This patch changes the code to avoid touching the GPIOs for this asic rev. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-20tg3: Turn off the debug UART for 57765Matt Carlson1-1/+2
If the debug UART is left enabled, the LEDs will not work properly. This patch disables the debug UART. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-20tg3: Fix tx mailbox initializationMatt Carlson1-1/+4
If a device supports MSI-X interrupts, the driver assumes TSS will be available. This is not true for the 57765. This patch changes the code so that only the default tx mailbox is initialized if TSS is not available. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-20tg3: Supply a nicaddr for 57765 jumbo RCBMatt Carlson1-1/+1
The 57765 needs the driver to supply a nic address to the jumbo RCB, just like all other devices except the 5717. This patch changes the test to single out the 5717 rather than maintain a lengthy whitelist of asic revs. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-20tg3: Fix 5717 and 57765 memory selftestsMatt Carlson1-1/+16
Both the 5717 and the 57765 will fail 'ethtool -t' selftests at the memory selftest portion. The memory map for these two devices differs from the rest of the asic revs and each other. This patch adds a new memory map to use for memory selftests. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-20tg3: Abort phy init for 5717 serdes devicesMatt Carlson1-1/+7
The 5717 serdes devices have a different phy register layout than all other previous serdes devices. This patch aborts the phy init sequence in tg3_phy_reset() if the device is a 5717 serdes. It also aborts the tg3_phy_toggle_apd() operation. Most other operations in the MII_SERDES path are O.K. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-20tg3: Add 5717 serdes phy IDMatt Carlson1-1/+2
The serdes and copper phys of the 5717 asic rev have different phy IDs. This patch adds the serdes phy ID. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-20tg3: Improve internal resource allocationsMatt Carlson1-4/+21
The 5717 and the 57765 have more resources at their disposal internally. This patch tunes the driver to get better performance. The adjustments made here only apply to the 57765 and 5717 asic revs. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-20tg3: Enable PLL PD when CLKREQ disabled for 5717A0Matt Carlson1-0/+16
PCIe PLL power down cannot be used if CLKREQ is enabled because data corruption will occur. If CLKREQ is disabled though, enabling PCIE P1 PLL power-down saves some power. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-13tg3: Update copyright and driver versionMatt Carlson1-3/+3
This patch updates the copyright notice for 2010 and updates the version number to 3.106. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-13tg3: Disable 5717 serdes and B0 supportMatt Carlson1-0/+5
The B0 revision of the 5717 will not get enough testing by the time 2.6.33 ships. Since the kernel is already at RC3, serdes support will require too many patches to fix. For these reasons, this patch disables 5717 serdes support and will refuse to attach to all 5717 devices that are later than an A0 revision. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-13tg3: Add reliable serdes detection for 5717 A0Matt Carlson1-2/+7
The serdes status bit does not work as intended for the 5717 A0. This patch implements an alternative detection scheme that will only be valid for A0 revisions. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-13tg3: Fix std rx prod ring handlingMatt Carlson1-2/+3
There are some tg3 devices that require the driver to post new rx buffers in smaller increments. Commit 4361935afe3abc3e5a93006b99197fac1fabbd50, "tg3: Consider rx_std_prod_idx a hw mailbox" changed how the driver tracks the rx producer ring updates, but it does not make any special considerations for the above-mentioned devices. For those devices, it is possible for the driver to hit the special case path, which updates the hardware mailbox register but skips updating the shadow software mailbox member. If the special case path represents the final mailbox update for this ISR iteration, the hardware and software mailbox values will be out of sync. Ultimately, this will cause the driver to use a stale mailbox value on the next iteration, which will appear to the hardware as a large rx buffer update. Bad things ensue. The fix is to update the software shadow mailbox member when the special case path is taken. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-13tg3: Fix std prod ring nicaddr for 5787 and 57765Matt Carlson1-1/+1
Commit 87668d352aa8d135bd695a050f18bbfc7b50b506, titled "tg3: Don't touch RCB nic addresses", tried to avoid assigning the nic address of the standard producer ring. Unfortunately, the default nic address is not correct for the 5787, the 5755M, or the 57765. This patch reenables the old behavior and opts out of the assignment only for the 5717. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Tested-by: Chow Loong Jin <hyperair@ubuntu.com> Tested-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-07drivers/net/: use DEFINE_PCI_DEVICE_TABLE()Alexey Dobriyan1-1/+1
Use DEFINE_PCI_DEVICE_TABLE() so we get place PCI ids table into correct section in every case. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03tg3: Update version to 3.105Matt Carlson1-2/+2
This patch updates the tg3 version to 3.105. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03tg3: Clean tg3_init_one()Matt Carlson1-6/+2
Tg3's firmware is no longer loaded from tg3_init_one(). Remove the error path that releases the firmware back to the system. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03tg3: Use pci_read_vpd() instead of private methodMatt Carlson1-23/+12
If the driver needs to use PCI configuration space to read the VPD data, the accesses could collide with the pci_read_vpd() function. This patch converts the driver to use pci_read_vpd() to avoid any potential collisions. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03tg3: Add some VPD preprocessor constantsMatt Carlson1-7/+8
This patch cleans up the VPD code by creating preprocessor definitions and using them in the place of hardcoded constants. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03tg3: Add 57765 asic revMatt Carlson1-19/+53
This patch adds the 57765 asic revision. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03tg3: Make TSS enable independent of MSI-X enableMatt Carlson1-35/+56
The 57765 asic rev has MSI-X capability, but does not support TSS. This patch changes the tx paths so that TSS is explicitly mentioned, rather than implied through the ENABLE_MSIX flag. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03drivers/net: Move && and || to end of previous lineJoe Perches1-7/+6
Only files where David Miller is the primary git-signer. wireless, wimax, ixgbe, etc are not modified. Compile tested x86 allyesconfig only Not all files compiled (not x86 compatible) Added a few > 80 column lines, which I ignored. Existing checkpatch complaints ignored. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-02tg3: remove use of skb_dma_map/unmapAlexander Duyck1-42/+131
Due to the fact that skb_dma_map/unmap do not work correctly when a HW IOMMU is enabled it has been recommended to go about removing the calls from the network device drivers. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> CC: Matt Carlson <mcarlson@broadcom.com> CC: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Update version to 3.104Matt Carlson1-2/+2
This patch updates the tg3 version to 3.104. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Fix DIDs, Enable 5717 supportMatt Carlson1-4/+6
This patch fixes the 5717 variant device ID enumerations and adds those DIDs to the PCI ID table. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Add rx prod ring consolidationMatt Carlson1-10/+161
This patch adds code to funnel each MSI-X vector's rx packet buffers into a single set of producer rings which will then be submitted to the hardware. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Create aliases for rx producer mailbox regsMatt Carlson1-12/+6
The rx producer mailbox registers are used in several spots in the code. The addition of TG3_64BIT_REG_LOW makes register references uncomfortably long. This patch creates an alias for the standard and jumbo ring producer index registers to make the code cleaner. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Lay proucer ring handling groundworkMatt Carlson1-36/+49
The patch increases the number of producer rings available and implements the constructor and destructor code that deals with them. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Consider rx_std_prod_idx a hw mailboxMatt Carlson1-6/+9
This patch changes how the code uses the rx_std_prod_idx member. In the following patch, the code will be changed so that it will act just like a hardware mailbox. This patch prepares the code so that memory barriers can be more easily inserted. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: rename rx_[std|jmb]_ptrMatt Carlson1-8/+8
A later patch is going to add consumer indicies for the producer rings. To keep things readable, this patch renames rx_[std|jmb]_ptr to rx_[std|jmb]_prod_idx. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: tg3_alloc_rx_skb(tnapi => tp)Matt Carlson1-7/+4
This patch converts the tnapi argument of tg3_alloc_rx_skb() to tp. The level of indirection is unnecessary. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Add prodring parameter to tg3_alloc_rx_skb()Matt Carlson1-20/+21
This patch changes the tg3_alloc_rx_skb() implementation to accept the destination producer ring set pointer as a parameter rather than assuming the source and destination producer rings are the same. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Make tg3_alloc_rx_skb() a dst-only operationMatt Carlson1-13/+9
This patch removes the source index parameter of tg3_alloc_rx_skb(). A later patch will make it possible for the source and destination producer rings to be different. This patch opts to make tg3_alloc_rx_skb() a destination-only implementation and move the code sensitive to the difference elsewhere. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Move napi_add calls below tg3_get_invariantsMatt Carlson1-47/+47
tg3_get_invariants(), among other things, discovers whether or not the device is MSI-X capable and how many interrupts it supports. This discovery needs to happen before registering NAPI instances with netdev. This patch moves the code block that calls napi_add later in tg3_init_one() so that tg3_get_invariants() has a chance to run first. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Create tg3_poll_msix() for non-zero MSIX vecsMatt Carlson1-8/+60
This patch gives all non-zero MSIX vectors their own NAPI handler. This will make NAPI handling for those vectors slightly more efficient. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Allow DMAs to cross cacheline boundariesMatt Carlson1-5/+15
By default, the 5717 (and future chips) break up PCIe DMA packets across cacheline boundaries. This isn't necessary on x86. This patch selectively loosens the restriction. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Use tg3_start_xmit_dma_bug for 5717 A0Matt Carlson1-9/+18
The A0 revision of the 5717 has problems with short packet fragments. It needs to use the tg3_start_xmit_dma_bug() routine. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Add new HW_TSO_3 flag for 5717Matt Carlson1-18/+23
The 5717 sets up TSO slightly differently in the transmit path. It looks like this method will be the new way of doing things. This patch defines a flag to indicate this. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Refine TSO and MSI discoveryMatt Carlson1-30/+34
This patch consolidates the TSO capability discovery code into its own code block. The code that decides whether or not to allow TSO is then cleaned up. Finally, the patch consolidates all MSI and MSIX capability code into a single code block. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Move TG3_FLG2_PROTECTED_NVRAM to tg3_flags3Matt Carlson1-6/+6
We need room for another TSO flag and it would be most efficient if it resided in tg3_flags2. This patch moves the TG3_FLG2_PROTECTED_NVRAM to tg3_flags3 to make room. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Napify tg3_start_xmit_dma_bug()Matt Carlson1-13/+19
This patch converts tg3_start_xmit_dma_bug() to accomodate multiple NAPI instances. This is prep work for a later patch in this series. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-15tg3: Don't touch RCB nic addressesMatt Carlson1-4/+6
This patch avoids reprogramming the RCB NIC addresses for all 5755 and later devices. The address is incorrect for 5717 devices and should be correct by default for all other affected devices. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>