linux-2.6
15 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Thu, 30 Apr 2009 03:30:35 +0000 (20:30 -0700)] 
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:
Documentation/isdn/00-INDEX
drivers/net/wireless/iwlwifi/iwl-scan.c
drivers/net/wireless/rndis_wlan.c
net/mac80211/main.c

15 years agoRevert "vxge: use max() instead of VXGE_HW_SET_LEVEL"
David S. Miller [Thu, 30 Apr 2009 00:53:20 +0000 (17:53 -0700)] 
Revert "vxge: use max() instead of VXGE_HW_SET_LEVEL"

This reverts commit 011983048a120e520147361be1067dd82343038e.

Causes warnings in the build as reported by Stephen Rothwell.
So this change is worse than what it's curing.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomii: Rewrite mii_ethtool_gset() to report mdio_support and lp_advertising
Ben Hutchings [Wed, 29 Apr 2009 08:34:44 +0000 (08:34 +0000)] 
mii: Rewrite mii_ethtool_gset() to report mdio_support and lp_advertising

Ignore link partner advertising flags while AN is not complete.

Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoethtool/mdio: Support backplane mode negotiation
Ben Hutchings [Wed, 29 Apr 2009 08:25:57 +0000 (08:25 +0000)] 
ethtool/mdio: Support backplane mode negotiation

Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoethtool/mdio: Report MDIO mode support and link partner advertising
Ben Hutchings [Wed, 29 Apr 2009 08:21:53 +0000 (08:21 +0000)] 
ethtool/mdio: Report MDIO mode support and link partner advertising

Add mdio_support and lp_advertising fields to ethtool_cmd.  Set these
in mdio45_ethtool_gset{,_npage}().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Use generic MDIO flow control auto-negotiation functions
Ben Hutchings [Wed, 29 Apr 2009 08:20:37 +0000 (08:20 +0000)] 
sfc: Use generic MDIO flow control auto-negotiation functions

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomdio: Add mdio45_ethtool_spauseparam_an()
Ben Hutchings [Wed, 29 Apr 2009 08:19:36 +0000 (08:19 +0000)] 
mdio: Add mdio45_ethtool_spauseparam_an()

This implements the ETHTOOL_SPAUSEPARAM operation for MDIO (clause 45)
PHYs with auto-negotiation MMDs.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomii: Add mii_advertise_flowctrl()
Ben Hutchings [Wed, 29 Apr 2009 08:19:03 +0000 (08:19 +0000)] 
mii: Add mii_advertise_flowctrl()

This converts flow control capabilites to an advertising mask and can
be useful in combination with mii_resolve_flowctrl_fdx().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomii: Simplify mii_resolve_flowctrl_fdx()
Ben Hutchings [Wed, 29 Apr 2009 08:15:05 +0000 (08:15 +0000)] 
mii: Simplify mii_resolve_flowctrl_fdx()

This is a shorter and more comprehensible formulation of the
conditions for each flow control mode.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agos2io: Use generic MDIO definitions
Ben Hutchings [Wed, 29 Apr 2009 08:13:29 +0000 (08:13 +0000)] 
s2io: Use generic MDIO definitions

Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgb: Use generic MDIO definitions
Ben Hutchings [Wed, 29 Apr 2009 08:11:05 +0000 (08:11 +0000)] 
ixgb: Use generic MDIO definitions

Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Use generic MDIO definitions and functions
Ben Hutchings [Wed, 29 Apr 2009 08:08:58 +0000 (08:08 +0000)] 
ixgbe: Use generic MDIO definitions and functions

Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxgb3: Use generic MDIO definitions and mdio_mii_ioctl()
Ben Hutchings [Wed, 29 Apr 2009 08:07:20 +0000 (08:07 +0000)] 
cxgb3: Use generic MDIO definitions and mdio_mii_ioctl()

Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agochelsio: Use generic MDIO definitions and mdio_mii_ioctl()
Ben Hutchings [Wed, 29 Apr 2009 08:06:34 +0000 (08:06 +0000)] 
chelsio: Use generic MDIO definitions and mdio_mii_ioctl()

Compile-tested only.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosfc: Use generic MDIO functions and definitions
Ben Hutchings [Wed, 29 Apr 2009 08:05:08 +0000 (08:05 +0000)] 
sfc: Use generic MDIO functions and definitions

Make use of the newly-added generic MDIO clause 45 support and remove
redundant definitions.

Add an 'efx_' prefix to the remaining driver-specific MDIO functions
and remove arguments which are redundant with efx->mdio.prtad.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomdio: Add generic MDIO (clause 45) support functions
Ben Hutchings [Wed, 29 Apr 2009 08:04:46 +0000 (08:04 +0000)] 
mdio: Add generic MDIO (clause 45) support functions

These roughly mirror many of the MII library functions and are based
on code from the sfc driver.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomdio: Add register definitions for MDIO (clause 45)
Ben Hutchings [Wed, 29 Apr 2009 08:04:14 +0000 (08:04 +0000)] 
mdio: Add register definitions for MDIO (clause 45)

IEEE 802.3 clause 45 specifies the MDIO interface and registers for
use in 10G and other PHYs, similar to the MII management interface.

PHYs may have up to 32 MMDs corresponding to different sub-layers and
functions, each with up to 65536 registers.  These are addressed by
PRTAD (similar to the MII PHY address) and DEVAD.  Define a mapping
for specifying PRTAD and DEVAD through the existing MII ioctls.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoethtool: Add port type PORT_OTHER
Ben Hutchings [Wed, 29 Apr 2009 08:02:59 +0000 (08:02 +0000)] 
ethtool: Add port type PORT_OTHER

Add a PORT_OTHER to represent all other physical port types.  Current
NICs generally do not allow switching between multiple port types in
software so specific types should not be needed.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomv643xx_eth: 64bit mib counter read fix
Lennert Buytenhek [Wed, 29 Apr 2009 11:58:18 +0000 (11:58 +0000)] 
mv643xx_eth: 64bit mib counter read fix

On several mv643xx_eth hardware versions, the two 64bit mib counters
for 'good octets received' and 'good octets sent' are actually 32bit
counters, and reading from the upper half of the register has the same
effect as reading from the lower half of the register: an atomic
read-and-clear of the entire 32bit counter value.  This can under heavy
traffic occasionally lead to small numbers being added to the upper
half of the 64bit mib counter even though no 32bit wrap has occured.

Since we poll the mib counters at least every 30 seconds anyway, we
might as well just skip the reads of the upper halves of the hardware
counters without breaking the stats, which this patch does.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Cc: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomv643xx_eth: OOM handling fixes
Lennert Buytenhek [Wed, 29 Apr 2009 11:57:34 +0000 (11:57 +0000)] 
mv643xx_eth: OOM handling fixes

Currently, when OOM occurs during rx ring refill, mv643xx_eth will get
into an infinite loop, due to the refill function setting the OOM bit
but not clearing the 'rx refill needed' bit for this queue, while the
calling function (the NAPI poll handler) will call the refill function
in a loop until the 'rx refill needed' bit goes off, without checking
the OOM bit.

This patch fixes this by checking the OOM bit in the NAPI poll handler
before attempting to do rx refill.  This means that once OOM occurs,
we won't try to do any memory allocations again until the next invocation
of the poll handler.

While we're at it, change the OOM flag to be a single bit instead of
one bit per receive queue since OOM is a system state rather than a
per-queue state, and cancel the OOM timer on entry to the NAPI poll
handler if it's running to prevent it from firing when we've already
come out of OOM.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Cc: stable@kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopcnet32: Remove pointless memory barriers
John Dykstra [Thu, 30 Apr 2009 00:22:30 +0000 (17:22 -0700)] 
pcnet32: Remove pointless memory barriers

These two memory barriers in performance-critical paths are not needed
on x86.  Even if some other architecture does buffer PCI I/O space
writes, the existing memory-mapped I/O barriers are unlikely to be what
is needed.

Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
Acked-by: Don Fry <pcnet32@verizon.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Wed, 29 Apr 2009 22:52:56 +0000 (15:52 -0700)] 
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

15 years agomac80211: default to automatic power control
Johannes Berg [Tue, 28 Apr 2009 22:28:18 +0000 (00:28 +0200)] 
mac80211: default to automatic power control

In "mac80211: correct wext transmit power handler"
I fixed the wext handler, but forgot to make the default of the
user_power_level -1 (aka "auto"), so that now the transmit power
is always set to 0, causing associations to time out and similar
problems since we're transmitting with very little power. Correct
this by correcting the default user_power_level to -1.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Bisected-by: Niel Lambrechts <niel.lambrechts@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agomac80211: fix modprobe deadlock by not calling wep_init under rtnl_lock
Alan Jenkins [Wed, 29 Apr 2009 10:41:24 +0000 (11:41 +0100)] 
mac80211: fix modprobe deadlock by not calling wep_init under rtnl_lock

- ieee80211_wep_init(), which is called with rtnl_lock held, blocks in
   request_module() [waiting for modprobe to load a crypto module].

 - modprobe blocks in a call to flush_workqueue(), when it closes a TTY
   [presumably when it exits].

 - The workqueue item linkwatch_event() blocks on rtnl_lock.

There's no reason for wep_init() to be called with rtnl_lock held, so
just move it outside the critical section.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoixgbe: Use pci_wake_from_d3() instead of multiple pci_enable_wake()
Don Skidmore [Wed, 29 Apr 2009 07:22:31 +0000 (00:22 -0700)] 
ixgbe: Use pci_wake_from_d3() instead of multiple pci_enable_wake()

We were calling pci_enable_wake() twice in a row for both D3_hot
and D3_cold.  This replaces those calls with a call to pci_wake_from_d3()
to avoid issues with PCI PM vs ordering constraints.

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>
15 years agonetxen: fix firmware download
Dhananjay Phadke [Tue, 28 Apr 2009 15:29:11 +0000 (15:29 +0000)] 
netxen: fix firmware download

o hold the firmware in memory across suspend, since filesystem
  may not be up after resuming.
o reset the chip after requesting firmware, to minimize downtime
  for NC-SI.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: refactor netxen_recv_context struct
Dhananjay Phadke [Tue, 28 Apr 2009 15:29:10 +0000 (15:29 +0000)] 
netxen: refactor netxen_recv_context struct

o move related fields into netxen_recv_context struct.
o allocate rx buffer and descriptor rings dynamically.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetxen: fix link event handling
Dhananjay Phadke [Tue, 28 Apr 2009 15:29:09 +0000 (15:29 +0000)] 
netxen: fix link event handling

Firmware starting 4.0.402 started supporting link events, disable
it for older firmwares.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoe100: do not go D3 in shutdown unless system is powering off
Thadeu Lima de Souza Cascardo [Wed, 29 Apr 2009 05:42:39 +0000 (22:42 -0700)] 
e100: do not go D3 in shutdown unless system is powering off

After experimenting with kexec with the last merges after 2.6.29, I've
had some problems when probing e100.  It would not read the eeprom.  After
some bisects, I realized this has been like that since forever (at least
2.6.18).  The problem is that shutdown is doing the same thing that
suspend does and puts the device in D3 state.  I couldn't find a way to
get the device back to a sane state in the probe function.  So, based on
some similar patches from Rafael J. Wysocki for e1000, e1000e, and ixgbe,
I wrote this one for e100.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluet...
David S. Miller [Wed, 29 Apr 2009 05:40:49 +0000 (22:40 -0700)] 
Merge branch 'master' of git://git./linux/kernel/git/holtmann/bluetooth-2.6

15 years agonetfilter: revised locking for x_tables
Stephen Hemminger [Wed, 29 Apr 2009 05:36:33 +0000 (22:36 -0700)] 
netfilter: revised locking for x_tables

The x_tables are organized with a table structure and a per-cpu copies
of the counters and rules. On older kernels there was a reader/writer
lock per table which was a performance bottleneck. In 2.6.30-rc, this
was converted to use RCU and the counters/rules which solved the performance
problems for do_table but made replacing rules much slower because of
the necessary RCU grace period.

This version uses a per-cpu set of spinlocks and counters to allow to
table processing to proceed without the cache thrashing of a global
reader lock and keeps the same performance for table updates.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoath5k: fix buffer overrun in rate debug code
Bob Copeland [Tue, 28 Apr 2009 02:12:43 +0000 (22:12 -0400)] 
ath5k: fix buffer overrun in rate debug code

char bname[5] is too small for the string "X GHz" when the null
terminator is taken into account.  Thus, turning on rate debugging
can crash unless we have lucky stack alignment.

Cc: stable@kernel.org
Reported-by: Paride Legovini <legovini@spiro.fisica.unipd.it>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoiwlwifi: notify on scan completion even when shutting down
Johannes Berg [Thu, 23 Apr 2009 08:45:04 +0000 (10:45 +0200)] 
iwlwifi: notify on scan completion even when shutting down

Under certain circumstances iwlwifi can get stuck and will no
longer accept scan requests, because the core code (cfg80211)
thinks that it's still processing one. This fixes one of the
points where it can happen, but I've still seen it (although
only with my radio-off-when-idle patch).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agorndis_wlan: fix initialization order for workqueue&workers
Jussi Kivilinna [Wed, 22 Apr 2009 07:59:37 +0000 (10:59 +0300)] 
rndis_wlan: fix initialization order for workqueue&workers

rndis_wext_link_change() might be called from rndis_command() at
initialization stage and priv->workqueue/priv->work have not been
initialized yet. This causes invalid opcode at rndis_wext_bind on
some brands of bcm4320.

Fix by initializing workqueue/workers in rndis_wext_bind() before
rndis_command is used.

This bug has existed since 2.6.25, reported at:
http://bugzilla.kernel.org/show_bug.cgi?id=12794

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agowireless: remove unneeded EXPORT_SYMBOL the tickles a powerpc compiler bug
Stephen Rothwell [Wed, 22 Apr 2009 05:11:05 +0000 (15:11 +1000)] 
wireless: remove unneeded EXPORT_SYMBOL the tickles a powerpc compiler bug

drivers/net/wireless/iwlwifi/iwl3945-base.c:1415: error: __ksymtab_iwl3945_rx_queue_reset causes a section type conflict

I am pretty sure that this is a compiler bug, so not to worry.  However,
as far as I can see, iwl-3945.o (the only user) and iwl3945-base.o are
always linked into the same module, so the EXPORT_SYMBOL (which causes
the problem) should not be needed.  Correct?

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15 years agoBluetooth: Fix connection establishment with low security requirement
Marcel Holtmann [Tue, 28 Apr 2009 16:04:55 +0000 (09:04 -0700)] 
Bluetooth: Fix connection establishment with low security requirement

The Bluetooth 2.1 specification introduced four different security modes
that can be mapped using Legacy Pairing and Simple Pairing. With the
usage of Simple Pairing it is required that all connections (except
the ones for SDP) are encrypted. So even the low security requirement
mandates an encrypted connection when using Simple Pairing. When using
Legacy Pairing (for Bluetooth 2.0 devices and older) this is not required
since it causes interoperability issues.

To support this properly the low security requirement translates into
different host controller transactions depending if Simple Pairing is
supported or not. However in case of Simple Pairing the command to
switch on encryption after a successful authentication is not triggered
for the low security mode. This patch fixes this and actually makes
the logic to differentiate between Simple Pairing and Legacy Pairing
a lot simpler.

Based on a report by Ville Tervo <ville.tervo@nokia.com>

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
15 years agoBluetooth: Add different pairing timeout for Legacy Pairing
Marcel Holtmann [Sun, 26 Apr 2009 18:01:22 +0000 (20:01 +0200)] 
Bluetooth: Add different pairing timeout for Legacy Pairing

The Bluetooth stack uses a reference counting for all established ACL
links and if no user (L2CAP connection) is present, the link will be
terminated to save power. The problem part is the dedicated pairing
when using Legacy Pairing (Bluetooth 2.0 and before). At that point
no user is present and pairing attempts will be disconnected within
10 seconds or less. In previous kernel version this was not a problem
since the disconnect timeout wasn't triggered on incoming connections
for the first time. However this caused issues with broken host stacks
that kept the connections around after dedicated pairing. When the
support for Simple Pairing got added, the link establishment procedure
needed to be changed and now causes issues when using Legacy Pairing

When using Simple Pairing it is possible to do a proper reference
counting of ACL link users. With Legacy Pairing this is not possible
since the specification is unclear in some areas and too many broken
Bluetooth devices have already been deployed. So instead of trying to
deal with all the broken devices, a special pairing timeout will be
introduced that increases the timeout to 60 seconds when pairing is
triggered.

If a broken devices now puts the stack into an unforeseen state, the
worst that happens is the disconnect timeout triggers after 120 seconds
instead of 4 seconds. This allows successful pairings with legacy and
broken devices now.

Based on a report by Johan Hedberg <johan.hedberg@nokia.com>

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
15 years agoBluetooth: Ensure that HCI sysfs add/del is preempt safe
Roger Quadros [Thu, 23 Apr 2009 11:50:54 +0000 (14:50 +0300)] 
Bluetooth: Ensure that HCI sysfs add/del is preempt safe

Use a different work_struct variables for add_conn() and del_conn() and
use single work queue instead of two for adding and deleting connections.

It eliminates the following error on a preemptible kernel:

[  204.358032] Unable to handle kernel NULL pointer dereference at virtual address 0000000c
[  204.370697] pgd = c0004000
[  204.373443] [0000000c] *pgd=00000000
[  204.378601] Internal error: Oops: 17 [#1] PREEMPT
[  204.383361] Modules linked in: vfat fat rfcomm sco l2cap sd_mod scsi_mod iphb pvr2d drm omaplfb ps
[  204.438537] CPU: 0    Not tainted  (2.6.28-maemo2 #1)
[  204.443664] PC is at klist_put+0x2c/0xb4
[  204.447601] LR is at klist_put+0x18/0xb4
[  204.451568] pc : [<c0270f08>]    lr : [<c0270ef4>]    psr: a0000113
[  204.451568] sp : cf1b3f10  ip : cf1b3f10  fp : cf1b3f2c
[  204.463104] r10: 00000000  r9 : 00000000  r8 : bf08029c
[  204.468353] r7 : c7869200  r6 : cfbe2690  r5 : c78692c8  r4 : 00000001
[  204.474945] r3 : 00000001  r2 : cf1b2000  r1 : 00000001  r0 : 00000000
[  204.481506] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM Segment kernel
[  204.488861] Control: 10c5387d  Table: 887fc018  DAC: 00000017
[  204.494628] Process btdelconn (pid: 515, stack limit = 0xcf1b22e0)

Signed-off-by: Roger Quadros <ext-roger.quadros@nokia.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
15 years agogianfar: Use memset instead of cacheable_memzero
Kumar Gala [Tue, 28 Apr 2009 15:04:10 +0000 (08:04 -0700)] 
gianfar: Use memset instead of cacheable_memzero

cacheable_memzero() is completely overkill for the clearing out the FCB
block which is only 8-bytes.  The compiler should easily optimize this
with memset.  Additionally, cacheable_memzero() only exists on ppc32 and
thus breaks builds of gianfar on ppc64.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoinet_diag: Remove dup assignments
Arnaldo Carvalho de Melo [Tue, 28 Apr 2009 15:03:26 +0000 (08:03 -0700)] 
inet_diag: Remove dup assignments

These are later assigned to other values without being used meanwhile.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: netif_tx_queue_stopped too expensive
Eric Dumazet [Tue, 28 Apr 2009 11:43:42 +0000 (04:43 -0700)] 
net: netif_tx_queue_stopped too expensive

netif_tx_queue_stopped(txq) is most of the time false.

Yet its cost is very expensive on SMP.

static inline int netif_tx_queue_stopped(const struct netdev_queue *dev_queue)
{
return test_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
}

I saw this on oprofile hunting and bnx2 driver bnx2_tx_int().

We probably should split "struct netdev_queue" in two parts, one
being read mostly.

__netif_tx_lock() touches _xmit_lock & xmit_lock_owner, these
deserve a separate cache line.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Avoid extra wakeups of threads blocked in wait_for_packet()
Eric Dumazet [Tue, 28 Apr 2009 09:24:21 +0000 (02:24 -0700)] 
net: Avoid extra wakeups of threads blocked in wait_for_packet()

In 2.6.25 we added UDP mem accounting.

This unfortunatly added a penalty when a frame is transmitted, since
we have at TX completion time to call sock_wfree() to perform necessary
memory accounting. This calls sock_def_write_space() and utimately
scheduler if any thread is waiting on the socket.
Thread(s) waiting for an incoming frame was scheduled, then had to sleep
again as event was meaningless.

(All threads waiting on a socket are using same sk_sleep anchor)

This adds lot of extra wakeups and increases latencies, as noted
by Christoph Lameter, and slows down softirq handler.

Reference : http://marc.info/?l=linux-netdev&m=124060437012283&w=2

Fortunatly, Davide Libenzi recently added concept of keyed wakeups
into kernel, and particularly for sockets (see commit
37e5540b3c9d838eb20f2ca8ea2eb8072271e403
epoll keyed wakeups: make sockets use keyed wakeups)

Davide goal was to optimize epoll, but this new wakeup infrastructure
can help non epoll users as well, if they care to setup an appropriate
handler.

This patch introduces new DEFINE_WAIT_FUNC() helper and uses it
in wait_for_packet(), so that only relevant event can wakeup a thread
blocked in this function.

Trace of function calls from bnx2 TX completion bnx2_poll_work() is :
__kfree_skb()
 skb_release_head_state()
  sock_wfree()
   sock_def_write_space()
    __wake_up_sync_key()
     __wake_up_common()
      receiver_wake_function() : Stops here since thread is waiting for an INPUT

Reported-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Fix ucc_geth.c handling of fixed-link w/o phy-connection-type property.
Grant Likely [Tue, 28 Apr 2009 09:11:53 +0000 (02:11 -0700)] 
net: Fix ucc_geth.c handling of fixed-link w/o phy-connection-type property.

Previous rework to ucc_geth.c to add of_mdio support (net: Rework
ucc_geth driver to use of_mdio infrastructure) added a block of
code which broke older openfirmware device trees which this case.

This patch removes the offending blurb.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agofs_enet: Remove dead code
Kumar Gala [Tue, 28 Apr 2009 09:05:21 +0000 (02:05 -0700)] 
fs_enet: Remove dead code

CONFIG_DUET doesn't exist anymore, remove all the code that exists to
support it.

[ Simplify fs_init() even further -DaveM ]

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Clear out stray tx work on link down
Nelson, Shannon [Mon, 27 Apr 2009 22:43:12 +0000 (22:43 +0000)] 
ixgbe: Clear out stray tx work on link down

Ayyappan at VMware noticed that we're missing this check from ixgbe which
is in our other drivers.  The difference with this implementation from our
other drivers is that this checks all the tx queues rather than just tx[0].

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>
15 years agoixgbe: Interrupt management update for 82599
Nelson, Shannon [Mon, 27 Apr 2009 22:42:54 +0000 (22:42 +0000)] 
ixgbe: Interrupt management update for 82599

Update the interrupt management to correctly handle greater
than 16 queue vectors.

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>
15 years agoixgbe: enable HW RSC for 82599
Alexander Duyck [Mon, 27 Apr 2009 22:42:37 +0000 (22:42 +0000)] 
ixgbe: enable HW RSC for 82599

This patch enables hardware receive side coalescing for 82599 hardware.
82599 can merge multiple frames from the same TCP/IP flow into a single
structure that can span one ore more descriptors.  The accumulated data is
arranged similar to how jumbo frames are arranged with the exception that
other packets can be interlaced inbetween.  To overcome this issue a next
pointer is included in the written back descriptor which indicates the next
descriptor in the writeback sequence.

This feature sets the NETIF_F_LRO flag and clearing it via the ethtool set
flags operation will also disable hardware RSC.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: enable hardware offload for sctp
Jesse Brandeburg [Mon, 27 Apr 2009 22:36:35 +0000 (22:36 +0000)] 
ixgbe: enable hardware offload for sctp

Inspired by: Vlad Yasevich <vladislav.yasevich@hp.com>

This is the code to enable ixgbe for hardware offload support
of CRC32c on both transmit and receive of SCTP traffic.

only 82599 supports this offload, not 82598.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: Enable SCTP checksum offloading
Jesse Brandeburg [Mon, 27 Apr 2009 22:36:13 +0000 (22:36 +0000)] 
igb: Enable SCTP checksum offloading

Originally from: Vlad Yasevich <vladislav.yasevich@hp.com>

This patch, both the driver portion and the sctp code was
modified by Jesse Brandeburg and is

Copyright(c) 2009 Intel Corporation.

Thanks go to Vlad for starting this work.

Intel 82576 chipset supports SCTP checksum offloading.  This
patch enables this functionality in the driver.  A new NETIF
feature is introduced for SCTP checksum offload.  If the driver
supports CRC32c checksum, it can set this feature flag.  The
hardware can offload both transmit and receive.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosctp: add feature bit for SCTP offload in hardware
Jesse Brandeburg [Mon, 27 Apr 2009 22:35:52 +0000 (22:35 +0000)] 
sctp: add feature bit for SCTP offload in hardware

this is the sctp code to enable hardware crc32c offload for
adapters that support it.

Originally by: Vlad Yasevich <vladislav.yasevich@hp.com>

modified by Jesse Brandeburg <jesse.brandeburg@intel.com>

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb/ixgbe: remove unecessary checks for CHECKSUM_UNNECESSARY
Alexander Duyck [Mon, 27 Apr 2009 22:35:33 +0000 (22:35 +0000)] 
igb/ixgbe: remove unecessary checks for CHECKSUM_UNNECESSARY

Both of these drivers do a check to verify ip_summed is set to
CHECKSUM_UNNECESSARY prior to passing the packet to GRO.  GRO itself
already does such a check so it is redundant and can be removed as this
will likely cause out of order issues when receiving a packet that didn't
pass checksum validation.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: make rxcsum configuration seperate from multiqueue
Alexander Duyck [Mon, 27 Apr 2009 22:35:14 +0000 (22:35 +0000)] 
igb: make rxcsum configuration seperate from multiqueue

The igb driver was being incorrectly setup to only allow disabling receive
checksum if multiqueue was disabled.  This change corrects that so that
RXCSUM is configured regardless of queue configuration.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoigb: reconfigure mailbox timeout logic
Alexander Duyck [Mon, 27 Apr 2009 22:34:54 +0000 (22:34 +0000)] 
igb: reconfigure mailbox timeout logic

This change updates the timeout logic so that it is not possible to have a
sucessful check for message and still return an error if countdown = 0.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Reported-by: Juha Leppanen <juha_motorsportscom@luukku.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc911x: add fifo byteswap support V2
Magnus Damm [Mon, 27 Apr 2009 21:32:16 +0000 (21:32 +0000)] 
smsc911x: add fifo byteswap support V2

This is V2 of the smsc911x fifo byteswap patch.

The smsc911x hardware supports both big and little and endian
hardware configurations, and the linux smsc911x driver currently
detects word order.

For correct operation on big endian platforms lacking swapped
byte lanes the following patch is needed. Only fifo data is
swapped, register data does not require any swapping.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoatl1c: disable L1/L0s when link detected
Jie Yang [Mon, 27 Apr 2009 19:42:03 +0000 (19:42 +0000)] 
atl1c: disable L1/L0s when link detected

Disable L1/L0s when link detected. We enable L1/L0s when link connected
before, but there is some hareware error on some platform. So just diable
this feature when link connected. This feature is about power saving.

Signed-off-by: Jie Yang <jie.yang@atheros.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Fix typo in net_device_ops description.
Mike Rapoport [Mon, 27 Apr 2009 12:45:54 +0000 (05:45 -0700)] 
net: Fix typo in net_device_ops description.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogro: Fix COMPLETE checksum handling
Herbert Xu [Mon, 27 Apr 2009 12:44:45 +0000 (05:44 -0700)] 
gro: Fix COMPLETE checksum handling

On a brand new GRO skb, we cannot call ip_hdr since the header
may lie in the non-linear area.  This patch adds the helper
skb_gro_network_header to handle this.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agogro: Fix handling of headers that extend over the tail
Herbert Xu [Mon, 27 Apr 2009 12:44:29 +0000 (05:44 -0700)] 
gro: Fix handling of headers that extend over the tail

The skb_gro_* code fails to handle the case where a header starts
in the linear area but ends in the frags area.  Since the goal
of skb_gro_* is to optimise the case of completely non-linear
packets, we can simply bail out if we have anything in the linear
area.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv4: Limit size of route cache hash table
Anton Blanchard [Mon, 27 Apr 2009 12:42:24 +0000 (05:42 -0700)] 
ipv4: Limit size of route cache hash table

Right now we have no upper limit on the size of the route cache hash table.
On a 128GB POWER6 box it ends up as 32MB:

    IP route cache hash table entries: 4194304 (order: 9, 33554432 bytes)

It would be nice to cap this for memory consumption reasons, but a massive
hashtable also causes a significant spike when measuring OS jitter.

With a 32MB hashtable and 4 million entries, rt_worker_func is taking
5 ms to complete. On another system with more memory it's taking 14 ms.
Even though rt_worker_func does call cond_sched() to limit its impact,
in an HPC environment we want to keep all sources of OS jitter to a minimum.

With the patch applied we limit the number of entries to 512k which
can still be overriden by using the rt_entries boot option:

    IP route cache hash table entries: 524288 (order: 6, 4194304 bytes)

With this patch rt_worker_func now takes 0.460 ms on the same system.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoAdd reference to CAPI 2.0 standard
Karsten Keil [Thu, 23 Apr 2009 02:24:21 +0000 (02:24 +0000)] 
Add reference to CAPI 2.0 standard

Move the entry about CAPI 2.0 to the beginning and add a URL.
Incorporate changes suggested by Randy Dunlap, thanks for proofreading.

Signed-off-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoDocumentation/isdn/INTERFACE.CAPI
Tilman Schmidt [Thu, 23 Apr 2009 02:24:21 +0000 (02:24 +0000)] 
Documentation/isdn/INTERFACE.CAPI

isdn: document Kernel CAPI driver interface

Create a file Documentation/isdn/INTERFACE.CAPI describing the
interface between the kernel CAPI subsystem and ISDN device drivers,
analogous to the existing Documentation/isdn/INTERFACE for the old
isdn4linux subsystem. Also add kerneldoc comments to the exported
functions in drivers/isdn/capi/kcapi.c.

Impact: Documentation
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoupdate Documentation/isdn/00-INDEX
Tilman Schmidt [Thu, 23 Apr 2009 02:24:21 +0000 (02:24 +0000)] 
update Documentation/isdn/00-INDEX

After the merging of mISDN, state which files refer only to the
old isdn4linux subsystem.  Also add a few missing files.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: driver version 1.48.105-1
Vladislav Zolotarov [Mon, 27 Apr 2009 10:28:25 +0000 (03:28 -0700)] 
bnx2x: driver version 1.48.105-1

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Removed blob file
Vladislav Zolotarov [Mon, 27 Apr 2009 10:28:03 +0000 (03:28 -0700)] 
bnx2x: Removed blob file

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: Separated FW from the source.
Vladislav Zolotarov [Mon, 27 Apr 2009 10:27:43 +0000 (03:27 -0700)] 
bnx2x: Separated FW from the source.

>From now on FW will be downloaded from the binary file using request_firmware.

There will be different files for every supported chip. Currently 57710 (e1) and
57711 (e1h).

File names have the following format: bnx2x-<chip version>-<FW version>.fw.
ihex versions of current FW files are submitted in the next patch.

Each binary file has a header in the following format:

struct bnx2x_fw_file_section {
__be32 len;
__be32 offset;
}

struct bnx2x_fw_file_hdr {
struct bnx2x_fw_file_section init_ops;
struct bnx2x_fw_file_section init_ops_offsets;
struct bnx2x_fw_file_section init_data;
struct bnx2x_fw_file_section tsem_int_table_data;
struct bnx2x_fw_file_section tsem_pram_data;
struct bnx2x_fw_file_section usem_int_table_data;
struct bnx2x_fw_file_section usem_pram_data;
struct bnx2x_fw_file_section csem_int_table_data;
struct bnx2x_fw_file_section csem_pram_data;
struct bnx2x_fw_file_section xsem_int_table_data;
struct bnx2x_fw_file_section xsem_pram_data;
struct bnx2x_fw_file_section fw_version;
}

Each bnx2x_fw_file_section contains the length and the offset of the appropriate
section in the binary file. Values are stored in the big endian format.

Data types of arrays:

init_data            __be32
init_ops_offsets     __be16
XXsem_pram_data         u8
XXsem_int_table_data    u8
init_ops             struct raw_op {
                          u8   op;
__be24 offset;
                        __be32 data;
     }
fw_version              u8

>From now boundaries of a specific initialization stage are stored in
init_ops_offsets array instead of being defined by separate macroes. The index
in init_ops_offsets is calculated by BLOCK_OPS_IDX macro:

#define BLOCK_OPS_IDX(block, stage, end) \
       (2*(((block)*STAGE_IDX_MAX) + (stage)) + (end))

Security:

In addition to sanity check of array boundaries bnx2x will check a FW version.
Additional checks might be added in the future.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobnx2x: FW 4.8.53.0
Vladislav Zolotarov [Mon, 27 Apr 2009 10:26:13 +0000 (03:26 -0700)] 
bnx2x: FW 4.8.53.0

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotun: add IFF_TUN_EXCL flag to avoid opening a persistent device.
David Woodhouse [Mon, 27 Apr 2009 10:23:54 +0000 (03:23 -0700)] 
tun: add IFF_TUN_EXCL flag to avoid opening a persistent device.

When creating a certain types of VPN, NetworkManager will first attempt
to find an available tun device by iterating through 'vpn%d' until it
finds one that isn't already busy. Then it'll set that to be persistent
and owned by the otherwise unprivileged user that the VPN dæmon itself
runs as.

There's a race condition here -- during the period where the vpn%d
device is created and we're waiting for the VPN dæmon to actually
connect and use it, if we try to create _another_ device we could end up
re-using the same one -- because trying to open it again doesn't get
-EBUSY as it would while it's _actually_ busy.

So solve this, we add an IFF_TUN_EXCL flag which causes tun_set_iff() to
fail if it would be opening an existing persistent tundevice -- so that
we can make sure we're getting an entirely _new_ device.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxacru: Fix negative dB output
Simon Arlott [Mon, 27 Apr 2009 10:22:15 +0000 (03:22 -0700)] 
cxacru: Fix negative dB output

Values of dB between -0.99 and -0.01 will be output with the wrong
sign. This converts the negative value to positive and outputs it
with a "-" prefix.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopasemi_mac: mac_to_intf() error not noticed
roel kluin [Thu, 23 Apr 2009 08:53:20 +0000 (08:53 +0000)] 
pasemi_mac: mac_to_intf() error not noticed

mac_to_intf() can return -1 when no device or function is found, but when
mac->dma_if is unsigned. The error wasn't noticed.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agodrop_monitor: Update netlink protocol to include netlink attribute header in alert...
Neil Horman [Mon, 27 Apr 2009 10:17:31 +0000 (03:17 -0700)] 
drop_monitor: Update netlink protocol to include netlink attribute header in alert message

When I initially implemented this protocol, I disregarded the use of netlink
attribute headers, thinking for my purposes they weren't needed.  I've come to
find out that, as I'm starting to work with sending down messages with
associated data (like config messages), the kernel code spits out warnings about
trailing data in a netlink skb that doesn't have an associated header on it.  As
such, I'm going to start including attribute headers in my netlink transaction,
and so for completeness, I should likely include them on messages bound from the
kernel to user space.  This patch adds that header to the kernel, and bumps the
protocol version accordingly

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Disallow SFP 1G modules in the SFP+ cages for 82598 and 82599
Waskiewicz Jr, Peter P [Thu, 23 Apr 2009 11:31:37 +0000 (11:31 +0000)] 
ixgbe: Disallow SFP 1G modules in the SFP+ cages for 82598 and 82599

82598 and 82599 do not support SFP 1G modules.  Instead of allowing the
driver to load, but never get link, rejecting the module and displaying
a useful message is more preferrable.  The framework for displaying the
failure message already exists, now we just need to detect and reject the
SFP modules.

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>
15 years agoigb: always use adapter->itr as EITR value
Alexander Duyck [Thu, 23 Apr 2009 11:20:29 +0000 (11:20 +0000)] 
igb: always use adapter->itr as EITR value

The igb driver was switching between adapter->itr containing the EITR value
and the number of interrupts per second.  This resulted in high latencies
being seen after brining the interface down and then back up.  To resolve
the issue the itr value will now only contain the value that should be
programmed into EITR.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoixgbe: Fix WoL functionality for 82599 KX4 devices
Waskiewicz Jr, Peter P [Thu, 23 Apr 2009 11:15:18 +0000 (11:15 +0000)] 
ixgbe: Fix WoL functionality for 82599 KX4 devices

The current code writes the PME enabled bit in PCI config space which is
wrong.  This was needed for pre-release hardware, and was not removed from
the driver.  Also, we need to clear the WUS (wake up status) after we
resume.  Otherwise we can't wake for the same event again since it's still
asserted in the hardware.  Plus, the multicast lists were being written
improperly, causing multicast WoL to fail.

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>
15 years agoveth: prevent oops caused by netdev destructor
Stephen Hemminger [Mon, 27 Apr 2009 10:04:58 +0000 (03:04 -0700)] 
veth: prevent oops caused by netdev destructor

From: Stephen Hemminger <shemminger@vyatta.com>

The veth driver will oops if sysfs hooks are open while module is removed.

The net device destructor can not point to code in a module; basically
there are only two possible safe values: NULL - no destructor, or
free_netdev - free on last use

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovxge: use max() instead of VXGE_HW_SET_LEVEL
Alexander Beregalov [Thu, 23 Apr 2009 15:53:21 +0000 (15:53 +0000)] 
vxge: use max() instead of VXGE_HW_SET_LEVEL

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Acked-by: Ram Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovxge: fix possible NULL dereference in vxge-traffic.c
Alexander Beregalov [Thu, 23 Apr 2009 15:31:38 +0000 (15:31 +0000)] 
vxge: fix possible NULL dereference in vxge-traffic.c

If vpath is NULL then hldev is NULL also.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Acked-by: Ram Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoxfrm: wrong hash value for temporary SA
Nicolas Dichtel [Mon, 27 Apr 2009 09:58:59 +0000 (02:58 -0700)] 
xfrm: wrong hash value for temporary SA

When kernel inserts a temporary SA for IKE, it uses the wrong hash
value for dst list. Two hash values were calcultated before: one with
source address and one with a wildcard source address.

Bug hinted by Junwei Zhang <junwei.zhang@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: ignore updelay param when there is no active slave
Jiri Pirko [Fri, 24 Apr 2009 03:57:29 +0000 (03:57 +0000)] 
bonding: ignore updelay param when there is no active slave

Pointed out by Sean E. Millichamp.

Quote from Documentation/networking/bonding.txt:
"Note that when a bonding interface has no active links, the
driver will immediately reuse the first link that goes up, even if the
updelay parameter has been specified (the updelay is ignored in this
case).  If there are slave interfaces waiting for the updelay timeout
to expire, the interface that first went into that state will be
immediately reused.  This reduces down time of the network if the
value of updelay has been overestimated, and since this occurs only in
cases with no connectivity, there is no additional penalty for
ignoring the updelay."

This patch actually changes the behaviour in this way.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
 drivers/net/bonding/bond_main.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: use ethtool for link checking first
Jiri Pirko [Fri, 24 Apr 2009 01:58:23 +0000 (01:58 +0000)] 
bonding: use ethtool for link checking first

This patch only changes the order of interfaces to use for checking slave link
status in bond_check_dev_link() to priorize ethtool interface. Should safe some
troubles as ethtool seems to be more supported.

Jirka

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
 drivers/net/bonding/bond_main.c |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: fix fsl_pq_mdio driver to use module_init()
Grant Likely [Sat, 25 Apr 2009 12:53:44 +0000 (12:53 +0000)] 
net: fix fsl_pq_mdio driver to use module_init()

Modules are not supposed to use any of the *_initcall*() hooks as
the entry point.  fsl_pq_mdio.c was using subsys_initcall_sync()
instead of module_init() to guarantee that the MDIO bus was initialized
before the Ethernet driver goes looking for the phy.  However, the recent
OF helpers rework happens to also make sure PHY connection is deferred to
.open time, so using an initcall is no longer necessary.

This patch replaces the initcall with a more traditional an accepted
module_init() call.

Tested on Freescale MPC8349emitxgp eval board.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: add Xilinx ll_temac device driver
Grant Likely [Sat, 25 Apr 2009 12:53:39 +0000 (12:53 +0000)] 
net: add Xilinx ll_temac device driver

This patch adds support for the Xilinx ll_temac 10/100/1000 Ethernet
device.  The ll_temac ipcore is typically used on Xilinx Virtex and
Spartan designs attached to either a PowerPC 4xx or Microblaze
processor.

At the present moment, this driver only works with Virtex5 PowerPC
designs because it assumes DCR is used to access the DMA registers.
However, the low level access to DMA registers is abstracted and
it should be easy to adapt for the other implementations.

I'm posting this driver now as an RFC.  There are still some things that
need to be tightened up, but it does appear to be stable.

Derived from driver code written by Yoshio Kashiwagi and David H. Lynch Jr.

Tested on Xilinx ML507 eval board with Base System Builder generated
FPGA design.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Rework fs_enet driver to use of_mdio infrastructure
Grant Likely [Sat, 25 Apr 2009 12:53:33 +0000 (12:53 +0000)] 
net: Rework fs_enet driver to use of_mdio infrastructure

This patch simplifies the driver by making use of more common code.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopowerpc/82xx: Rework Embedded Planet ep8248e platform to use of_mdio
Grant Likely [Sat, 25 Apr 2009 12:53:28 +0000 (12:53 +0000)] 
powerpc/82xx: Rework Embedded Planet ep8248e platform to use of_mdio

This patch modifies the bitbanged MDIO driver in the ep8248e platform
code to use the common of_mdio infrastructure.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Rework ucc_geth driver to use of_mdio infrastructure
Grant Likely [Sat, 25 Apr 2009 12:53:23 +0000 (12:53 +0000)] 
net: Rework ucc_geth driver to use of_mdio infrastructure

This patch simplifies the driver by making use of more common code.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Rework pasemi_mac driver to use of_mdio infrastructure
Grant Likely [Sat, 25 Apr 2009 12:53:17 +0000 (12:53 +0000)] 
net: Rework pasemi_mac driver to use of_mdio infrastructure

This patch simplifies the driver by making use of more common code.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Tested-by: Olof Johansson <olof@lixom.net>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Rework gianfar driver to use of_mdio infrastructure.
Grant Likely [Sat, 25 Apr 2009 12:53:12 +0000 (12:53 +0000)] 
net: Rework gianfar driver to use of_mdio infrastructure.

This patch simplifies the driver by making use of more common code.

Tested on Freescale MPC8349emitxgp eval board

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: rework fsl_pq_mdio driver to use of_mdio infrastructure
Grant Likely [Sat, 25 Apr 2009 12:53:07 +0000 (12:53 +0000)] 
net: rework fsl_pq_mdio driver to use of_mdio infrastructure

This patch simplifies the driver by making use of more common code.

Tested on Freescale MPC8349emitxgp eval board

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Rework mpc5200 fec driver to use of_mdio infrastructure.
Grant Likely [Sat, 25 Apr 2009 12:53:02 +0000 (12:53 +0000)] 
net: Rework mpc5200 fec driver to use of_mdio infrastructure.

The patch reworks the MPC5200 Fast Ethernet Controller (FEC) driver to
use the of_mdio infrastructure for registering PHY devices from data out
openfirmware device tree, and eliminates the assumption that the PHY
for the FEC is always attached to the FEC's own MDIO bus.  With this
patch, the FEC can use a PHY attached to any MDIO bus if it is described
in the device tree.

Tested on Freescale Lite5200b eval board

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoopenfirmware: Add OF phylib support code
Grant Likely [Sat, 25 Apr 2009 12:52:56 +0000 (12:52 +0000)] 
openfirmware: Add OF phylib support code

Add support for parsing the device tree for PHY devices on an MDIO bus.
Currently many of the PowerPC ethernet drivers are open coding a solution
for reading data out of the device tree to find the correct PHY device.
This patch implements a set of common routines to:

a) let MDIO bus drivers register phy_devices described in the tree, and
b) let MAC drivers find the correct phy_device via the tree.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agophylib: add *_direct() variants of phy_connect and phy_attach functions
Grant Likely [Sat, 25 Apr 2009 12:52:51 +0000 (12:52 +0000)] 
phylib: add *_direct() variants of phy_connect and phy_attach functions

Add phy_connect_direct() and phy_attach_direct() functions so that
drivers can use a pointer to the phy_device instead of trying to determine
the phy's bus_id string.

This patch is useful for OF device tree descriptions of phy devices where
the driver doesn't need or know what the bus_id value in order to get a
phy_device pointer.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agophylib: rework to prepare for OF registration of PHYs
Grant Likely [Sat, 25 Apr 2009 12:52:46 +0000 (12:52 +0000)] 
phylib: rework to prepare for OF registration of PHYs

This patch makes changes in preparation for supporting open firmware
device tree descriptions of MDIO busses.  Changes include:
- Cleanup handling of phy_map[] entries; they are already NULLed when
  registering and so don't need to be re-cleared, and it is good practice
  to clear them out when unregistering.
- Split phy_device registration out into a new function so that the
  OF helpers can do two stage registration (separate allocation and
  registration steps).

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoof: add of_parse_phandle() helper for parsing phandle properties
Grant Likely [Sat, 25 Apr 2009 12:52:40 +0000 (12:52 +0000)] 
of: add of_parse_phandle() helper for parsing phandle properties

of_parse_phandle() is a helper function to read and parse a phandle
property and return a pointer to the resulting device_node.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosnmp: add missing counters for RFC 4293
Neil Horman [Mon, 27 Apr 2009 09:45:02 +0000 (02:45 -0700)] 
snmp: add missing counters for RFC 4293

The IP MIB (RFC 4293) defines stats for InOctets, OutOctets, InMcastOctets and
OutMcastOctets:
http://tools.ietf.org/html/rfc4293
But it seems we don't track those in any way that easy to separate from other
protocols.  This patch adds those missing counters to the stats file. Tested
successfully by me

With help from Eric Dumazet.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agopcnet32: Remove redundant set of skb->dev
John Dykstra [Mon, 27 Apr 2009 09:42:20 +0000 (02:42 -0700)] 
pcnet32: Remove redundant set of skb->dev

Remove redundant set of skb->dev (now handled for ethernet
drivers by eth_type_trans()).

Signed-off-by: John Dykstra <john.dykstra1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoforcedeth: tx timeout fix
Ayaz Abdulla [Sat, 25 Apr 2009 09:17:56 +0000 (09:17 +0000)] 
forcedeth: tx timeout fix

This patch fixes the tx_timeout() to properly handle the clean up of the
tx ring. It also sets the tx put pointer back to the correct position to
be in sync with HW.

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Fix LL_MAX_HEADER for CONFIG_TR_MODULE
Adrian Bunk [Mon, 27 Apr 2009 09:36:20 +0000 (02:36 -0700)] 
net: Fix LL_MAX_HEADER for CONFIG_TR_MODULE

Unless I miss anything this should fix a bug.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv4: remove unused member in fib_table.
Rami Rosen [Mon, 27 Apr 2009 09:35:32 +0000 (02:35 -0700)] 
ipv4: remove unused member in fib_table.

This patch removes an unused parameter (tb_stamp) from fib_table
structure in include/net/ip_fib.h.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4_en: Handle page allocation failure during receive
Yevgeny Petrilin [Sun, 26 Apr 2009 20:42:57 +0000 (20:42 +0000)] 
mlx4_en: Handle page allocation failure during receive

If we failed to allocate new fragments for receive buffer,
the packet should be dropped and packets should be reused.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomlx4_en: Fix cleanup flow on cq activation
Yevgeny Petrilin [Sun, 26 Apr 2009 20:41:34 +0000 (20:41 +0000)] 
mlx4_en: Fix cleanup flow on cq activation

In case of mlx4_en_activate_cq() failure, the cleanup
code would go to rx_err and try to disable unactivated rings.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovlan: update vlan carrier state for admin up/down
Jay Vosburgh [Sun, 26 Apr 2009 01:03:35 +0000 (18:03 -0700)] 
vlan: update vlan carrier state for admin up/down

Currently, the VLAN event handler does not adjust the VLAN
device's carrier state when the real device or the VLAN device is set
administratively up or down.

The following patch adds a transfer of operating state from the
real device to the VLAN device when the real device is administratively
set up or down, and sets the carrier state up or down during init, open
and close of the VLAN device.

This permits observers above the VLAN device that care about the
carrier state (bonding's link monitor, for example) to receive updates
for administrative changes by more closely mimicing the behavior of real
devices.

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>