]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
12 years agobnx2x: FCoE statistics id fixed
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>
12 years agobnx2x: dcb bit indices flags used as bits
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>
12 years agobnx2x: added cpu_to_le16 when preparing ramrod's data
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>
12 years agobnx2x: pfc statistics counts pfc events twice
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>
12 years agobnx2x: update driver version to 1.72.10-0
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>
12 years agobnx2x: add gro_check
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>
12 years agouse FW 7.2.16
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>
12 years agobnx2x: consistent statistics after internal driver reload
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>
12 years agobnx2x: downgrade Max BW error message to debug
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>
12 years agodrivers/net/cnic.c: remove invalid reference to list iterator variable
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>
12 years agocnic: Fix mmap regression.
Joe Jin [Mon, 27 Aug 2012 11:10:01 +0000 (19:10 +0800)]
cnic: Fix mmap regression.

commit 1f85d58cdf15354a7120fc9ccc9bb9c45b53af88
    cnic: Remove uio mem[0].

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>
12 years agocnic: Handle RAMROD_CMD_ID_CLOSE error.
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>
12 years agocnic: Remove uio mem[0].
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>
12 years agocnic: Read bnx2x function number from internal register
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>
12 years agocnic: Fix occasional NULL pointer dereference during reboot.
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>
12 years agoethernet/broadcom: ip6_route_output() never returns NULL.
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>
12 years agobnx2: Try to recover from PCI block reset
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>
12 years agobnx2: Fix bug in bnx2_free_tx_skbs().
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>
12 years agobnx2: set maximal number of default RSS queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:58 +0000 (03:18 +0000)]
bnx2: set maximal number of default RSS queues

(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>
12 years agonet-next: Add netif_get_num_default_rss_queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:50 +0000 (03:18 +0000)]
net-next: Add netif_get_num_default_rss_queues

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>
12 years agobnx2: Add missing netif_tx_disable() in bnx2_close()
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>
12 years agobnx2: Add "fall through" comments
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>
12 years agobnx2: Update version 2.2.2
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>
12 years agobnx2: Read PCI function number from internal register
Michael Chan [Sat, 16 Jun 2012 15:45:43 +0000 (15:45 +0000)]
bnx2: Read PCI function number from internal register

so that it will work on any hypervisor.

(cherry picked from commit aefd90e41476223c95e3c84c7dd22a65a21b1e40)
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>
12 years agobnx2: Dump additional BC_STATE during firmware sync timeout.
Michael Chan [Sat, 16 Jun 2012 15:45:42 +0000 (15:45 +0000)]
bnx2: Dump additional BC_STATE during firmware sync timeout.

(cherry picked from commit 13e63517f4bc425a17888e6497c59a9663c2b520)
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>
12 years agobnx2: Dump all FTQ_CTL registers during tx_timeout
Michael Chan [Sat, 16 Jun 2012 15:45:41 +0000 (15:45 +0000)]
bnx2: Dump all FTQ_CTL registers during tx_timeout

to help debug tx timeouts reported in the field.

Reviewed-by Benjamin Li <benli@broadcom.com>
(cherry picked from commit 555069dad01c955f41593711ce2a688c668f8234)
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>
12 years agobroadcom: replace open-coded ARRAY_SIZE with macro
Jim Cromie [Tue, 10 Apr 2012 14:56:03 +0000 (14:56 +0000)]
broadcom: replace open-coded ARRAY_SIZE with macro

(cherry picked from commit 0db83cd85c278f2f7a2ba2948987983009cc0912)
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agobnx2: stop using net_device.{base_addr, irq}.
Francois Romieu [Fri, 9 Mar 2012 13:51:47 +0000 (14:51 +0100)]
bnx2: stop using net_device.{base_addr, irq}.

(cherry picked from commit c0357e975afdbbedab5c662d19bef865f02adc17)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agobnx2: switch to build_skb() infrastructure
Joe Jin [Mon, 27 Aug 2012 07:40:07 +0000 (15:40 +0800)]
bnx2: switch to build_skb() infrastructure

This is very similar to bnx2x conversion, but bnx2 only requires 16bytes
alignement at start of the received frame to store its l2_fhdr, so goal
was not to reduce skb truesize (in fact it should not change after this
patch)

Using build_skb() reduces cache line misses in the driver, since we
use cache hot skb instead of cold ones. Number of in-flight sk_buff
structures is lower, they are more likely recycled in SLUB caches
while still hot.

(backported from upstream commit dd2bc8e9c0685d8eaaaf06e65919e31d60478411)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Michael Chan <mchan@broadcom.com>
CC: Eilon Greenstein <eilong@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agobnx2: convert to SKB paged frag API.
Ian Campbell [Wed, 24 Aug 2011 22:28:12 +0000 (22:28 +0000)]
bnx2: convert to SKB paged frag API.

(cherry picked from commit b7b6a688d217936459ff5cf1087b2361db952509)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Michael Chan <mchan@broadcom.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Update version to 3.124
Michael Chan [Sun, 29 Jul 2012 19:15:45 +0000 (19:15 +0000)]
tg3: Update version to 3.124

(cherry picked from commit cac83e53917ebc058066eb98023c11fdaa2262dc)
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>
12 years agotg3: Fix race condition in tg3_get_stats64()
Michael Chan [Sun, 29 Jul 2012 19:15:44 +0000 (19:15 +0000)]
tg3: Fix race condition in tg3_get_stats64()

Spinlock should be taken before checking for tp->hw_stats.

(cherry picked from commit 0f566b208b41918053b2e67399673aaec02dde5d)
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>
12 years agotg3: Add New 5719 Read DMA workaround
Michael Chan [Sun, 29 Jul 2012 19:15:43 +0000 (19:15 +0000)]
tg3: Add New 5719 Read DMA workaround

After Power-on-reset, the 5719's TX DMA length registers may contain
uninitialized values and cause TX DMA to stall.  Check for invalid
values and set a register bit to flush the TX channels.  The bit
needs to be turned off after the DMA channels have been flushed.

(cherry picked from commit 091f0ea30074bc43f9250961b3247af713024bc6)
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>
12 years agotg3: Fix Read DMA workaround for 5719 A0.
Michael Chan [Sun, 29 Jul 2012 19:15:42 +0000 (19:15 +0000)]
tg3: Fix Read DMA workaround for 5719 A0.

The workaround was mis-applied to all 5719 and 5720 chips.

(cherry picked from commit 10ce95d6ef36c65df7dcd3b8fcf86913f8b298bd)
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>
12 years agotg3: Request APE_LOCK_PHY before PHY access
Michael Chan [Sun, 29 Jul 2012 19:15:41 +0000 (19:15 +0000)]
tg3: Request APE_LOCK_PHY before PHY access

to prevent PHY access conflict with APE firmware.

(cherry picked from commit 8151ad576d34a5ec1f1068edf25f3b7c47f6edab)
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>
12 years agotg3: Add hwmon support for temperature
Michael Chan [Mon, 16 Jul 2012 16:24:02 +0000 (16:24 +0000)]
tg3: Add hwmon support for temperature

Some tg3 devices have management firmware that can export sensor data.
Export temperature sensor reading via hwmon sysfs.

[hwmon interface suggested by Ben Hutchings <bhutchings@solarflare.com>]

(cherry picked from commit aed93e0bf493535c25c27270001226bb1dd379b2)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Nithin Nayak Sujir <nsujir@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>
12 years agotg3: Add APE scratchpad read function
Matt Carlson [Mon, 16 Jul 2012 16:24:01 +0000 (16:24 +0000)]
tg3: Add APE scratchpad read function

for retreiving temperature sensor data.

(cherry picked from commit cf8d55ae08459d6412779559fb1e88252db86c9d)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Nithin Nayak Sujir <nsujir@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>
12 years agotg3: Add common function tg3_ape_event_lock()
Matt Carlson [Mon, 16 Jul 2012 16:24:00 +0000 (16:24 +0000)]
tg3: Add common function tg3_ape_event_lock()

by refactoring code in tg3_ape_send_event().  The common function will
be used in subsequent patches.

(cherry picked from commit b65a372bbc74924b0ce564a3338d9e139367bd3d)
Signed-off-by: Matt Carlson <mcarlson@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>
12 years agotg3: Fix the setting of the APE_HAS_NCSI flag
Michael Chan [Mon, 16 Jul 2012 16:23:59 +0000 (16:23 +0000)]
tg3: Fix the setting of the APE_HAS_NCSI flag

The driver currently skips setting this flag if the VPD contains the
firmware version string.  We fix this by separating the probing of NCSI
from the reading of the NCSI version string.  The APE_HAS_NCSI flag is
needed to properly read sensor data.

(cherry picked from commit 165f4d1cb3d7a10c5bc8c0fdae63323354f5a225)
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>
12 years agotg3: add device id of Apple Thunderbolt Ethernet device
Greg KH [Thu, 12 Jul 2012 15:39:44 +0000 (15:39 +0000)]
tg3: add device id of Apple Thunderbolt Ethernet device

The Apple Thunderbolt ethernet device is already listed in the driver,
but not hooked up in the MODULE_DEVICE_TABLE().  This fixes that and
allows it to work properly.

(cherry picked from commit 02eca3f5f5e458c3a5d7b772bc8042ee2a4ebedf)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Apply short DMA frag workaround to 5906
Matt Carlson [Thu, 7 Jun 2012 12:56:54 +0000 (12:56 +0000)]
tg3: Apply short DMA frag workaround to 5906

5906 devices also need the short DMA fragment workaround.  This patch
makes the necessary change.

(cherry picked from commit b7abee6ef888117f92db370620ebf116a38e3f4d)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Tested-by: Christian Kujau <lists@nerdbynature.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: remove redundant NULL test before release_firmware() call
Jesper Juhl [Mon, 9 Apr 2012 20:50:15 +0000 (22:50 +0200)]
tg3: remove redundant NULL test before release_firmware() call

There is no need to test for a NULL pointer before calling
release_firmware - the function does that on its own.

(cherry picked from commit e3c5530b96b9c5994cfb2544a037161790c4f7c3)
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Fix 5717 serdes powerdown problem
Matt Carlson [Mon, 2 Apr 2012 09:01:40 +0000 (09:01 +0000)]
tg3: Fix 5717 serdes powerdown problem

If port 0 of a 5717 serdes device powers down, it hides the phy from
port 1.  This patch works around the problem by keeping port 0's phy
powered up.

(cherry picked from commit 085f1afc56619bda424941412fdeaff1e32c21dc)
Signed-off-by: Matt Carlson <mcarlson@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>
12 years agotg3: Fix RSS ring refill race condition
Michael Chan [Wed, 21 Mar 2012 15:38:33 +0000 (15:38 +0000)]
tg3: Fix RSS ring refill race condition

The RSS feature in tg3 hardware has only one rx producer ring for all
RSS rings.  NAPI vector 1 is special and handles the refilling of the
rx producer ring on behalf of all RSS rings.  There is a race condition
between these RSS NAPIs and the NAPI[1].  If NAPI[1] finishes checking
for refill and then another RSS ring empties the rx producer ring
before NAPI[1] exits NAPI, the chip will be completely out of SKBs in
the rx producer ring.

We fix this by adding a flag tp->rx_refill and rely on napi_schedule()/
napi_complete() to help synchronize it to close the race condition.

Update driver version to 3.123.

(cherry picked from commit 7ae5289017e5ed5514b2603d157fb54c058a3c82)
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>
12 years agotg3: Recode PCI MRRS adjustment as a PCI quirk
Matt Carlson [Mon, 27 Feb 2012 09:44:48 +0000 (09:44 +0000)]
tg3: Recode PCI MRRS adjustment as a PCI quirk

This patch recodes the MRRS cap for 5719 A0 devices as a PCI quirk.

(cherry picked from commit 0b471506712dd734964b3270d2aa88160712c262)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Fix poor tx performance on 57766 after MTU change
Michael Chan [Sun, 4 Mar 2012 14:48:15 +0000 (14:48 +0000)]
tg3: Fix poor tx performance on 57766 after MTU change

GRC reset causes the read DMA engine to go into a mode that breaks up
requests into 256 bytes.  A PHY reset is required to bring it back to
the normal mode.

(cherry picked from commit 2fae5e3670a666039e6f2fd63e1a5d320c71b913)
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>
12 years agotg3: Add memory barriers to sync BD data
Joe Jin [Mon, 27 Aug 2012 05:26:13 +0000 (13:26 +0800)]
tg3: Add memory barriers to sync BD data

for weak memory model architectures to ensure that the chip will DMA
valid BD data.

(cherry picked from commit 6541b806b5f267eda8f127bb7f5fec4e7e4db995)
Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Fix jumbo loopback test on 5719
Michael Chan [Sun, 4 Mar 2012 14:48:13 +0000 (14:48 +0000)]
tg3: Fix jumbo loopback test on 5719

Loopback on 9K packet fails because the chip has a DMA limit of 4K.  The
loopback test logic uses a single BD for simplicity.  Fix it by reducing
the jumbo packet size to the DMA limit.

(cherry picked from commit c441b456767357322dbc14b55bdc7da0051d0d98)
Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Fix tg3_get_stats64 for 5700 / 5701 devs
Joe Jin [Mon, 27 Aug 2012 05:22:21 +0000 (13:22 +0800)]
tg3: Fix tg3_get_stats64 for 5700 / 5701 devs

tg3_get_stats64() takes tp->lock when dealing with non-serdes bcm5700
and bcm5701 devices.  However, functions that call tg3_halt() have
already acquired tp->lock.  When tg3_get_stats64() is called in
tg3_halt(), deadlock will occur.

This patch fixes the problem by separating the stat gathering code into
a new tg3_get_nstats() function.  tg3_get_stats64() is recoded to call
this function and take tp->lock.  The code that takes tp->lock in
tg3_calc_crc_errors() has been removed.  Function signatures have been
cleaned up too.

(cherry picked from commit 65ec698d1368fc64d0b93fb703783d25ec550577)
Signed-off-by: Matt Carlson <mcarlson@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>
12 years agotg3: Create timer helper functions
Matt Carlson [Wed, 22 Feb 2012 12:35:21 +0000 (12:35 +0000)]
tg3: Create timer helper functions

This patch seeks to clean up the timer related code.  It begins by
moving one-time timer setup code from tg3_open() to tg3_init_one().
It then creates a function that encapsulates the code needed to start
the timer.  A tg3_timer_stop() function was added for parity.  Finally,
this patch moves all the timer functions to a more suitable location.

(cherry picked from commit 21f7638e6f05c36b35a36cd4311e08be5dc00bb1)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Clear RECOVERY_PENDING with reset_task_cancel
Matt Carlson [Wed, 22 Feb 2012 12:35:20 +0000 (12:35 +0000)]
tg3: Clear RECOVERY_PENDING with reset_task_cancel

If an error happens in the tx completion thread, tg3_reset_task will be
scheduled and TX_RECOVERY_PENDING will be set.  The TX_RECOVERY_PENDING
flag causes tg3_poll[_msix] to return early before doing much of its
work.  Tg3_reset_task() gets canceled when the configuration of the
device is changing, which always results in a chip reset.  When this
happens, the TX_RECOVERY_PENDING flag may be left set, which would
unnecessarily hinder tg3_poll from doing work.  This patch fixes the
problem.

(cherry picked from commit c71013597d49c7ca8bb5049f0c7873df2643fad5)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Remove SPEED_UNKNOWN checks
Matt Carlson [Wed, 22 Feb 2012 12:35:19 +0000 (12:35 +0000)]
tg3: Remove SPEED_UNKNOWN checks

tg3_phy_copper_begin() has code that configures the link
advertisements through the use of the link_config.speed and
link_config.duplex members.  The driver does not internally use these
members in this way, nor is it (currently) permitted via the ethtool
interface.  This patch removes the dead code.

(cherry picked from commit d13ba512cbba7de5d55d7a3b2aae7d83c8921457)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Fix link check in tg3_adjust_link
Matt Carlson [Wed, 22 Feb 2012 12:35:18 +0000 (12:35 +0000)]
tg3: Fix link check in tg3_adjust_link

The tg3 driver tried to detect link changes by comparing the tg3 local
active_speed member with SPEED_UNKNOWN (or formerly SPEED_INVALID).
This check is not correct, since phylib will never set its speed member
to either of these two values.  The code only appeared to work because
tg3 initializes active_speed to SPEED_INVALID during tg3_init_one.  This
patch introduces a new "old_link" tg3 member and then compares the
phy_device's link member against it to detect link state changes.

(cherry picked from commit 34655ad63893d3dd64f3fbaaaa0791550e554fa9)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: remove IRQF_SAMPLE_RANDOM flag
Davidlohr Bueso [Wed, 22 Feb 2012 03:06:54 +0000 (03:06 +0000)]
tg3: remove IRQF_SAMPLE_RANDOM flag

This driver is the last user of the IRQF_SAMPLE_RANDOM flag for net drivers, and since add_*_randomness
interfaces have now deprecated the flag as a source of external noise, we can remove it.

(cherry picked from commit f274fd9a0384c448335dcc51b04c4c41caa7f432)
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Update copyright
Matt Carlson [Mon, 13 Feb 2012 15:20:17 +0000 (15:20 +0000)]
tg3: Update copyright

This patch updates the copyright dates in the tg3 driver.

(cherry picked from commit 9e056c0320fafc03dc170772d8562e3142ed1778)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Use *_UNKNOWN ethtool definitions
Matt Carlson [Mon, 13 Feb 2012 15:20:16 +0000 (15:20 +0000)]
tg3: Use *_UNKNOWN ethtool definitions

This patch replaces tg3's private SPEED_INVALID and DUPLEX_INVALID
definitions with SPEED_UNKNOWN and DUPLEX_UNKNOWN respectively.

(cherry picked from commit e740522e6d3a6c3014da30f65fe254bc7f6410d7)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Remove unneeded link_config.orig_... members
Matt Carlson [Mon, 13 Feb 2012 15:20:15 +0000 (15:20 +0000)]
tg3: Remove unneeded link_config.orig_... members

This patch removes the unneeded link_config.orig_* members.  When the
phy is in a low power state, the TG3_PHYFLG_IS_LOW_POWER flag solely
determines how the link is configured.  When the phy is powered back up,
it can resume using the original settings.

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

(cherry picked from commit c6700ce2248ecf3b1b6fd009f6aed9b6387d3377)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Remove unused link config code
Matt Carlson [Mon, 13 Feb 2012 15:20:14 +0000 (15:20 +0000)]
tg3: Remove unused link config code

When tg3 devices are shutdown, the driver uses the
TG3_PHYFLG_IS_LOW_POWER flag to enable a static phy configuration.
Any attempt to use the link configuration variables is dead code.  This
patch removes such code.

(cherry picked from commit 2855b9fe416e55d01a1946b142d87abd4cceb6ea)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Consolidate ASIC rev detection code
Matt Carlson [Mon, 13 Feb 2012 15:20:13 +0000 (15:20 +0000)]
tg3: Consolidate ASIC rev detection code

Detecting the ASIC revision of a device is getting to be an increasingly
complex process.  This patch consolidates all the ASIC rev detection
code to a single routine for better maintainability.

(cherry picked from commit 42b123b1297d10e79bd75bc665058122161f368d)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Reduce UMP event collision window
Matt Carlson [Mon, 13 Feb 2012 15:20:12 +0000 (15:20 +0000)]
tg3: Reduce UMP event collision window

The tg3 driver needs to submit a few phy register values to the UMP
firmware each time the link state changes.  Up until now, the driver
would wait for the previous event to complete, then proceed to gather
data through a series of phy accesses.  Since phy accesses are
relatively slow, it is possible for another thread to attempt to submit
its own event while the UMP code is still construction its message.

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

(cherry picked from commit b28f389d92114ecf1a7c99eb3865438543a1808b)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Fix NVRAM page writes on newer devices
Matt Carlson [Mon, 13 Feb 2012 15:20:11 +0000 (15:20 +0000)]
tg3: Fix NVRAM page writes on newer devices

On newer devices, the hardware expects the NVRAM address register
to be written only once per NVRAM page.  To do otherwise causes NVRAM
corruption.  This patch fixes the problem.

(cherry picked from commit 422782249927e887a4c032d1d7e1f59de281ecbb)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Fix copper autoneg adv checks
Matt Carlson [Mon, 13 Feb 2012 15:20:10 +0000 (15:20 +0000)]
tg3: Fix copper autoneg adv checks

When checking the autoneg advertisements, the driver failed to include
the master and master enable bits for the bcm5701.  This patch fixes the
problem.

(cherry picked from commit 3198e07fd64aa8c3a38dda33bcc0f44265eb581e)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Fix stats while interface is down
Matt Carlson [Mon, 13 Feb 2012 15:20:09 +0000 (15:20 +0000)]
tg3: Fix stats while interface is down

If the tg3 interface is down, the driver will return ethtool stats
uninitialized.  This patch zeroes out the destination stat buffer in
such a case.

(cherry picked from commit b546e46f5c9f19a921d6f62db80f2e9371bc0558)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Disable new DMA engine for 57766
Matt Carlson [Mon, 13 Feb 2012 15:20:08 +0000 (15:20 +0000)]
tg3: Disable new DMA engine for 57766

A bug was found in the new DMA engine for the 57766.  This patch
disables it, which causes the device to fallback to the old DMA engine.

(cherry picked from commit 3906969189a409e590a51b18c86a92d0506c9372)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Move transmit comment to a better location
Matt Carlson [Mon, 13 Feb 2012 10:20:12 +0000 (10:20 +0000)]
tg3: Move transmit comment to a better location

This patch moves a comment in the transmit path to a better location.

(cherry picked from commit c5665a538da6b887a5096358a12527785506e5ac)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Eliminate unneeded prototype
Matt Carlson [Mon, 13 Feb 2012 10:20:11 +0000 (10:20 +0000)]
tg3: Eliminate unneeded prototype

This patch eliminates the unneeded tg3_halt_cpu() prototype and moves
the tg3_setup_phy() prototype closer to where it is needed.

(cherry picked from commit 4b40952268c2390a71b9728194eb4b4dd514c087)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Relocate tg3_find_peer
Matt Carlson [Mon, 13 Feb 2012 10:20:10 +0000 (10:20 +0000)]
tg3: Relocate tg3_find_peer

This patch relocates tg3_find_peer to eliminate a prototype.

(cherry picked from commit 16c7fa7dfe9a304ca6d5bdf39aa4a8d315336a07)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Move tg3_nvram_write_block functions
Matt Carlson [Mon, 13 Feb 2012 10:20:09 +0000 (10:20 +0000)]
tg3: Move tg3_nvram_write_block functions

This patch moves the tg3_nvram_write_block functions higher in the file
to eliminate a prototype.

(cherry picked from commit dbe9b92a602b203174a3227a05e69c019eebf91d)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Move tg3_set_rx_mode
Matt Carlson [Mon, 13 Feb 2012 10:20:08 +0000 (10:20 +0000)]
tg3: Move tg3_set_rx_mode

This patch moves __tg3_set_rx_mode above its first use and moves
tg3_set_rx_mode down closer to where the netdev_ops functions should be.

(cherry picked from commit ccd5ba9db50d09d6d6e2d91d76d3b27fff8f6ed5)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Move tg3_change_mtu to a better location
Joe Jin [Mon, 27 Aug 2012 05:14:37 +0000 (13:14 +0800)]
tg3: Move tg3_change_mtu to a better location

This patch moves tg3_change_mtu to a better location.

(cherry picked from commit faf1627ac15d25687259844575a128e9f06f3e6f)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Relocate tg3_reset_task
Matt Carlson [Mon, 13 Feb 2012 10:20:06 +0000 (10:20 +0000)]
tg3: Relocate tg3_reset_task

This patch moves tg3_reset_task further down in the file where it makes
more sense to be.

(cherry picked from commit 9a21fb8fc3a74429a4eee2d53df5a3167c290f2a)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Move tg3_restart_hw to a better location
Matt Carlson [Mon, 13 Feb 2012 10:20:05 +0000 (10:20 +0000)]
tg3: Move tg3_restart_hw to a better location

This patch relocates tg3_restart_hw() to a better location.

(cherry picked from commit ebf3312e781aee1bc22bb3a42cb324eb973a7c02)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Fix single-vector MSI-X code
Matt Carlson [Tue, 17 Jan 2012 15:27:23 +0000 (15:27 +0000)]
tg3: Fix single-vector MSI-X code

Kdump kernels leave MSI-X interrupts (as setup by the crashed kernel)
enabled.  However, kdump only enables one CPU in the new environment,
thus causing tg3 to abort MSI-X setup.  When the driver attempts to
enable INTA or MSI interrupt modes on a kdump kernel, interrupt
delivery fails.

This patch attempts to workaround the problem by forcing the driver
to enable a single MSI-X interrupt.  In such a configuration, the
device's multivector interrupt mode must be disabled.

(cherry picked from commit c3b5003b628d8e373262bee42c7260d6a799c73e)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agotg3: Make the RSS indir tbl admin configurable
Matt Carlson [Fri, 16 Dec 2011 13:33:23 +0000 (13:33 +0000)]
tg3: Make the RSS indir tbl admin configurable

This patch adds the ethtool callbacks necessary to change the rss
indirection table from userspace.  Should the number of interrupts
change (e.g.  across a close / open call, or through a reset) and
any one of the indirection table values fall out-of-range, the driver
will reset the indirection table to a default layout.

[Integrated many suggestions made by Ben Hutchings.]

Changes since v3

* Removed TG3_FLAG_SUPPORT_MSIX checks at the start of
  tg3_get_rxfh_indir() and tg3_set_rxfh_indir().

(cherry picked from commit 90415477bf1356f72acc34063ff52441fc10a754)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agoethtool: Define and apply a default policy for RX flow hash indirection
Joe Jin [Mon, 27 Aug 2012 12:54:45 +0000 (20:54 +0800)]
ethtool: Define and apply a default policy for RX flow hash indirection

All drivers that support modification of the RX flow hash indirection
table initialise it in the same way: RX rings are assigned to table
entries in rotation.  Make that default policy explicit by having them
call a ethtool_rxfh_indir_default() function.

In the ethtool core, add support for a zero size value for
ETHTOOL_SRXFHINDIR, which resets the table to this default.

(backported from upstream commit 278bc4296bd64ffd1d3913b487dc8a520e423a7a)
Partly-suggested-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Shreyas N Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agoethtool: Clarify use of size field for ETHTOOL_GRXFHINDIR
Ben Hutchings [Thu, 15 Dec 2011 13:51:16 +0000 (13:51 +0000)]
ethtool: Clarify use of size field for ETHTOOL_GRXFHINDIR

In order to find out the device's RX flow hash table size, ethtool
initially uses ETHTOOL_GRXFHINDIR with a buffer size of zero.  This
must be supported, but it is not necessary to support any other user
buffer size less than the device table size.

(cherry picked from commit 14596f7006297b67516e2b6a2b26bcb11fe08fb3)
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agoethtool: Centralise validation of ETHTOOL_{G, S}RXFHINDIR parameters
Joe Jin [Mon, 27 Aug 2012 12:38:36 +0000 (20:38 +0800)]
ethtool: Centralise validation of ETHTOOL_{G, S}RXFHINDIR parameters

Add a new ethtool operation (get_rxfh_indir_size) to get the
indirectional table size.  Use this to validate the user buffer size
before calling get_rxfh_indir or set_rxfh_indir.  Use get_rxnfc to get
the number of RX rings, and validate the contents of the new
indirection table before calling set_rxfh_indir.  Remove this
validation from drivers.

(backported from upstream commit 7850f63f1620512631445b901ae11cd149e7375c)
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agobonding: comparing a u8 with -1 is always false
Joe Jin [Mon, 27 Aug 2012 06:35:28 +0000 (14:35 +0800)]
bonding: comparing a u8 with -1 is always false

slave->duplex is a u8 type so the in bond_info_show_slave() when we
check "if (slave->duplex == -1)", it's always false.

(backported from upstream commit 589665f5a6008dbce1d0af2cb93e94a80bf78151)
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>
12 years agobonding:update speed/duplex for NETDEV_CHANGE
Joe Jin [Mon, 27 Aug 2012 06:34:02 +0000 (14:34 +0800)]
bonding:update speed/duplex for NETDEV_CHANGE

Zheng Liang(lzheng@redhat.com) found a bug that if we config bonding with
arp monitor, sometimes bonding driver cannot get the speed and duplex from
its slaves, it will assume them to be 100Mb/sec and Full, please see
/proc/net/bonding/bond0.
But there is no such problem when uses miimon.

(Take igb for example)
I find that the reason is that after dev_open() in bond_enslave(),
bond_update_speed_duplex() will call igb_get_settings()
, but in that function,
it runs ethtool_cmd_speed_set(ecmd, -1); ecmd->duplex = -1;
because igb get an error value of status.
So even dev_open() is called, but the device is not really ready to get its
settings.

Maybe it is safe for us to call igb_get_settings() only after
this message shows up, that is "igb: p4p1 NIC Link is Up 1000 Mbps Full Duplex,
Flow Control: RX".

So I prefer to update the speed and duplex for a slave when reseices
NETDEV_CHANGE/NETDEV_UP event.

Changelog
V2:
1 remove the "fake 100/Full" logic in bond_update_speed_duplex(),
  set speed and duplex to -1 when it gets error value of speed and duplex.
2 delete the warning in bond_enslave() if bond_update_speed_duplex() returns
  error.
3 make bond_info_show_slave() handle bad values of speed and duplex.

(backport from upstream commit 98f41f694f46085fda475cdee8cc0b6d2c5e6f1f)
Signed-off-by: Weiping Pan <wpan@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agofnic: fix incorrect use of SLAB_CACHE_DMA flag
Abhijeet Joglekar [Tue, 14 Jun 2011 04:21:01 +0000 (21:21 -0700)]
fnic: fix incorrect use of SLAB_CACHE_DMA flag

Driver was incorrectly using the SLAB_CACHE_DMA flag when creating a cache
for SGLs. fnic device does not have 24-bit DMA restrictions. Remove the flag
and allocations from ZONE_DMA.

Thanks to Roland Dreier and David Rientjes for pointing out the bug.

Signed-off-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 0c79c74272b25bbcfb0149d5a4627ed768795d2d)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agoixgbevf: upgrade to -2.6.2.
Joe Jin [Tue, 28 Aug 2012 06:01:45 +0000 (14:01 +0800)]
ixgbevf: upgrade to -2.6.2.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agoixgbe: upgrade to 3.10.16.
Joe Jin [Tue, 28 Aug 2012 05:58:38 +0000 (13:58 +0800)]
ixgbe: upgrade to 3.10.16.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agoigbvf: upgrade to 2.0.4
Joe Jin [Tue, 28 Aug 2012 05:52:43 +0000 (13:52 +0800)]
igbvf: upgrade to 2.0.4

Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agoigb: upgrade to 3.4.8.
Joe Jin [Tue, 28 Aug 2012 05:49:04 +0000 (13:49 +0800)]
igb: upgrade to 3.4.8.

Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agoe1000e: upgrade to 2.0.0.1
Joe Jin [Tue, 28 Aug 2012 05:44:44 +0000 (13:44 +0800)]
e1000e: upgrade to 2.0.0.1

Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agoe1000: upgrade to 8.0.35-NAPI
Joe Jin [Tue, 28 Aug 2012 05:39:05 +0000 (13:39 +0800)]
e1000: upgrade to 8.0.35-NAPI

Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agonet: e100: ucode is optional in some cases
Bjørn Mork [Thu, 19 Jul 2012 06:28:40 +0000 (06:28 +0000)]
net: e100: ucode is optional in some cases

commit 9ac32e1b firmware: convert e100 driver to request_firmware()

did a straight conversion of the in-driver ucode to external
files.  This introduced the possibility of the driver failing
to enable an interface due to missing ucode. There was no
evaluation of the importance of the ucode at the time.

Based on comments in earlier versions of this driver, and in
the source code for the FreeBSD fxp driver, we can assume that
the ucode implements the "CPU Cycle Saver" feature on supported
adapters.  Although generally wanted, this is an optional
feature. The ucode source is not available, preventing it from
being included in free distributions. This creates unnecessary
problems for the end users. Doing a network install based on a
free distribution installer requires the user to download and
insert the ucode into the installer.

Making the ucode optional when possible improves the user
experience and driver usability.

The ucode for some adapters include a bugfix, making it
essential.  We continue to fail for these adapters unless the
ucode is available.

(cherry picked from commit 8b0d2f9ed3d8e92feada7c5d70fa85be46e6f948)
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
12 years agoe100: enable transmit time stamping.
Richard Cochran [Sun, 8 Apr 2012 14:38:10 +0000 (14:38 +0000)]
e100: enable transmit time stamping.

This patch enables software (and phy device) transmit time stamping.
Tested on an old PIII laptop with built in NIC.

(cherry picked from commit 48425b14929ef185377e3827ba7135d88343face)
Signed-off-by: Richard Cochran <richardcochran@gmail.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 agoMerge branch 'uek-2.6.39-300_bug14472774' of git://ca-git.us.oracle.com/linux-muvarov...
Maxim Uvarov [Mon, 13 Aug 2012 13:03:21 +0000 (06:03 -0700)]
Merge branch 'uek-2.6.39-300_bug14472774' of git://ca-git.us.oracle.com/linux-muvarov-public

13 years agox86/nmi: Add new NMI queues to deal with IO_CHK and SERR
Maxim Uvarov [Thu, 9 Aug 2012 15:14:24 +0000 (08:14 -0700)]
x86/nmi: Add new NMI queues to deal with IO_CHK and SERR

In discussions with Thomas Mingarelli about hpwdt, he explained
to me some issues they were some when using their virtual NMI
button to test the hpwdt driver.

It turns out the virtual NMI button used on HP's machines do no
send unknown NMIs but instead send IO_CHK NMIs.  The way the
kernel code is written, the hpwdt driver can not register itself
against that type of NMI and therefore can not successfully
capture system information before panic'ing.

To solve this I created two new NMI queues to allow driver to
register against the IO_CHK and SERR NMIs.  Or in the hpwdt all
three (if you include unknown NMIs too).

The change is straightforward and just mimics what the unknown
NMI does.

Reported-and-tested-by: Thomas Mingarelli <thomas.mingarelli@hp.com>
Signed-off-by: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1333051877-15755-3-git-send-email-dzickus@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Conflicts:

arch/x86/kernel/nmi.c
drivers/watchdog/hpwdt.c

13 years agox86, nmi: Create new NMI handler routines
Don Zickus [Fri, 30 Sep 2011 19:06:20 +0000 (15:06 -0400)]
x86, nmi: Create new NMI handler routines

The NMI handlers used to rely on the notifier infrastructure.  This worked
great until we wanted to support handling multiple events better.

One of the key ideas to the nmi handling is to process _all_ the handlers for
each NMI.  The reason behind this switch is because NMIs are edge triggered.
If enough NMIs are triggered, then they could be lost because the cpu can
only latch at most one NMI (besides the one currently being processed).

In order to deal with this we have decided to process all the NMI handlers
for each NMI.  This allows the handlers to determine if they recieved an
event or not (the ones that can not determine this will be left to fend
for themselves on the unknown NMI list).

As a result of this change it is now possible to have an extra NMI that
was destined to be received for an already processed event.  Because the
event was processed in the previous NMI, this NMI gets dropped and becomes
an 'unknown' NMI.  This of course will cause printks that scare people.

However, we prefer to have extra NMIs as opposed to losing NMIs and as such
are have developed a basic mechanism to catch most of them.  That will be
a later patch.

To accomplish this idea, I unhooked the nmi handlers from the notifier
routines and created a new mechanism loosely based on doIRQ.  The reason
for this is the notifier routines have a couple of shortcomings.  One we
could't guarantee all future NMI handlers used NOTIFY_OK instead of
NOTIFY_STOP.  Second, we couldn't keep track of the number of events being
handled in each routine (most only handle one, perf can handle more than one).
Third, I wanted to eventually display which nmi handlers are registered in
the system in /proc/interrupts to help see who is generating NMIs.

The patch below just implements the new infrastructure but doesn't wire it up
yet (that is the next patch).  Its design is based on doIRQ structs and the
atomic notifier routines.  So the rcu stuff in the patch isn't entirely untested
(as the notifier routines have soaked it) but it should be double checked in
case I copied the code wrong.

Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1317409584-23662-3-git-send-email-dzickus@redhat.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
13 years agoMerge commit 'v2.6.39-300.4.0#bug14479881v2'
Maxim Uvarov [Mon, 13 Aug 2012 12:39:23 +0000 (05:39 -0700)]
Merge commit 'v2.6.39-300.4.0#bug14479881v2'

13 years agoMerge branch 'bug14063941' of git://ca-git.us.oracle.com/linux-jubi-public
Maxim Uvarov [Mon, 13 Aug 2012 12:36:32 +0000 (05:36 -0700)]
Merge branch 'bug14063941' of git://ca-git.us.oracle.com/linux-jubi-public

13 years agotick: Add tick skew boot option
Mike Galbraith [Tue, 8 May 2012 10:20:58 +0000 (12:20 +0200)]
tick: Add tick skew boot option

Let the user decide whether power consumption or jitter is the
more important consideration for their machines.

Quoting removal commit af5ab277ded04bd9bc6b048c5a2f0e7d70ef0867:

"Historically, Linux has tried to make the regular timer tick on the
 various CPUs not happen at the same time, to avoid contention on
 xtime_lock.

 Nowadays, with the tickless kernel, this contention no longer happens
 since time keeping and updating are done differently. In addition,
 this skew is actually hurting power consumption in a measurable way on
 many-core systems."

Problems:

- Contrary to the above, systems do encounter contention on both
  xtime_lock and RCU structure locks when the tick is synchronized.

- Moderate sized RT systems suffer intolerable jitter due to the tick
  being synchronized.

- SGI reports the same for their large systems.

- Fully utilized systems reap no power saving benefit from skew removal,
  but do suffer from resulting induced lock contention.

0209f649 rcu: limit rcu_node leaf-level fanout
  This patch was born to combat lock contention which testing showed
  to have been _induced by_ skew removal.  Skew the tick, contention
  disappeared virtually completely.

Signed-off-by: Mike Galbraith <mgalbraith@suse.de>
Link: http://lkml.kernel.org/r/1336472458.21924.78.camel@marge.simpson.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
13 years agomm/vmstat.c: cache align vm_stat
Dimitri Sivanich [Tue, 1 Nov 2011 00:09:46 +0000 (17:09 -0700)]
mm/vmstat.c: cache align vm_stat

Avoid false sharing of the vm_stat array.

This was found to adversely affect tmpfs I/O performance.

Tests run on a 640 cpu UV system.

With 120 threads doing parallel writes, each to different tmpfs mounts:
No patch: ~300 MB/sec
With vm_stat alignment: ~430 MB/sec

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
Acked-by: Christoph Lameter <cl@gentwo.org>
Acked-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agovfs: fix panic in __d_lookup() with high dentry hashtable counts
Dimitri Sivanich [Fri, 10 Aug 2012 11:46:56 +0000 (04:46 -0700)]
vfs: fix panic in __d_lookup() with high dentry hashtable counts

When the number of dentry cache hash table entries gets too high
(2147483648 entries), as happens by default on a 16TB system, use of a
signed integer in the dcache_init() initialization loop prevents the
dentry_hashtable from getting initialized, causing a panic in
__d_lookup().  Fix this in dcache_init() and similar areas.

Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Conflicts:

net/ipv4/tcp.c

13 years agocpusets: randomize node rotor used in cpuset_mem_spread_node()
Jack Steiner [Fri, 10 Aug 2012 11:45:33 +0000 (04:45 -0700)]
cpusets: randomize node rotor used in cpuset_mem_spread_node()

Some workloads that create a large number of small files tend to assign
too many pages to node 0 (multi-node systems).  Part of the reason is that
the rotor (in cpuset_mem_spread_node()) used to assign nodes starts at
node 0 for newly created tasks.

This patch changes the rotor to be initialized to a random node number of
the cpuset.

[akpm@linux-foundation.org: fix layout]
[Lee.Schermerhorn@hp.com: Define stub numa_random() for !NUMA configuration]
Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Paul Menage <menage@google.com>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Robin Holt <holt@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Conflicts:

arch/x86/mm/numa.c

13 years agox86: Reduce clock calibration time during slave cpu startup
Jack Steiner [Fri, 10 Aug 2012 11:44:37 +0000 (04:44 -0700)]
x86: Reduce clock calibration time during slave cpu startup

Reduce the startup time for slave cpus.

Adds hooks for an arch-specific function for clock calibration.
These hooks are used on x86.  If a newly started cpu has the
same phys_proc_id as a core already active, uses the TSC for the
delay loop and has a CONSTANT_TSC, use the already-calculated
value of loops_per_jiffy.

This patch reduces the time required to start slave cpus on a
4096 cpu system from: 465 sec OLD 62 sec NEW

This reduces boot time on a 4096p system by almost 7 minutes.
Nice...

Signed-off-by: Jack Steiner <steiner@sgi.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: John Stultz <john.stultz@linaro.org>
[fix CONFIG_SMP=n build]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Conflicts:

init/calibrate.c

13 years agox66, UV: Enable 64-bit ACPI MFCG support for SGI UV2 platform
Jack Steiner [Thu, 2 Jun 2011 19:59:43 +0000 (14:59 -0500)]
x66, UV: Enable 64-bit ACPI MFCG support for SGI UV2 platform

Enable 64-bit ACPI MFCG support for SGI UV2 platform. The check
is similar to the check on UV1. UV2 has a different oem_id
string.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Link: http://lkml.kernel.org/r/20110602195943.GA27079@sgi.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
13 years agox86, pci: Increase the number of iommus supported to be MAX_IO_APICS
Mike Travis [Fri, 10 Aug 2012 11:40:36 +0000 (04:40 -0700)]
x86, pci: Increase the number of iommus supported to be MAX_IO_APICS

The number of IOMMUs supported should be the same as the number of IO APICS.
This limit comes into play when the IOMMUs are identity mapped, thus the
number of possible IOMMUs in the "static identity" (si) domain should be
this same number.

Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Jack Steiner <steiner@sgi.com>