linux-2.6-microblaze.git
14 years agostmmac: fix kconfig for crc32 build error
Carmelo AMOROSO [Wed, 31 Mar 2010 21:44:03 +0000 (21:44 +0000)]
stmmac: fix kconfig for crc32 build error

stmmac uses crc32 functions so it needs to select CRC32.

Fixes build error:
drivers/built-in.o: In function `dwmac1000_set_filter':
dwmac1000_core.c:(.text+0x3c380): undefined reference to `crc32_le'
dwmac1000_core.c:(.text+0x3c384): undefined reference to `bitrev32'

Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: fix bug in vlan rx path for big endian architecture
Ajit Khaparde [Wed, 31 Mar 2010 02:00:32 +0000 (02:00 +0000)]
be2net: fix bug in vlan rx path for big endian architecture

vlan traffic on big endian architecture is broken.
Need to swap the vid before giving packet to stack.
This patch fixes it.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: fix flashing on big endian architectures
Ajit Khaparde [Wed, 31 Mar 2010 01:57:10 +0000 (01:57 +0000)]
be2net: fix flashing on big endian architectures

Flashing is broken on big endian architectures like ppc.
This patch fixes it.

From: Naresh G <nareshg@serverengines.com>
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobe2net: fix a bug in flashing the redboot section
Ajit Khaparde [Wed, 31 Mar 2010 01:47:45 +0000 (01:47 +0000)]
be2net: fix a bug in flashing the redboot section

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 1 Apr 2010 02:32:50 +0000 (19:32 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

14 years agobonding: bond_xmit_roundrobin() fix
Eric Dumazet [Tue, 30 Mar 2010 23:08:37 +0000 (23:08 +0000)]
bonding: bond_xmit_roundrobin() fix

Commit a2fd940f (bonding: fix broken multicast with round-robin mode)
added a problem on litle endian machines.

drivers/net/bonding/bond_main.c:4159: warning: comparison is always
false due to limited range of data type

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net: Add missing unlock
Julia Lawall [Mon, 29 Mar 2010 05:35:05 +0000 (05:35 +0000)]
drivers/net: Add missing unlock

Unlock the lock before leaving the function.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression E1;
identifier f;
@@

f (...) { <+...
* spin_lock_irqsave (E1,...);
... when != E1
* return ...;
...+> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: gianfar - align BD ring size console messages
Kim Phillips [Tue, 30 Mar 2010 11:54:22 +0000 (11:54 +0000)]
net: gianfar - align BD ring size console messages

fix this:

eth2: :RX BD ring size for Q[0]: 256
eth2:TX BD ring size for Q[0]: 256

to look like:

eth2: RX BD ring size for Q[0]: 256
eth2: TX BD ring size for Q[0]: 256

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: gianfar - initialize per-queue statistics
Kim Phillips [Tue, 30 Mar 2010 11:54:21 +0000 (11:54 +0000)]
net: gianfar - initialize per-queue statistics

Interfaces come up claiming having already received 3.0 GiB.
Use kzalloc to properly initialize per-queue data.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogianfar: Fix a memory leak in gianfar close code
Andy Fleming [Mon, 29 Mar 2010 15:42:23 +0000 (15:42 +0000)]
gianfar: Fix a memory leak in gianfar close code

gianfar needed to ensure existence of the *skbuff arrays before
freeing the skbs in them, rather than ensuring their nonexistence.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Fix oops from tcp_collapse() when using splice()
Steven J. Magnani [Tue, 30 Mar 2010 20:56:01 +0000 (13:56 -0700)]
net: Fix oops from tcp_collapse() when using splice()

tcp_read_sock() can have a eat skbs without immediately advancing copied_seq.
This can cause a panic in tcp_collapse() if it is called as a result
of the recv_actor dropping the socket lock.

A userspace program that splices data from a socket to either another
socket or to a file can trigger this bug.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/wireless/libertas: do not call wiphy_unregister() w/o wiphy_register()
Daniel Mack [Mon, 29 Mar 2010 15:14:18 +0000 (17:14 +0200)]
net/wireless/libertas: do not call wiphy_unregister() w/o wiphy_register()

The libertas driver calls wiphy_unregister() without a prior
wiphy_register() when a devices fails initialization. Fix this by
introducing a private flag.

[    9.310000] Unable to handle kernel NULL pointer dereference at virtual address 00000000

[...]

[    9.330000] [<c0311310>] (wiphy_unregister+0xfc/0x19c) from [<bf00c9ec>] (lbs_cfg_free+0x70/0x9c [libertas])
[    9.330000] [<bf00c9ec>] (lbs_cfg_free+0x70/0x9c [libertas]) from [<bf014fdc>] (lbs_remove_card+0x180/0x210 [libertas])
[    9.330000] [<bf014fdc>] (lbs_remove_card+0x180/0x210 [libertas]) from [<bf035394>] (if_sdio_probe+0xdc4/0xef4 [libertas_sdio])
[    9.330000] [<bf035394>] (if_sdio_probe+0xdc4/0xef4 [libertas_sdio]) from [<c0230d14>] (sdio_bus_probe+0xd4/0xf0)
[    9.330000] [<c0230d14>] (sdio_bus_probe+0xd4/0xf0) from [<c01a6034>] (driver_probe_device+0xa4/0x174)
[    9.330000] [<c01a6034>] (driver_probe_device+0xa4/0x174) from [<c01a6164>] (__driver_attach+0x60/0x84)
[    9.330000] [<c01a6164>] (__driver_attach+0x60/0x84) from [<c01a5854>] (bus_for_each_dev+0x4c/0x8c)
[    9.330000] [<c01a5854>] (bus_for_each_dev+0x4c/0x8c) from [<c01a50e4>] (bus_add_driver+0xa0/0x228)
[    9.330000] [<c01a50e4>] (bus_add_driver+0xa0/0x228) from [<c01a6470>] (driver_register+0xc0/0x150)
[    9.330000] [<c01a6470>] (driver_register+0xc0/0x150) from [<bf03a06c>] (if_sdio_init_module+0x6c/0x108 [libertas_sdio])
[    9.330000] [<bf03a06c>] (if_sdio_init_module+0x6c/0x108 [libertas_sdio]) from [<c00263ac>] (do_one_initcall+0x5c/0x1bc)
[    9.330000] [<c00263ac>] (do_one_initcall+0x5c/0x1bc) from [<c0069f80>] (sys_init_module+0xc0/0x1f0)
[    9.330000] [<c0069f80>] (sys_init_module+0xc0/0x1f0) from [<c0026f00>] (ret_fast_syscall+0x0/0x30)

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Dan Williams <dcbw@redhat.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Holger Schurig <hs4233@mail.mn-solutions.de>
Cc: Bing Zhao <bzhao@marvell.com>
Cc: libertas-dev@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: range checking issue
Dan Carpenter [Sun, 28 Mar 2010 11:55:00 +0000 (14:55 +0300)]
iwlwifi: range checking issue

IWL_RATE_COUNT is 13 and IWL_RATE_COUNT_LEGACY is 12.

IWL_RATE_COUNT_LEGACY is the right one here because iwl3945_rates
doesn't support 60M and also that's how "rates" is defined in
iwlcore_init_geos() from drivers/net/wireless/iwlwifi/iwl-core.c.

        rates = kzalloc((sizeof(struct ieee80211_rate) * IWL_RATE_COUNT_LEGACY),
                        GFP_KERNEL);

Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: stable@kernel.org
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agosetup correct int pipe type in ar9170_usb_exec_cmd
Valentin Longchamp [Fri, 26 Mar 2010 10:44:33 +0000 (11:44 +0100)]
setup correct int pipe type in ar9170_usb_exec_cmd

An int urb is constructed but we fill it in with a bulk pipe type.

Commit f661c6f8c67bd55e93348f160d590ff9edf08904 implemented a pipe type
check when CONFIG_USB_DEBUG is enabled. The check failed for all the ar9170
usb transfers and the driver could not configure the wifi dongle.

This went unnoticed until now because most people don't have
CONFIG_USB_DEBUG enabled.

Signed-off-by: Valentin Longchamp <valentin.longchamp@epfl.ch>
Cc: Stable <stable@kernel.org>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Disable powersaving by default in rt2500usb.
Gertjan van Wingerde [Wed, 24 Mar 2010 20:42:37 +0000 (21:42 +0100)]
rt2x00: Disable powersaving by default in rt2500usb.

Recent bug reports have shown that rt2500usb also suffers from the
powersave problems that the PCI rt2x00 drivers suffer from.
So disable powersaving by default for rt2500usb as well.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2x00: Fix typo in RF register programming of rt2800.
Gertjan van Wingerde [Wed, 24 Mar 2010 20:42:36 +0000 (21:42 +0100)]
rt2x00: Fix typo in RF register programming of rt2800.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: clear unattended interrupts in tasklet
Shanyu Zhao [Tue, 16 Mar 2010 17:22:26 +0000 (10:22 -0700)]
iwlwifi: clear unattended interrupts in tasklet

Previously in interrupt handling tasklet, iwlwifi driver only clear/ack
those interrupts that are enabled by the driver through inta_mask.
If the hardware generates unattended interrupts, driver will not ack them,
defeating the interrupt coalescing feature. This results in high number
of interrupts per second and high CPU utilization.

This patch addresses this issue by acking those unattended interrupts
in the tasklet. Local test showed an order of magnitude improvement
in terms of the number of interrupts without sacrificing networking
throughput. This is a workaround for hardware issue.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
14 years agoiwlwifi: counting number of tfds can be free for 4965
Wey-Yi Guy [Thu, 18 Mar 2010 16:05:00 +0000 (09:05 -0700)]
iwlwifi: counting number of tfds can be free for 4965

Forget one hunk in 4965 during "iwlwifi: error checking for number of tfds
in queue" patch.

Reported-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: stable@kernel.org
14 years agoiwlwifi: fix regulatory
Reinette Chatre [Fri, 12 Mar 2010 19:13:26 +0000 (11:13 -0800)]
iwlwifi: fix regulatory

Commit "cfg80211: convert bools into flags" mistakenly modified iwlwifi's
regulatory settings instead of just converting it. Fix this.

This fixes http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2172

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: stable@kernel.org
14 years agomac80211: move netdev queue enabling to correct spot
Johannes Berg [Mon, 22 Mar 2010 20:42:43 +0000 (13:42 -0700)]
mac80211: move netdev queue enabling to correct spot

"mac80211: fix skb buffering issue" still left a race
between enabling the hardware queues and the virtual
interface queues. In hindsight it's totally obvious
that enabling the netdev queues for a hardware queue
when the hardware queue is enabled is wrong, because
it could well possible that we can fill the hw queue
with packets we already have pending. Thus, we must
only enable the netdev queues once all the pending
packets have been processed and sent off to the device.

In testing, I haven't been able to trigger this race
condition, but it's clearly there, possibly only when
aggregation is being enabled.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoAdd USB ID for Thomson SpeedTouch 120g to p54usb id table
Hans de Goede [Wed, 17 Mar 2010 13:37:16 +0000 (14:37 +0100)]
Add USB ID for Thomson SpeedTouch 120g to p54usb id table

Thanks to Chris Chabot for giving his old wireless usb dongle to me
to test it under Linux.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoAdd a pci-id to the mwl8k driver
Benjamin Larsson [Fri, 19 Mar 2010 00:46:10 +0000 (01:46 +0100)]
Add a pci-id to the mwl8k driver

Signed-off-by: Benjamin Larsson <banan@ludd.ltu.se>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoar9170: add support for NEC WL300NU-G USB dongle
Ben Konrath [Thu, 18 Mar 2010 23:06:57 +0000 (19:06 -0400)]
ar9170: add support for NEC WL300NU-G USB dongle

This patch adds support for the NEC WL300NU-G USB wifi dongle.

Signed-off-by: Ben Konrath <ben@bagu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix PREQ processing and one small bug
Porsch, Marco [Wed, 24 Feb 2010 08:53:13 +0000 (09:53 +0100)]
mac80211: fix PREQ processing and one small bug

1st) a PREQ should only be processed, if it has the same SN and better
metric (instead of better or equal).
2nd) next_hop[ETH_ALEN] now actually used to buffer
mpath->next_hop->sta.addr for use out of lock.

Signed-off-by: Marco Porsch <marco.porsch@siemens.com>
Acked-by: Javier Cardona <javier@cozybit.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: correct typos in "unavailable upon resume" warning
John W. Linville [Wed, 17 Mar 2010 15:28:18 +0000 (11:28 -0400)]
mac80211: correct typos in "unavailable upon resume" warning

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowireless: convert reg_regdb_search_lock to mutex
John W. Linville [Tue, 16 Mar 2010 19:40:59 +0000 (15:40 -0400)]
wireless: convert reg_regdb_search_lock to mutex

Stanse discovered that kmalloc is being called with GFP_KERNEL while
holding this spinlock.  The spinlock can be a mutex instead, which also
enables the removal of the unlock/lock around the lock/unlock of
cfg80211_mutex and the call to set_regdom.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agor8169: offical fix for CVE-2009-4537 (overlength frame DMAs)
Neil Horman [Mon, 29 Mar 2010 20:16:02 +0000 (13:16 -0700)]
r8169: offical fix for CVE-2009-4537 (overlength frame DMAs)

Official patch to fix the r8169 frame length check error.

Based on this initial thread:
http://marc.info/?l=linux-netdev&m=126202972828626&w=1
This is the official patch to fix the frame length problems in the r8169
driver.  As noted in the previous thread, while this patch incurs a performance
hit on the driver, its possible to improve performance dynamically by updating
the mtu and rx_copybreak values at runtime to return performance to what it was
for those NICS which are unaffected by the ideosyncracy (if there are any).

Summary:

    A while back Eric submitted a patch for r8169 in which the proper
allocated frame size was written to RXMaxSize to prevent the NIC from dmaing too
much data.  This was done in commit fdd7b4c3302c93f6833e338903ea77245eb510b4.  A
long time prior to that however, Francois posted
126fa4b9ca5d9d7cb7d46f779ad3bd3631ca387c, which expiclitly disabled the MaxSize
setting due to the fact that the hardware behaved in odd ways when overlong
frames were received on NIC's supported by this driver.  This was mentioned in a
security conference recently:
http://events.ccc.de/congress/2009/Fahrplan//events/3596.en.html

It seems that if we can't enable frame size filtering, then, as Eric correctly
noticed, we can find ourselves DMA-ing too much data to a buffer, causing
corruption.  As a result is seems that we are forced to allocate a frame which
is ready to handle a maximally sized receive.

This obviously has performance issues with it, so to mitigate that issue, this
patch does two things:

1) Raises the copybreak value to the frame allocation size, which should force
appropriately sized packets to get allocated on rx, rather than a full new 16k
buffer.

2) This patch only disables frame filtering initially (i.e., during the NIC
open), changing the MTU results in ring buffer allocation of a size in relation
to the new mtu (along with a warning indicating that this is dangerous).

Because of item (2), individuals who can't cope with the performance hit (or can
otherwise filter frames to prevent the bug), or who have hardware they are sure
is unaffected by this issue, can manually lower the copybreak and reset the mtu
such that performance is restored easily.

Signed-off-by: Neil Horman <nhorman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv6: Don't drop cache route entry unless timer actually expired.
YOSHIFUJI Hideaki / 吉藤英明 [Sun, 28 Mar 2010 07:15:45 +0000 (07:15 +0000)]
ipv6: Don't drop cache route entry unless timer actually expired.

This is ipv6 variant of the commit 5e016cbf6.. ("ipv4: Don't drop
redirected route cache entry unless PTMU actually expired")
by Guenter Roeck <guenter.roeck@ericsson.com>.

Remove cache route entry in ipv6_negative_advice() only if
the timer is expired.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotulip: Add missing parens.
David S. Miller [Mon, 29 Mar 2010 01:56:34 +0000 (18:56 -0700)]
tulip: Add missing parens.

As reported by Stephen Rothwell.

drivers/net/tulip/uli526x.c: In function 'uli526x_rx_packet':
drivers/net/tulip/uli526x.c:861: warning: assignment makes pointer from integer without a cast

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agor8169: fix broken register writes
Francois Romieu [Sun, 28 Mar 2010 02:35:46 +0000 (19:35 -0700)]
r8169: fix broken register writes

This is quite similar to b39fe41f481d20c201012e4483e76c203802dda7
though said registers are not even documented as 64-bit registers
- as opposed to the initial TxDescStartAddress ones - but as single
bytes which must be combined into 32 bits at the MMIO read/write
level before being merged into a 64 bit logical entity.

Credits go to Ben Hutchings <ben@decadent.org.uk> for the MAR
registers (aka "multicast is broken for ages on ARM) and to
Timo Teräs <timo.teras@iki.fi> for the MAC registers.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopcnet_cs: add new id
Ken Kawasaki [Sat, 27 Mar 2010 10:55:37 +0000 (10:55 +0000)]
pcnet_cs: add new id

pcnet_cs:
 *add new id (Allied Telesis LM33-PCM-T Lan&Modem multifunction card)
 *use PROD_ID for LA-PCM.(because LA-PCM and LM33-PCM-T use the same MANF_ID).

Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: fix broken multicast with round-robin mode
Andy Gospodarek [Thu, 25 Mar 2010 14:49:05 +0000 (14:49 +0000)]
bonding: fix broken multicast with round-robin mode

Round-robin (mode 0) does nothing to ensure that any multicast traffic
originally destined for the host will continue to arrive at the host when
the link that sent the IGMP join or membership report goes down.  One of
the benefits of absolute round-robin transmit.

Keeping track of subscribed multicast groups for each slave did not seem
like a good use of resources, so I decided to simply send on the
curr_active slave of the bond (typically the first enslaved device that
is up).  This makes failover management simple as IGMP membership
reports only need to be sent when the curr_active_slave changes.  I
tested this patch and it appears to work as expected.

Originally reported by Lon Hohberger <lhh@redhat.com>.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
CC: Lon Hohberger <lhh@redhat.com>
CC: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net: Fix continuation lines
Joe Perches [Fri, 26 Mar 2010 16:27:55 +0000 (16:27 +0000)]
drivers/net: Fix continuation lines

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoe1000: do not modify tx_queue_len on link speed change
Emil Tantilov [Fri, 26 Mar 2010 11:25:58 +0000 (11:25 +0000)]
e1000: do not modify tx_queue_len on link speed change

Previously the driver tweaked txqueuelen to avoid false Tx hang reports
seen at half duplex.  This had the effect of overriding user set values
on link change/reset. Testing shows that adjusting only the timeout
factor is sufficient to prevent Tx hang reports at half duplex.

This patch removes all instances of tx_queue_len in the driver.

Based on e1000e patch by Franco Fichtner <franco@lastsummer.de>

CC: Franco Fichtner <franco@lastsummer.de>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Acked-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>
14 years agonet: ipmr/ip6mr: prevent out-of-bounds vif_table access
Nicolas Dichtel [Thu, 25 Mar 2010 23:45:35 +0000 (23:45 +0000)]
net: ipmr/ip6mr: prevent out-of-bounds vif_table access

When cache is unresolved, c->mf[6]c_parent is set to 65535 and
minvif, maxvif are not initialized, hence we must avoid to
parse IIF and OIF.
A second problem can happen when the user dumps a cache entry
where a VIF, that was referenced at creation time, has been
removed.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Do not run all Diagnostic offline tests when VFs are active
Greg Rose [Thu, 25 Mar 2010 17:06:48 +0000 (17:06 +0000)]
ixgbe: Do not run all Diagnostic offline tests when VFs are active

When running the offline diagnostic tests check to see if any VFs are
online.  If so then only run the link test.  This is necessary because
the VFs running in guest VMs aren't aware of when the PF is taken
offline for a diagnostic test.  Also put a message to the system log
telling the system administrator to take the VFs offline manually if
(s)he wants to run a full diagnostic.  Return 1 on each of the tests
not run to alert the user of the condition.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoigb: use correct bits to identify if managability is enabled
Alexander Duyck [Thu, 25 Mar 2010 17:15:06 +0000 (17:15 +0000)]
igb: use correct bits to identify if managability is enabled

igb was previously checking the wrong bits in the MANC register to determine
if managability was enabled.  As a result it was incorrectly powering down and
resetting the phy when it didn't need to.

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>
14 years agobenet: Fix compile warnnings in drivers/net/benet/be_ethtool.c
wzt wzt [Thu, 25 Mar 2010 20:12:59 +0000 (20:12 +0000)]
benet: Fix compile warnnings in drivers/net/benet/be_ethtool.c

Fix the following warnings:

be_ethtool.c:493: warning: integer constant is too large for 'long' type
be_ethtool.c:493: warning: integer constant is too large for 'long' type

Signed-off-by: Zhitong Wang <zhitong.wangzt@alibaba-inc.com>
Acked-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: Add MSG_WAITFORONE flag to recvmmsg
Brandon L Black [Fri, 26 Mar 2010 16:18:03 +0000 (16:18 +0000)]
net: Add MSG_WAITFORONE flag to recvmmsg

Add new flag MSG_WAITFORONE for the recvmmsg() syscall.
When this flag is specified for a blocking socket, recvmmsg()
will only block until at least 1 packet is available.  The
default behavior is to block until all vlen packets are
available.  This flag has no effect on non-blocking sockets
or when used in combination with MSG_DONTWAIT.

Signed-off-by: Brandon L Black <blblack@gmail.com>
Acked-by: Ulrich Drepper <drepper@redhat.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoe1000e: do not modify tx_queue_len on link speed change
Emil Tantilov [Wed, 24 Mar 2010 12:55:02 +0000 (12:55 +0000)]
e1000e: do not modify tx_queue_len on link speed change

Previously the driver tweaked txqueuelen to avoid false Tx hang reports seen at half duplex.
This had the effect of overriding user set values on link change/reset. Testing shows that
adjusting only the timeout factor is sufficient to prevent Tx hang reports at half duplex.

This patch removes all instances of tx_queue_len in the driver.

Originally reported and patched by Franco Fichtner
CC: Franco Fichtner <franco@lastsummer.de>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoigbvf: do not modify tx_queue_len on link speed change
Emil Tantilov [Thu, 25 Mar 2010 12:11:48 +0000 (12:11 +0000)]
igbvf: do not modify tx_queue_len on link speed change

Previously the driver tweaked txqueuelen to avoid false Tx hang reports seen at half duplex.
This had the effect of overriding user set values on link change/reset. Testing shows that
adjusting only the timeout factor is sufficient to prevent Tx hang reports at half duplex.

Based on e1000e patch by Franco Fichtner <franco@lastsummer.de>

CC: Franco Fichtner <franco@lastsummer.de>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: Restart rt_intern_hash after emergency rebuild (v2)
Pavel Emelyanov [Wed, 24 Mar 2010 21:51:22 +0000 (21:51 +0000)]
ipv4: Restart rt_intern_hash after emergency rebuild (v2)

The the rebuild changes the genid which in turn is used at
the hash calculation. Thus if we don't restart and go on with
inserting the rt will happen in wrong chain.

(Fixed Neil's comment about the index passed into the rt_intern_hash)

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Reviewed-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: Cleanup struct net dereference in rt_intern_hash
Pavel Emelyanov [Wed, 24 Mar 2010 07:43:17 +0000 (07:43 +0000)]
ipv4: Cleanup struct net dereference in rt_intern_hash

There's no need in getting it 3 times and gcc isn't smart enough
to understand this himself.

This is just a cleanup before the fix (next patch).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: fix netlink address dumping in IPv4/IPv6
Patrick McHardy [Sat, 27 Mar 2010 03:27:49 +0000 (20:27 -0700)]
net: fix netlink address dumping in IPv4/IPv6

When a dump is interrupted at the last device in a hash chain and
then continued, "idx" won't get incremented past s_idx, so s_ip_idx
is not reset when moving on to the next device. This means of all
following devices only the last n - s_ip_idx addresses are dumped.

Tested-by: Pawel Staszewski <pstaszewski@itcare.pl>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agotulip: Fix null dereference in uli526x_rx_packet()
Kyle McMartin [Fri, 27 Mar 2009 17:23:32 +0000 (17:23 +0000)]
tulip: Fix null dereference in uli526x_rx_packet()

Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agogianfar: fix undo of reserve()
Ben Menchaca [Wed, 24 Mar 2010 05:05:02 +0000 (05:05 +0000)]
gianfar: fix undo of reserve()

Fix undo of reserve() before RX recycle

gfar_new_skb reserve()s space in the SKB to align it.  If an error occurs,
and the skb needs to be returned to the RX recycle queue, the current code
attempts to reset head, but did not reset tail.  This patch remembers the
alignment amount, and reverses the reserve() when needed.

Signed-off-by: Ben Menchaca <ben@bigfootnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: filter FIP frames into the FCoE offload queues
Chris Leech [Wed, 24 Mar 2010 12:45:21 +0000 (12:45 +0000)]
ixgbe: filter FIP frames into the FCoE offload queues

During FCF solicitation, the switch is supposed to pad the
solicited advertisement out to the endpoints specified
maximum FCoE frame size.  That means that we need to receive
FIP frames that are larger than the standard MTU.  To make
sure the receive queue is configured correctly, we should be
filtering FIP traffic into the FCoE queues.

Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Priority tag FIP frames
Robert Love [Wed, 24 Mar 2010 12:45:00 +0000 (12:45 +0000)]
ixgbe: Priority tag FIP frames

Currently FIP (FCoE Initialization Protocol) frames
are going untagged. This causes various problems
with FCFs (switches) that have negotiated a priority
over dcbx. This patch tags FIP frames with the same
priority as the FCoE frames.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Don't allow user buffer count to exceed 256
Robert Love [Wed, 24 Mar 2010 10:02:04 +0000 (10:02 +0000)]
ixgbe: Don't allow user buffer count to exceed 256

If the user buffer count was 256 the shift would place a 1
in the offset region leading to errors. It also overwrites
the uers buffer list. This patch makes sure that at most
256 user buffers are allowed for DDP and the buffer count
is masked properly such that it doesn't overwrite the offset
when shifting the bits.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Frank Zhang <frank_1.zhang@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: cleanup maximum number of tx queues
John Fastabend [Wed, 24 Mar 2010 10:01:45 +0000 (10:01 +0000)]
ixgbe: cleanup maximum number of tx queues

In the last patch I missed an unecessary min_t comparison.
This patch removes it, the path allocates at most
72 tx queues for 82599 and 24 for 82598 there is no need
for this check.

Additionally this sets MAX_[TX|RX]_QUEUES to 72.  Which is
used as the size for the tx/rx_ring arrays. There is no
reason to have more tx_rings/rx_rings then num_tx_queues.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Change where clear_to_send_flag is reset to zero.
Greg Rose [Wed, 24 Mar 2010 09:36:27 +0000 (09:36 +0000)]
ixgbe: Change where clear_to_send_flag is reset to zero.

The clear_to_send flag is being cleared before the call to ping all
the VFs.  It should be called after pinging all the VFs.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: In SR-IOV mode insert delay before bring the adapter up
Greg Rose [Wed, 24 Mar 2010 09:36:08 +0000 (09:36 +0000)]
ixgbe: In SR-IOV mode insert delay before bring the adapter up

VFs running in guest VMs do not respond in as timely a manner to
PF indication it is going down as they do when running in the host
domain.  If the adapter is in SR-IOV mode insert a two second delay
to guarantee that all VFs have had time to respond to the PF reset.
In any case resetting the PF while VFs are active should be
discouraged but if it must be done then there will be a two
second delay to help synchronize resets among the PF and all the
VFs.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbevf: Fix signed/unsigned int error
Greg Rose [Wed, 24 Mar 2010 09:35:42 +0000 (09:35 +0000)]
ixgbevf: Fix signed/unsigned int error

In the Tx mapping function if a DMA error occurred then the unwind of
previously mapped sections would improperly check an unsigned int if
it was less than zero.  Changed the index variable to signed to avoid
the error.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: update version to 4.0.73
Amit Kumar Salecha [Fri, 26 Mar 2010 00:30:10 +0000 (00:30 +0000)]
netxen: update version to 4.0.73

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: added sanity check for pci map
Amit Kumar Salecha [Fri, 26 Mar 2010 00:30:09 +0000 (00:30 +0000)]
netxen: added sanity check for pci map

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Return value of ioremap is not checked, NULL check added.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix warning in ioaddr for NX3031 chip
Amit Kumar Salecha [Fri, 26 Mar 2010 00:30:08 +0000 (00:30 +0000)]
netxen: fix warning in ioaddr for NX3031 chip

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
crb_intr_mask/crb_sts_consumer is predefined for NX2031 not for
NX3031. For NX3031, these values get defined in rx context creation.
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix bios version calculation
Amit Kumar Salecha [Fri, 26 Mar 2010 00:30:07 +0000 (00:30 +0000)]
netxen: fix bios version calculation

Bios sub version from unified fw image is calculated incorrect.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoRevert "r8169: enable 64-bit DMA by default for PCI Express devices (v2)"
David S. Miller [Fri, 26 Mar 2010 17:23:30 +0000 (10:23 -0700)]
Revert "r8169: enable 64-bit DMA by default for PCI Express devices (v2)"

This reverts commit 353176888386d9025062a12dcec08d49af10cf2c.

People are reporting problems due to this change and there
is no anticipation that the cause will be tracked down
any time soon.

We can try next time to selectively re-enable this based upon chip
type, or have a black list of some sort.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoisdn: Add netdev to lists in MAINTAINERS entry.
David S. Miller [Fri, 26 Mar 2010 03:32:39 +0000 (20:32 -0700)]
isdn: Add netdev to lists in MAINTAINERS entry.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoTIPC: Removed inactive maintainer
Jon Maloy [Thu, 25 Mar 2010 19:40:09 +0000 (12:40 -0700)]
TIPC: Removed inactive maintainer

Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoisdn: Cleanup Sections in PCMCIA driver elsa
Henne [Thu, 25 Mar 2010 12:05:32 +0000 (12:05 +0000)]
isdn: Cleanup Sections in PCMCIA driver elsa

Compiling this driver gave a section mismatch,
so I reviewed the init/exit paths of the driver
and made the correct changes.

WARNING: drivers/isdn/hisax/built-in.o(.text+0x55e37): Section mismatch
in reference from the function elsa_cs_config() to the function
.devinit.text:hisax_init_pcmcia()
The function elsa_cs_config() references
the function __devinit hisax_init_pcmcia().
This is often because elsa_cs_config lacks a __devinit
annotation or the annotation of hisax_init_pcmcia is wrong.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Acked-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoisdn: Cleanup Sections in PCMCIA driver avma1
Henne [Thu, 25 Mar 2010 12:05:31 +0000 (12:05 +0000)]
isdn: Cleanup Sections in PCMCIA driver avma1

Compiling this driver gave a section mismatch,
so I reviewed the init/exit paths of the driver
and made the correct changes.

WARNING: drivers/isdn/hisax/built-in.o(.text+0x56512): Section mismatch
in reference from the function avma1cs_config() to the function
.devinit.text:hisax_init_pcmcia()
The function avma1cs_config() references
the function __devinit hisax_init_pcmcia().
This is often because avma1cs_config lacks a __devinit
annotation or the annotation of hisax_init_pcmcia is wrong.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Acked-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoisdn: Cleanup Sections in PCMCIA driver teles
Henne [Thu, 25 Mar 2010 12:05:30 +0000 (12:05 +0000)]
isdn: Cleanup Sections in PCMCIA driver teles

Compiling this driver gave a section mismatch,
so I reviewed the init/exit paths of the driver
and made the correct changes.

WARNING: drivers/isdn/hisax/built-in.o(.text+0x56bfb): Section mismatch
in reference from the function teles_cs_config() to the function
.devinit.text:hisax_init_pcmcia()
The function teles_cs_config() references
the function __devinit hisax_init_pcmcia().
This is often because teles_cs_config lacks a __devinit
annotation or the annotation of hisax_init_pcmcia is wrong.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Acked-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoisdn: Cleanup Sections in PCMCIA driver sedlbauer
Henne [Thu, 25 Mar 2010 12:05:29 +0000 (12:05 +0000)]
isdn: Cleanup Sections in PCMCIA driver sedlbauer

Compiling this driver gave a section mismatch,
so I reviewed the init/exit paths of the driver
and made the correct changes.

WARNING: drivers/isdn/hisax/built-in.o(.text+0x558d6): Section mismatch
in reference from the function sedlbauer_config() to the function
.devinit.text:hisax_init_pcmcia()
The function sedlbauer_config() references
the function __devinit hisax_init_pcmcia().
This is often because sedlbauer_config lacks a __devinit
annotation or the annotation of hisax_init_pcmcia is wrong.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Acked-by: Karsten Keil <keil@b1-systems.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovia-velocity: Fix FLOW_CNTL_TX_RX handling in set_mii_flow_control()
David S. Miller [Tue, 23 Mar 2010 02:59:47 +0000 (19:59 -0700)]
via-velocity: Fix FLOW_CNTL_TX_RX handling in set_mii_flow_control()

Clear, don't set, ANAR_ASMDIR in this case.

Noticed by Roel Kluin.

Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-2.6
David S. Miller [Thu, 25 Mar 2010 18:48:58 +0000 (11:48 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-2.6

14 years agonetfilter: xt_hashlimit: IPV6 bugfix
Eric Dumazet [Thu, 25 Mar 2010 16:25:11 +0000 (17:25 +0100)]
netfilter: xt_hashlimit: IPV6 bugfix

A missing break statement in hashlimit_ipv6_mask(), and masks
between /64 and /95 are not working at all...

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: ip6table_raw: fix table priority
Jozsef Kadlecsik [Thu, 25 Mar 2010 10:17:26 +0000 (11:17 +0100)]
netfilter: ip6table_raw: fix table priority

The order of the IPv6 raw table is currently reversed, that makes impossible
to use the NOTRACK target in IPv6: for example if someone enters

ip6tables -t raw -A PREROUTING -p tcp --dport 80 -j NOTRACK

and if we receive fragmented packets then the first fragment will be
untracked and thus skip nf_ct_frag6_gather (and conntrack), while all
subsequent fragments enter nf_ct_frag6_gather and reassembly will never
successfully be finished.

Singed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agonetfilter: xt_hashlimit: dl_seq_stop() fix
Eric Dumazet [Thu, 25 Mar 2010 10:00:22 +0000 (11:00 +0100)]
netfilter: xt_hashlimit: dl_seq_stop() fix

If dl_seq_start() memory allocation fails, we crash later in
dl_seq_stop(), trying to kfree(ERR_PTR(-ENOMEM))

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agoaf_key: return error if pfkey_xfrm_policy2msg_prep() fails
Dan Carpenter [Wed, 24 Mar 2010 01:47:00 +0000 (01:47 +0000)]
af_key: return error if pfkey_xfrm_policy2msg_prep() fails

The original code saved the error value but just returned 0 in the end.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Jamal Hadi Salim <hadi@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoskbuff: remove unused dma_head & dma_maps fields
Alexander Duyck [Tue, 23 Mar 2010 20:40:50 +0000 (20:40 +0000)]
skbuff: remove unused dma_head & dma_maps fields

The dma map fields in the skb_shared_info structure no longer has any users
and can be dropped since it is making the skb_shared_info unecessarily larger.

Running slabtop show that we were using 4K slabs for the skb->head on x86_64 w/
an allocation size of 1522.  It turns out that the dma_head and dma_maps array
made skb_shared large enough that we had crossed over the 2k boundary with
standard frames and as such we were using 4k blocks of memory for all skbs.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovlan: updates vlan real_num_tx_queues
Vasu Dev [Tue, 23 Mar 2010 14:42:05 +0000 (14:42 +0000)]
vlan: updates vlan real_num_tx_queues

Updates real_num_tx_queues in case underlying real device
has changed real_num_tx_queues.

-v2
 As per Eric Dumazet<eric.dumazet@gmail.com> comment:-
   -- adds BUG_ON to catch case of real_num_tx_queues exceeding num_tx_queues.
   -- created this self contained patch to just update real_num_tx_queues.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovlan: adds vlan_dev_select_queue
Vasu Dev [Tue, 23 Mar 2010 14:41:45 +0000 (14:41 +0000)]
vlan: adds vlan_dev_select_queue

This is required to correctly select vlan tx queue for a driver
supporting multi tx queue with ndo_select_queue implemented since
currently selected vlan tx queue is unaligned to selected queue by
real net_devce ndo_select_queue.

Unaligned vlan tx queue selection causes thrash with higher vlan
tx lock contention for least fcoe traffic and wrong socket tx
queue_mapping for ixgbe having ndo_select_queue implemented.

-v2

As per Eric Dumazet<eric.dumazet@gmail.com> comments, mirrored
vlan net_device_ops to have them with and without vlan_dev_select_queue
and then select according to real dev ndo_select_queue present or not
for a vlan net_device. This is to completely skip vlan_dev_select_queue
calling for real net_device not supporting ndo_select_queue.

Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoigb: only use vlan_gro_receive if vlans are registered
Alexander Duyck [Tue, 23 Mar 2010 18:35:18 +0000 (18:35 +0000)]
igb: only use vlan_gro_receive if vlans are registered

This change makes it so that vlan_gro_receive is only used if vlans have been
registered to the adapter structure.  Previously we were just sending all vlan
tagged frames in via this function but this results in a null pointer
dereference when vlans are not registered.

[ This fixes bugzilla entry 15582 -Eric Dumazet]

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoigb: do not modify tx_queue_len on link speed change
Emil Tantilov [Tue, 23 Mar 2010 18:34:57 +0000 (18:34 +0000)]
igb: do not modify tx_queue_len on link speed change

Previously the driver tweaked txqueuelen to avoid false Tx hang reports seen at half duplex.
This had the effect of overriding user set values on link change/reset. Testing shows that
adjusting only the timeout factor is sufficient to prevent Tx hang reports at half duplex.

Based on e1000e patch by Franco Fichtner <franco@lastsummer.de>

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoigb: count Rx FIFO errors correctly
Mitch Williams [Tue, 23 Mar 2010 18:34:38 +0000 (18:34 +0000)]
igb: count Rx FIFO errors correctly

Don't aggregate rx_no_buffer_count into rx_fifo_errors. RNBC counts
packets that get queued temporarily in the adapter's FIFO. These
packets are not dropped and are not errors. The correct counter
is rx_missed_errors (MPC).

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2: Use proper handler during netpoll.
Michael Chan [Tue, 23 Mar 2010 13:13:12 +0000 (13:13 +0000)]
bnx2: Use proper handler during netpoll.

Netpoll needs to call the proper handler depending on the IRQ mode
and the vector.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2: Fix netpoll crash.
Benjamin Li [Tue, 23 Mar 2010 13:13:11 +0000 (13:13 +0000)]
bnx2: Fix netpoll crash.

The bnx2 driver calls netif_napi_add() for all the NAPI structs during
->probe() time but not all of them will be used if we're not in MSI-X
mode.  This creates a problem for netpoll since it will poll all the
NAPI structs in the dev_list whether or not they are scheduled, resulting
in a crash when we access structure fields not initialized for that vector.

We fix it by moving the netif_napi_add() call to ->open() after the number
of IRQ vectors has been determined.

Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoksz884x: fix return value of netdev_set_eeprom
Jens Rottmann [Tue, 23 Mar 2010 04:23:50 +0000 (04:23 +0000)]
ksz884x: fix return value of netdev_set_eeprom

ksz884x: fix return value of netdev_set_eeprom

netdev_set_eeprom() confused ethtool by just returning 1 on error
instead of a proper -EINVAL.

Signed-off-by: Jens Rottmann <JRottmann@LiPPERTEmbedded.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocgroups: net_cls as module
Ben Blum [Tue, 23 Mar 2010 05:24:03 +0000 (05:24 +0000)]
cgroups: net_cls as module

Allows the net_cls cgroup subsystem to be compiled as a module

This patch modifies net/sched/cls_cgroup.c to allow the net_cls subsystem
to be optionally compiled as a module instead of builtin.  The
cgroup_subsys struct is moved around a bit to allow the subsys_id to be
either declared as a compile-time constant by the cgroup_subsys.h include
in cgroup.h, or, if it's a module, initialized within the struct by
cgroup_load_subsys.

Signed-off-by: Ben Blum <bblum@andrew.cmu.edu>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Paul Menage <menage@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: The driver doesn't work on NX_P3_B1 so cause probe to fail.
Eric W. Biederman [Wed, 17 Mar 2010 22:24:39 +0000 (22:24 +0000)]
netxen: The driver doesn't work on NX_P3_B1 so cause probe to fail.

I haven't been able to get link up on a NX_P3_B1 since 2.6.31.  The
driver complains about a firmware hang instead.  When I asked I was
told rev 0x41 was a preproduction rev.  So disable support in the
driver so no one is surprised the code doesn't work.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetpoll: warn when there are spaces in parameters
Amerigo Wang [Sun, 21 Mar 2010 22:59:58 +0000 (22:59 +0000)]
netpoll: warn when there are spaces in parameters

v2: update according to Frans' comments.

Currently, if we leave spaces before dst port,
netconsole will silently accept it as 0. Warn about this.

Also, when spaces appear in other places, make them
visible in error messages.

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: David Miller <davem@davemloft.net>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: bfin_can: switch to common Blackfin can header
Mike Frysinger [Sun, 21 Mar 2010 21:06:01 +0000 (21:06 +0000)]
can: bfin_can: switch to common Blackfin can header

The MMR bits are being moved to this header, so include it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'master' of /home/davem/src/GIT/linux-2.6/
David S. Miller [Tue, 23 Mar 2010 03:05:26 +0000 (20:05 -0700)]
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/

14 years agoFix up prototype for sys_ipc breakage
Linus Torvalds [Mon, 22 Mar 2010 20:12:33 +0000 (13:12 -0700)]
Fix up prototype for sys_ipc breakage

Commit 45575f5a426c ("ppc64 sys_ipc breakage in 2.6.34-rc2") fixed the
definition of the sys_ipc() helper, but didn't fix the prototype in
<linux/syscalls.h>

Reported-and-tested-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agonetfilter: xt_recent: fix regression in rules using a zero hit_count
Patrick McHardy [Mon, 22 Mar 2010 17:25:20 +0000 (18:25 +0100)]
netfilter: xt_recent: fix regression in rules using a zero hit_count

Commit 8ccb92ad (netfilter: xt_recent: fix false match) fixed supposedly
false matches in rules using a zero hit_count. As it turns out there is
nothing false about these matches and people are actually using entries
with a hit_count of zero to make rules dependant on addresses inserted
manually through /proc.

Since this slipped past the eyes of three reviewers, instead of
reverting the commit in question, this patch explicitly checks
for a hit_count of zero to make the intentions more clear.

Reported-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Tested-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
Cc: stable@kernel.org
Signed-off-by: Patrick McHardy <kaber@trash.net>
14 years agorxrpc: Check allocation failure.
Tetsuo Handa [Mon, 22 Mar 2010 17:22:55 +0000 (10:22 -0700)]
rxrpc: Check allocation failure.

alloc_skb() can return NULL.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Linus Torvalds [Mon, 22 Mar 2010 17:03:51 +0000 (10:03 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/mst/vhost

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  virtio: console: Check if port is valid in resize_console
  virtio: console: Generate a kobject CHANGE event on adding 'name' attribute

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Mon, 22 Mar 2010 17:01:58 +0000 (10:01 -0700)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (38 commits)
  ip_gre: include route header_len in max_headroom calculation
  if_tunnel.h: add missing ams/byteorder.h include
  ipv4: Don't drop redirected route cache entry unless PTMU actually expired
  net: suppress lockdep-RCU false positive in FIB trie.
  Bluetooth: Fix kernel crash on L2CAP stress tests
  Bluetooth: Convert debug files to actually use debugfs instead of sysfs
  Bluetooth: Fix potential bad memory access with sysfs files
  netfilter: ctnetlink: fix reliable event delivery if message building fails
  netlink: fix NETLINK_RECV_NO_ENOBUFS in netlink_set_err()
  NET_DMA: free skbs periodically
  netlink: fix unaligned access in nla_get_be64()
  tcp: Fix tcp_mark_head_lost() with packets == 0
  net: ipmr/ip6mr: fix potential out-of-bounds vif_table access
  KS8695: update ksp->next_rx_desc_read at the end of rx loop
  igb: Add support for 82576 ET2 Quad Port Server Adapter
  ixgbevf: Message formatting cleanups
  ixgbevf: Shorten up delay timer for watchdog task
  ixgbevf: Fix VF Stats accounting after reset
  ixgbe: Set IXGBE_RSC_CB(skb)->DMA field to zero after unmapping the address
  ixgbe: fix for real_num_tx_queues update issue
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp
Linus Torvalds [Mon, 22 Mar 2010 16:58:04 +0000 (09:58 -0700)]
Merge branch 'for-linus' of git://git./linux/kernel/git/bp/bp

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
  edac, mce: Filter out invalid values

14 years agorxrpc: Check allocation failure.
Tetsuo Handa [Mon, 22 Mar 2010 13:50:19 +0000 (13:50 +0000)]
rxrpc: Check allocation failure.

alloc_skb() can return NULL.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoAFS: Potential null dereference
Dan Carpenter [Mon, 22 Mar 2010 13:07:14 +0000 (13:07 +0000)]
AFS: Potential null dereference

It seems clear from the surrounding code that xpermits is allowed to be
NULL here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoppc64 sys_ipc breakage in 2.6.34-rc2
Anton Blanchard [Mon, 22 Mar 2010 06:47:59 +0000 (17:47 +1100)]
ppc64 sys_ipc breakage in 2.6.34-rc2

I chased down a fail on ppc64 on 2.6.34-rc2 where an application that
uses shared memory was getting a SEGV.

Commit baed7fc9b580bd3fb8252ff1d9b36eaf1f86b670 ("Add generic sys_ipc
wrapper") changed the second argument from an unsigned long to an int.
When we call shmget the system call wrappers for sys_ipc will sign
extend second (ie the size) which truncates it.  It took a while to
track down because the call succeeds and strace shows the untruncated
size :)

The patch below changes second from an int to an unsigned long which
fixes shmget on ppc64 (and I assume s390, sparc64 and mips64).

Signed-off-by: Anton Blanchard <anton@samba.org>
--

I assume the function prototypes for the other IPC methods would cause us
to sign or zero extend second where appropriate (avoiding any security
issues). Come to think of it, the syscall wrappers for each method should do
that for us as well.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agox86 / perf: Fix suspend to RAM on HP nx6325
Rafael J. Wysocki [Sun, 21 Mar 2010 20:51:51 +0000 (21:51 +0100)]
x86 / perf: Fix suspend to RAM on HP nx6325

Commit 3f6da3905398826d85731247e7fbcf53400c18bd
(perf: Rework and fix the arch CPU-hotplug hooks) broke suspend to
RAM on my HP nx6325 (and most likely on other AMD-based boxes too)
by allowing amd_pmu_cpu_offline() to be executed for CPUs that are
going offline as part of the suspend process.  The problem is that
cpuhw->amd_nb may be NULL already, so the function should make sure
it's not NULL before accessing the object pointed to by it.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoedac, mce: Filter out invalid values
Borislav Petkov [Tue, 9 Mar 2010 19:38:48 +0000 (20:38 +0100)]
edac, mce: Filter out invalid values

Print the CPU associated with the error only when the field is valid.

Cc: <stable@kernel.org> # .32.x .33.x
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
14 years agovirtio: console: Check if port is valid in resize_console
Amit Shah [Fri, 19 Mar 2010 12:06:44 +0000 (17:36 +0530)]
virtio: console: Check if port is valid in resize_console

The console port could have been hot-unplugged. Check if it is valid
before working on it.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agovirtio: console: Generate a kobject CHANGE event on adding 'name' attribute
Amit Shah [Fri, 19 Mar 2010 12:06:43 +0000 (17:36 +0530)]
virtio: console: Generate a kobject CHANGE event on adding 'name' attribute

When the host lets us know what 'name' a port is assigned, we create the
sysfs 'name' attribute. Generate a 'change' event after this so that
udev wakes up and acts on the rules for virtio-ports (currently there's
only one rule that creates a symlink from the 'name' to the actual char
device).

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
14 years agoip_gre: include route header_len in max_headroom calculation
Timo Teräs [Sat, 20 Mar 2010 02:27:58 +0000 (02:27 +0000)]
ip_gre: include route header_len in max_headroom calculation

Taking route's header_len into account, and updating gre device
needed_headroom will give better hints on upper bound of required
headroom. This is useful if the gre traffic is xfrm'ed.

Signed-off-by: Timo Teras <timo.teras@iki.fi>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoif_tunnel.h: add missing ams/byteorder.h include
Paulius Zaleckas [Mon, 22 Mar 2010 04:19:02 +0000 (21:19 -0700)]
if_tunnel.h: add missing ams/byteorder.h include

When compiling userspace application which includes
if_tunnel.h and uses GRE_* defines you will get undefined
reference to __cpu_to_be16.

Fix this by adding missing #include <asm/byteorder.h>

Cc: stable@kernel.org
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoipv4: Don't drop redirected route cache entry unless PTMU actually expired
Guenter Roeck [Mon, 22 Mar 2010 03:55:13 +0000 (20:55 -0700)]
ipv4: Don't drop redirected route cache entry unless PTMU actually expired

TCP sessions over IPv4 can get stuck if routers between endpoints
do not fragment packets but implement PMTU instead, and we are using
those routers because of an ICMP redirect.

Setup is as follows

       MTU1    MTU2   MTU1
    A--------B------C------D

with MTU1 > MTU2. A and D are endpoints, B and C are routers. B and C
implement PMTU and drop packets larger than MTU2 (for example because
DF is set on all packets). TCP sessions are initiated between A and D.
There is packet loss between A and D, causing frequent TCP
retransmits.

After the number of retransmits on a TCP session reaches tcp_retries1,
tcp calls dst_negative_advice() prior to each retransmit. This results
in route cache entries for the peer to be deleted in
ipv4_negative_advice() if the Path MTU is set.

If the outstanding data on an affected TCP session is larger than
MTU2, packets sent from the endpoints will be dropped by B or C, and
ICMP NEEDFRAG will be returned. A and D receive NEEDFRAG messages and
update PMTU.

Before the next retransmit, tcp will again call dst_negative_advice(),
causing the route cache entry (with correct PMTU) to be deleted. The
retransmitted packet will be larger than MTU2, causing it to be
dropped again.

This sequence repeats until the TCP session aborts or is terminated.

Problem is fixed by removing redirected route cache entries in
ipv4_negative_advice() only if the PMTU is expired.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>