Commit Graph

596 Commits (a6b5ea353845b3f3d9ac4317c0b3be9cc37c259b)

Author SHA1 Message Date
Tejun Heo 760141a53e igb[v],ixgbe: don't use flush_scheduled_work()
All three drivers use flush_scheduled_work() similarly during driver
detach.  Replace it with explicit cancels.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: e1000-devel@lists.sourceforge.net
Cc: netdev@vger.kernel.org
2010-12-12 16:45:14 +01:00
Don Skidmore 9fe93afdd0 ixgbe: cleanup string function calls to use bound checking versions.
Some minor cleanup to use string calls that use bound checks just to
be extra safe.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-12-10 22:12:58 -08:00
Emil Tantilov 5136cad37b ixgbe: fix ntuple support
commit f62bbb5e62
ixgbe: Update ixgbe to use new vlan accleration.

removed ETH_FLAG_NTUPLE from the supported flags.

This patch puts it back on to allow for setting ntuple via ethtool.

CC: Jesse Gross <jesse@nicira.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-12-10 22:12:55 -08:00
Don Skidmore d994653db4 ixgbe: fix X540 to use it's own info struct
This patch enables X540 hardware to use it's own set of support
functions.  This is useful as it has no need of SFP+ support.  A
couple minor bugs with the eeprom semaphore were also cleaned up.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-12-10 22:12:52 -08:00
Don Skidmore 2b264909c6 ixgbe: fix X540 phy id to correct value
The existing PHY ID for X540 was from early production hardware and
is no longer correct.  This patch corrects that.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-12-10 22:12:46 -08:00
Jeff Kirsher 667445008d Intel Wired LAN drivers: Use static const
Based on work by Joe Perches <joe@perches.com>

Using static const to decrease data and overall object size.

CC: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Emil Tantilov <emil.s.tantilov@intel.com>
2010-12-10 22:12:32 -08:00
David S. Miller fe6c791570 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
	net/llc/af_llc.c
2010-12-08 13:47:38 -08:00
Don Skidmore 9f91170773 ixgbe: fix enum type mismatch on disable laser
Fixes a recent bug on the patch (c6ecf39a10)
that disabled the laser on ifconfig down.  Compilers were seeing a enum
mismatch.

Signed-off-by Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-06 13:18:51 -08:00
Don Skidmore a7f5a5fcd9 ixgbe: fix for link failure on SFP+ DA cables
This patch helps prevent FW/SW semaphore collision from leading
to link establishment failure.  The collision might mess up the
PHY registers so we reset the PHY.  However there are SFI/KR areas
in the PHY that are not reset with a Reset_AN so we need to change
LMS to reset it.  Also wait until AN state machine is AN_GOOD

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-06 13:18:50 -08:00
Don Skidmore b8eb3a1046 ixgbe: fix possible NULL pointer deference in shutdown path
After freeing the rings we were not zeroing out the ring count values.
This patch now clears these counts correctly.

Reported-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-06 13:16:29 -08:00
Don Skidmore 289700dbc4 ixgbe: add support for new format of PBA numbers
The new PBA format is stored as a string.  This patch allows the
driver to support both the old and new format.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-03 09:39:11 -08:00
Don Skidmore dbffcb210f ixgbe: add support for 82599 FCoE SKU
Add both NIC and backplane support for FCoE enabled devices IDs.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-03 09:36:47 -08:00
Don Skidmore 0b077feac0 ixgbe: add WOL support for SFP+ subdevice
This patch will add wake on LAN support to the dev/sub_dev 10FB 11A9.  This
will also include ixgbe ethtool support for this device.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-03 09:36:46 -08:00
Don Skidmore c6ecf39a10 ixgbe: fix link behavior for SFP+ when driver is brought down
We have had several requests to have ifconfig down command disable
the SFP+ laser and thus make link go down.  Likewise on ifconfig up
the laser would be enabled and link would come up.  This patch enables
that behavior.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-03 09:36:45 -08:00
Eric Dumazet 89bf67f1f0 drivers/net: use vzalloc()
Use vzalloc() and vzalloc_node() in net drivers

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-11-27 22:53:38 -08:00
Don Skidmore 9a2d09cf61 ixgbe: update version number for ixgbe
This will reflect addition of new X540 hardware

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-11-21 09:55:10 -08:00
Eric Dumazet e2ddeba95c ixgbe: refactor ixgbe_alloc_queues()
I noticed ring variable was initialized before allocations, and that
memory node management was a bit ugly. We also leak memory in case of
ring allocations error.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:18 -08:00
Don Skidmore b93a22260f ixgbe: add support for x540 MAC
This patch adds support for the x540 MAC which is the next MAC in the
82598/82599 line.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:17 -08:00
Don Skidmore fe15e8e1c7 ixgbe: add MAC and PHY support for x540
Adds the new x540.c file and Aquantia 1202 PHY for X540 support.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:16 -08:00
Don Skidmore a391f1d512 ixgbe: make silicon specific functions generic
The new MAC type X540 shares much of the same functionality of
some silicon specific functions.  To reduce duplicate code,
made these functions generic.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:15 -08:00
Yi Zou 9b55bb0384 ixgbe: make sure FCoE DDP user buffers are really released by the HW
When invalidating the DDP context is invalidated, the HW may not be done
with the user buffer right away. In which case, we poll the FCBUFF register
to check if the buffer valid bit is cleared or not, if not, we wait for max
100us that is guaranteed by the HW.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:14 -08:00
Yi Zou 8ca371e484 ixgbe: invalidate FCoE DDP context when no error status is available
The hw automatically invalidates the context if DDP is successful or there is
error detected. In case there is no error status available from the hw,
initializing the per context error status to be 1 allows the DDP context to be
still invalidated via the upper layer call to ddp_put().

Signed-off-by: Yi Zou <yi.zou@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:13 -08:00
Yi Zou a41c059741 ixgbe: avoid doing FCoE DDP when adapter is DOWN or RESETTING
There is no point to allow incoming DDP requests from the upper layer stack if
the adapter is going down or being reset.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:13 -08:00
John Fastabend c84d324c77 ixgbe: rework Tx hang detection to fix reoccurring false Tx hangs
The Tx hang logic has been known to detect false hangs when
the device is receiving pause frames or has delayed processing
for some other reason.

This patch makes the logic more robust and resolves these
known issues. The old logic checked to see if the device
was paused by querying the HW then the hang logic was
aborted if the device was currently paused. This check was
racy because the device could have been in the pause state
any time up to this check. The other operation of the
hang logic is to verify the Tx ring is still advancing
the old logic checked the EOP timestamp. This is not
sufficient to determine the ring is not advancing but
only infers that it may be moving slowly.

Here we add logic to track the number of completed Tx
descriptors and use the adapter stats to check if any
pause frames have been received since the previous Tx
hang check. This way we avoid racing with the HW
register and do not detect false hangs if the ring is
advancing slowly.

This patch is primarily the work of Jesse Brandeburg. I
clean it up some and fixed the PFC checking.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:12 -08:00
Alexander Duyck e3de4b7bdf ixgbe: Resolve null function pointer accesses on 82598 w/ multi-speed fiber
This change resolves some null function pointer accesses on 82598 when a
multi-speed fiber module is inserted into the adapter.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:11 -08:00
Alexander Duyck 2274543f15 ixgbe: populate the ring->q_vector pointer during ring mapping
The q_vector back pointer was not being set in the rings so it would not
have been possible to determine the parent q_vector of the ring.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:10 -08:00
Alexander Duyck d0759ebb05 ixgbe: cleanup ixgbe_map_rings_to_vectors
This change cleans up some of the items in ixgbe_map_rings_to_vectors.
Specifically it merges the two for loops and drops the unnecessary vectors
parameter.

It also moves the vector names into the q_vectors themselves.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:09 -08:00
Alexander Duyck 125601bf03 ixgbe: simplify math and improve stack use of ixgbe_set_itr functions
This change is meant to improve the stack utilization and simplify the math
used in ixgbe_set_itr_msix.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:08 -08:00
Alexander Duyck bf29ee6c48 ixgbe: cleanup unclear references to reg_idx
There are a number of places where we use the variable j to contain the
register index of the ring.  Instead of using such a non-descriptive
variable name it is better that we name it reg_idx so that it is clear what
the variable contains.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:07 -08:00
Alexander Duyck 9d6b758f42 ixgbe: cleanup unnecessary return value in ixgbe_cache_ring_rss
This change is just to cleanup some confusing logic in ixgbe_cache_ring_rss
which can be simplified by adding a conditional with return to the start of
the call.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:06 -08:00
Alexander Duyck 673ac60461 ixgbe: Cleanup DCB logic, whitespace, and comments in ixgbe_ethtool.c
This change address a few whitespace issues in DCB #ifdefs, adds a comment
calling out the DCB specific registers, and nests an if statement inline
with a number of if statements related to flow control.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:05 -08:00
Alexander Duyck 50d6c681d0 ixgbe: add WOL support for backplane adapters
This change adds support for certain 82599 based Mezzanine adapters.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:05 -08:00
Alexander Duyck e2b4e216b7 ixgbe: cleanup ixgbe_set_tx_csum ethtool flags configuration
This change makes it so that we always disable SCTP regardless of mac type
since we shouldn't need to check mac type before disabling a feature that
isn't supported on a given piece of hardware.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:04 -08:00
Alexander Duyck bd50817859 ixgbe: change mac_type if statements to switch statements
This change replaces a number of if/elseif/else statements with switch
statements to support the addition of future devices to the ixgbe driver.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:03 -08:00
Alexander Duyck aa80175a53 ixgbe: cleanup use of ixgbe_rsc_count and RSC_CB
This change cleans up the use of rsc_count and changes it to a boolean since
the actual numerical value is used nowhere in the Rx cleanup path.  I am
also moving the skb count into the RSC_CB path since it is much easier to
track it there than when it is passed as a parameter to various function
calls.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:02 -08:00
Alexander Duyck ee9e0f0b40 ixgbe: cleanup ATR filter setup function
This change cleans up the ixgbe_atr filter setup function so that it uses
fewer items from the stack.  Since the code is only applicable to IPv4 w/
TCP it makes sense to just use the pointers based on the headers themselves
instead of copying them to temp variables and then writing those to the
filters.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:01 -08:00
Alexander Duyck c267fc166a ixgbe: cleanup ixgbe_clean_rx_irq
The code for ixgbe_clean_rx_irq was much more tangled up than it needed to
be in terms of logic statements and unused variables.  This change
untangles much of that and drops several unused variables such as cleaned
which was being returned but never checked.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:27:00 -08:00
Alexander Duyck 32aa77a4fc ixgbe: change vector numbering so that queues end up on correct CPUs
This changes the numbering scheme slightly. Previously the ordering was
coming out like this:
Rx-2
Rx-1
Rx-0
TxRx-0
Which would drop two queues on CPU 0. This change makes it so that the
ordering is like this:
Rx-3
Rx-2
Rx-1
TxRx-0
This means that each CPU will have it's own Rx queue, and only CPU 0 will
have the Tx queue.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:59 -08:00
Alexander Duyck b953799ee2 ixgbe: reorder Tx cleanup so that if adapter will reset we don't rearm
The code as it existed could re-arm the queues when it was requesting a HW
reset due to a TX hang. Instead of doing that this change makes it so that
we will just exit if the hardware is believed to be hung.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:58 -08:00
Alexander Duyck 80fba3f434 ixgbe: Disable RSC when ITR setting is too high to allow RSC
RSC will flush its descriptors every time the interrupt throttle timer
expires.  In addition there are known issues with RSC when the rx-usecs
value is set too low.  As such we are forced to clear the RSC_ENABLED bit
and reset the adapter when the rx-usecs value is set too low.

However we do not need to clear the NETIF_F_LRO flag because it is used to
indicate that the user wants to leave the LRO feature enabled, and in fact
with this change we will now re-enable RSC as soon as the rx-usecs value is
increased and the flag is still set.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:57 -08:00
Alexander Duyck 73c4b7cdd2 ixgbe: cleanup race conditions in link setup
This change makes it so that we perform link setup with interrupts
disabled. If the SFP has not been detected previously we will schedule the
SFP detection task to run in order to detect link.  By doing this we avoid
the possibility of interrupts firing in the middle of our link setup during
ixgbe_up_complete.

In addition this change makes it so that the multi-speed fiber setup and SFP
setup are not mutually exclusive.  The addresses issues seen in which a
link would only come up at 1G on some multi-speed fiber modules.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:57 -08:00
Alexander Duyck 7d637bcc8f ixgbe: add a state flags to ring
This change adds a set of state flags to the rings that allow them to
independently function allowing for features like RSC, packet split, and
TX hang detection to be done per ring instead of for the entire device.

This is accomplished by re-purposing the flow director reinit_state member
and making it a global state instead since a long for a single bit flag is
a bit wasteful.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:56 -08:00
Alexander Duyck 33cf09c958 ixgbe: move CPU variable from ring into q_vector, add ring->q_vector
This is the start of work to sort out what belongs in the rings and what
belongs in the q_vector. Items like the CPU variable for make much more
sense in the q_vector since the CPU is a per-interrupt thing rather than a
per ring thing.
I also added a back-pointer from the ring to the q_vector.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:55 -08:00
Alexander Duyck c60fbb00f0 ixgbe: move adapter into pci_dev driver data instead of netdev
This change moves an adapter pointer into the private portion of the
pci_dev instead of a pointer to the netdev. The reason for this change is
because in most cases we just want the adapter anyway. In addition as we
start moving toward multiple netdevs per port we may want to move the
adapter pointer out of the netdevs entirely.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:54 -08:00
Alexander Duyck 01fa7d905f ixgbe: remove residual code left over from earlier combining of TXDCTL
Missed some code that was left floating around in the DCB configuration
for the TXDCTL register.  As a result the register was being messed with in
two different spots when we only needed to do the change once.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:53 -08:00
Alexander Duyck 5f5ae6fc86 ixgbe: move ixgbe_clear_interrupt_scheme to before pci_save_state
The main reason for this change is to keep the suspend/resume logic matched
up. The clear_interrupt_scheme function will disable MSI-X which will
effect the PCIe configuration space. Therefore we will want to do it before
we save state to avoid having the interrupt state restored by
pci_restore_state, and then trying to re-enable MSI/MSI-X interrupts via
ixgbe_setup_interrupt_scheme.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:52 -08:00
Alexander Duyck fc77dc3cc1 ixgbe: add a netdev pointer to the ring structure
This change places a netdev pointer directly into the ring structure. This
way we can avoid having to determine which netdev we are supposed to be
using and can just access the one on the ring directly.
As a result of this change further collapse of the code is possible by
dropping the adapter from ixgbe_alloc_rx_buffers, and the netdev pointer
from ixgbe_xmit_frame_ring_adv and ixgbe_maybe_stop_tx.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:51 -08:00
Alexander Duyck 5b7da51547 ixgbe: combine some stats into a union to allow for Tx/Rx stats overlap
This change moved some of the RX and TX stats into separate structures and
them placed those structures in a union in order to help reduce the size of
the ring structure.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:50 -08:00
Alexander Duyck b6ec895ecd ixgbe: move device pointer into the ring structure
This change is meant to simplify DMA map/unmap by providing a device
pointer. As a result the adapter pointer can be dropped from many of
the calls.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:49 -08:00
Alexander Duyck 84ea2591e4 ixgbe: drop ring->head, make ring->tail a pointer instead of offset
This change drops ring->head since it is not used in any hot-path and can
easily be determined using IXGBE_[RT]DH(ring->reg_idx).

It also changes ring->tail into a true pointer so we can avoid unnecessary
pointer math to find the location of the tail.

In addition I also dropped the setting of head and tail in
ixgbe_clean_[rx|tx]_ring. The only location that should be setting the head
and tail values is ixgbe_configure_[rx|tx]_ring and that is only while the
queue is disabled.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2010-11-16 19:26:49 -08:00