]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
13 years agoe1000e/ixgb: fix assignment of 0/1 to bool variables.
Joe Jin [Thu, 17 May 2012 03:18:27 +0000 (11:18 +0800)]
e1000e/ixgb: fix assignment of 0/1 to bool variables.

DaveM said:
   Please, this kind of stuff rots forever and not using bool properly
   drives me crazy.

Joe Perches <joe@perches.com> gave me the spatch script:

@@
bool b;
@@
-b = 0
+b = false
@@
bool b;
@@
-b = 1
+b = true

I merely installed coccinelle, read the documentation and took credit.

(backported from commit 3db1cd5c05f35fb43eb134df6f321de4e63141f2)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agointel: Convert <FOO>_LENGTH_OF_ADDRESS to ETH_ALEN
Joe Perches [Tue, 20 Sep 2011 15:32:52 +0000 (15:32 +0000)]
intel: Convert <FOO>_LENGTH_OF_ADDRESS to ETH_ALEN

Use the normal #defines not module specific ones.

(cherry picked from commit ea99d832cce7e724ba37c488e0571a00cb14d430)
Signed-off-by: Joe Perches <joe@perches.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoe1000: fix skb truesize underestimation
Eric Dumazet [Thu, 13 Oct 2011 07:53:42 +0000 (07:53 +0000)]
e1000: fix skb truesize underestimation

e1000 allocates a full page per skb fragment. We must account PAGE_SIZE
increments on skb->truesize, not the actual frag length.

(cherry picked from commit ed64b3cc11502f50e1401f12e33d021592800bca)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoe1000: convert to private mutex from rtnl
Jesse Brandeburg [Wed, 5 Oct 2011 07:24:51 +0000 (07:24 +0000)]
e1000: convert to private mutex from rtnl

The e1000 driver when running with lockdep could run into
some possible deadlocks between the work items acquiring
rtnl and the rtnl lock being acquired before work items
were cancelled.

Use a private mutex to make sure lock ordering isn't violated.
The private mutex is only used to protect areas not generally
covered by the rtnl lock already.

(cherry picked from commit 0ef4eedc2e98edd51cd106e1f6a27178622b7e57)
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Tushar Dave <tushar.n.dave@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoe1000: convert mdelay to msleep
Jesse Brandeburg [Wed, 5 Oct 2011 07:24:46 +0000 (07:24 +0000)]
e1000: convert mdelay to msleep

With the previous commit, there are several functions
that are only ever called from thread context, and are
able to sleep with msleep instead of mdelay.

(cherry picked from commit 4e0d8f7d97f9150bdd07f6355e5c1486967dce79)
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Tushar Dave <tushar.n.dave@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoe1000: convert hardware management from timers to threads
Jesse Brandeburg [Wed, 5 Oct 2011 07:24:41 +0000 (07:24 +0000)]
e1000: convert hardware management from timers to threads

Thomas Gleixner (tglx) reported that e1000 was delaying for many milliseconds
(using mdelay) from inside timer/interrupt context.  None of these paths are
performance critical and can be moved into threads/work items.  This patch
implements the work items and the next patch changes the mdelays to msleeps.

(cherry picked from commit a4010afef585b7142eb605e3a6e4210c0e1b2957)
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Tushar Dave <tushar.n.dave@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoe100: Remove alloc_etherdev error messages
Joe Jin [Thu, 17 May 2012 03:02:23 +0000 (11:02 +0800)]
e100: Remove alloc_etherdev error messages

alloc_etherdev has a generic OOM/unable to alloc message.
Remove the duplicative messages after alloc_etherdev calls.

(backported from commit 41de8d4cff21a2e81e3d9ff66f5f7c903f9c3ab1)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agonet: Remove Intel NICs unnecessary driver assignments of ethtool_ringparam fields...
Joe Jin [Thu, 17 May 2012 02:52:30 +0000 (10:52 +0800)]
net: Remove Intel NICs unnecessary driver assignments of ethtool_ringparam fields to zero

For e100/e1000/e1000e/igb/igbvf/ixgb/ixgbe/ixgbevf

Per comments from Ben Hutchings on a previous patch, sweep the floors
a little removing unnecessary assignments of zero to fields of struct
ethtool_ringparam in driver code supporting ethtool -g.

(backported from commit 8b0c11679fd37522d8d34a76101319a085d80912)
Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoe100: Show short v/s long rx length errors in ethtool stats.
Ben Greear [Fri, 17 Feb 2012 13:44:28 +0000 (13:44 +0000)]
e100: Show short v/s long rx length errors in ethtool stats.

(cherry picked from commit 6f66342c1ecd59467d4579176dd81a4e837a06ef)
Signed-off-by: Ben Greear <greearb@candelatech.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoe100: Fix rx-over-length statistics.
Ben Greear [Fri, 17 Feb 2012 13:44:23 +0000 (13:44 +0000)]
e100: Fix rx-over-length statistics.

The old code would += the total errors every time
stats were gathered.  Instead, keep a count of short-pkt
and long-pkt counters and then simply add them together
for the rx-over-length stat.

(cherry picked from commit d24d65eda97fe51f2996538148e85d309e2460e4)
Signed-off-by: Ben Greear <greearb@candelatech.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agoe100: make sure vlan support isn't advertised on old adapters
Jesse Brandeburg [Sat, 22 Oct 2011 05:18:10 +0000 (05:18 +0000)]
e100: make sure vlan support isn't advertised on old adapters

e100 parts don't support vlan offload but they generally do
allow use of vlans in higher software layers via the 8021q module.
That said, there are a couple of really old revisions of e100
hardware that don't even allow the longer frame sizes
required for vlan use with standard MTU.

Use the VLAN_CHALLENGED flag to prevent vlan binding to these
devices.

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 243559f436f26b571ea3a4e70ff082892dc58f16)
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Michael Tokarev <mjt@tls.msk.ru>
CC: David Lamparter <equinox@diac24.net>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago8139cp: properly config rx mode after resuming
Jason Wang [Fri, 30 Dec 2011 23:44:42 +0000 (23:44 +0000)]
8139cp: properly config rx mode after resuming

Rx mode should be reset after resming, so unconditionally updating rx
mode rather than conditionally updating based on the value we
remembered, otherwise unexpected value may be used by the nic after
resuming.

btw. I find and test this when debugging guest hibernation in qemu, as
I did not have a 8139cp card in hand, this patch is untested in a
physical 8139cp card, plase review it carefully.

(cherry picked from commit f872b237c1750221932e715da2552225afe4a95c)
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: add bnx2x firmware 7.2.16
Joe Jin [Thu, 17 May 2012 01:44:56 +0000 (09:44 +0800)]
bnx2x: add bnx2x firmware 7.2.16

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Remove bh disable in softirq context
Neil Horman [Fri, 9 Mar 2012 22:50:13 +0000 (14:50 -0800)]
bnx2fc: Remove bh disable in softirq context

As with the fcoe sw transport, the bnx2fc packet handler function runs only in
softirq context.  Theres no need to disable bottom halves here

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit fc05ab74b78a9e16b0faa9f0dc3c87f3f30d3231)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: HSI dependent changes for 7.2.xx FW
Bhanu Prakash Gollapudi [Mon, 20 Feb 2012 09:59:09 +0000 (09:59 +0000)]
bnx2fc: HSI dependent changes for 7.2.xx FW

with Tx only section for single cached SGEs.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1101a0d87a8e336914d2f31b528748a231c375ed)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Bumped version to 1.0.10
Bhanu Prakash Gollapudi [Tue, 24 Jan 2012 02:00:49 +0000 (18:00 -0800)]
bnx2fc: Bumped version to 1.0.10

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 98788a134979fe66c32a1393adf66f7d3faf16ea)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: NPIV ports go offline when interface is brought down & up
Bhanu Prakash Gollapudi [Tue, 24 Jan 2012 02:00:48 +0000 (18:00 -0800)]
bnx2fc: NPIV ports go offline when interface is brought down & up

When there are 255 NPIV ports, and the interface is brought down & up, both
physical and NPIV ports are logged off and never logged back in. Since
discovery happens on single CPU, XID resources on that CPU will be limited,
which when exhausted the discovery fails. Increase the XID resource range to
ensure that the discovery completes successfully. Also ensure that
fc_exch_mgr_alloc() doesn't fail on the system that has lower number of CPUs.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 7d742f659e00f08016a4446a9134036e47f9a0cf)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Handle LOGO flooding from the target
Bhanu Prakash Gollapudi [Tue, 24 Jan 2012 02:00:47 +0000 (18:00 -0800)]
bnx2fc: Handle LOGO flooding from the target

Host drops sessions when flood of unsolicited LOGOs are received from the
target. Because of unsufficient PLOGI retries, upon exceeding the retry count
of 3, the target sessions are dropped. Increased the retry count to 255 to
allow sufficient retries in this scenario.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 44c570b5b09d1d1cc3167834f89f754f1bc5ac14)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: fix panic in bnx2fc_post_io_req
Bhanu Prakash Gollapudi [Tue, 24 Jan 2012 02:00:46 +0000 (18:00 -0800)]
bnx2fc: fix panic in bnx2fc_post_io_req

System panics while accessing stale pointer - timer_work_queue - in the IO path
before bnx2fc_stop is called. Fix is to destroy the workqueue after the destroy
operation is complete.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 2a7b29c5f267c143e280c1a5174a0d930bd6c1e3)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Bumped version to 1.0.9
Bhanu Prakash Gollapudi [Mon, 24 Oct 2011 06:23:58 +0000 (23:23 -0700)]
bnx2fc: Bumped version to 1.0.9

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit fd2541893da50cbc1e547a9aaebf104bed859915)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Handle SRR LS_ACC drop scenario
Bhanu Prakash Gollapudi [Mon, 24 Oct 2011 06:23:57 +0000 (23:23 -0700)]
bnx2fc: Handle SRR LS_ACC drop scenario

When SRR LS_ACC is dropped, the driver was not issuing ABTS for SRR when it
times out. Since the target received SRR, it was able to send the XFER_RDY and
the the original IO request completed successfully. In this condition ABTS was
not sent during bnx2fc_srr_compl(). Fix this by first checking for ELS timeout
and issue ABTS before checking if original IO request is complete.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 32c30454507b4f5f00661ac12ddbcc150983b9ff)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Handle ABTS timeout during ulp timeout
Bhanu Prakash Gollapudi [Mon, 24 Oct 2011 06:23:56 +0000 (23:23 -0700)]
bnx2fc: Handle ABTS timeout during ulp timeout

If the IO and the corresponding ABTS are not responded by a target, cleanup the
IO and issue explicit logout when ulp timer expires while waiting for ABTS to
complete. Wait for the session to be ready before returning to the SCSI layer.
If the session is not ready let the SCSI-ml escalate the error recovery.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 99cc600cdd6f938633394523447378f7a43f4340)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Bumped version to 1.0.8
Bhanu Prakash Gollapudi [Mon, 3 Oct 2011 23:45:03 +0000 (16:45 -0700)]
bnx2fc: Bumped version to 1.0.8

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 29f366e8a99fdced4c0b5417a478d7539adc66d3)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Return error statistics of remote peer
Bhanu Prakash Gollapudi [Mon, 3 Oct 2011 23:45:02 +0000 (16:45 -0700)]
bnx2fc: Return error statistics of remote peer

Add support for get_lesb so that the valid statistics are returned by the
remote peer when RLS command is issued.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit f72f6979c924af1c33dac9aff5a8004e89ada667)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: call ctlr_link_up only when the interface is enabled
Bhanu Prakash Gollapudi [Mon, 3 Oct 2011 23:45:00 +0000 (16:45 -0700)]
bnx2fc: call ctlr_link_up only when the interface is enabled

Link may not be up when the driver receives ulp_start event, and hence
fcoe_ctlr_link_up is not called. Call fcoe_ctlr_link_up during
indicate_netevent only when the interface is enabled. (It has to be called when
enabled because that is an indication that the vlan discovery is completed).

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit fd8fa9071e49a56cc91f739813ea88f16b7c1240)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Bumped version to 1.0.7
Bhanu Prakash Gollapudi [Mon, 19 Sep 2011 23:52:14 +0000 (16:52 -0700)]
bnx2fc: Bumped version to 1.0.7

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 0a336d6f1b9e2419c2fa724a5463b63fa9df7ee5)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Handle bnx2fc_map_sg failure
Bhanu Prakash Gollapudi [Mon, 19 Sep 2011 23:52:13 +0000 (16:52 -0700)]
bnx2fc: Handle bnx2fc_map_sg failure

Gracefully handle bnx2fc_map_sg failure, so that queuecommand returns host busy
and SCSI-ml can retry the IO.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 822f29032b98ee44eb8ef2684ba4c7df6c967198)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Replace scsi_dma_map() with dma_map_sg().
Bhanu Prakash Gollapudi [Mon, 19 Sep 2011 23:52:12 +0000 (16:52 -0700)]
bnx2fc: Replace scsi_dma_map() with dma_map_sg().

scsi_dma_map doesn't work for NPIV since vport dev isn't fully initialized.

For more details: http://marc.info/?l=linux-scsi&m=118312448030633&w=2 and
commit - c59fd9ebc46da8d48b76955d4d48e3597f8c8726.

Signed-off-by: Nithin Sujir <nsujir@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 3ce41ea1478e9dcc3a0e47189c443ba3c7670b70)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Bumped version to 1.0.6
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:54 +0000 (15:54 -0700)]
bnx2fc: Bumped version to 1.0.6

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit cf00025d1d04cef76ef979d39e54122c3b9233e9)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Fix FW assert during RSCN stress tests
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:53 +0000 (15:54 -0700)]
bnx2fc: Fix FW assert during RSCN stress tests

Firmware asserts when the same CQE is armed twice. This scenario happens during
RSCN stress tests as driver incorrects arms the CQ after the session is
offloaded.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit a96e8e11635773dd88dbe1307f9482146cfe0562)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Fix panic caused because of incorrect errror handling in create().
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:52 +0000 (15:54 -0700)]
bnx2fc: Fix panic caused because of incorrect errror handling in create().

Driver incorrectly calls bnx2fc_interface_cleanup() when bnx2fc_if_create fails
which accesses bad pointer. Handle bnx2fc_if_create failure by directly calling
bnx2fc_net_cleanup.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 013068fa6f65f7037adedc141fbd27afc99ab1bb)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Avoid calling bnx2fc_if_destroy with unnecessary locks
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:51 +0000 (15:54 -0700)]
bnx2fc: Avoid calling bnx2fc_if_destroy with unnecessary locks

It is not required to hold rtnl_lock and bnx2fc_dev_lock when calling
bnx2fc_if_destroy, as the locking is only required to serialize creation and
deletion of fcoe instances. More importantly, this unnecessary locking causes
deadlock as bnx2fc_if_destroy calls fc_remove_host holding rtnl_lock.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 0cbf32e1681d870632a1772601cbaadd996dc978)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Validate vlan id in NETDEV_UNREGISTER handler
Nithin Nayak Sujir [Tue, 30 Aug 2011 22:54:50 +0000 (15:54 -0700)]
bnx2fc: Validate vlan id in NETDEV_UNREGISTER handler

When bnx2fc receives an UNREGISTER event on a vlan interface it calls
destroy on all interfaces that matches the physical interface. Add
vlan_id check to destroy only the vlan interface that generated the
event.

Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 26b2982f78c1fc6f486a67271b1d0a0d305dd54b)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: No abort issued for REC when it times out
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:49 +0000 (15:54 -0700)]
bnx2fc: No abort issued for REC when it times out

ABTS was not issued for timed out REC, as REC completion handler exits out if
the IO completed. Check for timed out REC and issue ABTS before proceeding with
further processing in REC completion handler. Also, initialize rec_retry and
srr_retry before starting the IO.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit c1c16bd51a29eea8843f20161ddd32cddc524142)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Send solicitation only after vlan discovery is complete
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:48 +0000 (15:54 -0700)]
bnx2fc: Send solicitation only after vlan discovery is complete

Link up event is generated to the driver even before vlan discovery has
started. Because of this driver can send discovery solicitation on a stale
vlan. Call fcoe_ctlr_link_up() only when the driver is in enabled state, which
implies the vlan discovery is complete before sending solicitation.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 8a5badf1ea10c726b9cc04e52f91395b1248e034)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Reset max receive frame size during link up
Bhanu Prakash Gollapudi [Tue, 30 Aug 2011 22:54:47 +0000 (15:54 -0700)]
bnx2fc: Reset max receive frame size during link up

If the max receive frame size is changed during link down, the driver uses the
same value after linkup unless it is reset to default.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit c780673cfb1e3d16d23f9808738539625d3b9363)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Need not schedule destroy_work from __bnx2fc_destroy
Bhanu Prakash Gollapudi [Thu, 25 Aug 2011 01:56:42 +0000 (18:56 -0700)]
bnx2fc: Need not schedule destroy_work from __bnx2fc_destroy

Since it is already called in the right context with rtnl_lock and dev_mutex
held.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit eccdcd026ae7359e22b70444b8a45f712f05cc37)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Bump version to 1.0.5
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:52 +0000 (17:38 -0700)]
bnx2fc: Bump version to 1.0.5

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 55a3a35dd4fe616301450c85a77e2d5b5f4bb7bf)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Prevent creating of NPIV port with duplicate WWN
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:51 +0000 (17:38 -0700)]
bnx2fc: Prevent creating of NPIV port with duplicate WWN

This patch adds a validation step before allowing creation of a new NPIV port.
It checks whether the WWPN passed for the new NPIV port to be created is unique
for the given physical port.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 861efc547ce517e3d75a507ebc2268e6a0dfa767)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2fc: Obtain WWNN/WWPN from the shared memory
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:50 +0000 (17:38 -0700)]
bnx2fc: Obtain WWNN/WWPN from the shared memory

bnx2x driver would obtain the WWNN/WWPN from the shared memory and can be
obtained by the bnx2fc driver via ndo_fcoe_get_wwn.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 5243960777a8d5f0dfabd0e67035d13ac6eaf304)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] fcoe,libfcoe: Move common code for fcoe_get_lesb to fcoe_transport
Bhanu Prakash Gollapudi [Mon, 3 Oct 2011 23:45:01 +0000 (16:45 -0700)]
[SCSI] fcoe,libfcoe: Move common code for fcoe_get_lesb to fcoe_transport

Except for obtaining the netdev from lport, fcoe_get_lesb is the common code
for the LLDs.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Acked-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 814740d5f67ae5f205349019bfaae38bcd0c8732)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] fcoe: Move common functions to fcoe_transport library
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:49 +0000 (17:38 -0700)]
[SCSI] fcoe: Move common functions to fcoe_transport library

Export fcoe_get_wwn, fcoe_validate_vport_create and fcoe_wwn_to_str so that all
LLDs can use these common function.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit d834895c41d34b64a1923fa631e6a64f763ed31c)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Drop incoming ABTS
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:48 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Drop incoming ABTS

As an initiator, driver need not handle incoming ABTS. It initiates an ABTS if
any IO requests time out.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 3f8744d147375aca902de7a9f2632a89872565f4)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: code cleanup in bnx2fc_offload_session
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:47 +0000 (17:38 -0700)]
[SCSI] bnx2fc: code cleanup in bnx2fc_offload_session

- Free session resources before rport logoff
- Do not free session resources in bnx2fc_alloc_session_resc() as it is handled
  in caller's error handling path.
- Do not call bnx2fc_free_session_resc() if bnx2fc_init_tgt() fails as cq_lock
  is not yet initialized.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 5fb8fd0dbc0f7e3bc3ea594223e5d4b50c2092d9)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Fix NULL pointer deref during arm_cq.
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:46 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Fix NULL pointer deref during arm_cq.

There exists a race condition between CQ doorbell unmap and IO completion path
that arms the CQ which causes a NULL dereference. Protect the ctx_base with
cq_lock to avoid this. Also, wait for the CQ doorbell to be successfully mapped
before arming the CQ.

Also, do not count uncolicited CQ completions for free_sqes.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit b338c785c5c945383046ff39092e3021ea5b1d95)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: IO errors when receiving unsolicited LOGO
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:45 +0000 (17:38 -0700)]
[SCSI] bnx2fc: IO errors when receiving unsolicited LOGO

During the unsolicited LOGO processing, the session is uploaded and offloaded
after the relogin is complete. In between any new IOs are errored back as the
upload completion flag is set. Upon exhausting the retry count, the application
fails the IOs. Return target busy for all the cases when session is not ready.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 81214013130cd24142f6465f7f5a256fed530c17)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Do not reuse the fcoe connection id immediately
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:44 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Do not reuse the fcoe connection id immediately

CFC_DELETE is issued 2 secs after CONN_TERM is completed. If the session is
uploaded and offloaded immediately, it has to wait for the connection id to be
available.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 291fbe138f820f880b3e70852d200c0f2527430c)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Clear DESTROY_CMPL flag after firmware destroy
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:43 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Clear DESTROY_CMPL flag after firmware destroy

Since this flag was never cleared, the driver does not wait for firmware
destroy completions, causing missed KCQEs.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit cd703ae790a07ece30e51a8583ea2490d14efb7c)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Handle NETDEV_UNREGISTER for vlan devices
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:42 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Handle NETDEV_UNREGISTER for vlan devices

Since the driver holds the reference for vlan netdev, the reference has to be
released by the driver when the vlan device is removed. Driver handles this in
NETDEV_UNREGISTER event.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit abc49a937b23adc7d9748709ca82ee32464ae089)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Reorganize cleanup code between interface_cleanup and if_destory
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:41 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Reorganize cleanup code between interface_cleanup and if_destory

Move interface specific cleanup functionality to from bnx2fc_if_destroy to
bnx2fc_interface_cleanup. Do not access interface/hba in bnx2fc_if_destroy as
by the time this function is called interface may already be destroyed. This
patch is in preparation to handle NETDEV_UNREGISTER on a vlan device.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 9be17fc43e0121e966049a323ad38a35626525c1)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Change function names of bnx2fc_netdev_setup/bnx2fc_netdev_cleanup
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:40 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Change function names of bnx2fc_netdev_setup/bnx2fc_netdev_cleanup

Change them to bnx2fc_interface_setup/bnx2fc_interface_cleanup in preperation
for the patches to follow. Interface specific cleanup functionality will be
moved to bnx2fc_interface_cleanup.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 776cebcac6fad2f638c0ab16e2111a84c1c85d84)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Do not attempt destroying NPIV port twice
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:39 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Do not attempt destroying NPIV port twice

When NPIV ports are created/deleted rapidly there is a race condition between
bnx2fc_vport_destroy() from sysfs and bnx2fc_flogi_resp(), which could try to
delete the NPIV port from the list twice. Fix is to loop through the list of
NPIV ports to find a match, and only when it exists remove it.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit cdf54668bc48193e43adc8f75ce419ce0ce50fc0)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Remove erroneous kref_get on IO request
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:38 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Remove erroneous kref_get on IO request

During sequence cleanup, an additional reference for an IO has been
taken. Because of this, the IO is never released into the free list.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit b65d457913d1c0644394287d5d834373f42fb99a)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Enable bsg_request support for bnx2fc
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:37 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Enable bsg_request support for bnx2fc

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit e9a5289ca3bb2d3e2a8f9e464eeb97b076dcb0d1)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Bug fixes in percpu_thread_create/destroy
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:36 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Bug fixes in percpu_thread_create/destroy

Look up p->work_list to process cq completions, and correct the error check for
thread creation.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 3224876358a37f6e531dd5c7f7f002106ef328fc)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2fc: Reset the max receive frame size
Bhanu Prakash Gollapudi [Fri, 5 Aug 2011 00:38:35 +0000 (17:38 -0700)]
[SCSI] bnx2fc: Reset the max receive frame size

Reset max receive frame size every time before attempting FLOGI. Without this,
the stale MFS value will be used.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 627e628f6662550455e57466148d03f354ecdd3b)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2i: Fixed the override of the error_mask module param
Eddie Wai [Thu, 2 Feb 2012 23:22:00 +0000 (15:22 -0800)]
[SCSI] bnx2i: Fixed the override of the error_mask module param

The error_mask module param overrides has a bug which prevented
the new module param values to take effect.

Also changed the type attribute of the error_mask1/2 module params
from int to uint to allow the MSB to be set.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Acked-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 70fc872c738d1e0af7d0420047e4ca3acf283c9d)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2i: use kthread_create_on_node()
Eric Dumazet [Thu, 2 Feb 2012 13:03:22 +0000 (14:03 +0100)]
[SCSI] bnx2i: use kthread_create_on_node()

bnx2i_percpu_thread_create() create per cpu kthread, and should use
proper NUMA aware API.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 93713f3bf1d74c57ff851d17de54bb273d94210c)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2i: Fixed kernel panic caused by unprotected task->sc->request deref
Eddie Wai [Wed, 7 Dec 2011 06:41:21 +0000 (22:41 -0800)]
[SCSI] bnx2i: Fixed kernel panic caused by unprotected task->sc->request deref

During session recovery, the conn_stop call will trigger a flush
to all outstanding SCSI cmds in the xmit queue.  This will set
all outstanding task->sc to NULL prior to the session_teardown
call which frees the task memory.

In the bnx2i SCSI response processing path, only the task was being checked
for NULL under the session lock before the task->sc->request dereferencing.
If there are outstanding SCSI cmd responses pending for process, the
following kernel panic can be exposed where task->sc was found to be NULL.

 Call Trace:
[   69.720205]  [<ffffffffa040d0d0>] bnx2i_process_new_cqes+0x290/0x3c0 [bnx2i]
[   69.804289]  [<ffffffffa040d233>] bnx2i_fastpath_notification+0x33/0xa0 [bnx2
i]
[   69.891490]  [<ffffffffa040d37b>] bnx2i_indicate_kcqe+0xdb/0x330 [bnx2i]
[   69.971427]  [<ffffffffa03eac5e>] service_kcqes+0x16e/0x1d0 [cnic]
[   70.045132]  [<ffffffffa03eacea>] cnic_service_bnx2x_kcq+0x2a/0x50 [cnic]
[   70.126105]  [<ffffffffa03ead53>] cnic_service_bnx2x_bh+0x43/0x140 [cnic]
[   70.207081]  [<ffffffff81060676>] tasklet_action+0x66/0x110
[   70.273521]  [<ffffffff8106025f>] __do_softirq+0xef/0x220
[   70.337887]  [<ffffffff81447ebc>] call_softirq+0x1c/0x30

This patch adds the !task->sc check and also protects the sc dereferencing
under the session lock.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit a878185c3b93e692ace0d1628a47f3d75504ab4f)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2i: Fixed the endian on TTT for NOP out transmission
Eddie Wai [Fri, 26 Aug 2011 18:16:47 +0000 (11:16 -0700)]
[SCSI] bnx2i: Fixed the endian on TTT for NOP out transmission

The iscsi_nopout task's TTT is defined as __be32 while the DMA
memory to the chip is CPU specific.  This creates a problem for
unsolicited NOP-In responses where the TTT is not the RESERVED
tag of 0xFFs.  This patch adds a call to be32_to_cpu for the TTT
specified.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 610602f369b4c810c9df05e431abd38f38cb8e0d)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years ago[SCSI] bnx2i: Fixed kernel panic due to illegal usage of sc->request->cpu
Eddie Wai [Fri, 15 Jul 2011 18:17:26 +0000 (11:17 -0700)]
[SCSI] bnx2i: Fixed kernel panic due to illegal usage of sc->request->cpu

A kernel panic was observed when passing the sc->request->cpu = -1 to
retrieve the per_cpu variable pointer:
 #0 [ffff880011203960] machine_kexec at ffffffff81022bc3
 #1 [ffff8800112039b0] crash_kexec at ffffffff81088630
 #2 [ffff880011203a80] __die at ffffffff8139ea20
 #3 [ffff880011203aa0] no_context at ffffffff8102f3a7
 #4 [ffff880011203ae0] __bad_area_nosemaphore at ffffffff8102f665
 #5 [ffff880011203ba0] retint_signal at ffffffff8139dd1f
 #6 [ffff880011203cc8] bnx2i_indicate_kcqe at ffffffffa03dc4f2
 #7 [ffff880011203da8] service_kcqes at ffffffffa03cb04f
 #8 [ffff880011203e68] cnic_service_bnx2x_kcq at ffffffffa03cb14a
 #9 [ffff880011203e88] cnic_service_bnx2x_bh at ffffffffa03cb1b3

The problem lies in the slow path sg_io (and perhaps sg_scsi_ioctl) call to
blk_get_request->get_request/wait->blk_alloc_request->blk_rq_init which
re-initializes the request->cpu to -1.  There is no assignment for cpu from
that to the request_fn call to low level drivers.

When this happens, the sc->request->cpu will be using the init value of
-1.  This will create a kernel panic when it hits bnx2i because the code
refers it to get the per_cpu variables ptr.

This change is to put in a guard against that and also for cases when
bio affinity/queue completion to the same cpu is not enabled.  In those
cases, the request->cpu will remain a -1 also.

This bug was created from commit:  b5cf6b63f73abdc051035f0050b367beeb2ef94c

For the case when the blk layer did not setup the request->cpu, bnx2i
will complete the sc with the current CPU of the thread.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 0d83ab65ff1b54ce8b6cd172285cf71a38c4cceb)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agocnic: Fix select dependencies in bnx2fc/bnx2i Kconfig.
David S. Miller [Fri, 12 Aug 2011 10:00:47 +0000 (03:00 -0700)]
cnic: Fix select dependencies in bnx2fc/bnx2i Kconfig.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4c78893b3d107e2a053c8f51c526510857c09858)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Fix 578xx link LED
Yaniv Rosner [Wed, 7 Sep 2011 00:48:06 +0000 (00:48 +0000)]
bnx2x: Fix 578xx link LED

Fix 1G link LED for the BCM578xx-SFI/KR.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ab505dec96340946079d1288f49041bea9f259ff)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Enable FEC for 57810-KR
Yaniv Rosner [Wed, 7 Sep 2011 00:47:54 +0000 (00:47 +0000)]
bnx2x: Enable FEC for 57810-KR

Enable FEC(Forward Error Correction) for 57810-KR to reduce link errors.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6b1f3900fc0909fbf3bd672242378015f76b3df8)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: disable dcb on 578xx since not supported yet
Dmitry Kravkov [Tue, 9 Aug 2011 03:11:13 +0000 (03:11 +0000)]
bnx2x: disable dcb on 578xx since not supported yet

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7712b644964c36d1216315b791faccc7d5238b16)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: decrease print level to debug
Dmitry Kravkov [Tue, 30 Aug 2011 00:08:40 +0000 (00:08 +0000)]
bnx2x: decrease print level to debug

It may happen every link toggle.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5f837363457a2280530373267f86092625d15a4d)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix BRB thresholds for dropless_fc mode
Dmitry Kravkov [Tue, 30 Aug 2011 00:08:39 +0000 (00:08 +0000)]
bnx2x: fix BRB thresholds for dropless_fc mode

Fix the thresholds according to 5778x HW and increase rx_ring size
to suit new thresholds in dropless_fc mode.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit dfacf1387ceb6d7d6df614b18016fd1f347a1996)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix cl_id allocation for non-eth clients for NPAR mode
Dmitry Kravkov [Sun, 9 Oct 2011 23:57:36 +0000 (23:57 +0000)]
bnx2x: fix cl_id allocation for non-eth clients for NPAR mode

There are some consolidations of NPAR configuration
when FCoE and iSCSI L2 clients will get the same id,
in this case FCoE ring will be non-functional.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 134d0f974c55c942541f1663d51fa846257eff2a)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Fix for a host coalescing bug which impared latency.
Ariel Elior [Tue, 30 Aug 2011 00:08:46 +0000 (00:08 +0000)]
bnx2x: Fix for a host coalescing bug which impared latency.

Seperated Rx and Tx coalescing to different state machines.

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 150966ad56291776a1f3fed86000a027e0794922)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix select_queue when FCoE is disabled
Vladislav Zolotarov [Tue, 9 Aug 2011 03:08:55 +0000 (03:08 +0000)]
bnx2x: fix select_queue when FCoE is disabled

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cdb9d6ae8d128cc01d7a0649201102cd7de356e0)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix WOL by enablement PME in config space
Dmitry Kravkov [Thu, 22 Sep 2011 02:33:32 +0000 (02:33 +0000)]
bnx2x: fix WOL by enablement PME in config space

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f99779035730f8c3be8aeadd386cc9e77e086446)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Fix XMAC loopback test
Yaniv Rosner [Wed, 7 Sep 2011 00:48:03 +0000 (00:48 +0000)]
bnx2x: Fix XMAC loopback test

Change XMAC loopback type from CORE LOCAL to LINE LOCAL for the BCM578xx due to intermittent problem with the loopback with this configuration.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4d7e25d6cc4312b1f949123fea7026fd56441513)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: init FCOE FP only once
Vladislav Zolotarov [Tue, 9 Aug 2011 03:08:09 +0000 (03:08 +0000)]
bnx2x: init FCOE FP only once

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 45d3539a2309858906abd8261c26f8ba8e50405a)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Remove fiber remote fault detection
Yaniv Rosner [Wed, 7 Sep 2011 00:47:58 +0000 (00:47 +0000)]
bnx2x: Remove fiber remote fault detection

Remove remote fault detection as a tactic retreat due to link issues involved with it.
Once issue is resolved, this feature will be restored again.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0582242049c67d59c3a95cd1cba8995fa955c858)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agocnic: update for FW 7.2.xx
Michael Chan [Mon, 20 Feb 2012 09:59:10 +0000 (09:59 +0000)]
cnic: update for FW 7.2.xx

(cherry picked from commit e65de0716f4fb72b09fb37f603b71f4eabe18322)
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: correction to firmware interface
Yuval Mintz [Tue, 3 Apr 2012 00:07:11 +0000 (00:07 +0000)]
bnx2x: correction to firmware interface

Commit 621b4d6 updated the bnx2x driver to a new FW version, but lacked
a commit to a header file with changes to the firmware's interface.
The missing interface change causes iscsi and fcoe to misbehave with the
updated firmware.

(cherry picked from commit f2ed5ee1b050495be49e5a0d5df152663558ef08)
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
CC: Michael Chan <mchan@broadcom.com>
CC: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix vector traveling while looking for an empty entry
Dmitry Kravkov [Mon, 26 Mar 2012 21:08:55 +0000 (21:08 +0000)]
bnx2x: fix vector traveling while looking for an empty entry

Fixes the bug that may prevent from mac to be configured,
while there is an empty slot for it.

Reported-by: Maciej Żenczykowski <zenczykowski@gmail.com>
(cherry picked from commit c54e9bd38a06babf94fd45e5f1df9a1109e12818)
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: mark functions as loaded on shared memory
Yuval Mintz [Mon, 12 Mar 2012 08:53:11 +0000 (08:53 +0000)]
bnx2x: mark functions as loaded on shared memory

This change enables the FW to make more accurate decisions regarding the
active functions.

(cherry picked from commit 9ce392d4fa43c3abb9ab02a29e225084ed84451e)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix memory leak in bnx2x_init_firmware()
Michal Schmidt [Thu, 15 Mar 2012 14:08:29 +0000 (14:08 +0000)]
bnx2x: fix memory leak in bnx2x_init_firmware()

When cycling the interface down and up, bnx2x_init_firmware() knows that
the firmware is already loaded, but nevertheless it allocates certain
arrays anew (init_data, init_ops, init_ops_offsets, iro_arr). The old
arrays are leaked.

Fix the leaks by returning early if the firmware was already loaded.
Because if the firmware is loaded, so are the arrays.

(cherry picked from commit c0ea452e422a1fc78ec8c639df64012d0b8dbb4a)
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix a crash on corrupt firmware file
Michal Schmidt [Thu, 15 Mar 2012 14:08:28 +0000 (14:08 +0000)]
bnx2x: fix a crash on corrupt firmware file

If the requested firmware is deemed corrupt and then released, reset the
pointer to NULL in order to avoid double-freeing it in
bnx2x_release_firmware() or dereferencing it in bnx2x_init_firmware().

(cherry picked from commit 127d0a198a310970b31866af8bbb6d4b1068e546)
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: make bnx2x_close() static again
Michal Schmidt [Thu, 16 Feb 2012 02:38:48 +0000 (02:38 +0000)]
bnx2x: make bnx2x_close() static again

Commit 8304859a "bnx2x: add fan failure event handling" made the function
bnx2x_close() non-static unnecessarily. The function is not called from
other sources. Make it static again.

(cherry picked from commit 56ad315250bec1cd239c18712e072d1ff1f4aaf3)
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Acked-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: removed code re-checking memory base after device open
Mintz Yuval [Wed, 15 Feb 2012 02:10:31 +0000 (02:10 +0000)]
bnx2x: removed code re-checking memory base after device open

(cherry picked from commit 04f2d51313938d004983652ea6162d4940d83a04)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: allow BCM84833 phy to advertise 100Base-T speeds
Mintz Yuval [Wed, 15 Feb 2012 02:10:30 +0000 (02:10 +0000)]
bnx2x: allow BCM84833 phy to advertise 100Base-T speeds

(cherry picked from commit 10bd1f243c3a5ea1aebae88d21932e5614afa9cc)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: notify cnic of address of info-to-the-mcp
Mintz Yuval [Wed, 15 Feb 2012 02:10:29 +0000 (02:10 +0000)]
bnx2x: notify cnic of address of info-to-the-mcp

(cherry picked from commit 82fa848c117e57f0b3fd848f2aaf3f6859f42201)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: allocate smaller Rx rings for 1G functions
Mintz Yuval [Wed, 15 Feb 2012 02:10:28 +0000 (02:10 +0000)]
bnx2x: allocate smaller Rx rings for 1G functions

(cherry picked from commit d760fc37b0f74502b3f748951f22c6683b079a8e)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: allocate memory dynamically in ethtool self-test.
Merav Sicron [Wed, 15 Feb 2012 02:10:27 +0000 (02:10 +0000)]
bnx2x: allocate memory dynamically in ethtool self-test.

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

(cherry picked from commit afa13b4b94bc4b3247fa46dd8698c8dbfe1a615c)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: force 10G on 84833 phy should be autoneg with only 10G advertised
Yaniv Rosner [Wed, 15 Feb 2012 02:10:26 +0000 (02:10 +0000)]
bnx2x: force 10G on 84833 phy should be autoneg with only 10G advertised

(cherry picked from commit 817a8aa8cfa1ebfb7bf27afb53ebb1ec3d49b564)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: added autoneg-restart after link advertisement changes
Yaniv Rosner [Wed, 15 Feb 2012 02:10:25 +0000 (02:10 +0000)]
bnx2x: added autoneg-restart after link advertisement changes

(cherry picked from commit 1b85ae52733b859e280035330e016731d4a62307)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: ethtool publishes link partners speed and FC
Mintz Yuval [Wed, 15 Feb 2012 02:10:24 +0000 (02:10 +0000)]
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.

(cherry picked from commit 9e7e8399c5d3c4dfaf84324a4a6b07a701d3e482)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: half duplex support added for several boards
Yaniv Rosner [Wed, 15 Feb 2012 02:10:23 +0000 (02:10 +0000)]
bnx2x: half duplex support added for several boards

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

(cherry picked from commit e18c56b2e94080982d4542987a6fcf80b12d9414)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: remove the 'poll' module option
Michal Schmidt [Tue, 14 Feb 2012 09:05:46 +0000 (09:05 +0000)]
bnx2x: remove the 'poll' module option

'poll' was a debugging option, but turning it on these days leads to
kernel panic. Remove it.

(cherry picked from commit fc543637525b59af38af2ce09a4dbdd7d5eb27bf)
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix bnx2x_storm_stats_update() on big endian
Eric Dumazet [Mon, 13 Feb 2012 06:23:12 +0000 (06:23 +0000)]
bnx2x: fix bnx2x_storm_stats_update() on big endian

commit 619c5cb6885 (New 7.0 FW: bnx2x, cnic, bnx2i, bnx2fc) added new
sparse warnings.

(cherry picked from commit 66d885cba670059396b2f9ed9d5f4cbead0baee0)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: Vladislav Zolotarov <vladz@broadcom.com>
Cc: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Fix mem leak in bnx2x_tpa_stop() if build_skb() fails.
Jesper Juhl [Mon, 6 Feb 2012 11:28:21 +0000 (11:28 +0000)]
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)).

(cherry picked from commit 3f61cd879c2f112c468e8849949b6fc88c739679)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Update version to 1.72.0 and copyrights
Ariel Elior [Thu, 26 Jan 2012 06:01:54 +0000 (06:01 +0000)]
bnx2x: Update version to 1.72.0 and copyrights

(cherry picked from commit 85b26ea18ee63be83d65ec6db72ad7857980a04b)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Recoverable and unrecoverable error statistics
Ariel Elior [Thu, 26 Jan 2012 06:01:53 +0000 (06:01 +0000)]
bnx2x: Recoverable and unrecoverable error statistics

Add statistics for tracking parity errors from which we successfully
recovered and those which were deemed unrecoverable.

(cherry picked from commit 7a752993fe90adf8e150cc1a85beef5f782429e7)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Recovery flow bug fixes
Ariel Elior [Thu, 26 Jan 2012 06:01:52 +0000 (06:01 +0000)]
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.

(cherry picked from commit 95c6c6165eaf5a031bcf31606e081c72e4acdeb8)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: init fw_seq after undi_unload is done
Dmitry Kravkov [Tue, 30 Aug 2011 00:08:44 +0000 (00:08 +0000)]
bnx2x: init fw_seq after undi_unload is done

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0735f2fc8c49f1fbbbb245d038582922984ed3d5)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Track active PFs with bitmap
Ariel Elior [Thu, 26 Jan 2012 06:01:51 +0000 (06:01 +0000)]
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.

(cherry picked from commit 889b9af34f986138eebebfe781567cb950b3a22b)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Lock PF-common resources
Ariel Elior [Thu, 26 Jan 2012 06:01:50 +0000 (06:01 +0000)]
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.

(cherry picked from commit f16da43b5df947cef427f19b8f5c4b2f5d566231)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: don't reset device while reading its configuration.
Dmitry Kravkov [Tue, 30 Aug 2011 00:08:43 +0000 (00:08 +0000)]
bnx2x: don't reset device while reading its configuration.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7a06a122322c89544774e789a11aa671423e9362)

Conflicts:

drivers/net/bnx2x/bnx2x_main.c

Signed-off-by: Joe Jin <joe.jin@oracle.com>