OSDN Git Service

android-x86/kernel.git
13 years agoPhonet: convert bound sockets hash list to RCU
Rémi Denis-Courmont [Tue, 12 Apr 2011 23:27:36 +0000 (23:27 +0000)]
Phonet: convert bound sockets hash list to RCU

This gets rid of the last spinlock in the Phonet stack proper.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: allow custom interval for physical identification
Allan, Bruce W [Wed, 13 Apr 2011 13:09:10 +0000 (13:09 +0000)]
ethtool: allow custom interval for physical identification

When physical identification of an adapter is done by toggling the
mechanism on and off through software utilizing the set_phys_id operation,
it is done with a fixed duration for both on and off states.  Some drivers
may want to set a custom duration for the on/off intervals.  This patch
changes the API so the return code from the driver's entry point when it
is called with ETHTOOL_ID_ACTIVE can specify the frequency at which to
cycle the on/off states, and updates the drivers that have already been
converted to use the new set_phys_id and use the synchronous method for
identifying an adapter.

The physical identification frequency set in the updated drivers is based
on how it was done prior to the introduction of set_phys_id.

Compile tested only.  Also fixes a compiler warning in sfc.

v2: drivers do not return -EINVAL for ETHOOL_ID_ACTIVE
v3: fold patchset into single patch and cleanup per Ben's feedback

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Sathya Perla <sathya.perla@emulex.com>
Cc: Subbu Seetharaman <subbu.seetharaman@emulex.com>
Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
Cc: Michael Chan <mchan@broadcom.com>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: Divy Le Ray <divy@chelsio.com>
Cc: Don Fry <pcnet32@frontier.com>
Cc: Jon Mason <jdmason@kudzu.us>
Cc: Solarflare linux maintainers <linux-net-drivers@solarflare.com>
Cc: Steve Hodgson <shodgson@solarflare.com>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Matt Carlson <mcarlson@broadcom.com>
Acked-by: Jon Mason <jdmason@kudzu.us>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Call fib_select_default() only when actually necessary.
David S. Miller [Thu, 14 Apr 2011 21:49:37 +0000 (14:49 -0700)]
ipv4: Call fib_select_default() only when actually necessary.

fib_select_default() is a complete NOP, and completely pointless
to invoke, when we have no more than 1 default route installed.

And this is far and away the common case.

So remember how many prefixlen==0 routes we have in the routing
table, and elide the call when we have no more than one of those.

This cuts output route creation time by 157 cycles on Niagara2+.

In order to add the new int to fib_table, we have to correct the type
of ->tb_data[] to unsigned long, otherwise the private area will be
unaligned on 64-bit systems.

Signed-off-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
13 years agobna: fix memory leak during RX path cleanup
Rasesh Mody [Thu, 14 Apr 2011 08:05:19 +0000 (08:05 +0000)]
bna: fix memory leak during RX path cleanup

The memory leak was caused by unintentional assignment of the Rx path
destroy callback function pointer to NULL just after correct
initialization.

Signed-off-by: Debashis Dutt <ddutt@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobna: fix for clean fw re-initialization
Rasesh Mody [Thu, 14 Apr 2011 08:05:18 +0000 (08:05 +0000)]
bna: fix for clean fw re-initialization

During a kernel crash, bna control path state machine and firmware do not
get a notification and hence are not cleanly shutdown. The registers
holding driver/IOC state information are not reset back to valid
disabled/parking values. This causes subsequent driver initialization
to hang during kdump kernel boot. This patch, during the initialization
of first PCI function, resets corresponding register when unclean shutown
is detect by reading chip registers. This will make sure that ioc/fw
gets clean re-initialization.

Signed-off-by: Debashis Dutt <ddutt@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.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...
David S. Miller [Thu, 14 Apr 2011 20:16:51 +0000 (13:16 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

13 years agousbnet: Fix up 'FLAG_POINTTOPOINT' and 'FLAG_MULTI_PACKET' overlaps.
huajun li [Wed, 13 Apr 2011 15:43:32 +0000 (15:43 +0000)]
usbnet: Fix up 'FLAG_POINTTOPOINT' and 'FLAG_MULTI_PACKET' overlaps.

USB tethering does not work anymore since 2.6.39-rc2, but it's okay in
-rc1. The root cause is the new added mask code 'FLAG_POINTTOPOINT'
overlaps 'FLAG_MULTI_PACKET'  in  include/linux/usb/usbnet.h, this
causes logic issue in  rx_process(). This patch cleans up the overlap.

Reported-and-Tested-by: Gottfried Haider <gottfried.haider@gmail.com>
Signed-off-by: Huajun Li <huajun.li.lee@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNET: AX.25, NETROM, ROSE: Remove SOCK_DEBUG calls
Ralf Baechle [Thu, 14 Apr 2011 07:20:07 +0000 (00:20 -0700)]
NET: AX.25, NETROM, ROSE: Remove SOCK_DEBUG calls

Nobody alive seems to recall when they last were useful.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoixgbe: DCB, X540 devices do not respond to pause frames
John Fastabend [Mon, 4 Apr 2011 04:29:46 +0000 (04:29 +0000)]
ixgbe: DCB, X540 devices do not respond to pause frames

DCB enabled X540 devices are not responding to pause frames
due to a missing register set that was added for these
devices that did not exist in other devices.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: DCB, misallocated packet buffer size with X540 device
John Fastabend [Mon, 4 Apr 2011 04:29:41 +0000 (04:29 +0000)]
ixgbe: DCB, misallocated packet buffer size with X540 device

The X540 device has a smaller packet buffer but the DCB configuration
never took this into account. Under stress this can result in the DMA
engine hanging and TX Unit hang occurring to reset the device. This
patch reworks the packet buffer allocation routine used for DCB on
82599 and X540 devices to account for RX packet buffer sizes.

This fixes the immediate hang. We should consolidate the various
hardware specific routines for configuring features into a single
routine. This will make it much harder to miss feature cases like
this.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: make device_caps() generic
Emil Tantilov [Thu, 31 Mar 2011 09:36:18 +0000 (09:36 +0000)]
ixgbe: make device_caps() generic

x540 has the same device capability word in the EEPROM as 82599.
This patch renames ixgbe_get_device_caps_82599 to
ixgbe_get_device_caps_generic, moves it to ixgbe_common.h and
sets up the function pointer for x540.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: explicitly disable 100H for x540
Emil Tantilov [Thu, 31 Mar 2011 09:36:12 +0000 (09:36 +0000)]
ixgbe: explicitly disable 100H for x540

100H is not supported on this HW, but the bit is set on the PHY.
This can result in link at 100F when advertising only 1000F.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: add support for new HW
Emil Tantilov [Thu, 24 Mar 2011 07:06:02 +0000 (07:06 +0000)]
ixgbe: add support for new HW

Add new device ID supported by ixgbe.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: fix semaphores in eeprom routines for x540
Emil Tantilov [Thu, 24 Mar 2011 00:57:50 +0000 (00:57 +0000)]
ixgbe: fix semaphores in eeprom routines for x540

HW can upload EEPROM content from flash while
in a middle of checksum calculation. Take NVM ownership for the whole
process of checksum update.

Call ixgbe_read_eerd_generic() and ixgbe_write_eewr_generic() directly to
avoid double take of semaphores which leads to long loading times.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: cleanup short msleep's (<20ms) to use usleep_range
Don Skidmore [Fri, 18 Mar 2011 09:32:53 +0000 (09:32 +0000)]
ixgbe: cleanup short msleep's (<20ms) to use usleep_range

Since msleep might not sleep for the desired amount when less
than 20ms use usleep_range.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: fix 82599 KR downshift coexistence with LESM FW module
Emil Tantilov [Fri, 18 Mar 2011 08:18:32 +0000 (08:18 +0000)]
ixgbe: fix 82599 KR downshift coexistence with LESM FW module

Disable KR to KX4/KX downshift on 82599 backplane devices when
LESM (Link Establishment State Machine) is enabled in FW. Those
features cannot co-exist as they both manipulate the same registers.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Acked-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Phillip Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: move disabling of relaxed ordering in start_hw()
Emil Tantilov [Sat, 19 Mar 2011 01:32:46 +0000 (01:32 +0000)]
ixgbe: move disabling of relaxed ordering in start_hw()

Relaxed ordering can lead to issues with some chipsets.

This patch makes sure that it is disabled by default and
not only when DCA is on.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: refactor common start_hw code for 82599 and x540
Emil Tantilov [Fri, 18 Mar 2011 08:18:22 +0000 (08:18 +0000)]
ixgbe: refactor common start_hw code for 82599 and x540

Factored out the common start_hw code into a new function
ixgbe_start_hw_gen2() so that it can be used by x540 and 82599.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Acked-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: update version string for Dell CEM use
Jeff Kirsher [Thu, 17 Mar 2011 18:11:38 +0000 (18:11 +0000)]
ixgbe: update version string for Dell CEM use

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Acked-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
13 years agoixgbe: fix namespacecheck issue
Emil Tantilov [Wed, 16 Mar 2011 01:58:20 +0000 (01:58 +0000)]
ixgbe: fix namespacecheck issue

Set ixgbe_identify_82599() as static

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: correct function number for some 82598 parts
Emil Tantilov [Wed, 16 Mar 2011 01:55:55 +0000 (01:55 +0000)]
ixgbe: correct function number for some 82598 parts

Some 82598 parts have LAN0 disabled and LAN1 enabled and the LAN ID bits in
Device Status register report the NIC as having only LAN1 as enabled. This
causes ixgbe_set_lan_id_multi_port_pcie() to set bus->func = 1 which is
incorrect.

Force bus->func to 0 when LAN0 is disabled in the EEPROM.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: fix return value checks
Emil Tantilov [Sat, 12 Mar 2011 08:56:38 +0000 (08:56 +0000)]
ixgbe: fix return value checks

The value of status was incorrectly tested. Also whitespace cleanup.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: DCB, further cleanups to app configuration
John Fastabend [Sat, 12 Mar 2011 03:50:53 +0000 (03:50 +0000)]
ixgbe: DCB, further cleanups to app configuration

With the app data on the kernel dcb_app list we no longer
need to specifically handle them in ixgbe for the CEE case.
So now we can remove app handling logic and check when the
hw is configured if the app data matches the hardware
configuration in set_hw_all().

If it does not match then we can reconfigure.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoe1000e: If ASPM L0s needs to be disabled, do it prior to enabling device
Bruce Allan [Thu, 24 Mar 2011 03:09:03 +0000 (03:09 +0000)]
e1000e: If ASPM L0s needs to be disabled, do it prior to enabling device

Based on a patch from Naga Chumbalkar <nagananda.chumbalkar@hp.com>:

If ASPM L0s needs to be disabled due to HW errata, do it prior to
"enabling" the device. This way if the kernel ever defaults its
aspm_policy to POLICY_POWERSAVE, then the e1000e driver will get a
chance to disable ASPM on the misbehaving device *prior* to calling
pci_enable_device_mem(). This will be useful in situations
where the BIOS indicates ASPM support on the server by clearing the
ACPI FADT "ASPM Controls" bit.

Note:
The kernel (2.6.38) currently uses the BIOS "default" as its aspm_policy.
However, Linux distros can diverge from that and set the default to
"powersave".

v2: o cleanup namespace pollution of e1000e_disable_aspm(),
    o fix type and initialization of the new aspm_disable_flag in a few
      functions, and
    o redefine FLAG2_DISABLE_ASPM_L0S to the first unused bit in
      adapter->flags2.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Cc: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoe1000e: fix stats locking in e1000_watchdog_task
Flavio Leitner [Tue, 5 Apr 2011 04:27:43 +0000 (04:27 +0000)]
e1000e: fix stats locking in e1000_watchdog_task

Just move the unlock down a bit because it unlocks too
early leaving a chance for get_stats64() run in parallel
while it is still accessing the stats.

Signed-off-by: Flavio Leitner <fleitner@redhat.com>
Acked-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoe1000e: convert to new VLAN model
Jeff Kirsher [Fri, 25 Mar 2011 16:01:01 +0000 (16:01 +0000)]
e1000e: convert to new VLAN model

This switches the e1000e driver to use the new VLAN interfaces.

CC: Jesse Gross <jesse@nicira.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
13 years agoe1000e: PCIe link speed in GT/s, not GB/s
Bruce Allan [Sat, 19 Mar 2011 00:31:23 +0000 (00:31 +0000)]
e1000e: PCIe link speed in GT/s, not GB/s

Correct the log message when driver loads.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoe1000e: convert short duration msleep() to usleep_range()
Bruce Allan [Sat, 19 Mar 2011 00:27:20 +0000 (00:27 +0000)]
e1000e: convert short duration msleep() to usleep_range()

With durations less than 20ms, the jiffies or legacy timer backed msleep()
may sleep ~20ms which might not be what the caller expects.  Instead, it
is recommended to use the hrtimers backed usleep_range().  For more, see
Documentation/timers/timers-howto.txt.  Issues reported by checkpatch.

In addition, remove unnecessary sleep in e1000e_write_nvm_spi().

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoigb: introduce igb_thermal_sensor_event for sensor checking
Stefan Assmann [Tue, 5 Apr 2011 04:27:15 +0000 (04:27 +0000)]
igb: introduce igb_thermal_sensor_event for sensor checking

The code for thermal sensor checking should be wrapped into a function.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoigb: fix typo in igb_validate_nvm_checksum_82580
Stefan Assmann [Tue, 5 Apr 2011 04:27:05 +0000 (04:27 +0000)]
igb: fix typo in igb_validate_nvm_checksum_82580

Comment spelling fix.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoigb: Add anti-spoofing feature documentation
Greg Rose [Sat, 12 Mar 2011 11:56:02 +0000 (11:56 +0000)]
igb: Add anti-spoofing feature documentation

Add the documentation for the anti-spoofing feature in the HW.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agonet: allow shifted access in smsc911x V2
Mathieu J. Poirier [Thu, 14 Apr 2011 00:13:00 +0000 (17:13 -0700)]
net: allow shifted access in smsc911x V2

This is a revised patch that permits a shifted access to the
LAN9221 registers.  More specifically:

 It adds a shift parameter in the platform_data.
 It introduces an ops in smsc911x_data.
 A choice of access function to use at run-time.
 Four new shifted access function.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Add support for extended VPD blocks
Matt Carlson [Wed, 13 Apr 2011 11:05:08 +0000 (11:05 +0000)]
tg3: Add support for extended VPD blocks

In some devices, the VPD block is relocated to a different area in
NVRAM.  The original location can still contain old, but still valid VPD
data.  This patch changes the code to look for an extended VPD block in
NVRAM.  If one is found, that block is used for all VPD operations
instead.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Add jumbo frame loopback tests to selftest
Matt Carlson [Wed, 13 Apr 2011 11:05:07 +0000 (11:05 +0000)]
tg3: Add jumbo frame loopback tests to selftest

This patch adds jumbo frame loopback test support to the ethtool
selftest.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Automatically size stat/test string arrays
Matt Carlson [Wed, 13 Apr 2011 11:05:06 +0000 (11:05 +0000)]
tg3: Automatically size stat/test string arrays

This patch reimplements the size preprocessor constants of the stats and
ethtool test string arrays.  The size is calculated at compile time
rather than using static constants.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Dump registers when status block shows errors
Matt Carlson [Wed, 13 Apr 2011 11:05:05 +0000 (11:05 +0000)]
tg3: Dump registers when status block shows errors

This patch monitors the error bit of the status word within the status
block.  If it is set, the driver will dump the driver state after
validating the error and then reset the chip.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Provide full regdump on tx timeout
Matt Carlson [Wed, 13 Apr 2011 11:05:04 +0000 (11:05 +0000)]
tg3: Provide full regdump on tx timeout

The current amount of information provided in the output of a tx timeout
is insufficient to determine a root cause.  This patch replaces the
terse, four-register status output with a more complete body of
information.  For PCIe devices, the full register space is dumped.  For
other devices, select registers are dumped instead.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agorndis_host: Poll status before control channel where necessary
Ben Hutchings [Wed, 13 Apr 2011 21:48:55 +0000 (14:48 -0700)]
rndis_host: Poll status before control channel where necessary

Some RNDIS devices don't respond on the control channel until polled
on the status channel.  In particular, this was reported to be the
case for the 2Wire HomePortal 1000SW and for some Windows Mobile
devices.

This is roughly based on a patch by John Carr <john.carr@unrouted.co.uk>
which is currently applied by Mandriva.

Reported-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoiwlegacy: fix tx_power initialization
Stanislaw Gruszka [Wed, 13 Apr 2011 08:56:51 +0000 (10:56 +0200)]
iwlegacy: fix tx_power initialization

priv->tx_power_next is not initialized to max supported power,
but instead default value is used, what cause errors like

[   58.597834] iwl3945 0000:03:00.0: Requested user TXPOWER 15 above upper limit 14.
[   58.597839] iwl3945 0000:03:00.0: Error setting Tx power (-22).

if maximum tx power read from the eeprom is smaller than default.
In consequence card is unable to initialize properly. Fix the problem
and cleanup tx power initialization.

Reported-and-tested-by: Robin Dong <hao.bigrat@gmail.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoRevert "tcp: disallow bind() to reuse addr/port"
David S. Miller [Wed, 13 Apr 2011 19:01:14 +0000 (12:01 -0700)]
Revert "tcp: disallow bind() to reuse addr/port"

This reverts commit c191a836a908d1dd6b40c503741f91b914de3348.

It causes known regressions for programs that expect to be able to use
SO_REUSEADDR to shutdown a socket, then successfully rebind another
socket to the same ID.

Programs such as haproxy and amavisd expect this to work.

This should fix kernel bugzilla 32832.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: limit skb frags for non tso packet
Amit Kumar Salecha [Tue, 12 Apr 2011 17:05:55 +0000 (17:05 +0000)]
qlcnic: limit skb frags for non tso packet

Machines are getting deadlock in four node cluster environment.
All nodes are accessing (find /gfs2 -depth -print|cpio -ocv > /dev/null)
200 GB storage on a GFS2 filesystem.
This result in memory fragmentation and driver receives 18 frags for
1448 byte packets.
For non tso packet, fw drops the tx request, if it has >14 frags.

Fixing it by pulling extra frags.

Cc: stable@kernel.org
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: review Wol and enable the Unicast support
Giuseppe Cavallaro [Wed, 13 Apr 2011 18:51:43 +0000 (11:51 -0700)]
stmmac: review Wol and enable the Unicast support

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomacb: Add rx overrun counter
Alexander Stein [Wed, 13 Apr 2011 05:03:24 +0000 (05:03 +0000)]
macb: Add rx overrun counter

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: can: mscan: fix build breakage in mpc5xxx_can
Anatolij Gustschin [Tue, 12 Apr 2011 23:49:28 +0000 (23:49 +0000)]
net: can: mscan: fix build breakage in mpc5xxx_can

Commit 74888760d40b3ac9054f9c5fa07b566c0676ba2d
"dt/net: Eliminate users of of_platform_{,un}register_driver"
broke building mscan driver. Fix it.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: ethtool support to configure number of channels
amit salecha [Thu, 7 Apr 2011 01:58:42 +0000 (01:58 +0000)]
net: ethtool support to configure number of channels

Ethtool support to configure RX, TX and other channels. combined field
in struct ethtool_channels to reflect set of channel (RX, TX or other).
Other channel can be link interrupts, SR-IOV coordination etc.

ETHTOOL_GCHANNELS will report max and current number of RX channels,
max and current number of TX channels, max and current number of other channel
or max and current number of combined channel.

Number of channel can be modify upto max number of channel through
ETHTOOL_SCHANNELS command.

Ben Hutchings:
o define 'combined' and 'other' types.  Most multiqueue drivers pair up RX and TX
  queues so that most channels combine RX and TX work.
o Please could you use a kernel-doc comment to describe the structure.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: ipset: SCTP, UDPLITE support added
Jozsef Kadlecsik [Wed, 13 Apr 2011 11:51:38 +0000 (13:51 +0200)]
netfilter: ipset: SCTP, UDPLITE support added

SCTP and UDPLITE port support added to the hash:*port* set types.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agosctp: fix oops while removed transport still using as retran path
Wei Yongjun [Tue, 12 Apr 2011 15:22:22 +0000 (15:22 +0000)]
sctp: fix oops while removed transport still using as retran path

Since we can not update retran path to unconfirmed transports,
when we remove a peer, the retran path may not be update if the
other transports are all unconfirmed, and we will still using
the removed transport as the retran path. This may cause panic
if retrasnmit happen.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: fix oops when updating retransmit path with DEBUG on
Vlad Yasevich [Tue, 12 Apr 2011 15:20:48 +0000 (15:20 +0000)]
sctp: fix oops when updating retransmit path with DEBUG on

commit fbdf501c9374966a56829ecca3a7f25d2b49a305
  sctp: Do no select unconfirmed transports for retransmissions

Introduced the initial falt.

commit d598b166ced20d9b9281ea3527c0e18405ddb803
  sctp: Make sure we always return valid retransmit path

Solved the problem, but forgot to change the DEBUG statement.
Thus it was still possible to dereference a NULL pointer.

Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Disable NETIF_F_TSO_ECN when TSO is disabled
Ben Hutchings [Tue, 12 Apr 2011 14:47:15 +0000 (14:47 +0000)]
net: Disable NETIF_F_TSO_ECN when TSO is disabled

NETIF_F_TSO_ECN has no effect when TSO is disabled; this just means
that feature state will be accurately reported to user-space.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Disable all TSO features when SG is disabled
Ben Hutchings [Tue, 12 Apr 2011 14:38:37 +0000 (14:38 +0000)]
net: Disable all TSO features when SG is disabled

The feature flags NETIF_F_TSO and NETIF_F_TSO6 independently enable
TSO for IPv4 and IPv6 respectively.  However, the test in
netdev_fix_features() and its predecessor functions was never updated
to check for NETIF_F_TSO6, possibly because it was originally proposed
that TSO for IPv6 would be dependent on both feature flags.

Now that these feature flags can be changed independently from
user-space and we depend on netdev_fix_features() to fix invalid
feature combinations, it's important to disable them both if
scatter-gather is disabled.  Also disable NETIF_F_TSO_ECN so
user-space sees all TSO features as disabled.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Missing 'inline' in vlan-disabled vlan_untag()
David S. Miller [Wed, 13 Apr 2011 02:27:51 +0000 (19:27 -0700)]
net: Missing 'inline' in vlan-disabled vlan_untag()

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'sfc-2.6.39' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-2.6
David S. Miller [Wed, 13 Apr 2011 00:10:52 +0000 (17:10 -0700)]
Merge branch 'sfc-2.6.39' of git://git./linux/kernel/git/bwh/sfc-2.6

13 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Tue, 12 Apr 2011 23:16:02 +0000 (16:16 -0700)]
Merge branch 'for-davem' of git://git./linux/kernel/git/linville/wireless-next-2.6

13 years agoatm: iphase: Fix set-but-not-used warnings.
David S. Miller [Tue, 12 Apr 2011 23:14:21 +0000 (16:14 -0700)]
atm: iphase: Fix set-but-not-used warnings.

The "iavcc" and "iadev" cases are obvious.

The intr_status and frmr_intr cases are reading a register to clear
the chip status.  This driver is pretty old and creaky, and uses
volatile pointer dereferences to do register I/O when it should be
using readl() and friends.  However that it outside of the scope of
these changes.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years ago9p: Kill set but unused variable in 9p_client_{read,write}() and p9_client_readdir()
David S. Miller [Tue, 12 Apr 2011 22:58:41 +0000 (15:58 -0700)]
9p: Kill set but unused variable in 9p_client_{read,write}() and p9_client_readdir()

Fixes the following warnings:

net/9p/client.c:1305:18: warning: variable ‘total’ set but not used [-Wunused-but-set-variable]
net/9p/client.c:1370:18: warning: variable ‘total’ set but not used [-Wunused-but-set-variable]
net/9p/client.c:1769:18: warning: variable ‘total’ set but not used [-Wunused-but-set-variable]

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosfc: Use rmb() to ensure reads occur in order
Neil Turton [Mon, 11 Apr 2011 10:42:43 +0000 (11:42 +0100)]
sfc: Use rmb() to ensure reads occur in order

Enabling write-combining may also enable read reordering.  The BIU is
only guaranteed to read from a 128-bit CSR or 64-bit SRAM word when
the host reads from its lowest address; otherwise the BIU may use the
latched value.  Therefore we need to reinstate the read memory
barriers after the first read operation for each CSR or SRAM word.

Signed-off-by; Ben Hutchings <bhutchings@solarflare.com>

13 years agoieee802154: Remove hacked CFLAGS in net/ieee802154/Makefile
David S. Miller [Tue, 12 Apr 2011 22:33:23 +0000 (15:33 -0700)]
ieee802154: Remove hacked CFLAGS in net/ieee802154/Makefile

It adds -Wall (which the kernel carefully controls already) and of all
things -DDEBUG (which should be set by other means if desired, please
we have dynamic-debug these days).

Kill this noise.

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoirda: fix locking unbalance in irda_sendmsg
Dave Jones [Tue, 12 Apr 2011 22:29:54 +0000 (15:29 -0700)]
irda: fix locking unbalance in irda_sendmsg

5b40964eadea40509d353318d2c82e8b7bf5e8a5 ("irda: Remove BKL instances
from af_irda.c") introduced a path where we have a locking unbalance.
If we pass invalid flags, we unlock a socket we never locked,
resulting in this...

=====================================
[ BUG: bad unlock balance detected! ]
-------------------------------------
trinity/20101 is trying to release lock (sk_lock-AF_IRDA) at:
[<ffffffffa057f001>] irda_sendmsg+0x207/0x21d [irda]
but there are no more locks to release!

other info that might help us debug this:
no locks held by trinity/20101.

stack backtrace:
Pid: 20101, comm: trinity Not tainted 2.6.39-rc3+ #3
Call Trace:
 [<ffffffffa057f001>] ? irda_sendmsg+0x207/0x21d [irda]
 [<ffffffff81085041>] print_unlock_inbalance_bug+0xc7/0xd2
 [<ffffffffa057f001>] ? irda_sendmsg+0x207/0x21d [irda]
 [<ffffffff81086aca>] lock_release+0xcf/0x18e
 [<ffffffff813ed190>] release_sock+0x2d/0x155
 [<ffffffffa057f001>] irda_sendmsg+0x207/0x21d [irda]
 [<ffffffff813e9f8c>] __sock_sendmsg+0x69/0x75
 [<ffffffff813ea105>] sock_sendmsg+0xa1/0xb6
 [<ffffffff81100ca3>] ? might_fault+0x5c/0xac
 [<ffffffff81086b7c>] ? lock_release+0x181/0x18e
 [<ffffffff81100cec>] ? might_fault+0xa5/0xac
 [<ffffffff81100ca3>] ? might_fault+0x5c/0xac
 [<ffffffff81133b94>] ? fcheck_files+0xb9/0xf0
 [<ffffffff813f387a>] ? copy_from_user+0x2f/0x31
 [<ffffffff813f3b70>] ? verify_iovec+0x52/0xa6
 [<ffffffff813eb4e3>] sys_sendmsg+0x23a/0x2b8
 [<ffffffff81086b7c>] ? lock_release+0x181/0x18e
 [<ffffffff810773c6>] ? up_read+0x28/0x2c
 [<ffffffff814bec3d>] ? do_page_fault+0x360/0x3b4
 [<ffffffff81087043>] ? trace_hardirqs_on_caller+0x10b/0x12f
 [<ffffffff810458aa>] ? finish_task_switch+0xb2/0xe3
 [<ffffffff8104583e>] ? finish_task_switch+0x46/0xe3
 [<ffffffff8108364a>] ? trace_hardirqs_off_caller+0x33/0x90
 [<ffffffff814bbaf9>] ? retint_swapgs+0x13/0x1b
 [<ffffffff81087043>] ? trace_hardirqs_on_caller+0x10b/0x12f
 [<ffffffff810a9dd3>] ? audit_syscall_entry+0x11c/0x148
 [<ffffffff8125609e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [<ffffffff814c22c2>] system_call_fastpath+0x16/0x1b

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/natsami: store MAC into perm_addr
Otavio Salvador [Tue, 12 Apr 2011 05:30:41 +0000 (05:30 +0000)]
net/natsami: store MAC into perm_addr

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/sis900: store MAC into perm_addr for SiS 900, 630E, 635 and 96x variants
Otavio Salvador [Tue, 12 Apr 2011 05:30:40 +0000 (05:30 +0000)]
net/sis900: store MAC into perm_addr for SiS 900, 630E, 635 and 96x variants

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: vlan_features comment clarification
Michał Mirosław [Tue, 12 Apr 2011 04:07:39 +0000 (04:07 +0000)]
net: vlan_features comment clarification

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: ioc3: convert to hw_features
Michał Mirosław [Tue, 12 Apr 2011 09:48:17 +0000 (09:48 +0000)]
net: ioc3: convert to hw_features

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: bnx2x: convert to hw_features
Michał Mirosław [Tue, 12 Apr 2011 09:38:23 +0000 (09:38 +0000)]
net: bnx2x: convert to hw_features

Since ndo_fix_features callback is postponing features change when
bp->recovery_state != BNX2X_RECOVERY_DONE, netdev_update_features()
has to be called again when this condition changes. Previously,
ethtool_ops->set_flags callback returned -EBUSY in that case
(it's not possible in the new model).

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
v5: - don't delay set_features, as it's rtnl_locked - same as recovery process
v4: - complete bp->rx_csum -> NETIF_F_RXCSUM conversion
    - add check for failed ndo_set_features in ndo_open callback
v3: - include NETIF_F_LRO in hw_features
    - don't call netdev_update_features() if bnx2x_nic_load() failed
v2: - comment in ndo_fix_features callback
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: bna: convert to hw_features
Michał Mirosław [Tue, 12 Apr 2011 09:38:23 +0000 (09:38 +0000)]
net: bna: convert to hw_features

Note: looks like bnad->conf_mutex is duplicating rtnl_lock.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: ps3_gelic: convert to hw_features
Michał Mirosław [Sun, 10 Apr 2011 04:49:55 +0000 (04:49 +0000)]
net: ps3_gelic: convert to hw_features

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: sky2: convert to hw_features
Michał Mirosław [Sun, 10 Apr 2011 03:13:21 +0000 (03:13 +0000)]
net: sky2: convert to hw_features

Caveats:
 - driver modifies vlan_features on HW VLAN TX changes
 - broken RX checksum will be reenabled on features change

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoconnector: fix skb double free in cn_rx_skb()
Patrick McHardy [Tue, 12 Apr 2011 05:39:51 +0000 (05:39 +0000)]
connector: fix skb double free in cn_rx_skb()

When a skb is delivered to a registered callback, cn_call_callback()
incorrectly returns -ENODEV after freeing the skb, causing cn_rx_skb()
to free the skb a second time.

Reported-by: Eric B Munson <emunson@mgebm.net>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Tested-by: Eric B Munson <emunson@mgebm.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: add RTNL_ASSERT in __netdev_update_features()
Michał Mirosław [Tue, 12 Apr 2011 09:56:38 +0000 (09:56 +0000)]
net: add RTNL_ASSERT in __netdev_update_features()

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: vlan: make non-hw-accel rx path similar to hw-accel
Jiri Pirko [Thu, 7 Apr 2011 19:48:33 +0000 (19:48 +0000)]
net: vlan: make non-hw-accel rx path similar to hw-accel

Now there are 2 paths for rx vlan frames. When rx-vlan-hw-accel is
enabled, skb is untagged by NIC, vlan_tci is set and the skb gets into
vlan code in __netif_receive_skb - vlan_hwaccel_do_receive.

For non-rx-vlan-hw-accel however, tagged skb goes thru whole
__netif_receive_skb, it's untagged in ptype_base hander and reinjected

This incosistency is fixed by this patch. Vlan untagging happens early in
__netif_receive_skb so the rest of code (ptype_all handlers, rx_handlers)
see the skb like it was untagged by hw.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
v1->v2:
remove "inline" from vlan_core.c functions
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Do not wrap sysctl igmp_max_memberships in IP_MULTICAST
Joakim Tjernlund [Tue, 12 Apr 2011 20:59:33 +0000 (13:59 -0700)]
net: Do not wrap sysctl igmp_max_memberships in IP_MULTICAST

controlling igmp_max_membership is useful even when IP_MULTICAST
is off.
Quagga(an OSPF deamon) uses multicast addresses for all interfaces
using a single socket and hits igmp_max_membership limit when
there are 20 interfaces or more.
Always export sysctl igmp_max_memberships in proc, just like
igmp_max_msf

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoinetpeer: reduce stack usage
Eric Dumazet [Mon, 11 Apr 2011 22:39:40 +0000 (22:39 +0000)]
inetpeer: reduce stack usage

On 64bit arches, we use 752 bytes of stack when cleanup_once() is called
from inet_getpeer().

Lets share the avl stack to save ~376 bytes.

Before patch :

# objdump -d net/ipv4/inetpeer.o | scripts/checkstack.pl

0x000006c3 unlink_from_pool [inetpeer.o]: 376
0x00000721 unlink_from_pool [inetpeer.o]: 376
0x00000cb1 inet_getpeer [inetpeer.o]: 376
0x00000e6d inet_getpeer [inetpeer.o]: 376
0x0004 inet_initpeers [inetpeer.o]: 112
# size net/ipv4/inetpeer.o
   text    data     bss     dec     hex filename
   5320     432      21    5773    168d net/ipv4/inetpeer.o

After patch :

objdump -d net/ipv4/inetpeer.o | scripts/checkstack.pl
0x00000c11 inet_getpeer [inetpeer.o]: 376
0x00000dcd inet_getpeer [inetpeer.o]: 376
0x00000ab9 peer_check_expire [inetpeer.o]: 328
0x00000b7f peer_check_expire [inetpeer.o]: 328
0x0004 inet_initpeers [inetpeer.o]: 112
# size net/ipv4/inetpeer.o
   text    data     bss     dec     hex filename
   5163     432      21    5616    15f0 net/ipv4/inetpeer.o

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Scot Doyle <lkml@scotdoyle.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Reviewed-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: time to blink provided in seconds not jiffies
Allan, Bruce W [Mon, 11 Apr 2011 13:01:59 +0000 (13:01 +0000)]
ethtool: time to blink provided in seconds not jiffies

When blinking for a duration set by the user, the value specified is in
seconds but it is used as the number of jiffies in the timeout after which
the Physical ID indicator is deactivated.  Fix by converting the timeout
to seconds.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoath9k_htc: Fix ethtool reporting
Sujith Manoharan [Mon, 11 Apr 2011 17:26:55 +0000 (22:56 +0530)]
ath9k_htc: Fix ethtool reporting

Pass the correct module name and device interface so that
ethtool can display the proper values.

The firmware version will be fixed later on when the FW
can actually report a version. :)

Reported-by: Richard Farina <sidhayn@gmail.com>
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Tested-by: Richard Farina <sidhayn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: fix stopping rx DMA during resets
Felix Fietkau [Fri, 8 Apr 2011 18:13:18 +0000 (20:13 +0200)]
ath9k_hw: fix stopping rx DMA during resets

During PHY errors, the MAC can sometimes fail to enter an idle state on older
hardware (before AR9380) after an rx stop has been requested.

This typically shows up in the kernel log with messages like these:

ath: Could not stop RX, we could be confusing the DMA engine when we start RX up
------------[ cut here ]------------
WARNING: at drivers/net/wireless/ath/ath9k/recv.c:504 ath_stoprecv+0xcc/0xf0 [ath9k]()
Call Trace:
[<8023f0e8>] dump_stack+0x8/0x34
[<80075050>] warn_slowpath_common+0x78/0xa4
[<80075094>] warn_slowpath_null+0x18/0x24
[<80d66d60>] ath_stoprecv+0xcc/0xf0 [ath9k]
[<80d642cc>] ath_set_channel+0xbc/0x270 [ath9k]
[<80d65254>] ath_radio_disable+0x4a4/0x7fc [ath9k]

When this happens, the state that the MAC enters is easy to identify and
does not result in bogus DMA traffic, however to ensure a working state
after a channel change, the hardware should still be reset.

This patch adds detection for this specific MAC state, after which the above
warnings completely disappear in my tests.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Cc: Kyungwan Nam <Kyungwan.Nam@Atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agobridge: reset IPCB in br_parse_ip_options
Eric Dumazet [Tue, 12 Apr 2011 20:39:14 +0000 (13:39 -0700)]
bridge: reset IPCB in br_parse_ip_options

Commit 462fb2af9788a82 (bridge : Sanitize skb before it enters the IP
stack), missed one IPCB init before calling ip_options_compile()

Thanks to Scot Doyle for his tests and bug reports.

Reported-by: Scot Doyle <lkml@scotdoyle.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Acked-by: Bandan Das <bandan.das@stratus.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Cc: Jan Lübbe <jluebbe@debian.org>
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, 12 Apr 2011 20:18:44 +0000 (16:18 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next-2.6 into for-davem

Conflicts:
drivers/net/wireless/ath/ar9170/main.c
drivers/net/wireless/ath/ar9170/phy.c
drivers/net/wireless/zd1211rw/zd_rf_rf2959.c

13 years agovxge: update driver version
Jon Mason [Fri, 8 Apr 2011 11:11:23 +0000 (11:11 +0000)]
vxge: update driver version

Update vxge driver version to 2.5.3

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agovxge: spin-lock issue
Jon Mason [Fri, 8 Apr 2011 11:11:22 +0000 (11:11 +0000)]
vxge: spin-lock issue

In vxge_hw_vpath_close, __vxge_hw_vp_terminate memsets the vpath which
clobbers the spin lock state, then the driver attempts to acquire the
spin lock.  Resolve this by not zeroing the lock part of vpath struct,
clean-up vpath locking in init, close, and fix locking hole in fw_api
call.

Issue found by Bob Picco <bpicco@redhat.com>

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agovxge: always enable hardware time stamp
Jon Mason [Fri, 8 Apr 2011 11:11:21 +0000 (11:11 +0000)]
vxge: always enable hardware time stamp

Hardware time stamp calculation can only be enabled by the privileged
function. Enable it always by default and simply use the ethtool
interface to set a flag to indicate whether or not the respective
function driver should indicate the timestamp along with the received
packet.

Also, make certain fields in vxge_hw_device_config bit-fields to reduce
the size of the struct.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agos2io: Fix warnings due to -Wunused-but-set-variable.
David S. Miller [Mon, 11 Apr 2011 23:00:00 +0000 (16:00 -0700)]
s2io: Fix warnings due to -Wunused-but-set-variable.

Most of these are cases where we are trying to read back a register
after a write to ensure completion.

Simply pre-fixing the readl() or readq() with "(void)" is sufficient
because these are volatile operations and the compiler cannot eliminate
them just because no real assignment takes place.

The case of free_rxd_blk()'s assignments to "struct buffAdd *ba" is a
real spurious assignment as this variable is completely otherwise
unused.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Jon Mason <jdmason@kudzu.us>
13 years agosfc: Do not use efx_process_channel_now() in online self-test
Ben Hutchings [Mon, 4 Apr 2011 13:22:11 +0000 (14:22 +0100)]
sfc: Do not use efx_process_channel_now() in online self-test

During self-tests we use efx_process_channel_now() to handle
completion and other events synchronously.  This disables interrupts
and NAPI processing for the channel in question, but it may still be
interrupted by another channel.  A single socket may receive packets
from multiple net devices or even multiple channels of the same net
device, so this can result in deadlock on a socket lock.

Receiving packets in process context will also result in incorrect
classification by the network cgroup classifier.

Therefore, we must only use efx_process_channel_now() in the offline
loopback tests (which never deliver packets up the stack) and not for
the online interrupt and event tests.

For the interrupt test, there is no reason to process events.  We
only care that an interrupt is raised.

For the event test, we want to know whether events have been received,
and there may be many events ahead of the one we inject.  Therefore
remove efx_channel::magic_count and instead test whether
efx_channel::eventq_read_ptr advances.  This is currently an event
queue index and might wrap around to exactly the same value, resulting
in a false negative.  Therefore move the masking to efx_event() and
efx_nic_eventq_read_ack() so that it cannot wrap within the time of
the test.

The event test also tries to diagnose failures by checking whether an
event was delivered without causing an interrupt.  Add and use a
helper function that only does this.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
13 years agosfc: Stop the TX queues during loopback self-tests
Neil Turton [Mon, 4 Apr 2011 12:46:23 +0000 (13:46 +0100)]
sfc: Stop the TX queues during loopback self-tests

If the TX queues are running during loopback self tests, host
traffic gets looped back which causes the test to fail.  Avoid
restarting the TX queues after the port reset so that any packets
sent by the host get held back until after the tests have completed.

[bwh: Also wake all TX queues at the end of self-tests.]

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
13 years agollc: Fix length check in llc_fixup_skb().
David S. Miller [Tue, 12 Apr 2011 01:59:05 +0000 (18:59 -0700)]
llc: Fix length check in llc_fixup_skb().

Fixes bugzilla #32872

The LLC stack pretends to support non-linear skbs but there is a
direct use of skb_tail_pointer() in llc_fixup_skb().

Use pskb_may_pull() to see if data_size bytes remain and can be
accessed linearly in the packet, instead of direct pointer checks.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoniu: Fix warnings due to -Wunused-but-set-variable
David S. Miller [Mon, 11 Apr 2011 22:49:26 +0000 (15:49 -0700)]
niu: Fix warnings due to -Wunused-but-set-variable

Most of these were legitimate, and once case was a real bug
(not propagating errors from ->xcvr_init() methods).

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif: Add BUG_ON if dev_info is missing in packet
Sjur Brændeland [Mon, 11 Apr 2011 10:43:52 +0000 (10:43 +0000)]
caif: Add BUG_ON if dev_info is missing in packet

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif: Don't resend if dev_queue_xmit fails.
Sjur Brændeland [Mon, 11 Apr 2011 10:43:51 +0000 (10:43 +0000)]
caif: Don't resend if dev_queue_xmit fails.

If CAIF Link Layer returns an error, we no longer try to re-build the
CAIF packet and resend it. Instead, we simply return any transmission
errors to the socket client.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif: code cleanup
Stephen Hemminger [Mon, 11 Apr 2011 10:43:50 +0000 (10:43 +0000)]
caif: code cleanup

Cleanup of new CAIF code.
  * make local functions static
  * remove code that is never used
  * expand get_caif_conf() since wrapper is no longer needed
  * make args to comparison functions const
  * rename connect_req_to_link_param to keep exported names
    consistent

Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Mon, 11 Apr 2011 20:44:25 +0000 (13:44 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/smsc911x.c

13 years agoniu: Recognise original ethtool class code for AH/ESP flow hashing
Ben Hutchings [Fri, 8 Apr 2011 13:49:15 +0000 (13:49 +0000)]
niu: Recognise original ethtool class code for AH/ESP flow hashing

When the RX network flow classification interface was originally
defined for reporting and controlling of flow hashing, AH and ESP were
not given distinct flow class codes (apparently because the Sun
Neptune hardware treats them very similarly).

For flow steering, they must be distinguished, so new and separate
flow class codes were added for AH and ESP.  But for backward-
compatibility, flow hash operations should continue to support the
original class codes.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agogianfar: Clean up implementation of RX network flow classification
Ben Hutchings [Fri, 8 Apr 2011 13:45:11 +0000 (13:45 +0000)]
gianfar: Clean up implementation of RX network flow classification

This code was cribbed from niu, so gfar_set_hash_opts() begins by
converting the ethtool flow class code into a class code for Sun
Neptune hardware, then does the same thing again for the hardware it's
really dealing with.  It may also return -1 (-EPERM) for some
unhandled ethtool flow class codes.

Remove the useless code and definitions, and fix the error code.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlge: use ethtool set_phys_id
stephen hemminger [Wed, 6 Apr 2011 13:47:50 +0000 (13:47 +0000)]
qlge: use ethtool set_phys_id

This is a stab at replacing old ethtool phys_id with set_phys_id
on the Qlogic 10Gb driver. Compile tested only.

Not sure if set_led_cfg will flash continuously, or needs
to be replaced by ETHTOOL_ID_ON/ETHTOOL_ID_OFF

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agov3 ethtool: add ntuple flow specifier data to network flow classifier
Alexander Duyck [Fri, 8 Apr 2011 18:01:59 +0000 (18:01 +0000)]
v3 ethtool: add ntuple flow specifier data to network flow classifier

This change is meant to add an ntuple data extensions to the rx network flow
classification specifiers.  The idea is to allow ntuple to be displayed via
the network flow classification interface.

The first patch had some left over stuff from the original flow extension
flags I had added.  That bit is removed in this patch.

The second had some left over comments that stated we ignored bits in the
masks when we actually match them.

This work is based on input from Ben Hutchings.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: prevent null pointer dereference with NTUPLE set but no set_rx_ntuple
Alexander Duyck [Fri, 8 Apr 2011 12:07:22 +0000 (12:07 +0000)]
ethtool: prevent null pointer dereference with NTUPLE set but no set_rx_ntuple

This change is meant to prevent a possible null pointer dereference if
NETIF_F_NTUPLE is defined but the set_rx_ntuple function pointer is not.

The main motivation behind this patch is to eventually replace the ntuple
interfaces entirely with the network flow classifier interfaces.  This
allows the device drivers to maintain the ntuple check internally while
using the network flow classifier interface for setting up and displaying
rules.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif: performance bugfix - allow radio stack to prioritize packets.
Sjur Brændeland [Mon, 11 Apr 2011 10:11:30 +0000 (10:11 +0000)]
caif: performance bugfix - allow radio stack to prioritize packets.

    In the CAIF Payload message the Packet Type indication must be set to
    UNCLASSIFIED in order to allow packet prioritization in the modem's
    network stack. Otherwise TCP-Ack is not prioritized in the modems
    transmit queue.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocaif: Bugfix use for_each_safe when removing list nodes.
Sjur Brændeland [Mon, 11 Apr 2011 10:11:29 +0000 (10:11 +0000)]
caif: Bugfix use for_each_safe when removing list nodes.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetxen: limit skb frags for non tso packet
amit salecha [Mon, 11 Apr 2011 02:10:22 +0000 (02:10 +0000)]
netxen: limit skb frags for non tso packet

Machines are getting deadlock in four node cluster environment.
All nodes are accessing (find /gfs2 -depth -print|cpio -ocv > /dev/null)
200 GB storage on a GFS2 filesystem.
This result in memory fragmentation and driver receives 18 frags for
1448 byte packets.
For non tso packet, fw drops the tx request, if it has >14 frags.

Fixing it by pulling extra frags.

Cc: stable@kernel.org
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding:fix two typos
Peter Pan(潘卫平) [Mon, 11 Apr 2011 00:16:32 +0000 (00:16 +0000)]
bonding:fix two typos

replace relpy with reply.
replace premanent with permanent.

Signed-off-by: Weiping Pan(潘卫平) <panweiping3@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: fix tranmitted/tranmitting typo
Peter Pan(潘卫平) [Mon, 11 Apr 2011 00:15:57 +0000 (00:15 +0000)]
net: fix tranmitted/tranmitting typo

replace tranmitted with transmitted.
replace tranmitting with transmitting.

Signed-off-by: Weiping Pan(潘卫平) <panweiping3@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding:delete unused rlb_interval_counter
Peter Pan(潘卫平) [Sun, 10 Apr 2011 22:17:25 +0000 (22:17 +0000)]
bonding:delete unused rlb_interval_counter

Now, alb_bond_info uses rx_ntt,rlb_update_delay_counter and
rlb_update_retry_counter to decide when to call rlb_update_rx_clients().

Signed-off-by: Weiping Pan(潘卫平) <panweiping3@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding:delete unused alb_timer
Peter Pan(潘卫平) [Sun, 10 Apr 2011 22:17:24 +0000 (22:17 +0000)]
bonding:delete unused alb_timer

Now bonding-alb uses delayed_work instead of timer_list.

Signed-off-by: Weiping Pan(潘卫平) <panweiping3@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>