aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-05-06bnx2: Add prefetches to rx path.Michael Chan1-3/+13
Add prefetches of the skb and the next rx descriptor to speed up rx path. Use prefetchw() for the skb [suggested by Eric Dumazet]. The rx descriptor is in skb->data which is mapped for streaming mode DMA. Eric Dumazet pointed out that we should not prefetch the data before dma_sync. So we prefetch only if dma_sync is no_op on the system. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-06bnx2: Add GRO support.Michael Chan1-3/+3
And turn on NETIF_F_GRO by default [requested by DaveM]. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-02Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-21/+27
2010-04-27bnx2: Update version to 2.0.9.Michael Chan1-2/+2
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 Chan1-18/+20
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 Chan1-1/+5
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-04-07bnx2: use the dma state API instead of the pci equivalentsFUJITA Tomonori1-20/+20
The DMA API is preferred. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-06Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-5/+9
Conflicts: drivers/net/bonding/bond_main.c drivers/net/via-velocity.c drivers/net/wireless/iwlwifi/iwl-agn.c
2010-04-03net: convert multicast list to list_headJiri Pirko1-3/+2
Converts the list and the core manipulating with it to be the same as uc_list. +uses two functions for adding/removing mc address (normal and "global" variant) instead of a function parameter. +removes dev_mcast.c completely. +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for manipulation with lists on a sandbox (used in bonding and 80211 drivers) Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-23bnx2: Use proper handler during netpoll.Michael Chan1-3/+5
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 Li1-2/+4
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 Carlson1-45/+29
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 Carlson1-24/+30
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 Carlson1-5/+6
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 Carlson1-20/+4
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 Carlson1-6/+17
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 Carlson1-3/+5
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 Pirko1-3/+1
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 Perches1-84/+61
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 Chan1-7/+7
- 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 Rabau1-5/+5
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 Chan1-25/+8
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 Chan1-1/+1
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 Chan1-0/+7
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 Chan1-1/+1
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 Pirko1-1/+1
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 Dobriyan1-2/+2
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 Pirko1-3/+2
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 Chan1-8/+56
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 Chan1-30/+32
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 Li1-0/+4
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 Chan1-1/+1
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 Leitao1-1/+9
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 Leitao1-1/+1
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 Chan1-28/+21
- 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 Chan1-2/+2
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 Chan1-3/+99
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 Chan1-2/+10
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 Chan1-0/+23
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 Chan1-1/+5
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 master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-0/+1
2009-12-02bnx2: remove skb_dma_map/unmap calls from driverAlexander Duyck1-12/+60
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 Leitao1-0/+1
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 Dumazet1-0/+4
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 Hutchings1-3/+0
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 master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-6/+11
Conflicts: drivers/net/yellowfin.c
2009-09-01netdev: convert bulk of drivers to netdev_tx_tStephen Hemminger1-1/+1
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 Chan1-5/+11
- 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 Chan1-2/+2
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 Chan1-3/+3
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>