]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
13 years agobnx2x: Prevent restarting Tx during bnx2x_nic_unload
Vladislav Zolotarov [Tue, 2 Aug 2011 08:35:43 +0000 (01:35 -0700)]
bnx2x: Prevent restarting Tx during bnx2x_nic_unload

Tx queues were stopped before  bp->state was changed to a value different
from BNX2X_STATE_OPEN, which allowed the bnx2x_tx_int() called from the
NAPI context to re-enable it. This then allowed the netdev->ndo_start_xmit()
to be called in the middle of the function reset and rings freeing.

This patch changes bp->state to a value different
from BNX2X_STATE_OPEN BEFORE disabling the Tx queues in order to restore the
broken protection against the above race in the bnx2x_tx_int().

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 87b7ba3d24a25cf18aece447de27d7804fa9668c)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: use pci_pcie_cap()
Vladislav Zolotarov [Sun, 24 Jul 2011 03:58:38 +0000 (03:58 +0000)]
bnx2x: use pci_pcie_cap()

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix bnx2x_stop_on_error flow in bnx2x_sp_rtnl_task
Vladislav Zolotarov [Sun, 24 Jul 2011 03:57:46 +0000 (03:57 +0000)]
bnx2x: fix bnx2x_stop_on_error flow in bnx2x_sp_rtnl_task

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: enable internal target-read for 57712 and up only
Shmulik Ravid [Sun, 24 Jul 2011 03:57:04 +0000 (03:57 +0000)]
bnx2x: enable internal target-read for 57712 and up only

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: count statistic ramrods on EQ to prevent MC assert
Vladislav Zolotarov [Sun, 24 Jul 2011 03:54:17 +0000 (03:54 +0000)]
bnx2x: count statistic ramrods on EQ to prevent MC assert

This patch includes:
 - Counting statistics ramrods as EQ ramrods the way they should be. This
   accounting is meant to prevent MC asserts in case of software bugs.
 - Fixes in debug facilities which were added while working on one of such
   bugs.

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix loopback for non 10G link
Yaniv Rosner [Sun, 24 Jul 2011 03:53:21 +0000 (03:53 +0000)]
bnx2x: fix loopback for non 10G link

Also fixes minor formatting in that function.

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: dcb - send all unmapped priorities to same COS as L2
Dmitry Kravkov [Sun, 24 Jul 2011 04:09:43 +0000 (04:09 +0000)]
bnx2x: dcb - send all unmapped priorities to same COS as L2

As a result of DCBX negotiation some priorities maybe untouched and still
unmapped to any COS; instead of sending them to COS0 we assign them
to the same COS as L2 traffic - to avoid collisions with storage class of
service.

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Broken self-test in SF mode on 578xx
Vladislav Zolotarov [Thu, 21 Jul 2011 07:58:54 +0000 (07:58 +0000)]
bnx2x: Broken self-test in SF mode on 578xx

This patch fixes both the failure in the self-test on 578xx
and a hole in a parity recovery flow that this failure
has discovered:
 - internal 'pending' state in a VLAN_MAC object wasn't been cleared
when the object state change was called with DRV_ONLY flag, which in
particular happens when a parity error happens during the self-test.
 - bp->sp_state wasn't cleared in the similar circumstances as described
above.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 7961689586d30a34c10b18ac95ba1cd72cefe725)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Parity errors recovery for 578xx
Vladislav Zolotarov [Thu, 21 Jul 2011 07:58:36 +0000 (07:58 +0000)]
bnx2x: Parity errors recovery for 578xx

Fix the parity errors recovery flow for 578xx:
    - Add a separate column for the 578xx in the parity mask
      registers DB.
    - Fix the bnx2x_process_kill_chip_reset() to handle the blocks
      newly introduced in the 578xx.

Cover ATC and PGLUE_B blocks for 57712 and 578xx.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8736c82650500222c031dd7f59f0126e59808e36)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Read FIP mac from SHMEM in single function mode
Vladislav Zolotarov [Thu, 21 Jul 2011 07:57:52 +0000 (07:57 +0000)]
bnx2x: Read FIP mac from SHMEM in single function mode

Read FIP MAC address from SHMEM's "port" section
similar to what we do in a MF mode when we read it from
a "func" section of SHMEM.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c03bd39c564f4b5d7683514e9249986e1404940d)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Fixed ethtool -d for 578xx
Vladislav Zolotarov [Thu, 21 Jul 2011 07:57:23 +0000 (07:57 +0000)]
bnx2x: Fixed ethtool -d for 578xx

Registers dump code erroneously treated 578xx as 57712.
This patch fixes the above and also removes unused data
structures.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
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>
(cherry picked from commit 0fea29c129bdae7aca217551acb1108e00cc5ff1)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: disable FCoE for 578xx devices since not yet supported
Dmitry Kravkov [Tue, 19 Jul 2011 01:46:11 +0000 (01:46 +0000)]
bnx2x: disable FCoE for 578xx devices since not yet supported

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix memory barriers
Vladislav Zolotarov [Tue, 19 Jul 2011 01:45:02 +0000 (01:45 +0000)]
bnx2x: fix memory barriers

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: use BNX2X_Q_FLG_TPA_IPV6 for TPA queue configuration
Vladislav Zolotarov [Tue, 19 Jul 2011 01:44:11 +0000 (01:44 +0000)]
bnx2x: use BNX2X_Q_FLG_TPA_IPV6 for TPA queue configuration

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: disable loacal BH when scheduling FCOE napi
Vladislav Zolotarov [Tue, 19 Jul 2011 01:43:25 +0000 (01:43 +0000)]
bnx2x: disable loacal BH when scheduling FCOE napi

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: fix MB index for 4-port devices
Dmitry Kravkov [Tue, 19 Jul 2011 01:42:40 +0000 (01:42 +0000)]
bnx2x: fix MB index for 4-port devices

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: DCB rework
Dmitry Kravkov [Tue, 19 Jul 2011 01:42:04 +0000 (01:42 +0000)]
bnx2x: DCB rework

create DCB related states in function state-machine
allow handling of DCB errors from FW
allow disablement of DCB in FW, when peer disappears or error
clean up unused functions/variables as pointed by
David Binderman <dcb314@hotmail.com>

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: remove unnecessary dma_sync
Vladislav Zolotarov [Tue, 19 Jul 2011 01:40:27 +0000 (01:40 +0000)]
bnx2x: remove unnecessary dma_sync

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: stop tx before CNIC_STOP
Vladislav Zolotarov [Tue, 19 Jul 2011 01:39:41 +0000 (01:39 +0000)]
bnx2x: stop tx before CNIC_STOP

It may take some time to cnic to respond, this prevents tx_timeout
when it happens.

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: add missing command in error handling flow
Dmitry Kravkov [Tue, 19 Jul 2011 01:38:53 +0000 (01:38 +0000)]
bnx2x: add missing command in error handling flow

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: use correct dma_sync function
Vladislav Zolotarov [Tue, 19 Jul 2011 01:37:42 +0000 (01:37 +0000)]
bnx2x: use correct dma_sync function

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

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Fix compilation when CNIC is not selected in config
Dmitry Kravkov [Sat, 16 Jul 2011 20:35:51 +0000 (13:35 -0700)]
bnx2x: Fix compilation when CNIC is not selected in config

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit faa2831445cdc95774584045fe10f749fa62244e)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Multiple concurrent l2 traffic classes
Ariel Elior [Thu, 14 Jul 2011 08:31:57 +0000 (08:31 +0000)]
bnx2x: Multiple concurrent l2 traffic classes

Overview:
 Support mapping of priorities to traffic classes and
 traffic classes to transmission queues ranges in the net device.
 The queue ranges are (count, offset) pairs relating to the txq
 array.
 This can be done via DCBX negotiation or by kernel.
 As a result Enhanced Transmission Selection (ETS) and Priority Flow
 Control (PFC) are supported between L2 network traffic classes.

 Mapping:
 This patch uses the netdev_set_num_tc, netdev_set_prio_tc_map and
 netdev_set_tc_queue functions to map priorities to traffic classes
 and traffic classes to transmission queue ranges.
 This mapping is performed by bnx2x_setup_tc function which is
 connected to the ndo_setup_tc.
 This function is always called at nic load where by default it
 maps all priorities to tc 0, and it may also be called by the
 kernel or by the bnx2x upon DCBX negotiation to modify the mapping.

 rtnl lock:
 When the ndo_setup_tc is called at nic load or by kernel the rtnl
 lock is already taken. However, when DCBX negotiation takes place
 the lock is not taken. The work is therefore scheduled to be
 handled by the sp_rtnl task.

 Fastpath:
 The fastpath structure of the bnx2x which was previously used
 to hold the information of one tx queue and one rx queue was
 redesigned to represent multiple tx queues, one for each traffic
 class.
 The transmission queue supplied in the skb by the kernel can no
 longer be interpreted as a straightforward index into the fastpath
 structure array, but it must rather be decoded to the appropriate
 fastpath index and the tc within that fastpath.

 Slowpath:
 The bnx2x's queue object was redesigned to accommodate multiple
 transmission queues. The queue object's state machine was enhanced
 to allow opening multiple transmission-only connections on top of
 the regular tx-rx connection.

 Firmware:
 This feature relies on the tx-only queue feature introduced in the
 bnx2x 7.0.23 firmware and the FW likewise must have the bnx2x multi
 cos support.

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>
(cherry picked from commit 6383c0b35b48bfbd0fc8c6fe126a6603c5a9a4b3)

Conflicts:

drivers/net/bnx2x/bnx2x_main.c

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Renaming the "reset_task" to "sp_rtnl_task"
Ariel Elior [Thu, 14 Jul 2011 08:31:19 +0000 (08:31 +0000)]
bnx2x: Renaming the "reset_task" to "sp_rtnl_task"

Renaming the "reset_task" to a more general purpose name,
 "sp_rtnl_task", as it is already used for another purpose
 other than reset which is parity recovery, and since I
 plan to add a third operation for this task, updating the
 priority to traffic class and traffic class to transmission
 queues mappings after dcbx negotiation takes place.
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>
(cherry picked from commit 7be08a7222c345798b0697a89ea3dd2c7c83f47c)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Add dcbnl notification
Shmulik Ravid [Thu, 7 Jul 2011 12:11:30 +0000 (05:11 -0700)]
bnx2x: Add dcbnl notification

This patch adds a dcbnl notification to the bnx2x. The notification is
sent to user mode clients following a change in the dcb negotiated
parameters as resolved by the embedded DCBX stack.

Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3c878d4746ca12cc8022f9e02f055f175b847dbc)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agodcbnl: Add CEE notification
Shmulik Ravid [Tue, 5 Jul 2011 06:16:25 +0000 (06:16 +0000)]
dcbnl: Add CEE notification

This patch add an unsolicited notification of the DCBX negotiated
parameters for the CEE flavor of the DCBX protocol. The notification
message is identical to the aggregated CEE get operation and holds all
the pertinent local and peer information. The notification routine is
exported so it can be invoked by drivers supporting an embedded DCBX
stack.

Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5b7f7626743e0912958981343b47ac0ab2206b1c)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agodcbnl: Aggregated CEE GET operation
Shmulik Ravid [Tue, 5 Jul 2011 06:16:22 +0000 (06:16 +0000)]
dcbnl: Aggregated CEE GET operation

The following couple of patches add dcbnl an unsolicited notification of
the the DCB configuration for the CEE flavor of the DCBX protocol. This
is useful when the user-mode DCB client is not responsible for
conducting and resolving the DCBX negotiation (either because the DCBX
stack is embedded in the HW or the negotiation is handled by another
agent in the host), but still needs to get the negotiated parameters.
This functionality already exists for the IEEE flavor of the DCBX
protocol and these patches add it to the older CEE flavor.

The first patch extends the CEE attribute GET operation to include not
only the peer information, but also all the pertinent local
configuration (negotiated parameters). The second patch adds and export
a CEE specific notification routine.

Signed-off-by: Shmulik Ravid <shmulikr@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 37cf4d1a9b0903b874a638d0f8649873ddde8a12)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agodcb: use nlmsg_free() instead of kfree()
Dan Carpenter [Thu, 23 Jun 2011 10:14:42 +0000 (03:14 -0700)]
dcb: use nlmsg_free() instead of kfree()

These sk_buff structs were allocated with nlmsg_new() so they should
be freed with nlmsg_free().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4d054f2f1445aceedab3f9642692d55d2caa7ec6)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agodcb: Add missing error check in dcb_ieee_set()
John Fastabend [Tue, 21 Jun 2011 07:35:04 +0000 (07:35 +0000)]
dcb: Add missing error check in dcb_ieee_set()

Missing error checking before nla_parse_nested().

Reported-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4003b65871c101eb5ce8f37a325feac54aa5c681)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agodcb: fix return type on dcb_setapp()
John Fastabend [Tue, 21 Jun 2011 07:34:58 +0000 (07:34 +0000)]
dcb: fix return type on dcb_setapp()

Incorrect return type on dcb_setapp() this routine
returns negative error codes. All call sites of
dcb_setapp() assign the return value to an int already
so no need to update drivers.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ab6baf980b095c70a56c5eb2f58166aef8a0edc8)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agodcb: Add dcb_ieee_getapp_mask() for drivers to query APP settings
John Fastabend [Tue, 21 Jun 2011 07:34:53 +0000 (07:34 +0000)]
dcb: Add dcb_ieee_getapp_mask() for drivers to query APP settings

With multiple APP entries per selector and protocol drivers
or stacks may want to pick a specific value or stripe traffic
across many priorities. Also if an APP entry in use is
deleted the stack/driver may want to choose from the existing
APP entries.

To facilitate this and avoid having duplicate code to walk
the APP ring provide a routine dcb_ieee_getapp_mask() to
return a u8 bitmask of all priorities set for the specified
selector and protocol. This routine and bitmask is a helper
for DCB kernel users.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a364c8cf80251849bab207be8c9e66253c8ca8f8)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agodcb: Add ieee_dcb_delapp() and dcb op to delete app entry
Joe Jin [Wed, 16 May 2012 08:27:49 +0000 (16:27 +0800)]
dcb: Add ieee_dcb_delapp() and dcb op to delete app entry

Now that we allow multiple IEEE App entries we need a way
to remove specific entries. To do this add the ieee_dcb_delapp()
routine.

Additionaly drivers may need to remove the APP entry from
their firmware tables. Add dcb ops routine to handle this.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f9ae7e4b515c4d56baf6e0e84ebee2e03ae57a25)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agodcb: Add ieee_dcb_setapp() to be used for IEEE 802.1Qaz APP data
John Fastabend [Tue, 21 Jun 2011 07:34:42 +0000 (07:34 +0000)]
dcb: Add ieee_dcb_setapp() to be used for IEEE 802.1Qaz APP data

This adds a setapp routine for IEEE802.1Qaz encoded APP data types.
The IEEE 802.1Qaz spec encodes the priority bits differently and
allows for multiple APP data entries of the same selector and
protocol. Trying to force these to use the same set routines was
becoming tedious. Furthermore, userspace could probably enforce
the correct semantics, but expecting drivers to do this seems
error prone in the firmware case.

For these reasons add ieee_dcb_setapp() that understands the
IEEE 802.1Qaz encoded form.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b6db2174c59ef1e72f7bd63e0f105b1a2d7f18d3)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agonet: dcbnl, add multicast group for DCB
John Fastabend [Tue, 21 Jun 2011 07:34:37 +0000 (07:34 +0000)]
net: dcbnl, add multicast group for DCB

Now that dcbnl is being used in many cases by more
than a single agent it is beneficial to be notified
when some entity either driver or user space has
changed the DCB attributes.

Today applications either end up polling the interface
or relying on a user space database to maintain the DCB
state and post events. Polling is a poor solution for
obvious reasons. And relying on a user space database
has its own downside. Namely it has created strange
boot dependencies requiring the database be populated
before any applications dependent on DCB attributes
starts or the application goes into a polling loop.
Populating the database requires negotiating link
setting with the peer and can take anywhere from less
than a second up to a few seconds depending on the switch
implementation.

Perhaps more importantly if another application or an
embedded agent sets a DCB link attribute the database
has no way of knowing other than polling the kernel.
This prevents applications from responding quickly to
changes in link events which at least in the FCoE case
and probably any other protocols expecting a lossless
link may result in IO errors.

By adding a multicast group for DCB we have clean way
to disseminate kernel DCB link attributes up to user
space. Avoiding the need for user space to maintain
a coherant database and disperse events that potentially
do not reflect the current link state.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 314b4778ed579f29b6d46ba90dbf31314c13805f)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agodcb: Add DCBX capabilities bitmask to the get_ieee response
John Fastabend [Tue, 21 Jun 2011 07:34:31 +0000 (07:34 +0000)]
dcb: Add DCBX capabilities bitmask to the get_ieee response

Adding the capabilities bitmask to the get_ieee response allows
user space to determine the current DCBX mode. Either CEE or IEEE
this is useful with devices that support switching between modes
where knowing the current state is relevant.

Derived from work by Mark Rustad

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c7797baf9f3900996ca800ab6298f95957bb4606)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2x: Fix warning message during 57712/8727 initialization
Yaniv Rosner [Tue, 5 Jul 2011 01:07:16 +0000 (01:07 +0000)]
bnx2x: Fix warning message during 57712/8727 initialization

Clear warning message "MDC/MDIO access timeout" during first driver load by setting MDIO clock.
This warning has no significant meaning, since it occurs prior to the first PHY initialization.

(cherry picked from commit 7d09926d1decb658d4e24f70216b6b0b74168026)
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>
13 years agobnx2x: Add autogrEEEn support
Yaniv Rosner [Tue, 5 Jul 2011 01:07:05 +0000 (01:07 +0000)]
bnx2x: Add autogrEEEn support

Add autogrEEEn support on BCM84833 and 54618se, which allows to reduce power consumption.

(cherry picked from commit a89a1d4a738668ccb2270ac218cddd30f0bef2a0)
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>
13 years agobnx2x: Fix BCM84833 initialization
Yaniv Rosner [Tue, 5 Jul 2011 01:06:59 +0000 (01:06 +0000)]
bnx2x: Fix BCM84833 initialization

(cherry picked from commit 0520e63acb387a265c2a6abbf51c44c67149cf37)
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>
13 years agobnx2x: Fix false link indication at link partner when DAC is used
Yaniv Rosner [Tue, 5 Jul 2011 01:06:53 +0000 (01:06 +0000)]
bnx2x: Fix false link indication at link partner when DAC is used

When driver is unloaded, disable PMD in addition to TX laser, provided that the management firmware will be able to enable it back.

(cherry picked from commit 85242eea68f5039458afad0e4030828496bb4034)
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>
13 years agobnx2x: Reset PHY due to fan failure for 578xx
Yaniv Rosner [Tue, 5 Jul 2011 01:06:48 +0000 (01:06 +0000)]
bnx2x: Reset PHY due to fan failure for 578xx

Add hardware PHY reset action for BCM578xx when fan failure occur.
The new bnx2x_warpcore_hw_reset warps bnx2x_warpcore_power_module to fit the .hw_reset function template of the phy structure.

(cherry picked from commit 985848f80ffc61a29d9a72fec46ddce3c9643636)
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>
13 years agobnx2x: Add CL37 BAM for Warpcore
Yaniv Rosner [Tue, 5 Jul 2011 01:06:41 +0000 (01:06 +0000)]
bnx2x: Add CL37 BAM for Warpcore

Add CL37 BAM support according to configuration.

(cherry picked from commit a34bc969a19b3a2364c03c101abb3b4d467089c0)
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>
13 years agobnx2x: Change BCM54616S to BCM54618SE
Yaniv Rosner [Tue, 5 Jul 2011 01:06:34 +0000 (01:06 +0000)]
bnx2x: Change BCM54616S to BCM54618SE

Change 1G copper PHY BCM54616S to BCM54618SE since we only have HW with latter one of the two.

(cherry picked from commit 52c4d6c4b543574930667bfc2a4aed8af0713519)
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>
13 years agobnx2x: PFC fixes
Yaniv Rosner [Tue, 5 Jul 2011 01:06:27 +0000 (01:06 +0000)]
bnx2x: PFC fixes

Set the source MAC address for PFC packets and update its status during PMF migration.

(cherry picked from commit b8d6d0824d064ad447e6aacbce90f3a340d93d65)
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>
13 years agobnx2x: remove unnecessary read of PCI_CAP_ID_EXP
Jon Mason [Mon, 27 Jun 2011 07:45:12 +0000 (07:45 +0000)]
bnx2x: remove unnecessary read of PCI_CAP_ID_EXP

The PCIE capability offset is saved during PCI bus walking.  It will
remove an unnecessary search in the PCI configuration space if this
value is referenced instead of reacquiring it.  Also, pci_is_pcie is a
better way of determining if the device is PCIE or not (as it uses the
same saved PCIE capability offset).

(cherry picked from commit 77c98e6a7a3ab76340b315d31fe1edded17cba15)
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agocnic: Update VLAN ID during ISCSI_UEVENT_PATH_UPDATE
Eddie Wai [Wed, 8 Feb 2012 17:33:57 +0000 (17:33 +0000)]
cnic: Update VLAN ID during ISCSI_UEVENT_PATH_UPDATE

This will support the new VLAN attribute in the iSCSI iface file.

(cherry picked from commit 4cbbb04dc115423682349aa7466c8aeead825140)
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>
13 years agocnic: set error flag when iSCSI connection fails
Jeffrey Huang [Wed, 8 Feb 2012 17:33:56 +0000 (17:33 +0000)]
cnic: set error flag when iSCSI connection fails

to speed up error recovery due to SPQ failures.  The error flag will
expedite the recovery process by skipping the timeouts.

(cherry picked from commit 0cb1f4b96092b9d91d4e50d5c77b424745cd1102)
Signed-off-by: Jeffrey Huang <huangjw@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agocnic: Add FCoE parity error recovery
Michael Chan [Sun, 5 Feb 2012 15:24:40 +0000 (15:24 +0000)]
cnic: Add FCoE parity error recovery

When bnx2x returns error on FCoE SPQ messages, generate an error
completion to bnx2fc immediately to speed up error recovery.  This
will eliminate length timeouts and spped up the reset of the device.

(cherry picked from commit 3238a9be4d7ad95c741bcfe6c147406eeef62d95)
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agocnic: Improve error recovery on bnx2x devices
Michael Chan [Wed, 4 Jan 2012 12:12:28 +0000 (12:12 +0000)]
cnic: Improve error recovery on bnx2x devices

When a bnx2x device encounters parity errors, it will not respond to all
SPQ messages.  As a result, the shutdown sequence before reset can take
a long time as the ulp drivers (bnx2i/bnx2fc) have to wait for timeout
of all such messages.

To improve this scenario, when bnx2x returns error on the SPQ, we'll send
an immediate response to the ulp drivers to avoid such lengthy timeouts.

Adjust the return code of relevant functions to return error only if
the message cannot be sent on the SPQ so that we'll generate an error
completion to the ulp drivers.

(cherry picked from commit 23021c21055f88a428b6deb6f803fa0d659e023f)
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>
13 years agocnic: Add timeout for ramrod replies.
Michael Chan [Fri, 26 Aug 2011 09:45:40 +0000 (09:45 +0000)]
cnic: Add timeout for ramrod replies.

If the bnx2x device has encountered parity errors, the chip will not DMA
any replies.  Using wait_event_timeout() will allow us to make forward
progress and let bnx2x reset the chip.

(cherry picked from commit dcc7e3a6a2a2464cf96dee329f7c58fe8c230d97)
Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agocnic, bnx2fc: Increase maximum FCoE sessions.
Michael Chan [Fri, 26 Aug 2011 09:45:39 +0000 (09:45 +0000)]
cnic, bnx2fc: Increase maximum FCoE sessions.

Increase it to NVRAM configured limit or 1024 whichever is less.

(cherry picked from commit dc219a2e4812eecdc5438d2a0e2434b03d3efbf2)
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2: Update driver to use new mips firmware.
Joe Jin [Wed, 16 May 2012 05:48:22 +0000 (13:48 +0800)]
bnx2: Update driver to use new mips firmware.

bnx2-mips-06-6.2.3 and bnx2-mips-09-6.2.1.b

New firmware fixes iSCSI problems with some LeftHand targets that don't
set TTT=0xffffffff for Data-In according to spec.  Firmware generates
exception warnings for this condition and becomes very slow.  This is
fixed by suppressing these warnings when using default error mask.

(cherry picked from commit c2c20ef43d00b1439631e603f8dcee9a803cd8b3)
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>
13 years agobnx2: Add missing memory barrier in bnx2_start_xmit()
Joe Jin [Wed, 16 May 2012 06:00:24 +0000 (14:00 +0800)]
bnx2: Add missing memory barrier in bnx2_start_xmit()

Sync DMA descriptor before hitting the TX mailbox for weak memory model
CPUs.

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

(backported from commit 94bf91baf3a16ec274de3cd913be3033c029f853)
Signed-off-by: Vlad Zolotarov <vlad@scalemp.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2: Add support for ethtool --show-channels|--set-channels
Michael Chan [Sun, 5 Feb 2012 15:24:38 +0000 (15:24 +0000)]
bnx2: Add support for ethtool --show-channels|--set-channels

Allow the user to override the default number of RSS/TSS rings.

(cherry picked from commit b033281f618fa40ee1b24a60cd8043b4979bfee4)
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>
13 years agobnx2: fix skb truesize underestimation
Eric Dumazet [Thu, 13 Oct 2011 07:50:19 +0000 (07:50 +0000)]
bnx2: fix skb truesize underestimation

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

(cherry picked from commit a1f4e8bcbccf50cf1894c263af4d677d4f566533)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agobnx2: don't request firmware when there's no userspace.
françois romieu [Fri, 30 Sep 2011 00:36:52 +0000 (00:36 +0000)]
bnx2: don't request firmware when there's no userspace.

The firmware is cached during the first successful call to open() and
released once the network device is unregistered. The driver uses the
cached firmware between open() and unregister_netdev().

It's similar to 953a12cc2889d1be92e80a2d0bab5ffef4942300 but the
firmware is mandatory.

(cherry picked from commit 7880b72e94fd3cf3283de6752175191583bce9f0)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.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>
13 years agotg3: Avoid panic from reserved statblk field access
Matt Carlson [Tue, 24 Apr 2012 13:37:01 +0000 (13:37 +0000)]
tg3: Avoid panic from reserved statblk field access

When RSS is enabled, interrupt vector 0 does not receive any rx traffic.
The rx producer index fields for vector 0's status block should be
considered reserved in this case.  This patch changes the code to
respect these reserved fields, which avoids a kernel panic when these
fields take on non-zero values.

(cherry picked from commit f891ea1)
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>
13 years agotg3: Use mii_advertise_flowctrl
Matt Carlson [Wed, 14 Dec 2011 11:10:00 +0000 (11:10 +0000)]
tg3: Use mii_advertise_flowctrl

This patch replaces tg3's internal tg3_advert_flowctrl_1000T function
with mii_advertise_flowctrl provided by the kernel headers.

(cherry picked from commit f88788f0da6326cbcaa837e12c8c074027891f07)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-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>
13 years agotg3: Fix advertisement handling
Joe Jin [Wed, 16 May 2012 03:19:28 +0000 (11:19 +0800)]
tg3: Fix advertisement handling

Commit 28011cf19b (net: Add ethtool to mii advertisment conversion
helpers) added a helper function ethtool_adv_to_mii_100bt() and
tg3_copper_is_advertising_all(), tg3_phy_autoneg_cfg() were
modified to use this.
Before that commit, ethtool to mii advertisement conversion was
done wrt speed, but now pause operation is also taken account.
So, in tg3_copper_is_advertising_all(), below condition becomes
true and this makes link up fails.

if ((adv_reg & ADVERTISE_ALL) != all_mask)
return 0;

To fix this add ADVERTISE_ALL bit and operation to cap speed,
and change default advertisement not including ADVERTISED_Pause.

(backported from commit 202ff1c26c768efeead20b388556eda265dc8352)
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agotg3: Add 57766 ASIC rev support
Matt Carlson [Wed, 14 Dec 2011 11:09:59 +0000 (11:09 +0000)]
tg3: Add 57766 ASIC rev support

This patch adds support for the 57766 ASIC revision.

(cherry picked from commit 55086ad95d740577def0b4e6ecc2c0ae9b0d6dec)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-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>
13 years agotg3: Make the TX BD DMA limit configurable
Matt Carlson [Wed, 14 Dec 2011 11:09:58 +0000 (11:09 +0000)]
tg3: Make the TX BD DMA limit configurable

The 57766 ASIC rev will impose a new TX BD DMA limit on the driver.
This patch prepares for 57766 support by making the tx BD DMA limit
tunable.

(cherry picked from commit a4cb428d31e11af1662e19c6fab9133c0f7a0eda)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-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>
13 years agotg3: Track LP advertising
Matt Carlson [Thu, 8 Dec 2011 14:40:16 +0000 (14:40 +0000)]
tg3: Track LP advertising

This patch adds code to track the autonegotiation advertisements of the
link partner and report them through ethtool.

(cherry picked from commit 859edb2631c31813e63cbff7a81ced4f853b63ed)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.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>
13 years ago tg3: Integrate flowctrl check into AN adv check
Joe Jin [Wed, 16 May 2012 03:12:17 +0000 (11:12 +0800)]
 tg3: Integrate flowctrl check into AN adv check

This patch integrates tg3_adv_1000T_flowctrl_ok() into
tg3_copper_is_advertising_all() and renames the function
tg3_phy_copper_an_config_ok().

(backported from commit e2bf73e75aef01d93f569c4625b0d7f50f3e1031)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agonet: Change mii to ethtool advertisement function names
Matt Carlson [Thu, 17 Nov 2011 14:30:55 +0000 (14:30 +0000)]
net: Change mii to ethtool advertisement function names

This patch implements advice by Ben Hutchings to change the mii side of
the function names to look more like the register whose values they
convert.  New LPA translation functions have been added as well.

(cherry picked from commit 37f07023d30708b5da091fe6d6be9b60783c6d82)
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>
13 years agonet: Add ethtool to mii advertisment conversion helpers
Joe Jin [Tue, 15 May 2012 13:39:36 +0000 (21:39 +0800)]
net: Add ethtool to mii advertisment conversion helpers

Translating between ethtool advertisement settings and MII
advertisements are common operations for ethernet drivers.  This patch
adds a set of helper functions that implements the conversion.  The
patch then modifies a couple of the drivers to use the new functions.

(backport from commit 28011cf19b75df9d3f35489a7599a97ec0b3f1a0)
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>
13 years agotg3: fix ipv6 header length computation
Eric Dumazet [Mon, 23 Jan 2012 01:22:09 +0000 (01:22 +0000)]
tg3: fix ipv6 header length computation

tg3_start_xmit() makes the wrong assumption for TSOV6 that skb->head
doesnt include any payload data.

if (skb_is_gso_v6(skb))
hdr_len = skb_headlen(skb) - ETH_HLEN;

This is not true anymore after commit f07d960df3 (tcp: avoid frag
allocation for small frames)

We should instead use : skb_transport_offset(skb) + tcp_hdrlen(skb)

Its also true for IPv4

(cherry picked from commit a5a1195559f2e20bd975f58e50f53ebe84d5cca6)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.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>
13 years agotg3: Break out RSS indir table init and assignment
Matt Carlson [Wed, 14 Dec 2011 11:10:01 +0000 (11:10 +0000)]
tg3: Break out RSS indir table init and assignment

This patch creates a new device member to hold the RSS indirection table
and separates out the code that initializes the table from the code that
programs the table into device registers.

(cherry picked from commit bcebcc468a6bcd3820fe9ad36b34220563efc93a)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-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>
13 years agotg3: Update version to 3.122
Matt Carlson [Thu, 8 Dec 2011 14:40:18 +0000 (14:40 +0000)]
tg3: Update version to 3.122

This patch updates the tg3 version to 3.122.

(cherry picked from commit efab79c5c3bf830a41b2f737146a9b70c0e13f44)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agotg3: Return flowctrl config through ethtool
Matt Carlson [Thu, 8 Dec 2011 14:40:17 +0000 (14:40 +0000)]
tg3: Return flowctrl config through ethtool

This patch changes the driver to return the flow control configuration
rather than the flow control status through the ETHTOOL_GPAUSEPARAM
ioctl.

(cherry picked from commit 4a2db503c57f7223d851dc7ab8cefca614e0d98a)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agotg3: Save stats across chip resets
Matt Carlson [Thu, 8 Dec 2011 14:40:14 +0000 (14:40 +0000)]
tg3: Save stats across chip resets

Tg3 has a place to store stats, but doesn't really use it.  This patch
modifies the driver so that stats are saved across chip resets and gets
cleared across close / open calls.

(cherry picked from commit 92feeabf3f673767c6ee4cfc7fc224098446c1c1)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agotg3: Remove ethtool stats member from dev struct
Matt Carlson [Thu, 8 Dec 2011 14:40:13 +0000 (14:40 +0000)]
tg3: Remove ethtool stats member from dev struct

This patch removes the ethtool stats member from the tg3 device
structure.

(cherry picked from commit 0e6c9da35ef774109a1b5740144c9d442bd5a5b5)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agotg3: Scale back code that modifies MRRS
Matt Carlson [Mon, 28 Nov 2011 09:41:04 +0000 (09:41 +0000)]
tg3: Scale back code that modifies MRRS

Tg3 normally gets a performance boost by increasing the PCI Maximum Read
Request Size (MRRS) to 4k.  Unfortunately, this is causing some problems
on particular hardware platforms.  This patch removes all code that
modifies the MRRS except for one case.

As part of a solution to fix an internal FIFO problem on the 5719, the
driver artificially capped the MRRS to 2k for the entire 5719, and later
5720, ASIC revs.  This was overly aggressive and only really needed to
be done for the 5719 A0.  In the spirit of the rest of this patch, the
driver will only reprogram the MRRS for this device if the value exceeds
the 2k cap.

(cherry picked from commit 2c55a3d08ade44a778c182c220a7907ec65d5fb8)
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>
13 years agotg3: Fix TSO CAP for 5704 devs w / ASF enabled
Matt Carlson [Mon, 28 Nov 2011 09:41:03 +0000 (09:41 +0000)]
tg3: Fix TSO CAP for 5704 devs w / ASF enabled

On the earliest TSO capable devices, TSO was accomplished through
firmware.  The TSO cannot coexist with ASF management firmware though.
The tg3 driver determines whether or not ASF is enabled by calling
tg3_get_eeprom_hw_cfg(), which checks a particular bit of NIC memory.
Commit dabc5c670d3f86d15ee4f42ab38ec5bd2682487d, entitled "tg3: Move
TSO_CAPABLE assignment", accidentally moved the code that determines
TSO capabilities earlier than the call to tg3_get_eeprom_hw_cfg().  As a
consequence, the driver was attempting to determine TSO capabilities
before it had all the data it needed to make the decision.

This patch fixes the problem by revisiting and reevaluating the decision
after tg3_get_eeprom_hw_cfg() is called.

(cherry picked from commit cf9ecf4b631f649a964fa611f1a5e8874f2a76db)
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>
13 years agotg3: Add MDI-X reporting
Matt Carlson [Mon, 21 Nov 2011 15:01:20 +0000 (15:01 +0000)]
tg3: Add MDI-X reporting

This patch adds MDI-X state reporting.

(cherry picked from commit e348c5e7de4a759a94eed4d0303ba81a4939f8b9)
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>
13 years agotg3: Restrict large prod ring cap devices
Matt Carlson [Mon, 21 Nov 2011 15:01:19 +0000 (15:01 +0000)]
tg3: Restrict large prod ring cap devices

Future devices may or may not be capable of supporting larger rx
producer rings.  This patch changes the code so that this flag is set on
an ASIC rev to ASIC rev basis.  Also, this patch changes a place where
the LRG_PROD_RING_CAP flag was not controlling how the rx standard
producer ring size was set.

(cherry picked from commit fa6b2aae6ab5ae1ce4b65c1872477c4b794d338e)
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>
13 years agotg3: Adjust BD replenish thresholds
Matt Carlson [Mon, 21 Nov 2011 15:01:18 +0000 (15:01 +0000)]
tg3: Adjust BD replenish thresholds

The BD replenish thresholds for the 57765 and newer ASIC revs are a
little strict.  They were tuned for a mode that is currently unused.
This patch relaxes the thresholds so that they are set to values more
inline with the resources available.

(cherry picked from commit 513aa6ea39adfc9daf5b4bc33b49008733c3eb51)
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>
13 years agotg3: Make 1000Base-X FC resolution look like 1000T
Matt Carlson [Mon, 21 Nov 2011 15:01:17 +0000 (15:01 +0000)]
tg3: Make 1000Base-X FC resolution look like 1000T

This patch changes tg3's 1000Base-X flow control resolution to look like
the 1000Base-T flow control resolution code.

(cherry picked from commit f3791cdf33e7d21515de25f5ead0eca38f85ca11)
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>
13 years agotg3: Update version to 3.121
Matt Carlson [Fri, 4 Nov 2011 09:15:05 +0000 (09:15 +0000)]
tg3: Update version to 3.121

This patch updates the tg3 version to 3.121.

(cherry picked from commit 5ae7fa06bb90421bc63f1f1e56ab241b49bc7b91)
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>
13 years agotg3: Eliminate timer race with reset_task
Matt Carlson [Fri, 4 Nov 2011 09:15:04 +0000 (09:15 +0000)]
tg3: Eliminate timer race with reset_task

During shutdown, it is impossible to reliably disable the timer and
reset_task threads.  Each thread can schedule the other, which leads to
shutdown code that chases its tail.

To fix the problem, this patch removes the ability of tg3_reset_task to
schedule a new timer thread.  To support this change, tg3_timer no
longer terminates itself, but rather goes into a polling mode.

(cherry picked from commit 5b1906241905d9bd1abe920854b3d43c2b9c85e1)
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>
13 years agotg3: Schedule at most one tg3_reset_task run
Joe Jin [Tue, 15 May 2012 13:25:17 +0000 (21:25 +0800)]
tg3: Schedule at most one tg3_reset_task run

It is possible for multiple threads in the tg3 driver to each attempt to
schedule a run of tg3_reset_task().  The multiple tg3_reset_task
executions could all wind up on the same queue (and execute serially) or
wind up on the queues of another processor (which could execute in
parallel).  Either scenario is not what was truly desired.

This patch adds a new flag, TG3_FLAG_RESET_TASK_PENDING, and uses it to
determine whether or not to schedule another run of tg3_reset_task().
With the new flag comes two new functions to facilitate scheduling and
descheduling of tg3_reset_task().

(backport from commit db21997379906fe7657d360674e1106d80b020a4)
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>
13 years agotg3: Obtain PCI function number from device
Matt Carlson [Fri, 4 Nov 2011 09:15:02 +0000 (09:15 +0000)]
tg3: Obtain PCI function number from device

This patch adds code to attempt to obtain the PCI function number from
the device rather than accept the number handed by the kernel.  In
pass-through scenarios, the function number handed by the kernel may not
reflect the true function of the device.

(cherry picked from commit 9dc5e342703948ea7b086d063c85c0e79dac8149)
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>
13 years agotg3: Fix irq alloc error cleanup path
Matt Carlson [Fri, 4 Nov 2011 09:15:01 +0000 (09:15 +0000)]
tg3: Fix irq alloc error cleanup path

This patch fixes a bug where the irq error cleanup path did not free all
the resources it allocated.

(cherry picked from commit 5bc09186deba2a016b60aa3923fc0e42838ce877)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Ben Li <benli@broadcom.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.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>
13 years agotg3: Fix 4k skb error recovery path
Matt Carlson [Fri, 4 Nov 2011 09:15:00 +0000 (09:15 +0000)]
tg3: Fix 4k skb error recovery path

On the error recovery resource unwind path, it is possible for the
driver to attempt to unmap a fragment that hadn't been mapped.  This
patch fixes the problem by correcting the "last" parameter supplied.

(cherry picked from commit ba1142e4fb291c7bf124d93596351dca8d226a0f)
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>
13 years agotg3: Fix 4k tx bd segmentation code
Joe Jin [Tue, 15 May 2012 13:18:45 +0000 (21:18 +0800)]
tg3: Fix 4k tx bd segmentation code

The new 4k tx bd segmentation code had a bug in the error cleanup path.
If the driver did not map all the physical fragments, the abort path
would wind up advancing the producer index beyond the point where the
setup code stopped.  This would ultimately turn into a tx recovery error
where the driver would expect the skb pointer to be set when it isn't.
This patch fixes the problem, and then makes the code a little easier to
understand.

(backport from commit b9e454826f22e17d1945bd282834c87aef8d0f95)
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>
13 years agotg3: Fix APE mutex init and use
Matt Carlson [Fri, 4 Nov 2011 09:14:58 +0000 (09:14 +0000)]
tg3: Fix APE mutex init and use

APE mutex register blocks are shared by all ports of multiport devices.
For some mutexing purposes, each function is assigned their own
register.  For other cases, each function is assigned its own request
and grant bits of a single register.  For the latter cases, the tg3
driver is incorrectly allowing each function to use the same set of
grant / request bits.  This patch fixes the code so that each function
uses the appropriate bitset.

(cherry picked from commit 78f94dc7b10d98cf4cf8498d98581500d910c6b7)
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>
13 years agotg3: add tx_dropped counter
Joe Jin [Tue, 15 May 2012 13:16:48 +0000 (21:16 +0800)]
tg3: add tx_dropped counter

If a frame cant be transmitted, it is silently discarded.

Add a counter to report these errors to user.

(backport from commit 48855432047c9de7ea9987349de4c47d48ade8d1)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agotg3: fix tigon3_dma_hwbug_workaround()
Eric Dumazet [Sat, 22 Oct 2011 07:29:53 +0000 (03:29 -0400)]
tg3: fix tigon3_dma_hwbug_workaround()

Ari got kernel panics using tg3 NIC, and bisected to 2669069aacc9 "tg3:
enable transmit time stamping."

This is because tigon3_dma_hwbug_workaround() might alloc a new skb and
free the original. We panic when skb_tx_timestamp() is called on freed
skb.

Reported-by: Ari Savolainen <ari.m.savolainen@gmail.com>
(cherry picked from commit f7ff19871bb4a3451e1ca2cf660bf633018cfbec)
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agotg3: Remove unnecessary driver assignments of ethtool_ringparam fields to zero
Joe Jin [Tue, 15 May 2012 13:13:07 +0000 (21:13 +0800)]
tg3: Remove unnecessary driver assignments of ethtool_ringparam fields to zero

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

This backport from commit 8b0c11679fd37522d8d34a76101319a085d80912
Signed-off-by: Rick Jones <rick.jones2@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agotg3: Code movement
Matt Carlson [Wed, 31 Aug 2011 11:44:54 +0000 (11:44 +0000)]
tg3: Code movement

This patch just moves some code around for better organization.

(cherry picked from commit 93a700a9d20b05b3c3c85efc53ac840499c2e103)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@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>
13 years agotg3: Eliminate tg3_halt_cpu() prototype
Matt Carlson [Wed, 31 Aug 2011 11:44:53 +0000 (11:44 +0000)]
tg3: Eliminate tg3_halt_cpu() prototype

This patch moves the implementatino of tg3_halt_cpu() earlier in the
file to eliminate its prototype.

(cherry picked from commit 997b4f135b8dffea812eda0311c142873804a785)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@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>
13 years agotg3: Eliminate tg3_write_sig_post_reset() prototype
Matt Carlson [Wed, 31 Aug 2011 11:44:52 +0000 (11:44 +0000)]
tg3: Eliminate tg3_write_sig_post_reset() prototype

This patch moves the implementation of tg3_write_sig_post_reset()
earlier to eliminate its prototype.

(cherry picked from commit fd6d3f0ec7050681f65445a38f81c43caea15ea6)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@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>
13 years agotg3: Eliminate tg3_stop_fw() prototype
Matt Carlson [Wed, 31 Aug 2011 11:44:51 +0000 (11:44 +0000)]
tg3: Eliminate tg3_stop_fw() prototype

This patch moves tg3_stop_fw() earlier in the file to eliminate its
prototype.

(cherry picked from commit 8d5a89b3da78fd4cb17b261bf9d3b016c2120cac)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@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>
13 years agotg3: Remove tp->rx_offset term when unneeded
Matt Carlson [Wed, 31 Aug 2011 11:44:49 +0000 (11:44 +0000)]
tg3: Remove tp->rx_offset term when unneeded

This patch removes the tp->rx_offset term if NET_IP_ALIGN is defined to
zero.

(cherry picked from commit 81389f57150ca84c9517a6ab2338f57badef4219)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@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>
13 years agotg3: Fix missed MSI workaround
Matt Carlson [Wed, 31 Aug 2011 11:44:48 +0000 (11:44 +0000)]
tg3: Fix missed MSI workaround

This patch fixes a minor counter initialization bug and makes the MSI
workaround slightly more efficient by attempting to service pending
interrupts before applying the workaround.

(cherry picked from commit 7f23073515c83e8a7261462329b6f26f211126d7)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@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>
13 years agotg3: Workaround tagged status update bug
Matt Carlson [Mon, 13 Jun 2011 13:38:55 +0000 (13:38 +0000)]
tg3: Workaround tagged status update bug

On rare occasions, writing the tag to the interrupt mailbox does not
reenable interrupts.  This patch fixes the problem by reissuing the
mailbox update.

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@conan.davemloft.net>
(cherry picked from commit 0e6cf6a9e3cf911577b1dde0dc724f634e4ca119)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agotg3: Add ability to turn off 1shot MSI
Matt Carlson [Wed, 31 Aug 2011 11:44:50 +0000 (11:44 +0000)]
tg3: Add ability to turn off 1shot MSI

In older devices, 1-shot MSI mode had to be enabled by the code.  In
newer devices however, 1-shot MSI mode is enabled by default; code would
be needed to disable it.

Disabling 1-shot MSI mode is useful when debugging.  This patch changes
the code so that the TG3_FLAG_1SHOT_MSI accurately reflects (and
controls) the state of 1-shot MSI mode.

(cherry picked from commit 7f23073515c83e8a7261462329b6f26f211126d7)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@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>
13 years agotg3: Check all adv bits when checking config
Matt Carlson [Wed, 31 Aug 2011 11:44:47 +0000 (11:44 +0000)]
tg3: Check all adv bits when checking config

This patch makes sure the driver checks all advertisement bits when
checking the current hw advertisements.

(cherry picked from commit b99d2a57b7d9e9e64e9193d70696b77ed035c311)
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Benjamin Li <benli@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>
13 years agotg3: Update version to 3.120
Matt Carlson [Fri, 19 Aug 2011 13:58:24 +0000 (13:58 +0000)]
tg3: Update version to 3.120

This patch updates the tg3 version to 3.120.

(cherry picked from commit eaa36660de7e174498618d69d7277d44a2f24c3d)
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>
13 years agotg3: Add external loopback support to selftest
Matt Carlson [Fri, 19 Aug 2011 13:58:23 +0000 (13:58 +0000)]
tg3: Add external loopback support to selftest

This patch adds external loopback support to tg3's ethtool selftest.

(cherry picked from commit 941ec90f35603f35466988efd01395377fd00475)
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>
13 years agonet: add external loopback test in ethtool self test
Amit Kumar Salecha [Wed, 29 Jun 2011 20:00:49 +0000 (20:00 +0000)]
net: add external loopback test in ethtool self test

External loopback test can be performed by application without any driver
support on normal Ethernet cards.
But on CNA devices, where multiple functions share same physical port.
Here internal loopback test and external loopback test can be initiated by
multiple functions at same time. To co exist all functions, firmware need
to regulate what test can be run by which function. So before performing external
loopback test, command need to send to firmware, which will quiescent other functions.

User may not want to run external loopback test always. As special cable need to be
connected for this test.
So adding explicit flag in ethtool self test, which will specify interface
to perform external loopback test.
 ETH_TEST_FL_EXTERNAL_LB: Application set to request external loopback test
 ETH_TEST_FL_EXTERNAL_LB_DONE: Driver ack if test performed

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0209bcd4d9ee66569d4ea76f9ab2de3a9c740c71)

Signed-off-by: Joe Jin <joe.jin@oracle.com>
13 years agotg3: Restructure tg3_test_loopback
Matt Carlson [Fri, 19 Aug 2011 13:58:22 +0000 (13:58 +0000)]
tg3: Restructure tg3_test_loopback

The tg3_test_loopback() function is starting to get more complicated as
more loopback tests are added.  This patch cleans up the code.

(cherry picked from commit 28a4595786a64fb51d41c0bad819256198525e49)
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>