David S. Miller [Mon, 2 Apr 2012 00:22:22 +0000 (20:22 -0400)]
enic: Stop using NLA_PUT*().
These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.
(cherry picked from commit 1a106de6e6543e7d44dbe1bc5f37a8964607dfa6) Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Wed, 7 Mar 2012 03:50:44 +0000 (03:50 +0000)]
enic: Fix addr valid check in enic_set_vf_mac
zero mac address is a valid address for VIC dynamic vnic and sriov Vf's.
Fix the check in enic_set_vf_mac appropriately
(cherry picked from commit b8622cbd58f345d48f683d881abe3037c60aa673) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Dan Carpenter [Wed, 29 Feb 2012 21:19:54 +0000 (21:19 +0000)]
enic: fix an endian bug in enic_probe()
"num_vfs" is a u32 but we only use the high 16 bits and the low 16bits
are left as zero. That isn't a problem for little endian systems but it
will break on big endian ones.
(cherry picked from commit 413708bbaf5c85c4c8a264145f7d6c3afcd97f99) Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Santosh Nayak [Fri, 24 Feb 2012 06:56:39 +0000 (06:56 +0000)]
enic: Fix endianness bug.
Sparse complaints the endian bug.
(cherry picked from commit 21ca54e99b085b9ff4c91ca41afe42a439966109) Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Mon, 20 Feb 2012 00:12:04 +0000 (00:12 +0000)]
enic: Add support for fw init command on sriov vf's
This patch fixes enic_probe to do a fw init devcmd for sriov vfs.
This enables vf driver in the guest to get into adapter init state without
having to explicitly issue an init fw cmd with portprofile info. But a
successful init on the vf will require the port profile information to be
pre-provisioned by the hypervisor via the pf
(cherry picked from commit 2b68c18194b078489a84023564bcf7464b6c7b37) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Mon, 20 Feb 2012 00:11:58 +0000 (00:11 +0000)]
enic: Fix ndo_set_vf_mac and ndo_set_vf_port to set/get the sriov vf's mac
This patch fixes the ndo_set_vf_mac netdev op to set the sriov vf mac
in adapter using the new fw devcmd CMD_SET_MAC_ADDR. During port profile
associate the pf driver gets the vf mac using CMD_GET_MAC_ADDR.
(cherry picked from commit b476583354fc62cae433eb24d4027597c03be4c9) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Mon, 20 Feb 2012 00:11:53 +0000 (00:11 +0000)]
enic: Add new fw devcmd to set mac address of an interface
This patch adds a new devcmd CMD_SET_MAC_ADDR to set the mac address of an
interface.
(cherry picked from commit d6c81bc6dca768dff1a3f127beee11e8102669a7) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Mon, 20 Feb 2012 00:11:48 +0000 (00:11 +0000)]
enic: rename CMD_MAC_ADDR to CMD_GET_MAC_ADDR
firmware devcmd CMD_MAC_ADDR gets the mac address of a vnic from adapter.
This patch renames it to CMD_GET_MAC_ADDR more appropriately.
(cherry picked from commit b13423ee0cba4dc23ca21e61ca45f482d6713509) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Danny Kukawka [Sat, 18 Feb 2012 06:50:43 +0000 (01:50 -0500)]
cisco/enic: use eth_hw_addr_random() instead of random_ether_addr()
Use dev_hw_addr_random() instead of calling random_ether_addr()
to set addr_assign_type correctly to NET_ADDR_RANDOM.
Reset the state to NET_ADDR_PERM as soon as the MAC get
changed via .ndo_set_mac_address.
v3: adapt to net-next
v2: use bitops, adapt to eth_hw_addr_random(), add a comment
(cherry picked from commit da1943164677ae2cdd630196b79089d476726348) Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Sat, 11 Feb 2012 22:12:44 +0000 (22:12 +0000)]
enic: remove assignment of random mac on enic vf
This patch removes random mac assignment on vf's. The vf's will start with
a zero mac and with upcoming support in fw/driver, a vf mac can be set
via the pf. vf's also support ndo_set_mac_address. This decision was made
based on the fact that a random mac on a vf is not really needed. And this
will reduce some of the problems with the vf's getting a new mac on
every driver load/unload (one of them being udev renaming the device on ever
load/unload and reboot).
(cherry picked from commit 73c2ae763af0eaa1794dda68c63f97c2905722a8) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: sujith sankar <ssujith@cisco.com> Signed-off-by: ChingWei Chang <cwchang@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Sat, 11 Feb 2012 21:37:37 +0000 (21:37 +0000)]
enic: Fix address deregistration for sriov vf during port profile disassociate
This patch fixes erroneous PF address deregistration in cases where
a port profile disassociate is called on an already disassociated interface.
(cherry picked from commit 9f1de88ddd5eac43c14ed20835b4c738be61e162) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: sujith sankar <ssujith@cisco.com> Signed-off-by: ChingWei Chang <cwchang@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Neel Patel [Fri, 3 Feb 2012 08:25:19 +0000 (08:25 +0000)]
enic: Check firmware capability before issuing firmware commands
Check if firmware supports a particular command by first checking capability
using devcmd CMD_CAPABILITY.
(cherry picked from commit f8a6dd59f79f83d7188909331dcdf6e45e1b2c1f) Signed-off-by: Neel Patel <neepatel@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Nishank Trivedi <nistrive@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Neel Patel [Fri, 3 Feb 2012 08:25:14 +0000 (08:25 +0000)]
enic: Enable support for multiple hardware receive queues
This patch enables support for multiple receive queues. If multiple receive
queues are used ingress traffic is hashed into one of the receive queues based
on IP or TCP or both headers. The max number of supported receive queues per
vnic is 8.
(cherry picked from commit 63da93d932af04cf80507b110afe894a8a8d1f90) Signed-off-by: Neel Patel <neepatel@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Nishank Trivedi <nistrive@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Thu, 19 Jan 2012 22:25:36 +0000 (22:25 +0000)]
enic: fix compile when CONFIG_PCI_IOV is not enabled
reverting back change that access enic->num_vfs outside
CONFIG_PCI_IOV
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
(cherry picked from commit b67f231ded332461dd31123c4f659c4681223fb1) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Wed, 18 Jan 2012 04:24:12 +0000 (04:24 +0000)]
enic: fix location of vnic dev unregister in enic_probe cleanup code
The vnic_dev_unregister is erroneously under CONFIG_PCI_IOV. This patch moves
it out of CONFIG_PCI_IOV
(cherry picked from commit 35d87e3325e91ec6bc446bf71f50eccc9a7b3b8f) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Wed, 18 Jan 2012 04:24:07 +0000 (04:24 +0000)]
enic: rearrange some of the port profile code
This patch rearranges some of the port profile code in enic_probe.
It moves out some lines of port profile related code currently
inside CONFIG_PCI_IOV. This is only done to move all port profile
related code together so that it can help isolate the port profile
handling code under a separate #ifdef in our internal build scripts.
(cherry picked from commit ca2b721de25b9893310fd695a38b495d14c70ff3) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Wed, 18 Jan 2012 04:24:02 +0000 (04:24 +0000)]
enic: Add sriov vf device id checks in port profile code
This patch adds checks for sriov vf's in enic port profile handling code.
sriov vf's are same as dynamic vnics but with a different device id.
(cherry picked from commit 7335903cba523fc2fd801a178a0e4fcf8ccae756) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Roopa Prabhu [Wed, 18 Jan 2012 04:23:55 +0000 (04:23 +0000)]
enic: This patch adds pci id 0x71 for SRIOV VF's
This patch adds pci id 0x71 for sriov VF's.
(cherry picked from commit 3a4adef5c0adbbd0d898578e13ba1adbbdecbbd5) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Thomas Meyer [Tue, 29 Nov 2011 11:08:00 +0000 (11:08 +0000)]
enic: Use kcalloc instead of kzalloc to allocate array
The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.
The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107
(cherry picked from commit a1de22191bc4c47ff50ef3274295f4384074696b) Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
enic: Add support for port profile association on a enic SRIOV VF
This patch touchs most of the enic port profile handling code.
Tried to break it into sub patches without success.
The patch mainly does the following:
- Port profile operations for a SRIOV VF are modified to work
only via its PF
- Changes the port profile static struct in struct enic to a pointer.
This is because a SRIOV PF has to now hold the port profile information
for all its VF's
- Moved address registration for VF's during port profile ASSOCIATE time
- Most changes in port profile handling code are changes related to indexing
into the port profile struct array of a PF for the VF port profile
information
(cherry picked from commit 3f192795cf1a0098df7bd655f7a72eee26bd63c3) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: David Wang <dwang2@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
This patch adds helper functions to use PF as proxy for SRIOV VF firmware
commands.
(cherry picked from commit 889d13f53cf9d741398637b6e8e578c65bb792e8) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: David Wang <dwang2@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
This patch adds support to enable SRIOV on enic devices. Enic SRIOV VF's are dynamic vnics and will use the same driver code as dynamic vnics.
(cherry picked from commit 8749b427f213e14303dfef4c1b9770f05f67916d) Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: David Wang <dwang2@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Ian Campbell [Mon, 29 Aug 2011 23:18:27 +0000 (23:18 +0000)]
enic: convert to SKB paged frag API.
(cherry picked from commit 4bf5adbf757565d2cc19758aec8452e5364dd700) Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Christian Benvenuti <benve@cisco.com> Cc: Vasanthy Kolluri <vkolluri@cisco.com> Cc: Roopa Prabhu <roprabhu@cisco.com> Cc: David Wang <dwang2@cisco.com> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
(cherry picked from commit e91506dbcfc9e405b2a8013e3a59741bbedce471) Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
bnx2fc: cleanup task management IO when it times out.
When the task management IO times out, or a flush operation is performed while
task management IO is pending, driver is not cleaning up the IO. This patch
cleans up the IO for the above cases.
(cherry picked from commit 92886c9c97fd20dde26a12cd9f43cd3c786bc8ea) Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
bnx2fc: Decrememnt io ref count when abort times out
When IO abort times out during eh_abort or a flush operation is performed while
abort is pending, the driver is not cleaning up the IO and thus not reducing
the IO reference count. With this change, as part of explicit logout, the IO is
cleaned up.
(cherry picked from commit c1bb4f33de87ad18ace1cf484ed0c78683d933a1) Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
bnx2fc: Allow FLOGI to be retried when receiving bad responses.
Commit 907c07d45199f954ddcf66c2c9763c87d012cb15 added more cases to do FLOGI
retry on receiving bad response. Remove the code that drops the packet and
allow the stack to handle bad FLOGI response.
(cherry picked from commit de9c05fafc296aa95b58352bad7f23f6199aa90d) Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Eddie Wai [Fri, 29 Jun 2012 23:37:35 +0000 (16:37 -0700)]
bnx2i: Removed the reference to the netdev->base_addr
The netdev->base_addr parameter has been deprecated in the L2 bnx2
driver. This is used by bnx2i for the BARn iomapping.
This patch will directly reference the pci_resource_start instead
of using the deprecated netdev->base_addr.
This patch is actually a critical bug fix as the 1G bnx2 driver no
longer supports the netdev->base_addr in the current kernel of the scsi
tree. This means that Broadcom's 1G Linux iSCSI offload solution would
not work at all without this patch.
(cherry picked from commit a77171806515fb5e2288219ddb47af1f0b1328e7) Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Eddie Wai [Wed, 25 Apr 2012 22:08:37 +0000 (15:08 -0700)]
bnx2i: Updated version and copyright year
Old version: 2.7.0.3
New version: 2.7.2.2
(cherry picked from commit 9ebd99c599bcb125acde9b3c98383ebd6e208bc1) Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Eddie Wai [Wed, 25 Apr 2012 22:03:45 +0000 (15:03 -0700)]
bnx2i: Added the setting of target can_queue via target_alloc
This will set the target can_queue limit to the number of preallocated
session tasks set during creation.
"Could not send nopout" messages were observed without this when the
iSCSI connection experiences dropped frames under heavy I/O stress.
(cherry picked from commit 6f9c04ff778e35aaad11266b55ef93f72224586e) Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Yuval Mintz [Sat, 16 Jun 2012 20:27:15 +0000 (20:27 +0000)]
bnx2x: fix link for BCM57711 with 84823 phy
(cherry picked from commit 5481388bc705de27ca37241a42c6612c86f2cc3b) Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com> 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>
Yuval Mintz [Sat, 16 Jun 2012 20:27:14 +0000 (20:27 +0000)]
bnx2x: fix I2C non-respondent issue
When I2C is not responding it's usually due to a previous
unexpected reset during I2C operation. We release it by
powering down and up the SFP+ module.
(cherry picked from commit 50a2984543aa2581d08580f8468533ce0ade8a62) Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com> 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>
Eric Dumazet [Wed, 13 Jun 2012 09:45:16 +0000 (09:45 +0000)]
bnx2x: fix panic when TX ring is full
There is a off by one error in the minimal number of BD in
bnx2x_start_xmit() and bnx2x_tx_int() before stopping/resuming tx queue.
A full size GSO packet, with data included in skb->head really needs
(MAX_SKB_FRAGS + 4) BDs, because of bnx2x_tx_split()
This error triggers if BQL is disabled and heavy TCP transmit traffic
occurs.
bnx2x_tx_split() definitely can be called, remove a wrong comment.
Reported-by: Tomas Hruby <thruby@google.com>
(cherry picked from commit bc14786a100cc6a81cd060e8031ec481241b418c) Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Eilon Greenstein <eilong@broadcom.com> Cc: Yaniv Rosner <yanivr@broadcom.com> Cc: Merav Sicron <meravs@broadcom.com> Cc: Tom Herbert <therbert@google.com> Cc: Robert Evans <evansr@google.com> Cc: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Eric Dumazet [Tue, 12 Jun 2012 23:50:04 +0000 (23:50 +0000)]
bnx2x: fix checksum validation
bnx2x driver incorrectly sets ip_summed to CHECKSUM_UNNECESSARY on
encapsulated segments. TCP stack happily accepts frames with bad
checksums, if they are inside a GRE or IPIP encapsulation.
Our understanding is that if no IP or L4 csum validation was done by the
hardware, we should leave ip_summed as is (CHECKSUM_NONE), since
hardware doesn't provide CHECKSUM_COMPLETE support in its cqe.
Then, if IP/L4 checksumming was done by the hardware, set
CHECKSUM_UNNECESSARY if no error was flagged.
Patch based on findings and analysis from Robert Evans
(cherry picked from commit d6cb3e41386f20fb0777d0b59a2def82c65d37f7) Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Eilon Greenstein <eilong@broadcom.com> Cc: Yaniv Rosner <yanivr@broadcom.com> Cc: Merav Sicron <meravs@broadcom.com> Cc: Tom Herbert <therbert@google.com> Cc: Robert Evans <evansr@google.com> Cc: Willem de Bruijn <willemb@google.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>
Yuval Mintz [Wed, 6 Jun 2012 17:13:07 +0000 (17:13 +0000)]
bnx2x: Added EEE support
This patch adds energy efficient energy support (802.3az) to bnx2x
boards with 84833 phys (and sufficiently new BC and external FW).
(cherry picked from commit c8c60d88c59cbb48737732ba948663a3efe882aa) 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>
Ariel Elior [Sun, 6 May 2012 07:05:57 +0000 (07:05 +0000)]
bnx2x: bug fix when loading after SAN boot
This is a bug fix for an "interface fails to load" issue.
The issue occurs when bnx2x driver loads after UNDI driver was previously
loaded over the chip. In such a scenario the UNDI driver is loaded and operates
in the pre-boot kernel, within its own specific host memory address range.
When the pre-boot stage is complete, the real kernel is loaded, in a new and
distinct host memory address range. The transition from pre-boot stage to boot
is asynchronous from UNDI point of view.
A race condition occurs when UNDI driver triggers a DMAE transaction to valid
host addresses in the pre-boot stage, when control is diverted to the real
kernel. This results in access to illegal addresses by our HW as the addresses
which were valid in the preboot stage are no longer considered valid.
Specifically, the 'was_error' bit in the pci glue of our device is set. This
causes all following pci transactions from chip to host to timeout (in
accordance to the pci spec).
(cherry picked from commit 24f06716cd5dbfc3d737ec2a24ac58ef76f68dc7) 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>
(cherry picked from commit 69c326b38f2f895ca4f09fd9b65782a021f4ba6c) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Mon, 27 Aug 2012 13:18:03 +0000 (21:18 +0800)]
bnx2x: remove some bloat
Before doing skb->head_frag work on bnx2x driver, I found too much stuff
was inlined in bnx2x/bnx2x_cmn.h for no good reason and made my work not
very easy.
Move some big functions out of this include file to the respective .c
file.
A lot of inline keywords are not needed at all in this huge driver.
text data bss dec hex filename
490083 1270 56 491409 77f91 bnx2x/bnx2x.ko.before
484206 1270 56 485532 7689c bnx2x/bnx2x.ko
(backported from upstream commit 1191cb83489e6ee87a38ae5b127651f4a7c438dc) Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Eilon Greenstein <eilong@broadcom.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Maciej Żenczykowski <maze@google.com> Cc: Neal Cardwell <ncardwell@google.com> Cc: Tom Herbert <therbert@google.com> Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Ben Hutchings <bhutchings@solarflare.com> Cc: Matt Carlson <mcarlson@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>
Joe Jin [Mon, 27 Aug 2012 13:10:50 +0000 (21:10 +0800)]
bnx2x: add transmit timestamping support
(backported from upstream commit 8373c57d6fa59ca35ad3cf11d719060051ccd920) Signed-off-by: Willem de Bruijn <willemb@google.com> Acked-by: Eilon Greenstein <eilong@broadcom.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
(cherry picked from commit e29ecd51de1683e6aeb88d76251f194b0311f749) Signed-off-by: Barak Witkowski <barak@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>
Removes GRO workaround, as issue is fixed in FW 7.2.51.
(cherry picked from commit 94b2f9ba4c87d155446957ee413e34298cbe7554) Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Barak Witkowski <barak@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>
Joe Jin [Mon, 27 Aug 2012 13:09:05 +0000 (21:09 +0800)]
bnx2x: add afex support
Following patch adds afex multifunction support to the driver (afex
multifunction is based on vntag header) and updates FW version used to 7.2.51.
Support includes the following:
1. Configure vif parameters in firmware (default vlan, vif id, default
priority, allowed priorities) according to values received from NIC.
2. Configure FW to strip/add default vlan according to afex vlan mode.
3. Notify link up to OS only after vif is fully initialized.
4. Support vif list set/get requests and configure FW accordingly.
5. Supply afex statistics upon request from NIC.
6. Special handling to L2 interface in case of FCoE vif.
(backported from upstream commit a334872224a67b614dc888460377862621f3dac7) Signed-off-by: Barak Witkowski <barak@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>
Dan Carpenter [Tue, 17 Apr 2012 20:53:42 +0000 (20:53 +0000)]
bnx2x: off by one in bnx2x_ets_e3b0_sp_pri_to_cos_set()
The sp_pri_to_cos[] array size depends on the config but lets say it is
BX_E3B0_MAX_NUM_COS_PORT0 and max_num_of_cos is also
DCBX_E3B0_MAX_NUM_COS_PORT0. In the original code
"pri == max_num_of_cos" was accepted but it is one past the end of the
array.
Also we used "pri" before capping it. It's a harmless read past the end
of the array, but it would affect which error message gets printed.
(cherry picked from commit 7e5998aa74065d3ab31d17e667f40ffebf4b8425) Signed-off-by: Dan Carpenter <dan.carpenter@oracle.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>
Fix a link problem on the second port of BCM57711 + BCM84823 boards due to
incorrect macro usage.
(cherry picked from commit f93fb01628c00d1f26e8b45d2f10b8feb650dd4b) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
(cherry picked from commit 99bf7f34368aac9b54dfa8801ae490a2326704f9) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
(cherry picked from commit 8267bbb01f005fa8d0c8d046ecc24ae0b52e4d70) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
This patch fixes a link problem on BCM57712 + BCM8727 designs in which the TX
laser is controller by GPIO, after 1.60.xx drivers were previously loaded.
On these designs the TX_LASER is enabled by logic AND between the PHY
(through MDIO), and the GPIO. When an old driver is used, it disables the
MDIO part, hence the GPIO control had no affect de facto.
(cherry picked from commit 59a2e53b826103be8c22d9820355320b749b38ef) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
bnx2x: Restore 1G LED on BCM57712+BCM8727 designs.
Fix no-LED problem when link speed is 1G on BCM57712 + BCM8727 designs, by
removing a logic error checking for a different PHY.
(cherry picked from commit 9379c9be4b20d5cb7bde577f402b749cd7d3caa2) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Fix 57810-KR flow-control handling link is achieved via CL37 AN.
(cherry picked from commit ca05f29cf515ac4a8e162c8e0eee886727f5dcc7) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
bnx2x: add missing parenthesis to prevent u32 overflow
Commit b475d78 lacked two pairs of parenthesis, causing an overflow in the
congestion management.
(cherry picked from commit cfcadc97a890b81f619715739ef101f8c2010e6b) Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> 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>
(cherry picked from commit 68df25d6c556c4df4dad32a0585317eab356e325) 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>
A semantic patch, fixing style issues in the bnx2x's link code.
(cherry picked from commit 8f73f0b97208d9e1142fd32236b5d990ee4ed4b3) Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
This patch revises the way by which rss are configured, removing
an unnecessary module paramater and unrequired modes.
(cherry picked from commit 963052348fd33221d9ae4212d6cdaa2346e2678e) Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> 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>
Joe Jin [Mon, 27 Aug 2012 12:28:56 +0000 (20:28 +0800)]
bnx2x: congestion management re-organization
The congestion management code has migrated into a common location,
allowing all fw writes controlling mf congestion to be made in a
single function in the code. This is a semantic change.
(backported from upstream commit b475d78f464195cbdeeda0d80a2ffbd54653a4bd) 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>
Notice this patch includes lines with over 80 characters, as to not
break strings.
(cherry picked from commit 7e8e02df17106007f4b043a39d22682f74df6f6f) Signed-off-by: Barak Witkowski <barak@broadcom.com> 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>
Restore remote-faule detection, which periodically checks for
remote-fault on the MAC layer. In case physical link appear to be
up but fault is set, it will provide a link down indication, and
when the fault is cleared, it will indicate link up again.
(cherry picked from commit 55098c5c61ea99f0fa46ddf817a0f940ca7e6af1) Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com> 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>
bnx2x: added support for working with one msix irq.
Until now, the bnx2x driver needed at least 2 available msix interrupt
vectors in order to use msix. This patch add the possibility of configuring
msix when only one interrupt vector is available.
Notice this patch contains lines with over 80 characters, as it keeps print
strings in a single line.
(cherry picked from commit 30a5de7723a8a4211be02e94236e9167a424fd07) Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> 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>
During boot-from-SAN, if msix interrupts are unavailable and inta
is requested, it is possible that inta would be disabled in the
pci bus. This patch enables inta when requested.
(cherry picked from commit 79a8557a6d18c3861d64ae110ddd7606c65d7504) 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>
Removed uninformative debug prints, as well as two functions
which were hardly used in the code.
(cherry picked from commit 32d68de1cd267f811d72f189cbaba3af624f0fd5) 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>
(cherry picked from commit ef81442f728ffcf30ccbc6db253df8e35a5182c4) 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>
Yuval Mintz [Mon, 26 Mar 2012 20:47:07 +0000 (20:47 +0000)]
bnx2x: previous driver unload revised
The flow in which the bnx2x driver starts after a previous driver
has been terminated in an 'unclean' manner has several bugs and
FW risks, which makes it possible for the driver to fail after
boot-from-SAN or kdump.
This patch contains a revised flow which performs a safer
initialization, solving the possible crash scenarios.
Notice this patch contains lines with over 80 characters, as it
keeps print-strings in a single line.
(cherry picked from commit 452427b015b1b0cbbef7b6207908726837d39d57) 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>
Dmitry Kravkov [Sun, 18 Mar 2012 10:33:45 +0000 (10:33 +0000)]
bnx2x: validate FW trace prior to its printing
(cherry picked from commit de1288041d01120559d53ebd98e0f92476ee56d3) Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> 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>
Yuval Mintz [Sun, 18 Mar 2012 10:33:44 +0000 (10:33 +0000)]
bnx2x: consistent statistics for old FW
Previously applied patch making the bnx2x statistics consistent
did not apply to old FWs. This remedies it, extending the consistent
behaviour to all drivers.
(cherry picked from commit cb4dca277694f6c53bf6daf0f5c609dda32e4656) Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Reported-by: Michal Schmidt <mschmidt@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Dmitry Kravkov [Sun, 18 Mar 2012 10:33:43 +0000 (10:33 +0000)]
bnx2x: changed iscsi/fcoe mac init and macros
This includes changes in macros to better distinguish between the two
protocols, and slightly changed the way their macs are set.
Notice this file contains string print lines with more than 80 characters,
as to not break prints.
(cherry picked from commit 9e62e912e56742af7eb7e0eeba3c7af4bb2f8537) Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> 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>
Dmitry Kravkov [Sun, 18 Mar 2012 10:33:42 +0000 (10:33 +0000)]
bnx2x: added TLV_NOT_FOUND flags to the dcb
The new error flags are supported by the bnx2x FW.
(cherry picked from commit 910b220290a4568ebf7ecc368bd3d1d8236d2335) Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> 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>
Dmitry Kravkov [Sun, 18 Mar 2012 10:33:41 +0000 (10:33 +0000)]
bnx2x: changed initial dcb configuration
The changes were mostly made to enable back-to-back data flow with dcb.
Other changes were simply deemed as a better 'clean' initial configuration.
(cherry picked from commit 9d4884f9d470cd696d7a7cd7a6d7099d13909dd9) Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Yuval Mintz [Sun, 18 Mar 2012 10:33:40 +0000 (10:33 +0000)]
bnx2x: removed dcb unused code
(cherry picked from commit c315a4ef55b9afa0373fbb10f8567d59f81247c9) 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>
Yuval Mintz [Sun, 18 Mar 2012 10:33:39 +0000 (10:33 +0000)]
bnx2x: reduced sparse warnings
This patch reduces sparse warnings in the bnx2x code,
mostly by changing functions into static and changing
initialization of structures.
(cherry picked from commit 3b60306690569927951be09160e80a8af9c94db4) 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>
Joe Jin [Mon, 27 Aug 2012 12:18:21 +0000 (20:18 +0800)]
bnx2x: revised driver prints
We've revised driver prints, changing the mask of existing prints
to allow better control over the debug messages, added prints to
error scenarios, removed unnecessary prints and corrected some spelling.
Please note that this patch contains lines with over 80 characters,
as string messages were kept in a single line.
(backported from upstream commit 51c1a580b1e07d58eb063f9f4a70aea8ad32fe23) Signed-off-by: Merav Sicron <meravs@broadcom.com> 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>
Dmitry Kravkov [Mon, 12 Mar 2012 08:53:14 +0000 (08:53 +0000)]
bnx2x: code doesn't use stats for allocating Rx BDs
Previously, allocation used queue statistics directly in its calcualtion.
This change causes these calculations to be summed into the statistics,
without being affected by them.
(cherry picked from commit f124488e4713dc9afa2028553261b1d399286e68) Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> 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>
Yuval Mintz [Mon, 12 Mar 2012 08:53:13 +0000 (08:53 +0000)]
bnx2x: ethtool returns req. AN even when AN fails
Previously, if autoneg failed, ethtool would return the achieved autoneg.
This patch corrects this, causing ethtool to return the requested autoneg
capabilities even if autoneg fails.
(cherry picked from commit 241fb5d2b4205a523a50a85f9c312e1eda8ec53d) 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>
Yuval Mintz [Mon, 12 Mar 2012 08:53:12 +0000 (08:53 +0000)]
bnx2x: ethtool now returns unknown speed/duplex
Previously, unless both interface and link were up, ethtool returned
the requested speed/duplex when asked for the interface's settings.
This change will now enable the driver to answer correctly (i.e.,
return unknown as its answer).
(cherry picked from commit 382984618e847ad4621d7ccbd48f5ec702c6a78e) 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>
Yuval Mintz [Mon, 12 Mar 2012 08:53:10 +0000 (08:53 +0000)]
bnx2x: use param's id instead of sp_obj's id
Previously, we've used the object's function id instead of using the
input's value. This is remedied, as in other flows.
(cherry picked from commit 259afa1f725dc7ec1626835b9ac54827a46cdf80) 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>
Yuval Mintz [Mon, 12 Mar 2012 08:53:09 +0000 (08:53 +0000)]
bnx2x: set_one_mac_e1x uses raw's state as input
Previously, we used a hard-coded value as paramater, instead of using the
input's value. This is now remedied, as in other flows.
(cherry picked from commit 33ac338cf97f5e225c62ebcb3ff1a40bf32c88ad) 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>
Yuval Mintz [Mon, 12 Mar 2012 08:53:08 +0000 (08:53 +0000)]
bnx2x: removed unused function bnx2x_queue_set_cos_cid
(cherry picked from commit c121089d9769a404468749b31c52c4d284cb56be) 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>
Yuval Mintz [Mon, 12 Mar 2012 08:53:07 +0000 (08:53 +0000)]
bnx2x: move LLH_CAM to header, apply naming conventions
These definitions are united into the header.
(cherry picked from commit 0a52fd019625867e766c0f6126b7a15b709f83ec) 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>
Yuval Mintz [Mon, 12 Mar 2012 11:22:07 +0000 (11:22 +0000)]
bnx2x: FCoE statistics id fixed
FCoE statistics ids were distinguished from the L2's statistics ids.
However, not all of the change was committed. This causes a possible
collision of indices when FCoE is present.
This patch fixes the issue.
(cherry picked from commit de5c37414af10ac9305d4a3e9c1468347ca3ccaa) 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>
Yuval Mintz [Mon, 12 Mar 2012 11:22:06 +0000 (11:22 +0000)]
bnx2x: dcb bit indices flags used as bits
DCB flags were updated using the flags' bit offsets instead of
the actual bits. This is now fixed.
(cherry picked from commit e695a2dda1775dafc88174d2c0d71fab18db105a) 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>
Ariel Elior [Mon, 12 Mar 2012 11:22:05 +0000 (11:22 +0000)]
bnx2x: added cpu_to_le16 when preparing ramrod's data
Fixed endianess issue when passing arguments to FW.
(cherry picked from commit ab4a71392eb8a91061c63af1d506f5d4580073cf) Signed-off-by: Ariel Elior <ariele@broadcom.com> 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>
Yuval Mintz [Mon, 12 Mar 2012 11:22:04 +0000 (11:22 +0000)]
bnx2x: pfc statistics counts pfc events twice
When pfc statistics were counted, the delta change from last count
was summed twice. This fixes the issue.
(cherry picked from commit db0ea84845538f15ab1b44da4af4b4fd7adc4d85) 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>
Dmitry Kravkov [Mon, 20 Feb 2012 09:59:12 +0000 (09:59 +0000)]
bnx2x: update driver version to 1.72.10-0
(cherry picked from commit 0b0a635f79f91f3755b6518627ea06dd0dbfd523) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Dmitry Kravkov [Mon, 20 Feb 2012 09:59:11 +0000 (09:59 +0000)]
bnx2x: add gro_check
The patch provides workaround for BUG in FW 7.2.16,
which in GRO mode may miscalculate buffer and
place on SGE one frag less than it could.
It may happen only for some MTUs, we mark these MTUs
with gro_check flag during device initialization or
MTU change.
Next FW should include fix for the issue and the
patch could be reverted.
(cherry picked from commit fe603b4d680a2bba9d8c6d4267450fcf295f30d1) 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>
Joe Jin [Mon, 27 Aug 2012 12:03:46 +0000 (20:03 +0800)]
use FW 7.2.16
The patch integrates FW 7.2.16 HSI and implements driver
part of GRO flow.
FW 7.2.16 adds the ability to aggregate packets for GRO
(and not just LRO) and also fixes some bugs.
1. Added new aggregation mode: GRO. In this mode packets are aggregated
such that the original packets can be reconstructed by the OS.
2. 57712 HW bug workaround - initialized all CAM TM registers to 0x32.
3. Adding the FCoE statistics structures to the BNX2X HSI.
4. Wrong configuration of TX HW input buffer size may cause theoretical
performance effect. Performed configuration fix.
5. FCOE - Arrival of packets beyond task IO size can lead to crash.
Fix firmware data-in flow.
6. iSCSI - In rare cases of on-chip termination the graceful termination
timer hangs, and the termination doesn't complete. Firmware fix to MSL
timer tolerance.
7. iSCSI - Chip hangs when target sends FIN out-of-order or with isles
open at the initiator side. Firmware implementation corrected to drop
FIN received out-of-order or with isles still open.
8. iSCSI - Chip hangs when in case of retransmission not aligned to 4-bytes
from the beginning of iSCSI PDU. Firmware implementation corrected
to support arbitrary aligned retransmissions.
9. iSCSI - Arrival of target-initiated NOP-IN during intense ISCSI traffic
might lead to crash. Firmware fix to relevant flow.
(backported from upstream commit 621b4d66b27e70ba9a0e8fa4676d9c4f916c8343) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Mon, 27 Aug 2012 12:02:03 +0000 (20:02 +0800)]
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.
(cherry picked from commit 1355b704b9ba44182a97c90b4480d79f0de8f040) 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>
Joe Jin [Mon, 27 Aug 2012 11:26:29 +0000 (19:26 +0800)]
bnx2x: downgrade Max BW error message to debug
There are valid configurations where Max BW is configured to zero for
some VNs.
Print the message only if debugging is enabled and do not call the
configuration "illegal".
[v2: use DP(), not BNX2X_DBG_ERR(); recommended by Eilon Greenstein.]
(backported from upstream commit 96b0accb8867627250e911f8929e6c01da1ffd40) 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>
Julia Lawall [Sun, 8 Jul 2012 01:37:43 +0000 (01:37 +0000)]
drivers/net/cnic.c: remove invalid reference to list iterator variable
If list_for_each_entry, etc complete a traversal of the list, the iterator
variable ends up pointing to an address at an offset from the list head,
and not a meaningful structure. Thus this value should not be used after
the end of the iterator. There does not seem to be a meaningful value to
provide to netdev_warn. Replace with pr_warn, since pr_err is used
elsewhere.
This problem was found using Coccinelle (http://coccinelle.lip6.fr/).
(cherry picked from commit 022f09784b85396b4ceba954ce28e50de4882281) Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
introduced a regression as older versions of userspace app still rely
on this mmap. Restore the mmap functionality and get the base address
from pci_resource_start() as the nedev->base_addr has been deprecated for
PCI devices.
Update version to 2.5.12.
(backported from upstream commit ae0eef66088777cf252c6b91d3eb5ef2f30a67c5) Signed-off-by: Michael Chan <mchan@broadocm.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Mon, 27 Aug 2012 11:08:10 +0000 (19:08 +0800)]
cnic: Handle RAMROD_CMD_ID_CLOSE error.
If firmware returns error status, proceed to close the iSCSI connection.
Update version to 2.5.11.
(backported from upstream commit 7bc910fd8f953c131de055d9871679a598db8dc6) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Michael Chan [Wed, 27 Jun 2012 15:08:21 +0000 (15:08 +0000)]
cnic: Remove uio mem[0].
This memory region is no longer used. Userspace gets the BAR address
directly from sysfs.
(cherry picked from commit 1f85d58cdf15354a7120fc9ccc9bb9c45b53af88) Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Eddie Wai [Wed, 27 Jun 2012 15:08:20 +0000 (15:08 +0000)]
cnic: Read bnx2x function number from internal register
so that it will work on any hypervisor.
(cherry picked from commit 78ea22e8042b8a55c5a047869ed1fd9b3711340c) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Mon, 27 Aug 2012 11:06:14 +0000 (19:06 +0800)]
cnic: Fix occasional NULL pointer dereference during reboot.
We register with bnx2x before we allocate ctx_tbl structure, so it is
possible for bnx2x to call cnic_ctl before the structure is allocated.
This can sometimes cause NULL pointer dereference of cp->ctx_tbl. We
fix this by adding simple checking for valid state before proceeding.
The cnic_ctl call is RCU protected so we don't have to deal with race
conditions.
Because of the additional checking, we need to finish the shutdown
before clearing the CNIC_UP flag.
(backported from upstream commit a2028b2376a858cb68a7fcc129f6508f59b45381) Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
RongQing.Li [Tue, 21 Feb 2012 22:10:50 +0000 (22:10 +0000)]
ethernet/broadcom: ip6_route_output() never returns NULL.
ip6_route_output() never returns NULL, so it is wrong to
check if the return value is NULL.
(cherry picked from commit 0541743b4b35f2ddc9e490b4e354930168b60d23) Signed-off-by: RongQing.Li <roy.qing.li@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Michael Chan [Mon, 16 Jul 2012 14:25:56 +0000 (14:25 +0000)]
bnx2: Try to recover from PCI block reset
If the PCI block has reset, the memory enable bit will be reset and
the device will not respond to MMIO access. bnx2_reset_task() currently
will not recover when this happens. Add code to detect this condition
and restore the PCI state. This scenario has been reported by some
users.
(cherry picked from commit efdfad3205403e1d1c5c0bdcbdb647ddd89bfaa3) Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Michael Chan [Tue, 10 Jul 2012 10:04:40 +0000 (10:04 +0000)]
bnx2: Fix bug in bnx2_free_tx_skbs().
In rare cases, bnx2x_free_tx_skbs() can unmap the wrong DMA address
when it gets to the last entry of the tx ring. We were not using
the proper macro to skip the last entry when advancing the tx index.
Reported-by: Zongyun Lai <zlai@vmware.com> Reviewed-by: Jeffrey Huang <huangjw@broadcom.com>
(cherry picked from commit c1f5163de417dab01fa9daaf09a74bbb19303f3c) Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
(cherry picked from commit 0a742128db29031e55d27e37b1b098433c56033a) Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@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>
Most multi-queue networking driver consider the number of online cpus when
configuring RSS queues.
This patch adds a wrapper to the number of cpus, setting an upper limit on the
number of cpus a driver should consider (by default) when allocating resources
for his queues.
(cherry picked from commit 16917b87a23b429226527f393270047069d665e9) 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>
Michael Chan [Wed, 27 Jun 2012 15:08:24 +0000 (15:08 +0000)]
bnx2: Add missing netif_tx_disable() in bnx2_close()
to stop all tx queues. Update version to 2.2.3.
(cherry picked from commit d2e553bca89596b7ac35f8abcec9c9b93f772fc2) Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Michael Chan [Wed, 27 Jun 2012 15:08:23 +0000 (15:08 +0000)]
bnx2: Add "fall through" comments
to indicate that the mising break statements are intended.
(cherry picked from commit 7947c9ce17c4b51122cfcef3c2e9e2632eb96a67) Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Michael Chan [Sat, 16 Jun 2012 15:45:44 +0000 (15:45 +0000)]
bnx2: Update version 2.2.2
(cherry picked from commit 260762c7d8030055a157b6f4ea7d1805a09e59e8) Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>