]> bbs.cooldavid.org Git - net-next-2.6.git/log
net-next-2.6.git
13 years agonet: Move "struct net" declaration inside the __KERNEL__ macro guard
Ollie Wild [Wed, 22 Sep 2010 05:54:54 +0000 (05:54 +0000)]
net: Move "struct net" declaration inside the __KERNEL__ macro guard

This patch reduces namespace pollution by moving the "struct net" declaration
out of the userspace-facing portion of linux/netlink.h.  It has no impact on
the kernel.

(This came up because we have several C++ applications which use "net" as a
namespace name.)

Signed-off-by: Ollie Wild <aaw@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: nf_conntrack_defrag: check socket type before touching nodefrag flag
Jiri Olsa [Tue, 21 Sep 2010 21:17:34 +0000 (21:17 +0000)]
netfilter: nf_conntrack_defrag: check socket type before touching nodefrag flag

we need to check proper socket type within ipv4_conntrack_defrag
function before referencing the nodefrag flag.

For example the tun driver receive path produces skbs with
AF_UNSPEC socket type, and so current code is causing unwanted
fragmented packets going out.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: nf_nat_snmp: fix checksum calculation (v4)
Patrick McHardy [Tue, 21 Sep 2010 21:17:33 +0000 (21:17 +0000)]
netfilter: nf_nat_snmp: fix checksum calculation (v4)

Fix checksum calculation in nf_nat_snmp_basic.

Based on patches by Clark Wang <wtweeker@163.com> and
Stephen Hemminger <shemminger@vyatta.com>.

https://bugzilla.kernel.org/show_bug.cgi?id=17622

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: fix a race in nf_ct_ext_create()
Eric Dumazet [Tue, 21 Sep 2010 21:17:32 +0000 (21:17 +0000)]
netfilter: fix a race in nf_ct_ext_create()

As soon as rcu_read_unlock() is called, there is no guarantee current
thread can safely derefence t pointer, rcu protected.

Fix is to copy t->alloc_size in a temporary variable.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: fix ipt_REJECT TCP RST routing for indev == outdev
Changli Gao [Tue, 21 Sep 2010 21:17:31 +0000 (21:17 +0000)]
netfilter: fix ipt_REJECT TCP RST routing for indev == outdev

ip_route_me_harder can't create the route cache when the outdev is the same
with the indev for the skbs whichout a valid protocol set.

__mkroute_input functions has this check:
1998         if (skb->protocol != htons(ETH_P_IP)) {
1999                 /* Not IP (i.e. ARP). Do not create route, if it is
2000                  * invalid for proxy arp. DNAT routes are always valid.
2001                  *
2002                  * Proxy arp feature have been extended to allow, ARP
2003                  * replies back to the same interface, to support
2004                  * Private VLAN switch technologies. See arp.c.
2005                  */
2006                 if (out_dev == in_dev &&
2007                     IN_DEV_PROXY_ARP_PVLAN(in_dev) == 0) {
2008                         err = -EINVAL;
2009                         goto cleanup;
2010                 }
2011         }

This patch gives the new skb a valid protocol to bypass this check. In order
to make ipt_REJECT work with bridges, you also need to enable ip_forward.

This patch also fixes a regression. When we used skb_copy_expand(), we
didn't have this issue stated above, as the protocol was properly set.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: nf_ct_sip: default to NF_ACCEPT in sip_help_tcp()
Simon Horman [Tue, 21 Sep 2010 21:17:30 +0000 (21:17 +0000)]
netfilter: nf_ct_sip: default to NF_ACCEPT in sip_help_tcp()

I initially noticed this because of the compiler warning below, but it
does seem to be a valid concern in the case where ct_sip_get_header()
returns 0 in the first iteration of the while loop.

net/netfilter/nf_conntrack_sip.c: In function 'sip_help_tcp':
net/netfilter/nf_conntrack_sip.c:1379: warning: 'ret' may be used uninitialized in this function

Signed-off-by: Simon Horman <horms@verge.net.au>
[Patrick: changed NF_DROP to NF_ACCEPT]
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: tproxy: nf_tproxy_assign_sock() can handle tw sockets
Eric Dumazet [Tue, 21 Sep 2010 21:17:29 +0000 (21:17 +0000)]
netfilter: tproxy: nf_tproxy_assign_sock() can handle tw sockets

transparent field of a socket is either inet_twsk(sk)->tw_transparent
for timewait sockets, or inet_sk(sk)->transparent for other sockets
(TCP/UDP).

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Wed, 22 Sep 2010 01:17:19 +0000 (18:17 -0700)]
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6

13 years agocaif: Use default send and receive buffer size in caif_socket.
Sjur Braendeland [Tue, 21 Sep 2010 11:44:46 +0000 (11:44 +0000)]
caif: Use default send and receive buffer size in caif_socket.

CAIF sockets should use socket's default send and receive buffers sizes.

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif: Fix function NULL pointer check.
Sjur Braendeland [Tue, 21 Sep 2010 11:44:45 +0000 (11:44 +0000)]
caif: Fix function NULL pointer check.

Check that receive function pointer is not null before calling it.

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif: Minor fixes in log prints.
Sjur Braendeland [Tue, 21 Sep 2010 11:44:44 +0000 (11:44 +0000)]
caif: Minor fixes in log prints.

Use pr_debug for flow control printouts, and refine an error printout.

Signed-off-by: Sjur Braendeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif: Remove buggy re-definition of pr_debug
Sjur Braendeland [Tue, 21 Sep 2010 10:40:06 +0000 (10:40 +0000)]
caif: Remove buggy re-definition of pr_debug

Remove debugging quirk redefining pr_debug to pr_warning.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: addrconf.h cleanups
Eric Dumazet [Tue, 21 Sep 2010 06:57:39 +0000 (06:57 +0000)]
ipv6: addrconf.h cleanups

- Use rcu_dereference_rtnl() in __in6_dev_get
- kerneldoc for __in6_dev_get() and in6_dev_get()
- Use inline functions instead of macros

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: constify some ppp/pptp structs
Eric Dumazet [Tue, 21 Sep 2010 06:43:54 +0000 (06:43 +0000)]
net: constify some ppp/pptp structs

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosundance: Use dev_kfree_skb_any() helper
Denis Kirjanov [Mon, 20 Sep 2010 22:57:49 +0000 (22:57 +0000)]
sundance: Use dev_kfree_skb_any() helper

Use dev_kfree_skb_any() helper to free the skb

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosundance: Handle DMA mapping errors
Denis Kirjanov [Mon, 20 Sep 2010 22:56:57 +0000 (22:56 +0000)]
sundance: Handle DMA mapping errors

Check for DMA mapping errors.

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosundance: Convert to DMA API
Denis Kirjanov [Mon, 20 Sep 2010 22:56:07 +0000 (22:56 +0000)]
sundance: Convert to DMA API

Convert to DMA API

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: core: use kernel's converter from hex to bin
Andy Shevchenko [Mon, 20 Sep 2010 20:40:26 +0000 (20:40 +0000)]
net: core: use kernel's converter from hex to bin

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers: atm: use native kernel's hex_to_bin() func
Andy Shevchenko [Mon, 20 Sep 2010 20:40:24 +0000 (20:40 +0000)]
drivers: atm: use native kernel's hex_to_bin() func

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Chas Williams <chas@cmf.nrl.navy.mil>
Cc: linux-atm-general@lists.sourceforge.net
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotmspci: fix tr%d in printk
Meelis Roos [Mon, 20 Sep 2010 21:19:03 +0000 (21:19 +0000)]
tmspci: fix tr%d in printk

tmspci driver uses dev->name before register_netdev() and so prints tr%d
in initialization messages. Fix it by using dev_info.

Found and tested on real hardware.

Signed-off-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: Fix build due to lack of ethtool.h include.
David S. Miller [Tue, 21 Sep 2010 23:12:11 +0000 (16:12 -0700)]
ethtool: Fix build due to lack of ethtool.h include.

net/core/ethtool.c: In function 'ethtool_get_regs':
net/core/ethtool.c:818:2: error: implicit declaration of function 'vmalloc'
net/core/ethtool.c:818:9: warning: assignment makes pointer from integer without a cast
net/core/ethtool.c:833:2: error: implicit declaration of function 'vfree'

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosfc: Fix build due to lack of vmalloc.h include.
David S. Miller [Tue, 21 Sep 2010 23:11:06 +0000 (16:11 -0700)]
sfc: Fix build due to lack of vmalloc.h include.

drivers/net/sfc/filter.c: In function ‘efx_probe_filters’:
drivers/net/sfc/filter.c:422: error: implicit declaration of function ‘vmalloc’
drivers/net/sfc/filter.c:422: warning: assignment makes pointer from integer without a cast
drivers/net/sfc/filter.c: In function ‘efx_remove_filters’:
drivers/net/sfc/filter.c:442: error: implicit declaration of function ‘vfree’

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'dccp' of git://eden-feed.erg.abdn.ac.uk/net-next-2.6
David S. Miller [Tue, 21 Sep 2010 23:00:40 +0000 (16:00 -0700)]
Merge branch 'dccp' of git://eden-feed.erg.abdn.ac.uk/net-next-2.6

13 years agoip: fix truesize mismatch in ip fragmentation
Eric Dumazet [Tue, 21 Sep 2010 08:47:45 +0000 (08:47 +0000)]
ip: fix truesize mismatch in ip fragmentation

Special care should be taken when slow path is hit in ip_fragment() :

When walking through frags, we transfert truesize ownership from skb to
frags. Then if we hit a slow_path condition, we must undo this or risk
uncharging frags->truesize twice, and in the end, having negative socket
sk_wmem_alloc counter, or even freeing socket sooner than expected.

Many thanks to Nick Bowler, who provided a very clean bug report and
test program.

Thanks to Jarek for reviewing my first patch and providing a V2

While Nick bisection pointed to commit 2b85a34e911 (net: No more
expensive sock_hold()/sock_put() on each tx), underlying bug is older
(2.6.12-rc5)

A side effect is to extend work done in commit b2722b1c3a893e
(ip_fragment: also adjust skb->truesize for packets not owned by a
socket) to ipv6 as well.

Reported-and-bisected-by: Nick Bowler <nbowler@elliptictech.com>
Tested-by: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Jarek Poplawski <jarkao2@gmail.com>
CC: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosfc: Clean up and correct comments on efx_monitor()
Ben Hutchings [Mon, 20 Sep 2010 08:44:10 +0000 (08:44 +0000)]
sfc: Clean up and correct comments on efx_monitor()

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosfc: Include RX IP filter table in register dump
Ben Hutchings [Mon, 20 Sep 2010 08:43:53 +0000 (08:43 +0000)]
sfc: Include RX IP filter table in register dump

For backward compatibility, add it at the end.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosfc: Implement the ethtool RX n-tuple control functions
Ben Hutchings [Mon, 20 Sep 2010 08:43:42 +0000 (08:43 +0000)]
sfc: Implement the ethtool RX n-tuple control functions

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosfc: Add filter table management
Ben Hutchings [Mon, 20 Sep 2010 08:43:07 +0000 (08:43 +0000)]
sfc: Add filter table management

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: Allocate register dump buffer with vmalloc()
Ben Hutchings [Mon, 20 Sep 2010 08:42:17 +0000 (08:42 +0000)]
ethtool: Allocate register dump buffer with vmalloc()

Some NICs have huge register files which exceed the maximum heap
allocation size.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: Add Ethernet MAC-level filtering/steering
Ben Hutchings [Mon, 20 Sep 2010 08:42:08 +0000 (08:42 +0000)]
ethtool: Add Ethernet MAC-level filtering/steering

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: Define RX n-tuple action to clear a rule
Ben Hutchings [Mon, 20 Sep 2010 08:41:47 +0000 (08:41 +0000)]
ethtool: Define RX n-tuple action to clear a rule

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetxen: dont set skb->truesize
Eric Dumazet [Tue, 21 Sep 2010 20:04:04 +0000 (13:04 -0700)]
netxen: dont set skb->truesize

skb->truesize is set in core network.

Dont change it unless dealing with fragments.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: dont set skb->truesize
Eric Dumazet [Mon, 20 Sep 2010 02:28:59 +0000 (02:28 +0000)]
qlcnic: dont set skb->truesize

skb->truesize is set in core network.

Dont change it unless dealing with fragments.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Tue, 21 Sep 2010 19:49:14 +0000 (15:49 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem

Conflicts:
arch/arm/mach-omap2/board-omap3pandora.c
drivers/net/wireless/ath/ath5k/base.c

13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Tue, 21 Sep 2010 19:26:07 +0000 (12:26 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6

13 years agoath9k: make the driver specific rate control module optional
Felix Fietkau [Mon, 20 Sep 2010 11:45:40 +0000 (13:45 +0200)]
ath9k: make the driver specific rate control module optional

ath9k can use minstrel_ht instead, so it makes sense to save some space here.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: move ath_tx_aggr_check() to the rate control module
Felix Fietkau [Mon, 20 Sep 2010 11:45:39 +0000 (13:45 +0200)]
ath9k: move ath_tx_aggr_check() to the rate control module

It is not used anywhere else and can be made static

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: clean up / fix aggregation session flush
Felix Fietkau [Mon, 20 Sep 2010 11:45:38 +0000 (13:45 +0200)]
ath9k: clean up / fix aggregation session flush

The tid aggregation cleanup is a bit fragile, as it discards failed
subframes in some places, and retransmits them in others. This could
block the cleanup of an existing aggregation session, if a retransmission
for a tid is issued, yet the tid is never scheduled again because of
the cleanup state.

Fix this by getting rid of as many subframes as possible, as early
as possible, and immediately transmitting pending subframes as regular
HT frames instead of waiting for the cleanup to complete.

Drop all pending subframes while keeping track of the Block ACK window
during aggregate tx completion to prevent sending out stale subframes,
which could confuse the receiver side.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix an aggregation start related race condition
Felix Fietkau [Mon, 20 Sep 2010 17:35:28 +0000 (19:35 +0200)]
ath9k: fix an aggregation start related race condition

A new aggregation session start can be issued by mac80211, even when the
cleanup of the previous session has not completed yet. Since the data structure
for the session is not recreated, this could corrupt the block ack window
and lock up the aggregation session. Fix this by delaying the new session
until the old one has been cleaned up.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: clean up block ack window handling
Felix Fietkau [Mon, 20 Sep 2010 11:45:36 +0000 (13:45 +0200)]
ath9k: clean up block ack window handling

There's no reason to keep pointers to pending tx buffers around, if they're
only used to keep track of which frames are still pending. Use a bitfield
instead.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: bugfix: use bitwise-AND instead of logical-AND
Eliad Peller [Sun, 19 Sep 2010 16:55:09 +0000 (18:55 +0200)]
wl1271: bugfix: use bitwise-AND instead of logical-AND

typo - while looking for specific bits we should do a bitwise-AND instead of logical-AND.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: avoid redundant memcpy of rx_status
Eliad Peller [Sun, 19 Sep 2010 16:55:08 +0000 (18:55 +0200)]
wl1271: avoid redundant memcpy of rx_status

copy the rx_status directly to skb->cb (control buffer) instead of copying
it to a local struct and then copying it again (for each rx packet)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: fix hang in AP mode when HT STA does PSM
Christian Lamparter [Fri, 17 Sep 2010 22:15:13 +0000 (00:15 +0200)]
carl9170: fix hang in AP mode when HT STA does PSM

This is a obvious bug, skb_queue_walk does not
work if the iterator gets removed from the queue.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: reinit phy after HT settings have changed
Christian Lamparter [Fri, 17 Sep 2010 21:09:19 +0000 (23:09 +0200)]
carl9170: reinit phy after HT settings have changed

The driver has a set of different initvals for 20 MHz
vs dynamic HT2040 operation. Because we can't change
some of the registers "in-flight", the driver needs to
perform a warm reset.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: fix state downgrade during reset
Christian Lamparter [Fri, 17 Sep 2010 20:58:40 +0000 (22:58 +0200)]
carl9170: fix state downgrade during reset

Don't mark the device as completely dead just yet.
If all goes to plan and carl9170_reboot succeeds
then we can skip the expensive userspace-driven
reinitialization anyway.

And if it doesn't and carl9170_reboot fails,
then carl9170_usb_cancel_urbs will do the
necessary steps.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: abort tasklet during usb reset
Christian Lamparter [Fri, 17 Sep 2010 20:47:28 +0000 (22:47 +0200)]
carl9170: abort tasklet during usb reset

This patch prevents the tasklet code from
interfering while the firmware is down for
an unscheduled maintenance.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: don't load bogus nf of chain 1
Christian Lamparter [Fri, 17 Sep 2010 20:42:37 +0000 (22:42 +0200)]
carl9170: don't load bogus nf of chain 1

According to Atheros, chain 1 is not connected.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: fix noise dBm conversion
Christian Lamparter [Fri, 17 Sep 2010 20:22:50 +0000 (22:22 +0200)]
carl9170: fix noise dBm conversion

Ever since carl9170 gained support to read the noisefloor,
the reported noisefloor level was pretty poor.

Initially I assumed that something was wrong in the PHY
setup and it would be impossible to fix without any
guidances. But this was not the case. In fact the nf
readings were correct and the thing that was broken
was the "simple" sign extension code!

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: use rx chainmask from eeprom
Christian Lamparter [Fri, 17 Sep 2010 20:07:59 +0000 (22:07 +0200)]
carl9170: use rx chainmask from eeprom

The eeprom provides a mask for all present rx chains.
Why not use it instead of the generic initval default?

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Add tx queue configuration function
Bruno Randolf [Fri, 17 Sep 2010 02:37:18 +0000 (11:37 +0900)]
ath5k: Add tx queue configuration function

Add the mac80211 callback function to configure the tx queue properties like
cw_min, cw_max and aifs.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Simplify cw_min/max and AIFS configuration
Bruno Randolf [Fri, 17 Sep 2010 02:37:12 +0000 (11:37 +0900)]
ath5k: Simplify cw_min/max and AIFS configuration

Get rid of overly complicated cw_min/max and AIFS configuration:

* Validate values in ath5k_hw_set_tx_queueprops(), so we can use them directly
  without further checks or computation in ath5k_hw_reset_tx_queue().

* Simplifiy by using AR5K_TUNE_AIFS|CWMIN|CWMAX variables directly since we
  don't support XR or B channels. That way we can also remove
  AR5K_TXQ_USEDEFAULT and the confusing logic around it.

* Update data types: AIFS is u8, CW's are u16.

* Remove now unneeded variables in ath5k_hw.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Keep last descriptor in queue
Bruno Randolf [Fri, 17 Sep 2010 02:37:07 +0000 (11:37 +0900)]
ath5k: Keep last descriptor in queue

If we return a TX descriptor to the pool of available descriptors, while a
queues TXDP still points to it we could potentially run into all sorts of
troube.

It has been suggested that there is hardware which can set the descriptors
done bit before it reads ds_link and moves on to the next descriptor. While the
documentation says this is not true for newer chipsets (the descriptor contents
are copied to some internal memory), we don't know about older hardware.

To be safe, we always keep the last descriptor in the queue, and avoid dangling
TXDP pointers. Unfortunately this does not fully resolve the problem - queues
still get stuck!

This is similar to what ath9k does.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Count how many times a queue got stuck
Bruno Randolf [Fri, 17 Sep 2010 02:37:02 +0000 (11:37 +0900)]
ath5k: Count how many times a queue got stuck

Add a counter to show how many times a queue got stuck in the debugfs queue
file.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Add watchdog for stuck TX queues
Bruno Randolf [Fri, 17 Sep 2010 02:36:56 +0000 (11:36 +0900)]
ath5k: Add watchdog for stuck TX queues

Since we do not know any better solution to the problem that TX queues can get
stuck, this adds a timer-based watchdog, which will check for stuck queues and
reset the hardware if necessary.

Ported from ath9k commit 164ace38536849966ffa377b1b1132993a5a375d.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Move tx frame completion into separate function
Bruno Randolf [Fri, 17 Sep 2010 02:36:51 +0000 (11:36 +0900)]
ath5k: Move tx frame completion into separate function

Clearer separation between queue handling and what we do with completed frames.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Fix TX queues stopping
Bruno Randolf [Fri, 17 Sep 2010 02:36:46 +0000 (11:36 +0900)]
ath5k: Fix TX queues stopping

It does not make sense to stop queues for NF calibration. This will not stop
transmissions from the card, if there are queued packets.

If we run out of TX buffers we need to stop all queues, not only one.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Fix queue debug file
Bruno Randolf [Fri, 17 Sep 2010 02:36:40 +0000 (11:36 +0900)]
ath5k: Fix queue debug file

Take txq lock in debug file and fix reporting of used buffers.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Use four hardware queues
Bruno Randolf [Fri, 17 Sep 2010 02:36:35 +0000 (11:36 +0900)]
ath5k: Use four hardware queues

Prepare ath5k for WME by using four hardware queues.

The way we set up our queues matches the mac80211 queue priority 1:1, so we
don't have to do any mapping for queue numbers.

Every queue uses 50 of the total 200 available transmit buffers, so the DMA
memory usage does not increase with this patch, but it might be good to
fine-tune the number of buffers per queue later (depending on the CPU speed and
load, and the speed of the medium access, it might not be big enough).

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: reorder base.c to remove fwd decls
Bob Copeland [Fri, 17 Sep 2010 03:45:07 +0000 (12:45 +0900)]
ath5k: reorder base.c to remove fwd decls

This change reorganizes the main ath5k file in order to re-group
related functions and remove most of the forward declarations
(from 61 down to 3).  This is, unfortunately, a lot of churn, but
there should be no functional changes.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath/ath5k/ath9k: Fix crypto capabilities merge issue
Bruno Randolf [Fri, 17 Sep 2010 02:36:25 +0000 (11:36 +0900)]
ath/ath5k/ath9k: Fix crypto capabilities merge issue

Fixing up a merge issue / concurrent development:

Remove unneeded ath_crypt_caps flags, as per "ath9k_hw: remove useless hw
capability flags" (364734fafbba0c3133e482db78149b9a823ae7a5), but set the
AESCCM flag for ath9k. common ath code still needs a flag for this because
there is ath5k hardware which can't do AES in hardware.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocarl9170: update AR9170 phy initvals
Christian Lamparter [Thu, 16 Sep 2010 20:55:20 +0000 (22:55 +0200)]
carl9170: update AR9170 phy initvals

This patch is loosely based on an ath9k patch called:
"ath9k_hw: sync initvals for ar9001 and ar9002 with Atheros"

It includes the following changes/fixes:
- AGC setting improvements
- timing changes for improved performance

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoomap: zoom: add mmc3/wl1271 device support
Ohad Ben-Cohen [Wed, 15 Sep 2010 23:32:30 +0000 (01:32 +0200)]
omap: zoom: add mmc3/wl1271 device support

Add MMC3 support on ZOOM, which has the wl1271 device hardwired to.

The wl1271 is a 4-wire, 1.8V, embedded SDIO WLAN device with an
external IRQ line, and power-controlled by a GPIO-based fixed regulator.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoomap: zoom: add fixed regulator device for wlan
Ohad Ben-Cohen [Wed, 15 Sep 2010 23:32:09 +0000 (01:32 +0200)]
omap: zoom: add fixed regulator device for wlan

Add a fixed regulator vmmc device to enable power control
of the wl1271 wlan device.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: make ref_clock configurable by board
Ohad Ben-Cohen [Wed, 15 Sep 2010 23:31:51 +0000 (01:31 +0200)]
wl1271: make ref_clock configurable by board

The wl1271 device is using a reference clock that may change
between board to board.

Make the ref_clock parameter configurable by board settings
instead of having a hard coded value in the sources.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: take irq info from private board data
Ohad Ben-Cohen [Wed, 15 Sep 2010 23:31:35 +0000 (01:31 +0200)]
wl1271: take irq info from private board data

Remove the hard coded irq information, and instead take
the irq information from the board's platform data.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl12xx: add platform data passing support
Ohad Ben-Cohen [Wed, 15 Sep 2010 23:31:12 +0000 (01:31 +0200)]
wl12xx: add platform data passing support

Add a simple mechanism to pass platform data to the
SDIO instances of wl12xx.

This way there is no confusion over who owns the 'embedded data',
typechecking is preserved, and no possibility for the wrong driver to
pick up the data.

Originally proposed by Russell King.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: propagate set_power's return value
Ohad Ben-Cohen [Wed, 15 Sep 2010 23:22:04 +0000 (01:22 +0200)]
wl1271: propagate set_power's return value

Make it possible for the set power method to indicate a
success/failure return value. This is needed to support
more complex power on/off operations such as SDIO
power manipulations.

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl12xx: make wl12xx.h common to both spi and sdio
Ohad Ben-Cohen [Thu, 16 Sep 2010 11:16:02 +0000 (13:16 +0200)]
wl12xx: make wl12xx.h common to both spi and sdio

Move wl12xx.h outside of the spi-specific location,
so it can be shared with both spi and sdio solutions.

Update all users of spi/wl12xx.h accordingly

Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agodccp ccid-3: Remove redundant 'options_received' struct
Gerrit Renker [Sun, 19 Sep 2010 18:14:23 +0000 (20:14 +0200)]
dccp ccid-3: Remove redundant 'options_received' struct

The `options_received' struct is redundant, since it re-duplicates the existing
`p' and `x_recv' fields. This patch removes the sub-struct and migrates the
format conversion operations to ccid3_hc_tx_parse_options().

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
13 years agodccp tfrc/ccid-3: computing the loss rate from the Loss Event Rate
Gerrit Renker [Sun, 19 Sep 2010 18:10:52 +0000 (20:10 +0200)]
dccp tfrc/ccid-3: computing the loss rate from the Loss Event Rate

This adds a function to take care of the following, separate cases occurring in
the computation of the Loss Rate p:

 * 1/(2^32-1) is mapped into 0% as per RFC 4342, 8.5;
 * 1/0        is mapped into 100%, the maximum;
 * to avoid that p = 1/x is rounded down to 0 when x is very large, since this
   means accidentally re-entering slow-start indicated by p == 0, the minimum
   resolution value of p is now returned instead;
 * a bug in ccid3_hc_rx_getsockopt is fixed: 1/0 was mapped into ~0U.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
13 years agodccp ccid-3: remove dead states
Gerrit Renker [Sun, 19 Sep 2010 18:08:24 +0000 (20:08 +0200)]
dccp ccid-3: remove dead states

This patch is thanks to an investigation by Leandro Sales de Melo and his
colleagues. They worked out two state diagrams which highlight the fact that
the xxx_TERM states in CCID-3/4 are in fact not necessary.

And this can be confirmed by in turn looking at the code: the xxx_TERM states
are only ever set in ccid3_hc_{rx,tx}_exit(): when CCID-3 sets the state
to xxx_TERM, it is at a time where no more processing should be going on,
hence it is not necessary to introduce a dedicated exit state - this is already
implied by unloading the CCID.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
13 years agodccp: Replace magic CCID-specific numbers by symbolic constants
Gerrit Renker [Sun, 19 Sep 2010 18:08:00 +0000 (20:08 +0200)]
dccp: Replace magic CCID-specific numbers by symbolic constants

The constants DCCPO_{MIN,MAX}_CCID_SPECIFIC are nowhere used in the code, but
instead for the CCID-specific options numbers are used.

This patch unifies the use of CCID-specific option numbers, by adding symbolic
names reflecting the definitions in RFC 4340, 10.3.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
13 years agodccp: Add packet type information to CCID-specific option parsing
Gerrit Renker [Sun, 19 Sep 2010 18:06:50 +0000 (20:06 +0200)]
dccp: Add packet type information to CCID-specific option parsing

This
 1. adds packet type information to ccid_hc_{rx,tx}_parse_options(). This is
    necessary, since table 3 in RFC 4340, 5.8 leaves it to the CCIDs to state
    which options may (not) appear on what packet type.

 2. adds such a check for CCID-3's {Loss Event, Receive} Rate as specified in
    RFC 4340 8.3 ("Receive Rate options MUST NOT be sent on DCCP-Data packets")
    and 8.5 ("Loss Event Rate options MUST NOT be sent on DCCP-Data packets").

 3. removes an unused argument `idx' from ccid_hc_{rx,tx}_parse_options(). This
    is also no longer necessary, since the CCID-specific option-parsing routines
    are passed every single parameter of the type-length-value option encoding.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
13 years agotcp: Fix race in tcp_poll
Tom Marshall [Mon, 20 Sep 2010 22:42:05 +0000 (15:42 -0700)]
tcp: Fix race in tcp_poll

If a RST comes in immediately after checking sk->sk_err, tcp_poll will
return POLLIN but not POLLOUT.  Fix this by checking sk->sk_err at the end
of tcp_poll.  Additionally, ensure the correct order of operations on SMP
machines with memory barriers.

Signed-off-by: Tom Marshall <tdm.code@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agorose: Fix signedness issues wrt. digi count.
David S. Miller [Mon, 20 Sep 2010 22:40:35 +0000 (15:40 -0700)]
rose: Fix signedness issues wrt. digi count.

Just use explicit casts, since we really can't change the
types of structures exported to userspace which have been
around for 15 years or so.

Reported-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'vhost-net' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
David S. Miller [Mon, 20 Sep 2010 18:13:34 +0000 (11:13 -0700)]
Merge branch 'vhost-net' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

13 years agoxfrm: Allow different selector family in temporary state
Thomas Egerer [Mon, 20 Sep 2010 18:11:38 +0000 (11:11 -0700)]
xfrm: Allow different selector family in temporary state

The family parameter xfrm_state_find is used to find a state matching a
certain policy. This value is set to the template's family
(encap_family) right before xfrm_state_find is called.
The family parameter is however also used to construct a temporary state
in xfrm_state_find itself which is wrong for inter-family scenarios
because it produces a selector for the wrong family. Since this selector
is included in the xfrm_user_acquire structure, user space programs
misinterpret IPv6 addresses as IPv4 and vice versa.
This patch splits up the original init_tempsel function into a part that
initializes the selector respectively the props and id of the temporary
state, to allow for differing ip address families whithin the state.

Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agowext: fix potential private ioctl memory content leak
Johannes Berg [Thu, 16 Sep 2010 22:38:25 +0000 (00:38 +0200)]
wext: fix potential private ioctl memory content leak

When a driver doesn't fill the entire buffer, old
heap contents may remain, and if it also doesn't
update the length properly, this old heap content
will be copied back to userspace.

It is very unlikely that this happens in any of
the drivers using private ioctls since it would
show up as junk being reported by iwpriv, but it
seems better to be safe here, so use kzalloc.

Reported-by: Jeff Mahoney <jeffm@suse.com>
Cc: stable@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoqlcnic: dont set skb->truesize
Eric Dumazet [Mon, 20 Sep 2010 02:28:59 +0000 (02:28 +0000)]
qlcnic: dont set skb->truesize

skb->truesize is set in core network.

Dont change it unless dealing with fragments.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: rx_dropped accounting
Eric Dumazet [Mon, 20 Sep 2010 00:12:11 +0000 (00:12 +0000)]
net: rx_dropped accounting

Under load, netif_rx() can drop incoming packets but administrators dont
have a chance to spot which device needs some tuning (RPS activation for
example)

This patch adds rx_dropped accounting in vlans and tunnels.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoip_gre: CONFIG_IPV6_MODULE support
Eric Dumazet [Mon, 20 Sep 2010 17:06:12 +0000 (10:06 -0700)]
ip_gre: CONFIG_IPV6_MODULE support

ipv6 can be a module, we should test CONFIG_IPV6 and CONFIG_IPV6_MODULE
to enable ipv6 bits in ip_gre.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobridge : Sanitize skb before it enters the IP stack
Bandan Das [Sun, 19 Sep 2010 09:34:33 +0000 (09:34 +0000)]
bridge : Sanitize skb before it enters the IP stack

Related dicussion here : http://lkml.org/lkml/2010/9/3/16

Introduce a function br_parse_ip_options that will audit the
skb and possibly refill IP options before a packet enters the
IP stack. If no options are present, the function will zero out
the skb cb area so that it is not misinterpreted as options by some
unsuspecting IP layer routine. If packet consistency fails, drop it.

Signed-off-by: Bandan Das <bandan.das@stratus.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agords: spin_lock_irq() is not nestable
Dan Carpenter [Sat, 18 Sep 2010 13:44:14 +0000 (13:44 +0000)]
rds: spin_lock_irq() is not nestable

This is basically just a cleanup.  IRQs were disabled on the previous
line so we don't need to do it again here.  In the current code IRQs
would get turned on one line earlier than intended.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agords: double unlock in rds_ib_cm_handle_connect()
Dan Carpenter [Sat, 18 Sep 2010 13:42:59 +0000 (13:42 +0000)]
rds: double unlock in rds_ib_cm_handle_connect()

We unlock after we goto out.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agords: signedness bug
Dan Carpenter [Sat, 18 Sep 2010 13:42:25 +0000 (13:42 +0000)]
rds: signedness bug

In the original code if the copy_from_user() fails in rds_rdma_pages()
then the error handling fails and we get a stack trace from kmalloc().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobna: off by one
Dan Carpenter [Sun, 19 Sep 2010 18:25:54 +0000 (11:25 -0700)]
bna: off by one

The mod->mbhdlr[] array has BFI_MC_MAX elements.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: reorder struct netdev_hw_addr
Eric Dumazet [Sun, 19 Sep 2010 18:24:02 +0000 (11:24 -0700)]
net: reorder struct netdev_hw_addr

Move 'synced' and 'global_use' fields before 'refcount', to shrinks
struct netdev_hw_addr by 8 bytes (on 64bit arches).

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: dont assume NET_IP_ALIGN is 2
Eric Dumazet [Sat, 18 Sep 2010 05:58:08 +0000 (22:58 -0700)]
qlcnic: dont assume NET_IP_ALIGN is 2

qlcnic driver allocates rx skbs and gives to hardware too bytes of extra
storage, allowing for corruption of kernel data.

NET_IP_ALIGN being 0 on some platforms (including x86), drivers should
not assume it's 2.

rds_ring->skb_size = rds_ring->dma_size + NET_IP_ALIGN;
...
skb = dev_alloc_skb(rds_ring->skb_size);
skb_reserve(skb, 2);
pci_map_single(pdev, skb->data, rds_ring->dma_size, PCI_DMA_FROMDEVICE);

(and rds_ring->skb_size == rds_ring->dma_size) -> bug

Because of extra alignment (1500 + 32) -> four extra bytes are available
before the struct skb_shared_info, so corruption is not noticed.

Note: this driver could use netdev_alloc_skb_ip_align()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodca: disable dca on IOAT ver.3.0 multiple-IOH platforms
Sosnowski, Maciej [Thu, 16 Sep 2010 06:02:26 +0000 (06:02 +0000)]
dca: disable dca on IOAT ver.3.0 multiple-IOH platforms

Direct Cache Access is not supported on IOAT ver.3.0 multiple-IOH platforms.
This patch blocks registering of dca providers when multiple IOH detected with IOAT ver.3.0.

Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetpoll: Disable IRQ around RCU dereference in netpoll_rx
Herbert Xu [Fri, 17 Sep 2010 23:55:03 +0000 (16:55 -0700)]
netpoll: Disable IRQ around RCU dereference in netpoll_rx

We cannot use rcu_dereference_bh safely in netpoll_rx as we may
be called with IRQs disabled.  We could however simply disable
IRQs as that too causes BH to be disabled and is safe in either
case.

Thanks to John Linville for discovering this bug and providing
a patch.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding: enable gro by default
Eric Dumazet [Fri, 17 Sep 2010 09:25:07 +0000 (09:25 +0000)]
bonding: enable gro by default

gro can be enabled by default on bonding devices.

Actual support depends on the lower devices.

One can still use ethtool to switch off GRO if needed.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: Add comments for valid use of flow types
Ben Hutchings [Thu, 16 Sep 2010 11:34:26 +0000 (11:34 +0000)]
ethtool: Add comments for valid use of flow types

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool, ixgbe: Move RX n-tuple mask fixup to ethtool
Ben Hutchings [Thu, 16 Sep 2010 11:28:07 +0000 (11:28 +0000)]
ethtool, ixgbe: Move RX n-tuple mask fixup to ethtool

The ethtool utility does not set masks for flow parameters that are
not specified, so if both value and mask are 0 then this must be
treated as equivalent to a mask with all bits set.  Currently that is
done in the only driver that implements RX n-tuple filtering, ixgbe.
Move it to the ethtool core.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: Do not reset the packet during sctp_packet_config().
Vlad Yasevich [Wed, 15 Sep 2010 14:00:26 +0000 (10:00 -0400)]
sctp: Do not reset the packet during sctp_packet_config().

sctp_packet_config() is called when getting the packet ready
for appending of chunks.  The function should not touch the
current state, since it's possible to ping-pong between two
transports when sending, and that can result packet corruption
followed by skb overlfow crash.

Reported-by: Thomas Dreibholz <dreibh@iem.uni-due.de>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetns: keep vlan slaves on master netns move
David Lamparter [Fri, 17 Sep 2010 03:22:19 +0000 (03:22 +0000)]
netns: keep vlan slaves on master netns move

previously, if a vlan master device was moved from one network namespace
to another, all 802.1q and macvlan slaves were deleted.

we can use dev->reg_state to figure out whether dev_change_net_namespace
is happening, since that won't set dev->reg_state NETREG_UNREGISTERING.
so, this changes 8021q and macvlan to ignore NETDEV_UNREGISTER when
reg_state is not NETREG_UNREGISTERING.

Signed-off-by: David Lamparter <equinox@diac24.net>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Daniel Lezcano <daniel.lezcano@free.fr>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: use one memset() to reset TDES01
Giuseppe CAVALLARO [Fri, 17 Sep 2010 03:23:42 +0000 (03:23 +0000)]
stmmac: use one memset() to reset TDES01

Use one memset() to reset all TDES01 fields instead
of one by one to reduce number of instructions.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: prevent dma init stuck in case of failures.
Giuseppe CAVALLARO [Fri, 17 Sep 2010 03:23:41 +0000 (03:23 +0000)]
stmmac: prevent dma init stuck in case of failures.

Add a limit when perform the DMA reset procedure
so, in case of problems (i.e. PHY reset failed) the
Kernel won't hang on the stmmac DMA initialisation
blocking the Kernels execution.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: consolidate and tidy-up the COE support
Giuseppe CAVALLARO [Fri, 17 Sep 2010 03:23:40 +0000 (03:23 +0000)]
stmmac: consolidate and tidy-up the COE support

The first version of the driver had hard-coded the logic
for handling the checksum offloading.
This was designed according to the chips included in
the STM platforms where:
o MAC10/100 supports no COE at all.
o GMAC fully supports RX/TX COE.

This is not good for other chip configurations where,
for example, the mac10/100 supports the tx csum in HW
or when the GMAC has no IPC.

Thanks to Johannes Stezenbach; he provided me a first
draft of this patch that only reviewed the IPC for the
GMAC devices.

This patch also helps on SPEAr platforms where the
MAC10/100 can perform the TX csum in HW.
Thanks to Deepak SIKRI for his support on this.

In the end, GMAC devices for STM platforms have
a bugged Jumbo frame support that needs to have
the Tx COE disabled for oversized frames (due to
limited buffer sizes). This information is also
passed through the driver's platform structure.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Deepak SIKRI <deepak.sikri@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: add CSR Clock range selection
Giuseppe CAVALLARO [Fri, 17 Sep 2010 03:23:39 +0000 (03:23 +0000)]
stmmac: add CSR Clock range selection

This patch adds the CSR Clock range selection.

Original patch from Johannes Stezenbach fixed the CSR
in the stmmac_mdio. We agreed to provide this through
the platform instead of.
Also thanks to Johannes for having tested it on ARM.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoiwlagn: initialize both tx/rx prio boost parameters
Wey-Yi Guy [Mon, 13 Sep 2010 15:08:18 +0000 (08:08 -0700)]
iwlagn: initialize both tx/rx prio boost parameters

For config bt command, initialize both tx_prio_boost and
rx_prio_boost to "0".

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>