Francois Romieu [Tue, 31 Jan 2012 10:20:34 +0000 (11:20 +0100)]
r8169: spinlock redux.
rtl8169_get_regs operates under RTNL and rtl task mutex whereas
rtl_set_rx_mode is either called under RTNL or rtl task mutex protection.
(cherry picked from commit 6c05d25267ebb371c4311de6904f740342e82f7c) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Francois Romieu [Tue, 31 Jan 2012 10:09:21 +0000 (11:09 +0100)]
r8169: avoid a useless work scheduling.
(cherry picked from commit 934714d088f35b81edafdce89397969baf77fb8a) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Suggested-by: Michał Mirosław <mirqus@gmail.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Francois Romieu [Tue, 31 Jan 2012 09:56:44 +0000 (10:56 +0100)]
r8169: move task enable boolean to bitfield.
Simpler, more consistent, with negligible cost in non-critical paths.
(cherry picked from commit 6c4a70c5f286077e78b294b3f3a93dc45c40db89) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Suggested-by: Michał Mirosław <mirqus@gmail.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Francois Romieu [Tue, 31 Jan 2012 09:47:34 +0000 (10:47 +0100)]
r8169: bh locking redux and task scheduling.
- atomic bit operations are globally visible
- pending status is always cleared before execution
- scheduled works are either idempotent or only required to happen once
after a series of originating events, say link events for instance
(cherry picked from commit 98ddf986fca17840e46e070354b7e2cd2169da15) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Suggested-by: Michał Mirosław <mirqus@gmail.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Francois Romieu [Mon, 30 Jan 2012 23:00:19 +0000 (00:00 +0100)]
r8169: fix early queue wake-up.
With infinite gratitude to Eric Dumazet for allowing me to identify
the error.
(cherry picked from commit ae1f23fb433ac0aaff8aeaa5a7b14348e9aa8277) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Fri, 18 May 2012 03:27:31 +0000 (11:27 +0800)]
r8169: remove work from irq handler.
The irq handler was a mess.
See 7ab87ff4c770eed71e3777936299292739fcd0fe ("via-rhine: move work from
irq handler to softirq and beyond") for similar changes. One can notice:
- all non-napi tasks are explicitely scheduled trough a single work queue.
- hiding software tx queue start behind the rtl_hw_start method is mildly
natural. Move it in the caller where needed.
- as can be seen from the heavy use of bh disabling locks, the driver is
not safe for irq context messages with netconsole. It is still quite
usable for general messaging though. Tested ok with concurrent registers
dump (ethtool -d) + background traffic + "echo t > /proc/sysrq-trigger".
As a side note, the comments in f11a377b3f4e897d11f0e8d1fc688667e2f19708
("r8169: avoid losing MSI interrupts") does not seem completely clear: if
I hack the driver further to stop acking the irq link event bit, MSI
interrupts keep being delivered (RTL8168b/8111b, XID 18000000).
(backported from commit da78dbff2e05630921c551dbbc70a4b7981a8fff) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Francois Romieu [Fri, 27 Jan 2012 14:05:38 +0000 (15:05 +0100)]
r8169: missing barriers.
(cherry picked from commit 1e874e041fc7c222cbd85b20c4406070be1f687a) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Francois Romieu [Thu, 26 Jan 2012 11:59:08 +0000 (12:59 +0100)]
r8169: irq mask helpers.
(cherry picked from commit 9085cdfa2f9f04d8678465748e2cced6e3f02e26) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Francois Romieu [Thu, 26 Jan 2012 11:50:01 +0000 (12:50 +0100)]
r8169: factor out IntrMask writes.
(cherry picked from commit 3e990ff5f119c2f9b142f3e2548dc90ca9b7dfa1) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Francois Romieu [Thu, 26 Jan 2012 10:23:32 +0000 (11:23 +0100)]
r8169: stop delaying workqueue.
Though motivated by the move of the driver to a single work queue of
sequential events and removal of hard irq processing, it looks safe as
a standalone change.
(cherry picked from commit 4422bcd4907d1bbb9f63e049e3c3819132c047a1) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Francois Romieu [Thu, 26 Jan 2012 08:59:50 +0000 (09:59 +0100)]
r8169: remove rtl8169_reinit_task.
I see no good reason to keep both rtl8169_reinit_task and rtl8169_reset_task:
- rtl8169_reinit_task adds a software failure point which does relate to
any hardware state
- they handle hardware the same. Remember that rtl8169_reinit_task was
introduced in the 8169 only era to handle PCI errors way before the 8168
asked for pll and firmware ops and compare :
(cherry picked from commit 209e5ac83b4d038ffb52cabc793f75031602a031) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Francois Romieu [Thu, 22 Dec 2011 17:59:37 +0000 (18:59 +0100)]
r8169: remove hardcoded PCIe registers accesses.
(cherry picked from commit 4512ff9f361a2786a18cb805d1f64b8d8719f121) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
françois romieu [Sun, 8 Jan 2012 13:41:33 +0000 (13:41 +0000)]
8139cp: fix missing napi_gro_flush.
The driver uses __napi_complete and napi_gro_receive. Without it, the
driver hits the BUG_ON(n->gro_list) assertion hard in __napi_complete.
(cherry picked from commit b189e810619a676e6b931a942a3e8387f3d39c21) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Tested-by: Marin Glibic <zhilla2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Jason Wang [Fri, 30 Dec 2011 23:44:33 +0000 (23:44 +0000)]
8139cp/8139too: do not read into reserved registers
delay_eeprom() use long read for Cfg9346 register(offset 0x50) which may read
into the area of reserved register(offset 0x53). Use byte read instead.
(cherry picked from commit 7d03f5a48e4d90854275b06433626243b3b3db17) Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
françois romieu [Thu, 15 Dec 2011 08:37:43 +0000 (08:37 +0000)]
r8169: fix Config2 MSIEnable bit setting.
The MSIEnable bit is only available for the 8169.
Avoid Config2 writes for the post-8169 8168 and 810x.
Reported-by: Su Kang Yin <cantona@cantona.net>
(cherry picked from commit 2ca6cf06d988fea21e812a86be79353352677c9c) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
françois romieu [Sun, 4 Dec 2011 20:30:52 +0000 (20:30 +0000)]
r8169: fix Rx index race between FIFO overflow recovery and NAPI handler.
Since 92fc43b4159b518f5baae57301f26d770b0834c9, rtl8169_tx_timeout ends up
resetting Rx and Tx indexes and thus racing with the NAPI handler via
-> rtl8169_hw_reset
-> rtl_hw_reset
-> rtl8169_init_ring_indexes
What about returning to the original state ?
rtl_hw_reset is only used by rtl8169_hw_reset and rtl8169_init_one.
The latter does not need rtl8169_init_ring_indexes because the indexes
still contain their original values from the newly allocated network
device private data area (i.e. 0).
rtl8169_hw_reset is used by:
1. rtl8169_down
Helper for rtl8169_close. rtl8169_open explicitely inits the indexes
anyway.
2. rtl8169_pcierr_interrupt
Indexes are set by rtl8169_reinit_task.
3. rtl8169_interrupt
rtl8169_hw_reset is needed when the device goes down. See 1.
4. rtl_shutdown
System shutdown handler. Indexes are irrelevant.
5. rtl8169_reset_task
Indexes must be set before rtl_hw_start is called.
6. rtl8169_tx_timeout
Indexes should not be set. This is the job of rtl8169_reset_task anyway.
The removal of rtl8169_hw_reset in rtl8169_tx_timeout and its move in
rtl8169_reset_task do not change the analysis.
(cherry picked from commit c7c2c39be8ed4e503e987151f4599455060e219a) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: hayeswang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
françois romieu [Sun, 4 Dec 2011 20:30:45 +0000 (20:30 +0000)]
r8169: Rx FIFO overflow fixes.
Realtek has specified that the post 8168c gigabit chips and the post
8105e fast ethernet chips recover automatically from a Rx FIFO overflow.
The driver does not need to clear the RxFIFOOver bit of IntrStatus and
it should rather avoid messing it.
The implementation deserves some explanation:
1. events outside of the intr_event bit mask are now ignored. It enforces
a no-processing policy for the events that either should not be there
or should be ignored.
2. RxFIFOOver was already ignored in rtl_cfg_infos[RTL_CFG_1] for the
whole 8168 line of chips with two exceptions:
- RTL_GIGA_MAC_VER_22 since b5ba6d12bdac21bc0620a5089e0f24e362645efd
("use RxFIFO overflow workaround for 8168c chipset.").
This one should now be correctly handled.
- RTL_GIGA_MAC_VER_11 (8168b) which requires a different Rx FIFO
overflow processing.
Though it does not conform to Realtek suggestion above, the updated
driver includes no change for RTL_GIGA_MAC_VER_12 and RTL_GIGA_MAC_VER_17.
Both are 8168b. RTL_GIGA_MAC_VER_12 is common and a bit old so I'd rather
wait for experimental evidence that the change suggested by Realtek really
helps or does not hurt in unexpected ways.
Removed case statements in rtl8169_interrupt are only 8168 relevant.
3. RxFIFOOver is masked for post 8105e 810x chips, namely the sole 8105e
(RTL_GIGA_MAC_VER_30) itself.
(cherry picked from commit 811fd3010cf512f2e23e6c4c912aad54516dc706) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: hayeswang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Rick Jones [Tue, 22 Nov 2011 14:06:26 +0000 (14:06 +0000)]
corral some wayward N/A fw_version dust bunnies
Round-up some wayward "N/A" fw_version dust bunnies as part of that
clean-up.
(cherry picked from commit 8ac72d167198f52cba8637cc9bec89339b8e4e64) Signed-off-by: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Jin [Fri, 18 May 2012 03:10:25 +0000 (11:10 +0800)]
ethernet: Convert MAC_ADDR_LEN uses to ETH_ALEN
Reduce the number of #defines, use the normal #define from if_ether.h
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(backported from commit 6a3c910ca04ecd69b16dae47b26097a92c533828)
Joe Jin [Fri, 18 May 2012 03:04:27 +0000 (11:04 +0800)]
sweep the floors and convert some .get_drvinfo routines to strlcpy
Per the mention made by Ben Hutchings that strlcpy is now the preferred
string copy routine for a .get_drvinfo routine, do a bit of floor
sweeping and convert some of the as-yet unconverted ethernet drivers to
it.
(backported from commit 68aad78c5023b8aa82da99b47f9d8cf40e8ca453) 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>
Hayes Wang [Sat, 18 Jun 2011 09:37:48 +0000 (11:37 +0200)]
r8169: support new firmware format.
The new firmware format adds versioning as firmware for a specific
chipset appears to be subject to change. Current "legacy" format is
still supported.
Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit 960aee6c7d5951ac20c0227ad73bad56392f0afc)
hayeswang [Mon, 7 Nov 2011 20:44:37 +0000 (20:44 +0000)]
r8169: increase the delay parameter of pm_schedule_suspend
The link down would occur when reseting PHY. And it would take about 2 ~ 5 seconds
from link down to link up. If the delay of pm_schedule_suspend is not long enough,
the device would enter runtime_suspend before link up. After link up, the device
would wake up and reset PHY again. Then, you would find the driver keep in a loop
of runtime_suspend and rumtime_resume.
(cherry picked from commit 10953db8e1a278742ef7e64a3d1491802bcfa98b) Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
hayeswang [Thu, 13 Oct 2011 20:14:37 +0000 (20:14 +0000)]
r8169: fix wrong eee setting for rlt8111evl
Correct the wrong parameter for setting EEE for RTL8111E-VL.
Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1b23a3e3d1b969e285c57a2d38f3739283ecfb80)
françois romieu [Fri, 14 Oct 2011 00:57:45 +0000 (00:57 +0000)]
r8169: fix driver shutdown WoL regression.
Due to commit 92fc43b4159b518f5baae57301f26d770b0834c9 ("r8169: modify the
flow of the hw reset."), rtl8169_hw_reset stomps during driver shutdown on
RxConfig bits which are needed for WOL on some versions of the hardware.
As these bits were formerly set from the r81{0x, 68}_pll_power_down methods,
factor them out for use in the driver shutdown (rtl_shutdown) handler.
I favored __rtl8169_get_wol() -hardware state indication- over
RTL_FEATURE_WOL as the latter has become a good candidate for removal.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes <hayeswang@realtek.com> Tested-by: Marc Ballarin <ballarin.marc@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 649b3b8c4e8681de443b4dc9e387c3036369e02e)
Rick Jones [Fri, 7 Oct 2011 06:42:21 +0000 (06:42 +0000)]
Add ethtool -g support to 8139cp
Add support for reporting ring sizes via ethtool -g to the 8139cp driver.
(cherry picked from commit 1d0861acfb24d0ca0661ff5a156b992b2c589458) 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>
françois romieu [Fri, 30 Sep 2011 00:38:02 +0000 (00:38 +0000)]
sc92031: use standard #defines from mii.h.
(cherry picked from commit 3235de1684ae88e5e380de254a2a674dcd558acc) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Francois Romieu [Tue, 3 May 2011 14:38:29 +0000 (16:38 +0200)]
r8169: jumbo fixes.
- fix features : jumbo frames and checksumming can not be used at the
same time.
- introduce hw_jumbo_{enable / disable} helpers. Their content has been
creatively extracted from Realtek's own drivers. As an illustration,
it would be nice to know how/if the MaxTxPacketSize register operates
when the device can work with a 9k jumbo frame as its documentation
(8168c) can not be applied beyond ~7k.
- rtl_tx_performance_tweak is moved forward. No change.
(cherry picked from commit d58d46b5d85139d18eb939aa7279c160bab70484) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
8168d and above allow jumbo frames beyond 8k. Bump the received
packet length check before enabling jumbo frames on these chipsets.
Frame length indication covers bits 0..13 of the first Rx descriptor
32 bits for the 8169 and 8168. I only have authoritative documentation
for the allowed use of the extra (13) bit with the 8169 and 8168c.
Realtek's drivers use the same mask for the 816x and the fast ethernet
only 810x.
(cherry picked from commit deb9d93c89d311714a60809b28160e538e1cbb43) Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Hayes Wang [Tue, 6 Sep 2011 08:55:18 +0000 (16:55 +0800)]
r8169: support new chips of RTL8111F
Support new chips of RTL8111F.
(cherry picked from commit c2218925f3a653ac6c39e62eb0e10232d2b44dab) Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com>
(cherry picked from commit 2544bfc0eb2581e0eedbdfea1468b3866223d47e)
Hayes Wang [Tue, 6 Sep 2011 08:55:15 +0000 (16:55 +0800)]
r8169: define the early size for 8111evl
For RTL8111EVL, the register of MaxTxPacketSize doesn't acctually
limit the tx size. It influnces the feature of early tx.
(cherry picked from commit 3090bd9a3102331ed981280ef05ee5433ce978d7) Signed-off-by: Hayes Wang <hayeswang@realtek.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Ian Campbell [Wed, 31 Aug 2011 00:47:06 +0000 (00:47 +0000)]
r8169: convert to SKB paged frag API.
(cherry picked from commit 929f61896e194f45696ba52852ccbfd5edd04df1) Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Realtek linux nic maintainers <nic_swsd@realtek.com> Cc: Francois Romieu <romieu@fr.zoreil.com> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Ian Campbell [Mon, 29 Aug 2011 23:18:18 +0000 (23:18 +0000)]
8139cp: convert to SKB paged frag API.
(cherry picked from commit deb8a069e39b272c0a37bfa7a5f52d49600963a4) Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Fri, 18 May 2012 02:10:06 +0000 (10:10 +0800)]
net: remove use of ndo_set_multicast_list in realtek drivers
replace it by ndo_set_rx_mode for realtek devices
(backported from commit afc4b13df143122f99a0eb10bfefb216c2806de0) Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Hayes suggested that the usual MAC{0, 4} register writes be completed
with writes to extended GigaMAC registers :
- 0xe0 .. 0xe5
- 0xf2 .. 0xf7
Registers 0xf0 and 0xf1 should be set to 0.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Hayes Wang <hayeswang@realtek.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c28aa38567101bad4e020f4392df41d0bf6c165c)
Sergei Shtylyov [Fri, 22 Jul 2011 05:37:24 +0000 (05:37 +0000)]
r8169: use pci_dev->subsystem_{vendor|device}
The driver reads PCI subsystem IDs from the PCI configuration registers while
they are already stored by the PCI subsystem in the 'subsystem_{vendor|device}'
fields of 'struct pci_dev'...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ccbae55e1c6dc18e95d72c044cf9345ea08abf7b)
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Signed-off-by: Hayes Wang <hayeswang@realtek.com>
(cherry picked from commit 1687b56679880a47164ae149530abee543f9d6b1)
Hayes Wang [Wed, 6 Jul 2011 07:58:04 +0000 (15:58 +0800)]
r8169: adjust the RxConfig settings.
Set the init value before reset in probe function. And then just
modify the relative bits and keep the init settings.
For 8110S, 8110SB, and 8110SC series, the initial value of RxConfig
needs to be set after the tx/rx is enabled.
Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit e542a2269f232d61270ceddd42b73a4348dee2bb)
Hayes Wang [Wed, 6 Jul 2011 07:58:08 +0000 (15:58 +0800)]
r8169: don't enable rx when shutdown.
Only 8111b needs to enable rx when shutdowning with WoL.
Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit aaa89c08d9ffa3739c93d65d98b73ec2aa2e93a5)
Hayes Wang [Wed, 6 Jul 2011 07:58:07 +0000 (15:58 +0800)]
r8169: fix wake on lan setting for non-8111E.
Only 8111E needs enable RxConfig bit 0 ~ 3 when suspending or
shutdowning for wake on lan.
Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit d4ed95d796e5126bba51466dc07e287cebc8bd19)
Hayes Wang [Wed, 6 Jul 2011 07:58:06 +0000 (15:58 +0800)]
r8169: support RTL8111E-VL.
Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit 70090424e59652c4b2e777b533cc23134b176b83)
Hayes Wang [Wed, 6 Jul 2011 07:58:05 +0000 (15:58 +0800)]
r8169: add ERI functions.
Add the ERI functions which would be used by the new chips.
Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit 133ac40ac26a6cba957ad5765892f0531ba6ccee)
Hayes Wang [Wed, 6 Jul 2011 07:58:03 +0000 (15:58 +0800)]
r8169: modify the flow of the hw reset.
- Disable tx and rx by resetting hw, so replace rtl8169_asic_down
with rtl8169_hw_reset.
- RxConfig bits 0 ~ 5 have to be cleared before hw reset to avoid
receiving spurious data.
- Certain chips need to do some checking before reset.
- Remove hw reset which is done before hw_start. It is done in close,
down or device probe functions.
- Move rtl8169_init_ring_indexes function into rtl_hw_reset function.
The indexes of tx and rx only need to be zero when the hw resets.
Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit 92fc43b4159b518f5baae57301f26d770b0834c9)
Hayes Wang [Wed, 6 Jul 2011 07:58:02 +0000 (15:58 +0800)]
r8169: adjust some registers.
Define new registers and modify some existing ones.
Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
(cherry picked from commit 4f6b00e5f139d7be3ca8371b769778f94fa549dd)
Jon Mason [Mon, 27 Jun 2011 07:46:31 +0000 (07:46 +0000)]
r8169: remove unnecessary read of PCI_CAP_ID_EXP
The PCIE capability offset is saved during PCI bus walking. Use the
value from pci_dev instead of checking in the driver and saving it off
the the driver specific structure. Also, it will remove an unnecessary
search in the PCI configuration space if this value is referenced
instead of reacquiring it.
Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e44daaded19baf8b7cf9ab3dedad8a01b8c49251)
Danny Kukawka [Fri, 24 Feb 2012 03:45:56 +0000 (03:45 +0000)]
ixgbevf: print MAC via printk format specifier
Print MAC/dev_addr via printk extended format specifier %pM
instead of custom code.
(cherry picked from commit f794e7efe40147ed0c34f889b75298fec10e66b8) Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Greg Rose [Fri, 6 Jan 2012 02:53:30 +0000 (02:53 +0000)]
ixgbevf: Update copyright notices
(cherry picked from commit 5c47a2b6211316ee9cd8740db453af7c5c01d0d6) Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Robert E Garrett <robertX.e.garrett@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Greg Rose [Wed, 1 Feb 2012 01:28:15 +0000 (01:28 +0000)]
ixgbevf: Fix mailbox interrupt ack bug
Remove jump to out label that was skipping over code to replace the
ack bit in the mailbox cache variable. This was causing driver mailbox
routines that poll for the PF to ack a message to time out which would
in turn cause all other mailbox messages to fail. Also replace the
mailbox cache variable message indication bit when a message is found
so that other functions that choose to poll for a mailbox message from
the PF won't miss it.
(cherry picked from commit 3a2c40336b5ee112f6a2bc784e79aa6124d7acf6) Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Robert E Garrett <robertX.e.garrett@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Stephen Hemminger [Wed, 18 Jan 2012 22:13:34 +0000 (22:13 +0000)]
ixgbevf: make operations tables const
The arrays of function pointers should be const to make life harder
for rootkits.
(cherry picked from commit 3d8fe98f8d5cb303d907d8f94ea6dc1f9a1d8b7a) Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Stephen Hemminger [Wed, 18 Jan 2012 22:13:33 +0000 (22:13 +0000)]
ixgbevf: fix sparse warnings
Fixes sparse warnings:
drivers/net/ixgbevf/vf.c:418:21: warning: symbol 'ixgbevf_82599_vf_info' was not declared. Should it be static?
drivers/net/ixgbevf/vf.c:423:21: warning: symbol 'ixgbevf_X540_vf_info' was not declared. Should it be static?
drivers/net/ixgbevf/mbx.c:331:29: warning: symbol 'ixgbevf_mbx_ops' was not declared. Should it be static?
(cherry picked from commit b5417bf8e8952401bca69ded67c30ead484af823) Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Stephen Hemminger [Wed, 18 Jan 2012 22:13:32 +0000 (22:13 +0000)]
ixgbevf: make ethtool ops and strings const
(cherry picked from commit b47aca135d6df5f676c768368baf3c099f054fcd) Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Greg Rose [Wed, 18 Jan 2012 22:13:31 +0000 (22:13 +0000)]
ixgbevf: Prevent possible race condition by checking for message
The mailbox interrupt routine might cause a race condition sometimes
and cause a message to be missed.
(cherry picked from commit 375b27cf5db963e2bc2a34dc5643d0d7ceca1ee2) Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Thu, 8 Dec 2011 06:36:28 +0000 (06:36 +0000)]
ixgbevf: Fix register defines to correctly handle complex expressions
This patch is meant to address possible issues with the IXGBEVF register
defines generating incorrect values when given a complex expression for the
register offset.
(cherry picked from commit f131a6c07ec0eb9d00f99af18be52a6da0458e82) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Greg Rose [Thu, 20 Oct 2011 04:14:49 +0000 (04:14 +0000)]
ixgbevf: Update release version
(cherry picked from commit c1a7e1ebc17a9243d99ba0432d1138d74114dea7) Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Greg Rose [Sat, 27 Aug 2011 02:06:25 +0000 (02:06 +0000)]
ixgbevf: Fix broken trunk vlan
Changes to clean up the vlan rx path broke trunk vlan. Trunk vlans in
a VF driver are those set using:
"ip link set <pfdev> vf <n> <vlanid>"
(cherry picked from commit dd1ed3b7bfed15f6162f63840941e9cf4f3611a1) Signed-off-by: Greg Rose <gregory.v.rose@intel.com> CC: Jiri Pirko <jpirko@redhat.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Thu, 17 May 2012 15:54:07 +0000 (23:54 +0800)]
ixgbevf: convert to ndo_fix_features
Private rx_csum flags are now duplicate of netdev->features & NETIF_F_RXCSUM.
Removing this needs deeper surgery.
Since ixgbevf doesn't change hardware state on RX csum enable/disable
its reset is avoided.
Things noticed:
- HW VLAN acceleration probably can be toggled, but it's left as is
- the resets on RX csum offload change can probably be avoided
- there is A LOT of copy-and-pasted code here
(backported from commit 471a76ded87d3375a3449dfa3d1cec567edd0c50) Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Greg Rose [Fri, 3 Jun 2011 03:53:24 +0000 (03:53 +0000)]
ixgbevf: Check if EOP has changed before using it
There is a chance that between the time EOP is read and the time it is
used another transmit on a different CPU could have run and completed,
thus leaving EOP in a bad state.
(cherry picked from commit 98b9e48fca11c8aa54b25c02d3329392b52db8ab) Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Thu, 17 May 2012 15:46:31 +0000 (23:46 +0800)]
ixgbe: Correct flag values set by ixgbe_fix_features
This patch replaces the variable name data with the variable name features
for ixgbe_fix_features and ixgbe_set_features. This helps to make some
issues more obvious such as the fact that we were disabling Rx VLAN tag
stripping when we should have been forcing it to be enabled when DCB is
enabled.
In addition there was deprecated code present that was disabling the LRO
flag if we had the itr value set too low. I have updated this logic so
that we will now allow the LRO flag to be set, but will not enable RSC
until the rx-usecs value is high enough to allow enough time for Rx packet
coalescing.
(cherry picked from commit 567d2de291b5ddb83654c5e87c14b4c6fa7216ed) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Don Skidmore [Thu, 15 Mar 2012 04:55:59 +0000 (04:55 +0000)]
ixgbe: fix typo in enumeration name
This was pointed out to me by Xiaojun Zhang on Source Forge.
CC: Xiaojun Zhang <zhangxiaojun@sourceforge.net>
(cherry picked from commit 70e5576cb0af5c1351432704a39319af119584bb) Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Thu, 17 May 2012 15:28:25 +0000 (23:28 +0800)]
ixgbe: Add support for enabling UDP RSS via the ethtool rx-flow-hash command
This patch adds support for enabling or disabling UDP RSS via the
ethtool -N rx-flow-hash command.
(cherry picked from commit ef6afc0caceebb3b49cd384f8c634f89f5089997) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Thu, 17 May 2012 15:26:35 +0000 (23:26 +0800)]
ixgbe: Whitespace cleanups
This patch contains several fixes for formatting in regards to whitespace.
(backported from commit 581330ba7b219fec0587452bd72fe5635c30c4ae) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:51:42 +0000 (07:51 +0000)]
ixgbe: Two minor fixes for RSS and FDIR set queues functions
This change fixes two minor issues. The first was the fact that we were
setting the return value to false twice in the set_rss_queues function.
The second is the fact that we should have been using "min_t(int," instead
of "min((int)" in set_fdir_queues.
(cherry picked from commit 6ca435078822d9728318dee49ba4f2ff8a2ead24) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:51:37 +0000 (07:51 +0000)]
ixgbe: drop err_eeprom tag which is at same location as err_sw_init
The err_eeprom and err_sw_init tags both go to the same location. So
instead of maintaining two tags this patch combines them so we only use
err_sw_init.
(cherry picked from commit 35937c055a691a125cf52343cd671f6190ae5b3b) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:51:27 +0000 (07:51 +0000)]
ixgbe: Move poll routine in order to improve readability
This change relocates the ixgbe_poll routine so it is right next to the
interrupt routine that schedules and calls it.
(cherry picked from commit eb01b9759e733c0ede11d35e3cde5b3c24ab32c9) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:51:22 +0000 (07:51 +0000)]
ixgbe: cleanup logic for the service timer and VF hang detection
This change just cleans up some of the logic in the service_timer function
so that we can avoid unnecessary swapping of the ready value between true to
false and back to true.
(cherry picked from commit 6bb78cfb50bfbaf90646a80448ee8de2372e292a) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Tue, 6 Mar 2012 07:52:38 +0000 (07:52 +0000)]
ixgbe: Fix issues with SR-IOV loopback when flow control is disabled
This patch allows us to avoid a Tx hang when SR-IOV is enabled. This hang
can be triggered by sending small packets at a rate that was triggering Rx
missed errors from the adapter while the internal Tx switch and at least
one VF are enabled.
This was all due to the fact that under heavy stress the Rx FIFO never
drained below the flow control high water mark. This resulted in the Tx
FIFO being head of line blocked due to the fact that it relies on the flow
control high water mark to determine when it is acceptable for the Tx to
place a packet in the Rx FIFO.
The resolution for this is to set the FCRTH value to the RXPBSIZE - 32 so
that even if the ring is almost completely full we can still place Tx
packets on the Rx ring and drop incoming Rx traffic if we do not have
sufficient space available in the Rx FIFO.
(cherry picked from commit c29f40ca19b8ca284a2d1415e26b802bc9b2fb67) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Thu, 17 May 2012 15:13:21 +0000 (23:13 +0800)]
ixgbe: Place skb on first buffer_info structure to avoid using stack space
Instead of keeping a local copy of the skb on the stack for as long as long
as we do it makes sense to instead just place it on the first tx_buffer
structure so that we can save space on the stack and avoid unnecessary
read/write operations copying the pointer out of the stack and onto the
ring later.
(backported from commit fd0db0ed02a6abce5427e90d1e8522322107d62b) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:50:51 +0000 (07:50 +0000)]
ixgbe: Use packets to track Tx completions instead of a seperate value
A separate value was added to track Tx completions in order to determine if
the Tx unit was hung. However we can do the same thing using the number of
packets completed without having to add another stat to the Tx ring.
(cherry picked from commit 7d7ce682f8437ff91c964c478b8845ed98a3207d) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:50:45 +0000 (07:50 +0000)]
ixgbe: Modify setup of descriptor flags to avoid conditional jumps
This change makes it more likely that the descriptor flags setup will use
cmov instructions instead of conditional jumps when setting up the flags.
The advantage to this is that the code should just flow a bit more
smoothly.
To do this it is necessary to set the TX_FLAGS_CSUM bit in tx_flags when
doing TSO so that we also do the checksum in addition to the segmentation
offload.
(cherry picked from commit 93f5b3c1f148f2cca247a2c5afdd3ba7a123a6f1) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:50:40 +0000 (07:50 +0000)]
ixgbe: Make certain that all frames fit minimum size requirements
This change makes certain that any packet we attempt to transmit will meet
minimum size requirements for the hardware.
(cherry picked from commit a50c29dd09ed14f8489677813a4b1c8b62dcf19d) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:50:35 +0000 (07:50 +0000)]
ixgbe: cleanup logic in ixgbe_change_mtu
This change is meant to just cleanup the logic in ixgbe_change_mtu since we
are making it unnecessarily complex due to a workaround required for 82599
when SR-IOV is enabled.
(cherry picked from commit 655309e944fd482e59850d55186571c1b2a91e55) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
John Fastabend [Sat, 11 Feb 2012 06:26:00 +0000 (06:26 +0000)]
ixgbe: dcb: use DCB config values for FCoE traffic class on open
Disabling and enabling DCB can cause FCoE hardware initialization to
occur on the incorrect traffic class when the up2tc mapping has not
yet been reconfigured.
Fix this by using the DCB configuration maps that are correct
and will be pushed at mqprio after DCB driver setup completes
successfully.
(cherry picked from commit cdf485be3a63d1f34293740fb726088c6840ceea) Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Tested-by: Marcus Dennis <marcusx.e.dennis@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Atita Shirwaikar [Sat, 18 Feb 2012 02:58:58 +0000 (02:58 +0000)]
ixgbe: Fix race condition where RX buffer could become corrupted.
There was a race condition in the reset path where the RX buffer
could become corrupted during Fdir configuration.This is due to
a HW bug.The fix right now is to lock the buffer while we do the
fdir configuration.Since we were using similar workaround for another bug,
I moved the existing code to a function and reused it.HW team also recommended
that IXGBE_MAX_SECRX_POLL value be changed from 30 to 40.The erratum for this
bug will be published in the next release 82599 Spec Update
(cherry picked from commit d2f5e7f3af777d52ce110ae60e8cb788bc93141c) Signed-off-by: Atita Shirwaikar <atita.shirwaikar@intel.com> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Jesse Brandeburg [Fri, 10 Feb 2012 10:20:02 +0000 (10:20 +0000)]
ixgbe: use typed min/max functions where possible
using the form min((int)var, ver)) is replaced by min_t(int, ...)
(cherry picked from commit 3ed69d7e318ce17c77d91fd09a963cf48ce3a8a9) Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Don Skidmore [Fri, 17 Feb 2012 07:38:13 +0000 (07:38 +0000)]
ixgbe: fix obvious return value bug.
This is clearly a typeo where we are not checking the return value from
get_link_capabilities but should. This patch corrects that.
(cherry picked from commit 9cdcf098800d9549b0bf1e759f8b456baabfb939) 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: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:50:20 +0000 (07:50 +0000)]
ixgbe: Replace eitr_low and eitr_high with static values in ixgbe_update_itr
There isn't much point in using variables to store the values of eitr_low
and eitr_high since they are not user changeable. As such I am replacing
them with the constants 10 and 20 in order to avoid any confusion on what
the values actually are.
(cherry picked from commit 621bd70eda47f33aa5f3a48da56649c0cb7e2329) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:50:14 +0000 (07:50 +0000)]
ixgbe: Do not disable read relaxed ordering when DCA is enabled
A previous fix had gone though and disabled relaxed ordering for Rx
descriptor read fetching. This was not necessary as this functions
correctly and has no ill effects on the system.
In addition several of the defines used for the DCA control registers were
incorrect in that they indicated descriptor effects when they actually had
an impact on either data or header write back. As such I have update these
to correctly reflect either DATA or HEAD.
(cherry picked from commit bdda1a61c1dbb1e3a4f76c944b7c1e3b3731c861) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:50:09 +0000 (07:50 +0000)]
ixgbe: Simplify logic for ethtool loopback frame creation and testing
This change makes it a bit easier to do the loopback frame creating and
testing. Previously we were doing an and to drop the last bit, and then
dividing the frame_size by 2 in order to get locations for frame bytes and
testing. Instead we can simplify it by just shifting the register one bit
to the right and using that for the frame offsets.
This change also replaces all instances of rx_buffer_info with just
rx_buffer since that is closer to the name of the actual structure being
used and can save a few extra characters.
In addition I have updated the logic for cleaning up a test frame so that
we pass an rx_buffer instead of the sk_buff. The main motivation behind
this is changes that will replace the sk_buff with just a page in the
future.
(cherry picked from commit 3832b26e49ad9e585239b32f763c31679f9e41fe) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:50:04 +0000 (07:50 +0000)]
ixgbe: Add iterator for cycling through rings on a q_vector
Since there are multiple spots where we have to cycle through all of the
rings on a q_vector it makes sense to just add a function for iterating
through all of them.
(cherry picked from commit a557928e26b08496c8f4b6c04e3838ad8048ad85) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:49:59 +0000 (07:49 +0000)]
ixgbe: Allocate rings as part of the q_vector
This patch makes the rings a part of the q_vector directly instead of
indirectly. Specifically on x86 systems this helps to avoid any cache
set conflicts between the q_vector, the tx_rings, and the rx_rings as the
critical stride is 4K and in order to cross that boundary you would need to
have over 15 rings on a single q_vector.
In addition this allows for smarter allocations when Flow Director is
enabled. Previously Flow Director would set the irq_affinity hints based
on the CPU and was still using a node interleaving approach which on some
systems would end up with the two values mismatched. With the new approach
we can set the affinity for the irq_vector and use the CPU for that
affinity to determine the node value for the node and the rings.
(cherry picked from commit de88eeeb16b164b615a5d71ad5fa0b7d51b14435) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:49:54 +0000 (07:49 +0000)]
ixgbe: Drop unnecessary napi_schedule_prep and spare blank line from ixgbe_intr
This patch is a minor cleanup to address the unnecessary use of
napi_schedule_prep in ixgbe_intr and to also remove a blank line that is
not needed since it is separating a comment from the line it is explaining.
(cherry picked from commit b9f6ed2bab0b087bdff870b7173f1d89efd96e54) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 10 Feb 2012 02:08:37 +0000 (02:08 +0000)]
ixgbe: Default to queue pairs when number of queues is less than CPUs
The old code had several errors in how it was determining the vector
budget. In order to simplify things this patch updates the code so that it
will attempt to always allocated paired Rx/Tx vectors instead of attempting
to allocate individual vectors when the number of queues is less than the
number of CPUs.
(cherry picked from commit 8f15486dd0f6e8423cb33fa8513ed9d074476471) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:49:43 +0000 (07:49 +0000)]
ixgbe: Correct Adaptive Interrupt Moderation so that it will change values
This change corrects an issue in which Adaptive Interrupt Moderation was
not changing values due to the fact that we were performing an and
operation on the resultant value that was causing the value to never change
from the default 20K interrupts per second.
(cherry picked from commit 5d967eb7f84d2761d624d033c2583187b37b56ce) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:49:38 +0000 (07:49 +0000)]
ixgbe: Address issues with Tx WHTRESH value not being set correctly
This change is meant to address the fact that the tx_itr_setting was
dropping to 0 when no separate Tx vectors were provided. This had resulted
in the driver incorrectly configuring the Tx ring with a WTHRESH of 1 in
order to avoid Tx hangs even though that was not necessary. This change
makes it so that we instead take a look at the Tx ring's q_vector to
determine if the ring will have an ITR value less than 8us.
(cherry picked from commit e954b374b4e42c5335679ec6d79ca2c50ce5d422) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Joe Jin [Thu, 17 May 2012 15:03:38 +0000 (23:03 +0800)]
ixgbe: Reorder adapter contents for better cache utilization
This change moves several frequently accessed items together into one cache
line in order to reduce cache misses in the hot-path.
(backported from commit 46646e61ea068b11758e8ffed3f4db300323dfc6) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:49:23 +0000 (07:49 +0000)]
ixgbe: Do no clear Tx status bits since eop_desc provides enough info
There isn't any need to clear the status bits in the descriptors due to the
fact that the eop_desc provides enough information for us to know
that we have cleaned to the last packet that the software has put on the
ring. The status bits are cleared as a part of putting the frame on the
ring so as long as we do not read the descriptor bit prior to reading the
value eop_desc we should be able to guarantee that we will not clean beyond
the end of the current data stream.
(cherry picked from commit 7f83a9e6292b49d1540f82f295ac8710ba562c5f) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Jeff Kirsher [Fri, 23 Sep 2011 15:34:38 +0000 (15:34 +0000)]
ixgbe: remove tie between NAPI work limits and interrupt moderation
As noted by Ben Hutchings and David Miller, work limits for NAPI
should not be tied to interrupt moderation parameters. This
should be handled by NAPI, possibly through sysfs.
Neil Horman & Stephen Hemminger are working on a solution for
NAPI currently. In the meantime, remove this tie between
work limits and interrupt moderation.
(cherry picked from commit 35551c47495a762fcfa5ca6217bf3eb36983d0df) Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> CC: Ben Hutchings <bhutchings@solarflare.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
John Fastabend [Fri, 10 Feb 2012 03:19:35 +0000 (03:19 +0000)]
ixgbe: dcb: check setup_tc return codes
dcb netlink code calls setup_tc to init hardware traffic classes
to use for DCB. At some call sites the return values are not
checked for errors and in one case may return -EINVAL back to
the net/dcbnl.c caller which is expecting a u8.
This fixes some smatch hits and although failures are never
seen in practive its best to check return codes.
Reported-by: Dan Carenter <dan.carpenter@oracle.com>
(cherry picked from commit 89d27a3c0ad7d5f2ce9ece055b3c7c619dc42f6c) 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> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Fri, 10 Feb 2012 02:08:32 +0000 (02:08 +0000)]
ixgbe: Fix comments that are out of date or formatted incorrectly
This patch corrects several comments that are either incorrect or formatted
incorrectly for multiline comments.
(cherry picked from commit 24ddd967806a5f0a7915721b7d60cac6f2cf5db9) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Don Skidmore [Tue, 28 Feb 2012 06:35:54 +0000 (06:35 +0000)]
ixgbe: fix spelling errors
Correct spelling error caught with codespell.py.
(cherry picked from commit c466d7a73360ed02167598a94984ab7b4dadfa68) Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Wed, 8 Feb 2012 07:49:33 +0000 (07:49 +0000)]
ixgbe: Minor formatting and comment corrections for ixgbe_xmit_frame_ring
This patch is meant to address several minor issues in
ixgbe_xmit_frame_ring. Specifically it adds a comment explaining the TXSW
flag, and correctly wraps a line over 80 characters.
(cherry picked from commit 9e0c5648d973cfe6bb037df3fdd08903c81bdc3e) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Tue, 31 Jan 2012 02:59:49 +0000 (02:59 +0000)]
ixgbe: Combine post-DMA processing of sk_buff fields into single function
This change combines a number of post-DMA Rx packet processing functions
into a single function. The advantage of this is that it combines most of
the Rx descriptor processing into one spot so it should all be warm in the
cache.
(cherry picked from commit 8a0da21be84019d605af2c9a92b20a084db77de1) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>
Alexander Duyck [Tue, 31 Jan 2012 02:59:44 +0000 (02:59 +0000)]
ixgbe: Drop the _ADV of descriptor macros since all ixgbe descriptors are ADV
It doesn't make much sense to differentiate between advanced and legacy
descriptors when the only descriptors that ixgbe uses are advanced
descriptors. As such we can drop the _ADV suffix since all ixgbe
descriptors are automatically advanced.
(cherry picked from commit e4f740287fbfdc7b68634e93c098c8ea8de691f1) Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Joe Jin <joe.jin@oracle.com>