Commit Graph

75116 Commits (ef2b90ee4dba7a3d9001f1f0003b860b39a4aaae)

Author SHA1 Message Date
Ben Hutchings ef2b90ee4d sfc: Move Falcon NIC operations to efx_nic_type
This is preparation for adding differing implementations for new NICs.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 16:46:27 -08:00
Ben Hutchings 4b0d29dcfc sfc: Turn pause frame generation on and off at the MAC, not the RX FIFO
Pause frame generation is gated by both RX_XOFF_MAC_EN and an enable
bit in each MAC.  RX_XOFF_MAC_EN bit always reads back as 0 so we need
to set it correctly every time we modify RX_CFG_REG.  Simplify this by
always setting it to 1 and only changing the enable bits in the MACs.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 16:46:26 -08:00
Ben Hutchings 674979d335 sfc: Remove duplicate hardware structure definitions
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 16:46:26 -08:00
Ben Hutchings 39e6021208 sfc: Remove redundant writes to INT_ADR_KER
This register only needs to be written after reset, not each time we
enable interrupts.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 16:46:25 -08:00
David S. Miller 9b963e5d0e Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/ieee802154/fakehard.c
	drivers/net/e1000e/ich8lan.c
	drivers/net/e1000e/phy.c
	drivers/net/netxen/netxen_nic_init.c
	drivers/net/wireless/ath/ath9k/main.c
2009-11-29 00:57:15 -08:00
PJ Waskiewicz 3b8626ba01 ixgbe: Display currently attached PHY through ethtool
This patch extends the ethtool interface to display what PHY
is currently connected to a NIC.  The results can be viewed in
ethtool ethX output.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 00:34:01 -08:00
Shannon Nelson 91152c3242 ixgbe: Fix Receive Address Register (RAR) cleaning and accounting
This fixes an issue when clearing out the RAR entries.  If RAR[0]
is the only address in use, don't clear the others.

Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 00:34:00 -08:00
Don Skidmore 000c486dda ixgbe: LINKS2 is not a valid register for 82598
82598 shouldn't try and access LINKS2 while configuring
link and flow control.  This is an 82599-only register.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 00:33:59 -08:00
PJ Waskiewicz 9bbe3a570b ixgbe: Disable Flow Control for certain devices
Flow Control autoneg should be disabled for certain adapters
that don't support autonegotiation of Flow Control at 10 gigabit.
These interfaces are the 10GBASE-T devices, CX4, and SFP+, all
running at 10 gigabit only.  1 gigabit is fine.

Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 00:33:58 -08:00
Shannon Nelson cfb3f91af4 ixgbe: handle parameters for tx and rx EITR, no div0
The driver was doing a divide by zero when adjusting tx-usecs.
This patch removes the divide by zero code and changes the logic slightly
to ignore tx-usecs in the case of shared TxRx vectors.

Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 00:33:58 -08:00
Kevin Hilman 9f950f72e5 NET: smc91x: convert to dev_pm_ops
Convert smc91x driver from legacy PM hooks over to using dev_pm_ops.

Tested on OMAP3 platform.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 00:21:29 -08:00
Ben Hutchings c1ac403bfa sfc: Clean up RX event handling
Add 'likely' hint to test of rx_checksum_enabled.
Don't count IP fragments; the IP stack can do that.
Do count non-matching multicast packets.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-29 00:01:21 -08:00
Ben Hutchings 0228f5cdb0 sfc: Move descriptor cache base addresses to struct efx_nic_type
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-28 23:58:55 -08:00
Ben Hutchings daeda6309e sfc: Decouple NIC revision number from Falcon PCI revision number
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-28 23:58:54 -08:00
Ben Hutchings 299f8d69f3 sfc: Remove some redundant whitespace
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-28 23:58:53 -08:00
Ben Hutchings 45d03e59b3 sfc: Remove another unused workaround macro
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-28 23:58:53 -08:00
Matthew Slattery 0589ece031 sfc: Remove EFX_WORKAROUND_9141 macro
The "bug9141 workaround" of setting TX_FLUSH_MIN_LEN_EN should really
be considered as a normal bit of configuration rather than a
workaround.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-28 23:58:52 -08:00
Ben Hutchings fb45f2c154 sfc: Limit some hardware workarounds to Falcon
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-28 23:58:52 -08:00
Steve Hodgson b895d73e98 sfc: Always start Falcon using the XMAC
The strap bits are only important on Falcon A and all production
boards using it have fixed-speed 10G PHYs.

Replace dummy MAC operations with default MAC operations.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-28 23:58:51 -08:00
Steve Hodgson ab86746175 sfc: Replace MDIO spinlock with mutex
We never use MDIO in atomic context, so we don't need to spin.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-28 23:58:51 -08:00
Steve Hodgson 47c3d19f60 sfc: QT202x: Reset before reading PHY id
Reading standard registers on the QT2025C before its firmware has
booted may cause the boot process to fail.  Therefore, follow the
recommended reset sequence before reading its id registers.  Either
order works for the QT2022C2, so don't differentiate.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-28 23:58:50 -08:00
Steve Hodgson fdaa9aed21 sfc: Simplify PHY polling
Falcon can generate events for LASI interrupts from the PHY, but in
practice we have never implemented this in reference designs.  Instead
we have polled, inserted the appropriate events, and then handled the
events later.  This is a waste of time and code.

Instead, make PHY poll functions update the link state synchronously
and report whether it changed.  We can still make use of the LASI
registers as a shortcut on the SFT9001.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-28 23:58:50 -08:00
Ben Hutchings cc83f6d692 sfc: Do not set net_device::trans_start in self-test
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:55 -08:00
Ben Hutchings f30eb23ea5 sfc: Move inline comment into kernel-doc
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:52 -08:00
Ben Hutchings 8be4f3e6f7 sfc: Change MAC promiscuity and multicast hash at the same time
From: Steve Hodgson <shodgson@solarflare.com>

Currently we can set multicast hash immediately (in atomic context)
but must delay setting MAC promiscuity.  There is not that much
point in deferring one but not the other, and setting the multicast
hash on Siena will involve a firmware request.  So process them
both in efx_mac_work().

Also, set the broadcast bit in the multicast hash in
efx_set_multicast_list(), since this is required for both Falcon and
Siena.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:49 -08:00
Ben Hutchings 9007b9fa36 sfc: Simplify XMAC link polling
From: Steve Hodgson <shodgson@solarflare.com>

Only the XMAC on Falcon needs help from the driver to poll and reset
the MAC-PHY link (XAUI); GMII is a simple parallel bus and on later
NICs firmware takes care of the XAUI link.  Also, an XMAC interrupt
currently schedules a work item which simply clears a flag
(efx_nic::mac_up) to be checked by the regular monitor (or the next
link reconfiguration, if that is sooner).

Rename the flag to xmac_poll_required, changing its sense.  Remove the
needless indirection and just set the flag immediately.  Call
falcon_xmac_poll() directly where required.

Add a new generic operation mac_op::check_fault to check the link
outside of regular monitoring, as required during self-tests.

(Note that this leaves us with an unused work item, but we will
immediately have another use for it.)

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:43 -08:00
Ben Hutchings fe75820b99 sfc: Move Falcon board/PHY/MAC monitoring code to falcon.c
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:40 -08:00
Ben Hutchings 55edc6e6ff sfc: Split MAC stats DMA initiation and completion
From: Steve Hodgson <shodgson@solarflare.com>

Currently we initiate MAC stats DMA and busy-wait for completion when
stats are requested.  We can improve on this with a periodic timer to
initiate and poll for stats, and opportunistically poll when stats are
requested.

Since efx_nic::stats_disable_count and efx_stats_{disable,enable}()
are Falcon-specific, rename them and move them accordingly.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:36 -08:00
Ben Hutchings 1dfc5ceacd sfc: Hold MAC lock for longer in efx_init_port()
Although efx_init_port() is only called at probe time and so cannot
race with port reconfiguration, most of the functions it calls can
expect to be called with the MAC lock held.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:32 -08:00
Steve Hodgson 26deba5013 sfc: Only switch Falcon MAC clocks as necessary
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:28 -08:00
Ben Hutchings 1338344a84 sfc: Remove unused function efx_flush_queues()
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:23 -08:00
Ben Hutchings 127e6e10ad sfc: Fix bugs in RX queue flushing
Avoid overrunning the hardware limit of 4 concurrent RX queue flushes.
Expand the queue flush state to support this.  Make similar changes to
TX flushing to keep the code symmetric.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:19 -08:00
Ben Hutchings 44838a447d sfc: Clean up struct falcon_board and struct falcon_board_data
Put all static information in struct falcon_board_type and replace it
with a pointer in struct falcon_board.  Simplify probing aocordingly.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:16 -08:00
Ben Hutchings 734a350a6c sfc: Remove unused constant
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:11 -08:00
Ben Hutchings 8986352a32 sfc: Comment corrections
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:07 -08:00
Ben Hutchings 332c1ce9e7 sfc: Strengthen EFX_ASSERT_RESET_SERIALISED
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:04 -08:00
Ben Hutchings 80cb9a0f7f sfc: Treat all MAC registers as 128-bit
Although all the defined fields in these registers are within 32 bits,
they are architecturally defined as 128-bit like most other Falcon
registers.  In particular, we must use efx_reado() to ensure proper
locking when reading MD_STAT_REG.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:59:00 -08:00
Ben Hutchings 46e1ac0f42 sfc: Fix descriptor cache sizes
These were accidentally undersized by a factor of 2, which limited
performance.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:58:57 -08:00
Arnd Bergmann 27c0b1a850 macvlan: export macvlan mode through netlink
In order to support all three modes of macvlan at
runtime, extend the existing netlink protocol
to allow choosing the mode per macvlan slave
interface.

This depends on a matching patch to iproute2
in order to become accessible in user land.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:53:10 -08:00
Arnd Bergmann 618e1b7482 macvlan: implement bridge, VEPA and private mode
This allows each macvlan slave device to be in one
of three modes, depending on the use case:

MACVLAN_PRIVATE:
  The device never communicates with any other device
  on the same upper_dev. This even includes frames
  coming back from a reflective relay, where supported
  by the adjacent bridge.

MACVLAN_VEPA:
  The new Virtual Ethernet Port Aggregator (VEPA) mode,
  we assume that the adjacent bridge returns all frames
  where both source and destination are local to the
  macvlan port, i.e. the bridge is set up as a reflective
  relay.
  Broadcast frames coming in from the upper_dev get
  flooded to all macvlan interfaces in VEPA mode.
  We never deliver any frames locally.

MACVLAN_BRIDGE:
  We provide the behavior of a simple bridge between
  different macvlan interfaces on the same port. Frames
  from one interface to another one get delivered directly
  and are not sent out externally. Broadcast frames get
  flooded to all other bridge ports and to the external
  interface, but when they come back from a reflective
  relay, we don't deliver them again.
  Since we know all the MAC addresses, the macvlan bridge
  mode does not require learning or STP like the bridge
  module does.

Based on an earlier patch "macvlan: Reflect macvlan packets
meant for other macvlan devices" by Eric Biederman.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Patrick McHardy <kaber@trash.net>
Cc: Eric Biederman <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:53:07 -08:00
Arnd Bergmann a1e514c5d0 macvlan: cleanup rx statistics
We have very similar code for rx statistics in
two places in the macvlan driver, with a third
one being added in the next patch.

Consolidate them into one function to improve
overall readability of the driver.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:53:02 -08:00
Arnd Bergmann 445409602c veth: move loopback logic to common location
The veth driver contains code to forward an skb
from the start_xmit function of one network
device into the receive path of another device.

Moving that code into a common location lets us
reuse the code for direct forwarding of data
between macvlan ports, and possibly in other
drivers.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:52:58 -08:00
Simon Kagstrom 1bda8aa86b via-velocity: Bump version
Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:51:29 -08:00
Simon Kagstrom b06f78f4d0 via-velocity: Set tx checksum from ethtool instead of module parameter
Defaults to on (as before).

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:51:25 -08:00
Simon Kagstrom c79992fdde via-velocity: Re-enable transmit scatter-gather support
The velocity hardware can handle up to 7 memory segments. This can be
turned on and off via ethtool. The support was removed in commit

  83c98a8cd0

but is re-enabled and cleaned up here. It's off by default.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:51:22 -08:00
Simon Kagstrom 2a5774f7d8 via-velocity: Change DMA_LENGTH_DEF (from the VIA driver)
The VIA driver has changed the default for the DMA_LENGTH_DEF parameter.
Together with adaptive interrupt supression and NAPI support, this
improves performance quite a bit

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:51:18 -08:00
Simon Kagstrom dfff7144b1 via-velocity: Implement NAPI support
This patch adds NAPI support for VIA velocity. The new velocity_poll
function also pairs tx/rx handling twice which improves perforamance on
some workloads (e.g., netperf UDP_STREAM) significantly (that part is
from the VIA driver).

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:51:15 -08:00
Simon Kagstrom 6dfc4b95b2 via-velocity: Add ethtool interrupt coalescing support
(Partially from the upstream VIA driver). Tweaking the number of
frames-per-interrupt and timer-until-interrupt can reduce the amount of
CPU work quite a lot.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:51:10 -08:00
Simon Kagstrom da95b2d422 via-velocity: Correct 64-byte alignment for rx buffers
(From the VIA driver). The current code does not guarantee 64-byte
alignment since it simply does

        int add = skb->data & 63;

        skb->data += add;

(via skb_reserve). So for example, if the skb->data address would be
0x10, this would result in 32-byte alignment (0x10 + 0x10).

Correct by adding

        64 - (skb->data & 63)

instead.

Signed-off-by: Simon Kagstrom <simon.kagstrom@netinsight.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-26 15:51:06 -08:00
Alexey Dobriyan 350f75960c r8169: move PHY regs tables to .rodata
As side effect, consume less stack.

	-rtl8169_get_mac_version [vmlinux]:	432
	-rtl8169_init_one [vmlinux]:		376
	+rtl8169_init_one [vmlinux]:		136

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-25 15:54:21 -08:00