aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/bnx2.c
AgeCommit message (Collapse)Author
2010-04-27bnx2: Update version to 2.0.9.Michael Chan
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-27bnx2: Prevent "scheduling while atomic" warning with cnic, bonding and vlan.Michael Chan
The bonding driver calls ndo_vlan_rx_register() while holding bond->lock. The bnx2 driver calls bnx2_netif_stop() to stop the rx handling while changing the vlgrp. The call also stops the cnic driver which sleeps while the bond->lock is held and cause the warning. This code path only needs to stop the NAPI rx handling while we are changing the vlgrp. Since no reset is going to occur, there is no need to stop cnic in this case. By adding a parameter to bnx2_netif_stop() to skip stopping cnic, we can avoid the warning. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-27bnx2: Fix lost MSI-X problem on 5709 NICs.Michael Chan
It has been reported that under certain heavy traffic conditions in MSI-X mode, the driver can lose an MSI-X vector causing all packets in the associated rx/tx ring pair to be dropped. The problem is caused by the chip dropping the write to unmask the MSI-X vector by the kernel (when migrating the IRQ for example). This can be prevented by increasing the GRC timeout value for these register read and write operations. Thanks to Dell for helping us debug this problem. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-23bnx2: Use proper handler during netpoll.Michael Chan
Netpoll needs to call the proper handler depending on the IRQ mode and the vector. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-23bnx2: Fix netpoll crash.Benjamin Li
The bnx2 driver calls netif_napi_add() for all the NAPI structs during ->probe() time but not all of them will be used if we're not in MSI-X mode. This creates a problem for netpoll since it will poll all the NAPI structs in the dev_list whether or not they are scheduled, resulting in a crash when we access structure fields not initialized for that vector. We fix it by moving the netif_napi_add() call to ->open() after the number of IRQ vectors has been determined. Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28bnx2: Remove now useless VPD codeMatt Carlson
Now that the VPD searching code is abstracted away, the outer loop used to detect the read-only large resource data type section is useless. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28pci: Add helper to search for VPD keywordsMatt Carlson
This patch adds the pci_vpd_find_info_keyword() helper function to find information field keywords within read-only and read-write large resource data type sections. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28pci: Add VPD information field helper functionsMatt Carlson
This patch adds a preprocessor constant to describe the PCI VPD information field header size and an inline function to extract the size of the information field itself. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28pci: Add helper to find a VPD resource data typeMatt Carlson
This patch adds the pci_vpd_find_tag() helper function to find VPD resource data types in a buffer. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28pci: Add large and small resource data type codeMatt Carlson
This patch introduces more VPD preprocessor definitions to identify some small and large resource data type item names. The patch then continues to correct how the tg3 and bnx2 drivers search for the "read-only data" large resource data type. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-28pci: Add PCI LRDT tag size and section sizeMatt Carlson
This patch adds a preprocessor constant to describe the PCI VPD large resource data type tag size and an inline function to extract the large resource section size from the large resource data type tag. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-22net: convert multiple drivers to use netdev_for_each_mc_addr, part3Jiri Pirko
Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17drivers/net/bnx2.c: Use (pr|netdev|netif)_<level> macro helpersJoe Perches
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Remove #define PFX Use pr_<level> Use netdev_<level> Use netif_<level> Remove periods from formats Coalesce long formats Coalesce some printks Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-16bnx2: Update firmwares and update version to 2.0.8.Michael Chan
- Increase FTQ depth to 256 to ehnabce performance. - Fix RV2P context corruption on 5709 when flow control is enabled. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-16bnx2: Fix bug when saving statistics.Patrick Rabau
This fixes the problem of dropping the carry when adding 2 32-bit values. Switch to use array indexing for better readability. Reported by and fix provided by Patrick Rabau. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-16bnx2: Allow user-specified multiple advertisement speed values.Michael Chan
Remove unnecessary code that works around older versions of ethtool that can pass down invalid advertisement speed values. This old code prevents the user from specifying multiple advertisement values. The new code uses simple masking to mask out invalid advertisment bits. Reported-by: Vlad Yasevich <vladislav.yasevich@hp.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-16bnx2: Adjust flow control water marks.Michael Chan
The current water marks are too high and can cause unnecessary flow control frames. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-16bnx2: Need to call cnic_setup_cnic_irq_info() after MTU change.Michael Chan
New status blocks are allocated during MTU change so we need to update this information for the cnic driver. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-16bnx2: Check BNX2_FLAG_USING_MSIX flag when setting up MSIX.Michael Chan
Checking the flag is more correct than checking bp->irq_nvecs. By accident it is not a problem because we always have more than 1 vectors when using MSIX mode. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-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 Pirko
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-28netdev: remove HAVE_ leftoversAlexey Dobriyan
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-25net: use helpers to access uc list V2Jiri Pirko
This patch introduces three macros to work with uc list from net drivers. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-17bnx2: Save statistics during reset.Michael Chan
MTU changes, ring size changes, etc cause the chip to be reset and the statisctics flushed. To keep track of the accumulated statistics, we add code to save the whole statistics block before reset. We also modify the macros and statistics functions to return the sum of the saved and current counters. Based on original patch by Breno Leitao <leitao@linux.vnet.ibm.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-17bnx2: Refine statistics code.Michael Chan
Refine the statistics macros by passing in just the name of the counter field. This makes it a lot easier and cleaner to add counters saved before the last reset in the next patch. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-08bnx2: Flush the register writes which setup the MSI-X tableBenjamin Li
The MSI-X table size needs to be properly set before pci_enable_msix() is called. But on certain machines, the writes are delayed and the MSI-X table size is incorrectly read. By reading the BNX2_PCI_MSIX_CONTROL register, the writes are flushed and now ensure that the MSI-X table is set correctly before MSI-X is enable on the device. This patch was originally diagnosed and authored by Kalyan Ram Chintalapati <kalyanc@vmware.com>. Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Kalyan Ram Chintalapati <kalyanc@vmware.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-20bnx2: Fix bnx2_netif_stop() merge error.Michael Chan
The error was introduced while merging: commit 4529819c45161e4a119134f56ef504e69420bc98 bnx2: reset_task is crashing the kernel. Fixing it. Signed-off-by: Michael Chan <mchan@broadcom.com>k Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-18bnx2: fixing a timout error due not refreshing TX timers correctlyBreno Leitao
When running the following script on an active bnx2 interface: while(true); do ifconfig ethX mtu 9000; ifconfig ethX mtu 1500; done A timeout error appears and dumps the following stack: NETDEV WATCHDOG: eth4 (bnx2): transmit queue 0 timed out ------------[ cut here ]------------ Badness at net/sched/sch_generic.c:261 <snip> This patch just fixes the way that ->trans_start is refreshed. Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-18bnx2: reset_task is crashing the kernel. Fixing it.Breno Leitao
If bnx2 schedules a reset via the reset_task, e.g., due to a TX timeout, it's possible for the NIC to be disabled with packets pending for transmit. In this case, napi_disable will loop forever, eventually crashing the kernel. This patch moves the disable of the device to after the napi_disable call. Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03bnx2: Refine VPD logic.Michael Chan
- Replace magic values with constants - Simplify length calculation and fix a bug Based on valuable feedback from Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03bnx2: Update version to 2.0.3.Michael Chan
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03bnx2: Read firmware version from VPD.Michael Chan
And display it through ethtool -i. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03bnx2: Print warning when unable to allocate the full SKB/page ring.Michael Chan
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03bnx2: Dump some state during tx timeout.Michael Chan
To help debug the problem. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03bnx2: Protect tx timeout reset with rtnl_lock().Michael Chan
To prevent race conditions with other reset events. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-02Merge branch 'master' of ↵David S. Miller
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
2009-12-02bnx2: remove skb_dma_map/unmap calls from driverAlexander Duyck
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. [ Fix bnx2_free_tx_skbs() ring indexing and use NETDEV_TX_OK return code in bnx2_start_xmit() after cleaning up DMA mapping errors. -Mchan ] Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-02bnx2: EEH is failing with timeoutBreno Leitao
bnx2 is failing when a PCI error is detected. The error is the following: bnx2: Chip not in correct endian mode bnx2: fw sync timeout, reset code = 404001d This error was caused because the way pci_restore_state() is working after commit 4b77b0a2ba27d64f58f16d8d4d48d8319dda36ff ("PCI: Clear saved_state after the state has been restored"). Signed-off-by: Breno Leitao<leitao@linux.vnet.ibm.com> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-04bnx2: avoid compiler warningsEric Dumazet
drivers/net/bnx2.c: In function ‘bnx2_enable_forced_2g5’: drivers/net/bnx2.c:1447: warning: ‘bmcr’ may be used uninitialized in this function drivers/net/bnx2.c: In function ‘bnx2_disable_forced_2g5’: drivers/net/bnx2.c:1482: warning: ‘bmcr’ may be used uninitialized in this function One fix would be to have an initial value, but a plain return might be better. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-03netdev: Remove redundant checks for CAP_NET_ADMIN in MDIO implementationsBen Hutchings
dev_ioctl() already checks capable(CAP_NET_ADMIN) before calling the driver's implementation of MDIO ioctls. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-02Merge branch 'master' of ↵David S. Miller
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/yellowfin.c
2009-09-01netdev: convert bulk of drivers to netdev_tx_tStephen Hemminger
In a couple of cases collapse some extra code like: int retval = NETDEV_TX_OK; ... return retval; into return NETDEV_TX_OK; Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29bnx2: Update firmware to 5.0.0.j3.Michael Chan
- Better small packet receive performance. - Better handling of Flow control on 5709. - Fixed iSCSI TMP ABORT TASK problem. - Added iSCSI TCP timestamp option. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-22bnx2: Update version to 2.0.2.Michael Chan
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-22bnx2: Use const on flash_table structure.Michael Chan
The structure, once initialized, never changes. Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-22bnx2: Refine coalescing parameters.Michael Chan
- Set the USE_INT_PARAM bit so the rx-frames-irq and tx-frames-irq will take effect on 5709. - Increase the default rx-frames to reduce interrupt count. - Decrease the default rx-frames-irq and tx-frames-irq to catch more events during NAPI poll. All these will reduce interrupts without affecting latency. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-22bnx2: Report FTQ discard counter.Michael Chan
Report this counter to ethtool -S and include it in netstat. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-22bnx2: Apply BROKEN_STATS workaround to 5706 and 5708.Michael Chan
Add flag to expand the workaround to both chips. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-22bnx2: Close device if MTU change or ring size change fails.Michael Chan
When unable to allocate memory for new MTU or new ring size, we need to close the device to prevent it from crashing. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-22bnx2: Check if_running() before touching chip registers.Michael Chan
Add this check to bnx2_netif_stop() and bnx2_vlan_rx_register() to prevent bus lockups on some systems when the chip is in low power state. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-22bnx2: Zero out status block before chip reset.Michael Chan
In case IRQs are shared, we will not mistakenly start processing the ring based on old status block indices. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>