]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/log
mirror_ubuntu-eoan-kernel.git
15 years agonetns 1/2: don't get/put old netns on CLONE_NEWNET
Alexey Dobriyan [Mon, 4 May 2009 18:11:38 +0000 (11:11 -0700)]
netns 1/2: don't get/put old netns on CLONE_NEWNET

copy_net_ns() doesn't copy anything, it creates fresh netns, so
get/put of old netns isn't needed.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agomacb: Add support of the netpoll API
Thomas Petazzoni [Mon, 4 May 2009 18:08:41 +0000 (11:08 -0700)]
macb: Add support of the netpoll API

With this patch in place, I'm successfully able to use the netconsole
mechanism with the Calao USB-A9263 board, which uses the AT91SAM9263
CPU, which in terms of Ethernet controller is supported by the macb
driver.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[haavard.skinnemoen@atmel.com: disable_irq() -> local_irq_save()]
[haavard.skinnemoen@atmel.com: convert to net_device_ops]
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agotcp: extend ECN sysctl to allow server-side only ECN
Ilpo Järvinen [Mon, 4 May 2009 18:07:36 +0000 (11:07 -0700)]
tcp: extend ECN sysctl to allow server-side only ECN

This should be very safe compared with full enabled, so I see
no reason why it shouldn't be done right away. As ECN can only
be negotiated if the SYN sending party is also supporting it,
somebody in the loop probably knows what he/she is doing. If
SYN does not ask for ECN, the server side SYN-ACK is identical
to what it is without ECN. Thus it's quite safe.

The chosen value is safe w.r.t to existing configs which
choose to currently set manually either 0 or 1 but
silently upgrades those who have not explicitly requested
ECN off.

Whether to just enable both sides comes up time to time but
unless that gets done now we can at least make the servers
aware of ECN already. As there are some known problems to occur
if ECN is enabled, it's currently questionable whether there's
any real gain from enabling clients as servers mostly won't
support it anyway (so we'd hit just the negative sides). After
enabling the servers and getting that deployed, the client end
enable really has some potential gain too.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Avoid modulus in skb_tx_hash() for forwarding case.
David S. Miller [Sun, 3 May 2009 21:43:10 +0000 (14:43 -0700)]
net: Avoid modulus in skb_tx_hash() for forwarding case.

Based almost entirely upon a patch by Eric Dumazet.

The common case is to have num-tx-queues <= num_rx_queues
and even if num_tx_queues is larger it will not be significantly
larger.

Therefore, a subtraction loop is always going to be faster than
modulus.

Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoipv4: remove unused macro (FIB_RES_RESET) from ip_fib.h.
Rami Rosen [Sun, 3 May 2009 08:58:48 +0000 (08:58 +0000)]
ipv4: remove unused macro (FIB_RES_RESET) from ip_fib.h.

Signed-off-by: Rami Rosen <ramirose@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agone2k-pci: use dev->addr_len instead of "6"
Jiri Pirko [Sat, 2 May 2009 23:55:06 +0000 (23:55 +0000)]
ne2k-pci: use dev->addr_len instead of "6"

Spotted a tiny ugliness in a recently posted patch. This patch cuts it out.

Jirka

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
 drivers/net/ne2k-pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Sun, 3 May 2009 21:18:53 +0000 (14:18 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

15 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Sun, 3 May 2009 21:07:43 +0000 (14:07 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

15 years agone2k-pci: Do not register device until initialized.
Lubomir Rintel [Sat, 2 May 2009 20:52:13 +0000 (13:52 -0700)]
ne2k-pci: Do not register device until initialized.

Doing it in reverse order causes uevent to be sent before
we have a MAC address, which confuses udev.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoSubject: [PATCH] br2684: restore net_dev initialization
Rabin Vincent [Sat, 2 May 2009 20:49:36 +0000 (13:49 -0700)]
Subject: [PATCH] br2684: restore net_dev initialization

Commit 0ba25ff4c669e5395110ba6ab4958a97a9f96922 ("br2684: convert to
net_device_ops") inadvertently deleted the initialization of the net_dev
pointer in the br2684_dev structure, leading to crashes.  This patch
adds it back.

Reported-by: Mikko Vinni <mmvinni@yahoo.com>
Tested-by: Mikko Vinni <mmvinni@yahoo.com>
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Only store high 16 bits of kernel generated filter priorities
Robert Love [Sat, 2 May 2009 20:48:32 +0000 (13:48 -0700)]
net: Only store high 16 bits of kernel generated filter priorities

The kernel should only be using the high 16 bits of a kernel
generated priority. Filter priorities in all other cases only
use the upper 16 bits of the u32 'prio' field of 'struct tcf_proto',
but when the kernel generates the priority of a filter is saves all
32 bits which can result in incorrect lookup failures when a filter
needs to be deleted or modified.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovirtio_net: Fix function name typo
Alex Williamson [Fri, 1 May 2009 17:31:10 +0000 (17:31 +0000)]
virtio_net: Fix function name typo

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovirtio_net: Cleanup command queue scatterlist usage
Alex Williamson [Fri, 1 May 2009 17:27:56 +0000 (17:27 +0000)]
virtio_net: Cleanup command queue scatterlist usage

We were avoiding calling sg_init* on scatterlists passed
into virtnet_send_command to prevent extraneous end markers.
This caused build warnings for uninitialized variables.
Cleanup the code to create proper scatterlists.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years ago3c589_cs: add cis(firmware) of 3Com multifunction pcmcia card
Ken Kawasaki [Sat, 2 May 2009 02:21:26 +0000 (19:21 -0700)]
3c589_cs: add cis(firmware) of 3Com multifunction pcmcia card

3c589_cs,3c574_cs,serial_cs:

 (1)add cis(firmware) of 3Com lan&modem mulitifunction pcmcia card.
 (2)load correct configuration register for 3Com card

Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: correct the cleanup in bond_create()
Jiri Pirko [Fri, 1 May 2009 22:35:28 +0000 (15:35 -0700)]
bonding: correct the cleanup in bond_create()

This patch makes the cleanup in bond_create nicer :) Also now the forgotten
free_netdev is called.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agovirtio: add missing include to virtio_net.h
Grant Likely [Fri, 1 May 2009 22:34:02 +0000 (15:34 -0700)]
virtio: add missing include to virtio_net.h

virtio_net.h uses the macro ETH_ALEN which is defined in linux/if_ether.h.
Discovered when hacking on virtio-over-pci patches.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoforcedeth: add clock gating feature <resend>
Ayaz Abdulla [Fri, 1 May 2009 01:41:50 +0000 (01:41 +0000)]
forcedeth: add clock gating feature <resend>

This patch adds new logic to support a clock gating feature found on the
latest set of chipsets. The clock gating is performed on the tx/rx
engines when the link is disconnected. Clock gating helps in reducing
power consumption.

* modified based on comments from netdev

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc95xx: add support for LAN9512 and LAN9514
Steve Glendinning [Fri, 1 May 2009 06:07:22 +0000 (06:07 +0000)]
smsc95xx: add support for LAN9512 and LAN9514

LAN9512 and LAN9514 are USB hubs with an integrated 10/100 ethernet
controller.  Logically this looks like an ethernet controller (similar
to LAN9500) permanently attached to one of the hub's downstream ports.

This patch adds the usb device id of the new ethernet controller to the
smsc95xx driver.  This id is the same in both new devices.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agosmsc95xx: configure LED outputs
Steve Glendinning [Fri, 1 May 2009 05:46:51 +0000 (05:46 +0000)]
smsc95xx: configure LED outputs

SMSC LAN9500 has dual purpose GPIO/LED pins, and by default at power-on
these are configured as GPIOs.  This means that if LEDs are fitted they
won't ever light.

This patch sets them to be LED outputs for speed, duplex and
link/activity.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetconsole: take care of NETDEV_UNREGISTER event
Bruno Prémont [Wed, 29 Apr 2009 20:45:17 +0000 (20:45 +0000)]
netconsole: take care of NETDEV_UNREGISTER event

When netconsole is loaded and a network interface fades away (e.g. on
rmmod $interface_driver_module) the rmmod remains stuck and some locks
are taken that prevent any additional module loading/unloading as well
as interface up/down changes.
In addition kernel logs (and console) get flooded at 10s interval with

[  122.464065] unregister_netdevice: waiting for eth0 to become free. Usage count = 1
[  132.704059] unregister_netdevice: waiting for eth0 to become free. Usage count = 1

This patch lets netconsole take NETDEV_UNREGISTER event into account
and release the affected interface if it was in use.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agoxt_socket: checks for the state of nf_conntrack
Laszlo Attila Toth [Fri, 1 May 2009 22:23:10 +0000 (15:23 -0700)]
xt_socket: checks for the state of nf_conntrack

xt_socket can use connection tracking, and checks whether it is a module.

Signed-off-by: Laszlo Attila Toth <panther@balabit.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: remove driver_data direct access of struct device
Greg Kroah-Hartman [Thu, 30 Apr 2009 12:19:31 +0000 (12:19 +0000)]
net: remove driver_data direct access of struct device

In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device.  Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used.  These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.

Cc: netdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agobonding: bond_slave_info_query() fix
Eric Dumazet [Thu, 23 Apr 2009 03:39:04 +0000 (03:39 +0000)]
bonding: bond_slave_info_query() fix

bond_slave_info_query() should keep a read lock while accessing slave info,
or risk accessing stale data and corruption.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agocxgb3: fixing gcc 4.4 compiler warning: suggest parentheses around operand of ‘!’
Sergey Senozhatsky [Fri, 1 May 2009 16:15:09 +0000 (09:15 -0700)]
cxgb3: fixing gcc 4.4 compiler warning: suggest parentheses around operand of ‘!’

Trivial: fixing gcc 4.4 compiler warning:
drivers/net/cxgb3/t3_hw.c: In function ‘t3_prep_adapter’:
drivers/net/cxgb3/t3_hw.c:3782: warning: suggest parentheses around operand of ‘!’ or change ‘|’ to ‘||’ or ‘!’ to ‘~’

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@mail.by>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonetfilter: use likely() in xt_info_rdlock_bh()
Eric Dumazet [Fri, 1 May 2009 16:10:46 +0000 (09:10 -0700)]
netfilter: use likely() in xt_info_rdlock_bh()

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Fix skb_tx_hash() for forwarding workloads.
Eric Dumazet [Fri, 1 May 2009 16:05:06 +0000 (09:05 -0700)]
net: Fix skb_tx_hash() for forwarding workloads.

When skb_rx_queue_recorded() is true, we dont want to use jash distribution
as the device driver exactly told us which queue was selected at RX time.
jhash makes a statistical shuffle, but this wont work with 8 static inputs.

Later improvements would be to compute reciprocal value of real_num_tx_queues
to avoid a divide here. But this computation should be done once,
when real_num_tx_queues is set. This needs a separate patch, and a new
field in struct net_device.

Reported-by: Andrew Dickinson <andrew@whydna.net>
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 years agonet: Fix oops when splicing skbs from a frag_list.
Jarek Poplawski [Thu, 30 Apr 2009 12:41:19 +0000 (05:41 -0700)]
net: Fix oops when splicing skbs from a frag_list.

Lennert Buytenhek wrote:
> Since 4fb669948116d928ae44262ab7743732c574630d ("net: Optimize memory
> usage when splicing from sockets.") I'm seeing this oops (e.g. in
> 2.6.30-rc3) when splicing from a TCP socket to /dev/null on a driver
> (mv643xx_eth) that uses LRO in the skb mode (lro_receive_skb) rather
> than the frag mode:

My patch incorrectly assumed skb->sk was always valid, but for
"frag_listed" skbs we can only use skb->sk of their parent.

Reported-by: Lennert Buytenhek <buytenh@wantstofly.org>
Debugged-by: Lennert Buytenhek <buytenh@wantstofly.org>
Tested-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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 master.kernel.org:/pub/scm/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.kernel.org/pub/scm/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.kernel.org/pub/scm/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>