Commit Graph

204 Commits (f2cedb63df14342ad40a8b5b324fc5d94a60b665)

Author SHA1 Message Date
Mintz Yuval a1e785e02b bnx2x: allow all functions to display the phy FW version
The phy FW version is stored in regular memory, no MDC-MDIO access or
any special locks are required to read it in the current implementation.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:50 -05:00
Mintz Yuval 04f2d51313 bnx2x: removed code re-checking memory base after device open
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:50 -05:00
Mintz Yuval 10bd1f243c bnx2x: allow BCM84833 phy to advertise 100Base-T speeds
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval 82fa848c11 bnx2x: notify cnic of address of info-to-the-mcp
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval d760fc37b0 bnx2x: allocate smaller Rx rings for 1G functions
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval afa13b4b94 bnx2x: allocate memory dynamically in ethtool self-test.
From: Merav Sicron <meravs@broadcom.com>

Current ethtool self tests usesa large buffer on stack. This patch replaces
that array by dynamically allocated memory

Signed-off-by: Merav Sicron <meravs@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval 817a8aa8cf bnx2x: force 10G on 84833 phy should be autoneg with only 10G advertised
From: Yaniv Rosner <yaniv.rosner@broadcom.com>

Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval 1b85ae5273 bnx2x: added autoneg-restart after link advertisement changes
From: Yaniv Rosner <yaniv.rosner@broadcom.com>

Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:49 -05:00
Mintz Yuval 9e7e8399c5 bnx2x: ethtool publishes link partners speed and FC
Following the changes in the ethtool source code, this patch enables
the bnx2x driver to publish the Link partner's capabilities s, when ethtool
is used on an interface which completed autoneg.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:48 -05:00
Mintz Yuval e18c56b2e9 bnx2x: half duplex support added for several boards
From: Yaniv Rosner <yaniv.rosner@broadcom.com>

Several boards require an additional HW bit written in-order to enable
half duplex.

Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:48 -05:00
Mintz Yuval 1355b704b9 bnx2x: consistent statistics after internal driver reload
Currently bnx2x statistics are reset by inner driver reload, e.g. by MTU
change. This patch fixes this issue - from now on statistics should only
be reset upon device closure.
Thanks to Michal Schmidt <mschmidt@redhat.com> for his initial patch
regarding this issue.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-15 15:30:48 -05:00
Matt Carlson 9e056c0320 tg3: Update copyright
This patch updates the copyright dates in the tg3 driver.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:08 -05:00
Matt Carlson e740522e6d tg3: Use *_UNKNOWN ethtool definitions
This patch replaces tg3's private SPEED_INVALID and DUPLEX_INVALID
definitions with SPEED_UNKNOWN and DUPLEX_UNKNOWN respectively.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:08 -05:00
Matt Carlson c6700ce224 tg3: Remove unneeded link_config.orig_... members
This patch removes the unneeded link_config.orig_* members.  When the
phy is in a low power state, the TG3_PHYFLG_IS_LOW_POWER flag solely
determines how the link is configured.  When the phy is powered back up,
it can resume using the original settings.

For the phylib case, the link configuration still needs to be saved, but
since the phylib maintains its own configuration, we can repurpose the
(unused in this case) tg3 link configuration members.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:07 -05:00
Matt Carlson 2855b9fe41 tg3: Remove unused link config code
When tg3 devices are shutdown, the driver uses the
TG3_PHYFLG_IS_LOW_POWER flag to enable a static phy configuration.
Any attempt to use the link configuration variables is dead code.  This
patch removes such code.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:06 -05:00
Matt Carlson 42b123b129 tg3: Consolidate ASIC rev detection code
Detecting the ASIC revision of a device is getting to be an increasingly
complex process.  This patch consolidates all the ASIC rev detection
code to a single routine for better maintainability.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:06 -05:00
Matt Carlson b28f389d92 tg3: Reduce UMP event collision window
The tg3 driver needs to submit a few phy register values to the UMP
firmware each time the link state changes.  Up until now, the driver
would wait for the previous event to complete, then proceed to gather
data through a series of phy accesses.  Since phy accesses are
relatively slow, it is possible for another thread to attempt to submit
its own event while the UMP code is still construction its message.

This patch seeks to minimize the collision window as much as possible by
preloading the phy data.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:06 -05:00
Matt Carlson 4227822499 tg3: Fix NVRAM page writes on newer devices
On newer devices, the hardware expects the NVRAM address register
to be written only once per NVRAM page.  To do otherwise causes NVRAM
corruption.  This patch fixes the problem.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:05 -05:00
Matt Carlson 3198e07fd6 tg3: Fix copper autoneg adv checks
When checking the autoneg advertisements, the driver failed to include
the master and master enable bits for the bcm5701.  This patch fixes the
problem.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:05 -05:00
Matt Carlson b546e46f5c tg3: Fix stats while interface is down
If the tg3 interface is down, the driver will return ethtool stats
uninitialized.  This patch zeroes out the destination stat buffer in
such a case.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:04 -05:00
Matt Carlson 3906969189 tg3: Disable new DMA engine for 57766
A bug was found in the new DMA engine for the 57766.  This patch
disables it, which causes the device to fallback to the old DMA engine.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 20:45:04 -05:00
Matt Carlson c5665a538d tg3: Move transmit comment to a better location
This patch moves a comment in the transmit path to a better location.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:33 -05:00
Matt Carlson 4b40952268 tg3: Eliminate unneeded prototype
This patch eliminates the unneeded tg3_halt_cpu() prototype and moves
the tg3_setup_phy() prototype closer to where it is needed.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:32 -05:00
Matt Carlson 16c7fa7dfe tg3: Relocate tg3_find_peer
This patch relocates tg3_find_peer to eliminate a prototype.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:32 -05:00
Matt Carlson dbe9b92a60 tg3: Move tg3_nvram_write_block functions
This patch moves the tg3_nvram_write_block functions higher in the file
to eliminate a prototype.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:32 -05:00
Matt Carlson ccd5ba9db5 tg3: Move tg3_set_rx_mode
This patch moves __tg3_set_rx_mode above its first use and moves
tg3_set_rx_mode down closer to where the netdev_ops functions should be.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:32 -05:00
Matt Carlson faf1627ac1 tg3: Move tg3_change_mtu to a better location
This patch moves tg3_change_mtu to a better location.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:32 -05:00
Matt Carlson 9a21fb8fc3 tg3: Relocate tg3_reset_task
This patch moves tg3_reset_task further down in the file where it makes
more sense to be.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:31 -05:00
Matt Carlson ebf3312e78 tg3: Move tg3_restart_hw to a better location
This patch relocates tg3_restart_hw() to a better location.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 15:57:31 -05:00
Joe Perches 23677ce317 drivers/net: Remove boolean comparisons to true/false
Booleans should not be compared to true or false
but be directly tested or tested with !.

Done via cocci script:

@@
bool t;
@@
- t == true
+ t
@@
bool t;
@@
- t != true
+ !t
@@
bool t;
@@
- t == false
+ !t
@@
bool t;
@@
- t != false
+ t

Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-13 00:47:40 -05:00
David S. Miller d5ef8a4d87 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/infiniband/hw/nes/nes_cm.c

Simple whitespace conflict.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-10 23:32:28 -05:00
Eddie Wai 4cbbb04dc1 cnic: Update VLAN ID during ISCSI_UEVENT_PATH_UPDATE
This will support the new VLAN attribute in the iSCSI iface file.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-09 14:03:50 -05:00
Jeffrey Huang 0cb1f4b960 cnic: set error flag when iSCSI connection fails
to speed up error recovery due to SPQ failures.  The error flag will
expedite the recovery process by skipping the timeouts.

Signed-off-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-09 14:03:50 -05:00
Jesper Juhl 3f61cd879c bnx2x: Fix mem leak in bnx2x_tpa_stop() if build_skb() fails.
We allocate memory for 'new_data' with kmalloc(). If we get the memory
we then try to build_skb() and if that should fail (which it can) we
do not enter 'if (likely(skb)) {' and actually use 'new_data' but
instead fall through to the 'drop:' label and end up returning from
the function without ever assigning 'new'data' to anything or freeing
it. That leaks the memory allocated to 'new_data'.

This patch fixes the memory leak by doing a kfree(new_data) in the
case where build_skb() fails (or where allocation of 'new_data' itself
fails, but in taht case it's just a harmless kfree(NULL)).

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-07 13:13:33 -05:00
Michael Chan 3238a9be4d cnic: Add FCoE parity error recovery
When bnx2x returns error on FCoE SPQ messages, generate an error
completion to bnx2fc immediately to speed up error recovery.  This
will eliminate length timeouts and spped up the reset of the device.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-05 22:42:00 -05:00
Vlad Zolotarov 94bf91baf3 bnx2: Add missing memory barrier in bnx2_start_xmit()
Sync DMA descriptor before hitting the TX mailbox for weak memory model
CPUs.

There has been discussions several years ago about this.  Some believe
that writel() should guarantee ordering.  Others want explicit barriers
if necessary.  Today writel() does not have the ordering guarantee and
many other drivers use explicit barriers.

Signed-off-by: Vlad Zolotarov <vlad@scalemp.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-05 22:42:00 -05:00
Michael Chan b033281f61 bnx2: Add support for ethtool --show-channels|--set-channels
Allow the user to override the default number of RSS/TSS rings.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-02-05 22:42:00 -05:00
Joe Perches 41de8d4cff drivers/net: Remove alloc_etherdev error messages
alloc_etherdev has a generic OOM/unable to alloc message.
Remove the duplicative messages after alloc_etherdev calls.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-31 16:20:48 -05:00
Joe Perches e404decb0f drivers/net: Remove unnecessary k.alloc/v.alloc OOM messages
alloc failures use dump_stack so emitting an additional
out-of-memory message is an unnecessary duplication.

Remove the allocation failure messages.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-31 16:20:21 -05:00
Ariel Elior 85b26ea18e bnx2x: Update version to 1.72.0 and copyrights
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-26 13:39:52 -05:00
Ariel Elior 7a752993fe bnx2x: Recoverable and unrecoverable error statistics
Add statistics for tracking parity errors from which we successfully
recovered and those which were deemed unrecoverable.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-26 13:39:52 -05:00
Ariel Elior 95c6c6165e bnx2x: Recovery flow bug fixes
1. Sample mcp pulse and mcp sequence in nic load instead of in init_one
as they may change by the time we want to use them.

2. Allow cnic to access device during nic load (by adding a new "LOADING" state
to recovery flow). This prevents the unnecessary cnic timeout which resulted
by cnic attempting to access because nic is loading, but being blocked because
of the Recovery state.

3. Issue 'fake' driver load command to mcp when last driver unloads to prevent
mcp from taking ownership. When recovery is complete unload fake driver to
allow mcp to initialize the hardware before first driver loads.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-26 13:39:52 -05:00
Ariel Elior 889b9af34f bnx2x: Track active PFs with bitmap
The recovery register (to which a hardware lock has been added in previous
patch) is used amongst other things to track the active PFs. The old
implementation which used a per path counter is not viable in a virtualized
environment where a pf may increment the counter and then have the kernel
crash around it preventing the counter from ever reaching zero.
In the new implementation the scenario described will result in the PF timing
out against the mcp, which will clear the PF's bit in the bitmask allowing
recovery process to proceed.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-26 13:39:52 -05:00
Ariel Elior f16da43b5d bnx2x: Lock PF-common resources
Use hardware locks to protect resources common to several Physical Functions. In
a virtualized environment the RTNL lock only protects a PF's driver against
the PFs sharing it's VMs with regard to device resources. Other PFs may reside
in other VMs under other OSs, and are not subject to the lock. Such resources
which were previously protected implicitly by the RTNL lock must now be
protected explicitly with dedicated HW locks.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-26 13:39:52 -05:00
Ariel Elior d1e2d9660e bnx2x: Loaded Firmware Version Validation
In a virtualized environment it is possible for a loading driver to discover
that Firmware is already loaded to the device, and that this FW does not match
its own. This can happen for example if different Physical Functions are
Assigned to different VMs in which different driver versions are loaded. The
code in this patch ensures that only drivers with matching FW are loaded over
the device, and that in the case described above where the Firmware version
doesn't match the driver load is aborted.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-26 13:39:51 -05:00
Ariel Elior 89db4ad830 bnx2x: Function Level Reset Final Cleanup
1. Fix bug where return value is ignored
2. Improve printouts
3. Fix typos

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-26 13:39:51 -05:00
Ariel Elior c22610d000 bnx2x: Obtain Bus Device Function from register
BDF was obtained from kernel but since in virtualized environment
(e.g. physical device assigment in KVM) the function number may
not be the real one, the info must be obtained from the device.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-26 13:39:51 -05:00
Ariel Elior 127a425e8f bnx2x: Removing indirect register access
In virtualized environments indirect access to the device may not be supported
(depending on the Hypervisor type). Indirect device access was used since in
some harware contexts (i.e. certain chipset and BIOS) every access the driver
makes across the pci is followed by a BIOS initiated Zero Length Read to the
same address. When accessing widebus registers this zero length read corrupts
the serialization of the read/write sequence resulting with errors. To avoid
this problem widebus registers are always accessed via the DMAE or the indirect
interface. However, the 57712x and 578xx devices intercept the zero length read
and so using the indirect interface with these devices is not necessary. Since
PDA is only supported for 57712x and 578xx the indirect access to device was
restricted to 57710 and 57711x.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-26 13:39:51 -05:00
Ariel Elior 8d7b02783b bnx2x: Support Queue Per Cos in 5771xx devices
Enable the use of up to three hardware queues for transmission. The queues
are always dequed round robin (i.e. strict priority, PFC and ETS are not
supported). This does allow the allocation of a seperate HW queue for low
volume, high priority traffic which will be serviced more promptly.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-26 13:39:51 -05:00
Dan Carpenter a44acd5514 bnx2x: unlock before returning an error
We introduced a new return here but forgot to drop the lock.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-25 16:58:26 -05:00