firefly-linux-kernel-4.4.55.git
14 years agocan: mcp251x: fix generation of error frames
Marc Kleine-Budde [Wed, 20 Oct 2010 00:02:26 +0000 (00:02 +0000)]
can: mcp251x: fix generation of error frames

The function "mcp251x_error_skb" is used to generate error frames.
They are identified by the "CAN_ERR_FLAG" in can_id. The function
overwrites the can_id so that the frames show up as normal frames instead
of error frames.

This patch fixes the problem by or'ing the can_id instead of overwriting it.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Tested-by: Jargalan Nermunkh <jargalan.nermunkh@criticallink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan: mcp251x: fix endless loop in interrupt handler if CANINTF_MERRF is set
Marc Kleine-Budde [Wed, 20 Oct 2010 00:02:25 +0000 (00:02 +0000)]
can: mcp251x: fix endless loop in interrupt handler if CANINTF_MERRF is set

Commit d3cd15657516141adce387810be8cb377baf020e introduced a bug, the
interrupt handler would loop endlessly if the CANINTF_MERRF bit is set,
because it's not cleared.

This patch fixes the problem by masking out the CANINTF_MERRF and all other
non interesting bits.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocan-raw: add msg_flags to distinguish local traffic
Oliver Hartkopp [Tue, 19 Oct 2010 09:32:04 +0000 (09:32 +0000)]
can-raw: add msg_flags to distinguish local traffic

CAN has no addressing scheme. It is currently impossible for userspace
to tell is a received CAN frame comes from another process on the local
host, or from a remote CAN device.

This patch add support for userspace applications to distinguish between
'own', 'local' and 'remote' CAN traffic. The distinction is made by returning
flags in msg->msg_flags in the call to recvmsg().

The added documentation explains the introduced flags.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years ago9p: client code cleanup
stephen hemminger [Tue, 19 Oct 2010 06:48:16 +0000 (06:48 +0000)]
9p: client code cleanup

Make p9_client_version static since only used in one file.
Remove p9_client_auth because it is defined but never used.
Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agords: make local functions/variables static
stephen hemminger [Tue, 19 Oct 2010 08:08:33 +0000 (08:08 +0000)]
rds: make local functions/variables static

The RDS protocol has lots of functions that should be
declared static. rds_message_get/add_version_extension is
removed since it defined but never used.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonapi: unexport napi_reuse_skb
stephen hemminger [Tue, 19 Oct 2010 07:12:10 +0000 (07:12 +0000)]
napi: unexport napi_reuse_skb

The function napi_reuse_skb is only used inside core.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agotipc: delete needless memset from bearer enabling.
Allan Stephens [Mon, 18 Oct 2010 11:43:56 +0000 (11:43 +0000)]
tipc: delete needless memset from bearer enabling.

Eliminates zeroing out of the new bearer structure at the start of
activation, since it is already in that state.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agodrivers/net/ax88796.c: Return error code in failure
Julia Lawall [Mon, 18 Oct 2010 04:11:14 +0000 (04:11 +0000)]
drivers/net/ax88796.c: Return error code in failure

In this code, 0 is returned on failure, even though other
failures return -ENOMEM or other similar values.

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

// <smpl>
@a@
identifier alloc;
identifier ret;
constant C;
expression x;
@@

x = alloc(...);
if (x == NULL) { <+... \(ret = -C; \| return -C; \) ...+> }

@@
identifier f, a.alloc;
expression ret;
expression x,e1,e2,e3;
@@

ret = 0
... when != ret = e1
*x = alloc(...)
... when != ret = e2
if (x == NULL) { ... when != ret = e3
  return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agob44: fix resume, request_irq after hw reset
James Hogan [Sun, 17 Oct 2010 01:48:59 +0000 (01:48 +0000)]
b44: fix resume, request_irq after hw reset

On resume, call request_irq() after resetting the hardware rather than
before. It's a shared interrupt so the handler could be called
immediately if another device on the same irq interrupts (and will be
called immediately if CONFIG_DEBUG_SHIRQ=y), but unless the hardware is
reinitialised with b44_init_hw() the read of the interrupt status
register will hang the system.

Signed-off-by: James Hogan <james@albanarts.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agocxgb4: function namespace cleanup (v3)
stephen hemminger [Mon, 18 Oct 2010 05:39:18 +0000 (05:39 +0000)]
cxgb4: function namespace cleanup (v3)

Make functions only used in one file local.
Remove lots of dead code, relating to unsupported functions
in mainline driver like RSS, IPv6, and TCP offload.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoCAPI: Silence lockdep warning on get_capi_appl_by_nr usage
Jan Kiszka [Sun, 17 Oct 2010 05:18:15 +0000 (05:18 +0000)]
CAPI: Silence lockdep warning on get_capi_appl_by_nr usage

As long as we hold capi_controller_lock, we can safely access
capi_applications without RCU protection as no one can modify the
application list underneath us. Introduce an RCU-free
__get_capi_appl_by_nr for this purpose. This silences lockdep warnings
on suspicious rcu_dereference usage.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobridge: Forward reserved group addresses if !STP
Benjamin Poirier [Mon, 18 Oct 2010 16:09:35 +0000 (16:09 +0000)]
bridge: Forward reserved group addresses if !STP

Make all frames sent to reserved group MAC addresses (01:80:c2:00:00:00 to
01:80:c2:00:00:0f) be forwarded if STP is disabled. This enables
forwarding EAPOL frames, among other things.

Signed-off-by: Benjamin Poirier <benjamin.poirier@polymtl.ca>
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/neighbour: cancel_delayed_work() + flush_scheduled_work() -> cancel_delayed_work_...
Tejun Heo [Tue, 19 Oct 2010 06:04:42 +0000 (06:04 +0000)]
net/neighbour: cancel_delayed_work() + flush_scheduled_work() -> cancel_delayed_work_sync()

flush_scheduled_work() is going away.  Prepare for it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agophy/marvell: fix 88e1121 support
Arnaud Patard [Thu, 21 Oct 2010 10:59:57 +0000 (03:59 -0700)]
phy/marvell: fix 88e1121 support

Commit c477d0447db08068a497e7beb892b2b2a7bff64b added support for RGMII
rx/tx delays except that it ends up clearing rx/tx delays bit for modes
differents that RGMII*ID. Due to this, ethernet is not working anymore
on my guruplug server +. This patch is fixing that.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: add a refcnt when turning on/off FCoE offload capability
Yi Zou [Wed, 20 Oct 2010 23:00:30 +0000 (23:00 +0000)]
ixgbe: add a refcnt when turning on/off FCoE offload capability

The FCoE offload is enabled/disabled per adapter, but upper FCoE protocol
stack could have multiple FCoE instances created on the same physical network
interface, e.g., FCoE on multiple VLAN interfaces on the same physical
network interface. In this case we want to turn on FCoE offload at the first
request from ndo_fcoe_enable() but only turn off FCoE offload at the very last
call to ndo_fcoe_disable(). This is fixed by adding a refcnt in the per adapter
FCoE structure and tear down FCoE offload when refcnt decrements to zero.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: fix stats handling
Eric Dumazet [Wed, 20 Oct 2010 23:00:04 +0000 (23:00 +0000)]
ixgbe: fix stats handling

Current ixgbe stats have following problems :

- Not 64 bit safe (on 32bit arches)

- Not safe in ixgbe_clean_rx_irq() :
   All cpus dirty a common location (netdev->stats.rx_bytes &
netdev->stats.rx_packets) without proper synchronization.
   This slow down a bit multiqueue operations, and possibly miss some
updates.

Fixes :

Implement ndo_get_stats64() method to provide accurate 64bit rx|tx
bytes/packets counters, using 64bit safe infrastructure.

ixgbe_get_ethtool_stats() also use this infrastructure to provide 64bit
safe counters.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-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>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: update copyright info
Emil Tantilov [Wed, 20 Oct 2010 22:59:40 +0000 (22:59 +0000)]
ixgbe: update copyright info

Update copyright notice

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 agojme: Advance version number
Guo-Fu Tseng [Mon, 18 Oct 2010 14:10:44 +0000 (14:10 +0000)]
jme: Advance version number

Advance version number and update copyright info

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agojme: Adding mii-tool support
Guo-Fu Tseng [Mon, 18 Oct 2010 14:10:43 +0000 (14:10 +0000)]
jme: Adding mii-tool support

Adding mii-tool support for some distribution only have mii-tool
installed by default.

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agojme: Prevent possible read re-order error
Guo-Fu Tseng [Mon, 18 Oct 2010 14:10:42 +0000 (14:10 +0000)]
jme: Prevent possible read re-order error

Adding read memory barrier in between flag reading and data reading of
receive descriptors. This prevents the data being read before hardware
complete writing informations.

Reported-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agojme: Add comment in jme_set_settings
Guo-Fu Tseng [Mon, 18 Oct 2010 14:10:41 +0000 (14:10 +0000)]
jme: Add comment in jme_set_settings

Explains what `fdc` variable is for.

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agojme: Fix PHY power-off error
Guo-Fu Tseng [Mon, 18 Oct 2010 14:10:40 +0000 (14:10 +0000)]
jme: Fix PHY power-off error

Adding phy_on in opposition to phy_off.

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Cc: <stable@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: cleanup: remove braces from single block statements
Bandan Das [Sat, 16 Oct 2010 20:19:59 +0000 (20:19 +0000)]
bonding: cleanup: remove braces from single block statements

checkpatch.pl cleanup : Remove braces from single statement
blocks.

Signed-off-by: Bandan Das <bandan.das@stratus.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: cleanup : add space around operators
Bandan Das [Sat, 16 Oct 2010 20:19:58 +0000 (20:19 +0000)]
bonding: cleanup : add space around operators

checkpatch.pl cleanup: Added spaces around operators at various places.
Also fixed some c99 style comments that I came across.

Signed-off-by: Bandan Das <bandan.das@stratus.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoDrivers: atm: Makefile: replace the use of <module>-objs with <module>-y
Tracey Dent [Fri, 15 Oct 2010 17:53:29 +0000 (17:53 +0000)]
Drivers: atm: Makefile: replace the use of <module>-objs with <module>-y

Changed <module>-objs to <module>-y in Makefile.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosmsc95xx: generate random MAC address once, not every ifup
Bernard Blackham [Mon, 18 Oct 2010 13:16:39 +0000 (13:16 +0000)]
smsc95xx: generate random MAC address once, not every ifup

The smsc95xx driver currently generates a new random MAC address
every time the interface is brought up. This makes it impossible to
override using the standard `ifconfig hw ether` approach.

Past patches tried to make the MAC address a module parameter or
base it off the die ID, but it seems to me much simpler (and
hopefully less controversial) to stick with the current random
generation scheme, but allow the user to change the address.

This patch does exactly that - it moves the random address
generation from smsc95xx_reset() into smsc95xx_bind(), so that it is
done once on module load, not on every ifup. The user can then
override this using the standard mechanisms.

Applies against 2.6.35 and linux-2.6 head.

Signed-off-by: Bernard Blackham <b-omap@largestprime.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2: Increase max rx ring size from 1K to 2K
Michael Chan [Mon, 18 Oct 2010 14:30:54 +0000 (14:30 +0000)]
bnx2: Increase max rx ring size from 1K to 2K

A number of customers are reporting packet loss under certain workloads
(e.g. heavy bursts of small packets) with flow control disabled.  A larger
rx ring helps to prevent these losses.

No change in default rx ring size and memory consumption.

Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
Acked-by: John Feeney <jfeeney@redhat.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet_sched: remove the unused parameter of qdisc_create_dflt()
Changli Gao [Sat, 16 Oct 2010 13:04:08 +0000 (13:04 +0000)]
net_sched: remove the unused parameter of qdisc_create_dflt()

The first parameter dev isn't in use in qdisc_create_dflt().

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: make release_and_destroy static
stephen hemminger [Fri, 15 Oct 2010 05:09:34 +0000 (05:09 +0000)]
bonding: make release_and_destroy static

Only used in main file.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoxfrm: make xfrm_bundle_ok local
stephen hemminger [Fri, 15 Oct 2010 05:14:19 +0000 (05:14 +0000)]
xfrm: make xfrm_bundle_ok local

Only used in one place.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agortnetlink: remove rtnl_kill_links
stephen hemminger [Fri, 15 Oct 2010 05:12:01 +0000 (05:12 +0000)]
rtnetlink: remove rtnl_kill_links

The function rtnl_kill_links is defined but never used.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoxfrm6: make xfrm6_tunnel_free_spi local
stephen hemminger [Fri, 15 Oct 2010 05:15:59 +0000 (05:15 +0000)]
xfrm6: make xfrm6_tunnel_free_spi local

Function only defined and used in one file.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agopch_gbe: make local functions static
stephen hemminger [Fri, 15 Oct 2010 11:09:14 +0000 (11:09 +0000)]
pch_gbe: make local functions static

Make routines that are only used in one file static.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovmxnet3: make bit twiddle routines inline
stephen hemminger [Fri, 15 Oct 2010 11:06:20 +0000 (11:06 +0000)]
vmxnet3: make bit twiddle routines inline

Gcc doesn't usually handle inline across compilation units, and the
functions don't have to be global in scope. Move the set/reset flag
functions int the existing vmxnet3 header.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Shreyas Bhatewara <sbhatewara@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: make bond_resend_igmp_join_requests_delayed static
stephen hemminger [Fri, 15 Oct 2010 11:02:56 +0000 (11:02 +0000)]
bonding: make bond_resend_igmp_join_requests_delayed static

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Flavio Leitner <fleitner@redhat.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosfc: make functions static
stephen hemminger [Mon, 18 Oct 2010 05:27:31 +0000 (05:27 +0000)]
sfc: make functions static

Make local functions and variable static. Do some rearrangement
of the string table stuff to put it where it gets used.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobridge: make br_parse_ip_options static
stephen hemminger [Mon, 18 Oct 2010 14:03:21 +0000 (14:03 +0000)]
bridge: make br_parse_ip_options static

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agosocket: localize functions
stephen hemminger [Mon, 18 Oct 2010 14:27:29 +0000 (14:27 +0000)]
socket: localize functions

A couple of functions in socket.c are only used there and
should be localized.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: make local function static.
stephen hemminger [Mon, 18 Oct 2010 17:40:10 +0000 (17:40 +0000)]
netxen: make local function static.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agofib: introduce fib_alias_accessed() helper
Eric Dumazet [Wed, 20 Oct 2010 22:03:38 +0000 (22:03 +0000)]
fib: introduce fib_alias_accessed() helper

Perf tools session at NFWS 2010 pointed out a false sharing on struct
fib_alias that can be avoided pretty easily, if we set FA_S_ACCESSED bit
only if needed (ie : not already set)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet/sched: fix missing spinlock init
Eric Dumazet [Fri, 15 Oct 2010 19:22:34 +0000 (19:22 +0000)]
net/sched: fix missing spinlock init

Under network load, doing :

tc qdisc del dev eth0 root

triggers :

[  167.193087] BUG: spinlock bad magic on CPU#3, udpflood/4928
[  167.193139]  lock: c15bc324, .magic: 00000000, .owner:
<none>/-1, .owner_cpu: -1
[  167.193193] Pid: 4928, comm: udpflood Not tainted
2.6.36-rc7-11417-g215340c-dirty #323
[  167.193245] Call Trace:
[  167.193292]  [<c13abaa0>] ? printk+0x18/0x20
[  167.193342]  [<c11afb53>] spin_bug+0xa3/0xf0
[  167.193389]  [<c11afcdd>] do_raw_spin_lock+0x7d/0x160
[  167.193440]  [<c1313d4e>] ? __dev_xmit_skb+0x27e/0x2b0
[  167.193496]  [<c107382b>] ? trace_hardirqs_on+0xb/0x10
[  167.193545]  [<c13ae99a>] _raw_spin_lock+0x3a/0x40
[  167.193593]  [<c1313d4e>] ? __dev_xmit_skb+0x27e/0x2b0
[  167.193641]  [<c1313d4e>] __dev_xmit_skb+0x27e/0x2b0

commit 79640a4ca695 (add additional lock to qdisc to increase
throughput) forgot to initialize  noop_qdisc and noqueue_qdisc busylock

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agor8169: print errors when dma mapping fail
Stanislaw Gruszka [Wed, 20 Oct 2010 22:25:43 +0000 (22:25 +0000)]
r8169: print errors when dma mapping fail

If dma mapping fail we are dropping packages or fail to open device.
But exact reason of drop/fail stays unknow for a user, so print errors.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agor8169: (re)init phy on resume
Stanislaw Gruszka [Wed, 20 Oct 2010 22:25:42 +0000 (22:25 +0000)]
r8169: (re)init phy on resume

Fix switching device to low-speed mode after resume reported in:
https://bugzilla.redhat.com/show_bug.cgi?id=502974

Reported-and-tested-by: Laurentiu Badea <bugzilla-redhat@wotevah.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agor8169: changing mtu clean up
Stanislaw Gruszka [Wed, 20 Oct 2010 22:25:41 +0000 (22:25 +0000)]
r8169: changing mtu clean up

Since we do not change rx buffer size any longer, we can
clean up rtl8169_change_mtu and in consequence rtl8169_down.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agor8169: do not account fragments as packets
Stanislaw Gruszka [Wed, 20 Oct 2010 22:25:40 +0000 (22:25 +0000)]
r8169: do not account fragments as packets

Only increase tx_{packets,dropped} statistics when transmit or drop
full skb, not just fragment.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agor8169: use pointer to struct device as local variable
Stanislaw Gruszka [Wed, 20 Oct 2010 22:25:39 +0000 (22:25 +0000)]
r8169: use pointer to struct device as local variable

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agor8169: replace PCI_DMA_{TO,FROM}DEVICE to DMA_{TO,FROM}_DEVICE
Stanislaw Gruszka [Wed, 20 Oct 2010 22:25:38 +0000 (22:25 +0000)]
r8169: replace PCI_DMA_{TO,FROM}DEVICE to DMA_{TO,FROM}_DEVICE

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agor8169: init rx ring cleanup
Stanislaw Gruszka [Wed, 20 Oct 2010 22:25:37 +0000 (22:25 +0000)]
r8169: init rx ring cleanup

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agor8169: check dma mapping failures
Stanislaw Gruszka [Wed, 20 Oct 2010 22:25:36 +0000 (22:25 +0000)]
r8169: check dma mapping failures

Check possible dma mapping errors and do clean up if it happens.

Fix overwrap bug in rtl8169_tx_clear on the way.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Update bnx2x to use new vlan accleration.
Hao Zheng [Wed, 20 Oct 2010 13:56:11 +0000 (13:56 +0000)]
bnx2x: Update bnx2x to use new vlan accleration.

Make the bnx2x driver use the new vlan accleration model.

Signed-off-by: Hao Zheng <hzheng@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
CC: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoixgbe: Update ixgbe to use new vlan accleration.
Jesse Gross [Wed, 20 Oct 2010 13:56:10 +0000 (13:56 +0000)]
ixgbe: Update ixgbe to use new vlan accleration.

Make the ixgbe driver use the new vlan accleration model.

Signed-off-by: Jesse Gross <jesse@nicira.com>
CC: Peter Waskiewicz <peter.p.waskiewicz.jr@intel.com>
CC: Emil Tantilov <emil.s.tantilov@intel.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2: Update bnx2 to use new vlan accleration.
Jesse Gross [Wed, 20 Oct 2010 13:56:09 +0000 (13:56 +0000)]
bnx2: Update bnx2 to use new vlan accleration.

Make the bnx2 driver use the new vlan accleration model.

Signed-off-by: Jesse Gross <jesse@nicira.com>
CC: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobridge: Add support for TX vlan offload.
Jesse Gross [Wed, 20 Oct 2010 13:56:08 +0000 (13:56 +0000)]
bridge: Add support for TX vlan offload.

If some of the underlying devices support it, enable vlan offload on
transmit for bridge devices.  This allows senders to take advantage of the
hardware support, similar to other forms of acceleration.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoethtool: Add support for vlan accleration.
Jesse Gross [Wed, 20 Oct 2010 13:56:07 +0000 (13:56 +0000)]
ethtool: Add support for vlan accleration.

Now that vlan acceleration is handled consistently regardless of usage,
it is possible to enable and disable it at will.  This adds support for
Ethtool operations that change the offloading status for debugging
purposes, similar to other forms of hardware acceleration.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovlan: Centralize handling of hardware acceleration.
Jesse Gross [Wed, 20 Oct 2010 13:56:06 +0000 (13:56 +0000)]
vlan: Centralize handling of hardware acceleration.

Currently each driver that is capable of vlan hardware acceleration
must be aware of the vlan groups that are configured and then pass
the stripped tag to a specialized receive function.  This is

different from other types of hardware offload in that it places a
significant amount of knowledge in the driver itself rather keeping
it in the networking core.

This makes vlan offloading function more similarly to other forms
of offloading (such as checksum offloading or TSO) by doing the
following:
* On receive, stripped vlans are passed directly to the network
core, without attempting to check for vlan groups or reconstructing
the header if no group
* vlans are made less special by folding the logic into the main
receive routines
* On transmit, the device layer will add the vlan header in software
if the hardware doesn't support it, instead of spreading that logic
out in upper layers, such as bonding.

There are a number of advantages to this:
* Fixes all bugs with drivers incorrectly dropping vlan headers at once.
* Avoids having to disable VLAN acceleration when in promiscuous mode
(good for bridging since it always puts devices in promiscuous mode).
* Keeps VLAN tag separate until given to ultimate consumer, which
avoids needing to do header reconstruction as in tg3 unless absolutely
necessary.
* Consolidates common code in core networking.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovlan: Avoid hash table lookup to find group.
Jesse Gross [Wed, 20 Oct 2010 13:56:05 +0000 (13:56 +0000)]
vlan: Avoid hash table lookup to find group.

A struct net_device always maps to zero or one vlan groups and we
always know the device when we are looking up a group.  We currently
do a hash table lookup on the device to find the group but it is
much simpler to just store a pointer.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovlan: Enable software emulation for vlan accleration.
Jesse Gross [Wed, 20 Oct 2010 13:56:04 +0000 (13:56 +0000)]
vlan: Enable software emulation for vlan accleration.

Currently users of hardware vlan accleration need to know whether
the device supports it before generating packets.  However, vlan
acceleration will soon be available in a more flexible manner so
knowing ahead of time becomes much more difficult.  This adds
a software fallback path for vlan packets on devices without the
necessary offloading support, similar to other types of hardware
accleration.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovlan: Don't check for vlan group before vlan_tx_tag_present.
Jesse Gross [Wed, 20 Oct 2010 13:56:03 +0000 (13:56 +0000)]
vlan: Don't check for vlan group before vlan_tx_tag_present.

Many (but not all) drivers check to see whether there is a vlan
group configured before using a tag stored in the skb.  There's
not much point in this check since it just throws away data that
should only be present in the expected circumstances.  However,
it will soon be legal and expected to get a vlan tag when no
vlan group is configured, so remove this check from all drivers
to avoid dropping the tags.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agovlan: Rename VLAN_GROUP_ARRAY_LEN to VLAN_N_VID.
Jesse Gross [Wed, 20 Oct 2010 13:56:02 +0000 (13:56 +0000)]
vlan: Rename VLAN_GROUP_ARRAY_LEN to VLAN_N_VID.

VLAN_GROUP_ARRAY_LEN is simply the number of possible vlan VIDs.
Since vlan groups will soon be more of an implementation detail
for vlan devices, rename the constant to be descriptive of its
actual purpose.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoebtables: Allow filtering of hardware accelerated vlan frames.
Jesse Gross [Wed, 20 Oct 2010 13:56:01 +0000 (13:56 +0000)]
ebtables: Allow filtering of hardware accelerated vlan frames.

An upcoming commit will allow packets with hardware vlan acceleration
information to be passed though more parts of the network stack, including
packets trunked through the bridge.  This adds support for matching and
filtering those packets through ebtables.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoenic: Fix log message
Vasanthy Kolluri [Wed, 20 Oct 2010 10:17:19 +0000 (10:17 +0000)]
enic: Fix log message

Fix a log message

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoenic: Change min MTU
Vasanthy Kolluri [Wed, 20 Oct 2010 10:17:14 +0000 (10:17 +0000)]
enic: Change min MTU

Change min MTU to 68.

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoenic: Replace firmware devcmd CMD_ENABLE with CMD_ENABLE_WAIT
Vasanthy Kolluri [Wed, 20 Oct 2010 10:17:09 +0000 (10:17 +0000)]
enic: Replace firmware devcmd CMD_ENABLE with CMD_ENABLE_WAIT

Replace no wait CMD_ENABLE firmware devcmd with CMD_ENABLE_WAIT

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoenic: Make firmware cognizant of the user set mac address
Vasanthy Kolluri [Wed, 20 Oct 2010 10:17:04 +0000 (10:17 +0000)]
enic: Make firmware cognizant of the user set mac address

Let the firmware know about the mac address set by the user using ndo_set_mac_address

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoenic: Add support for multiple hardware receive queues
Vasanthy Kolluri [Wed, 20 Oct 2010 10:16:59 +0000 (10:16 +0000)]
enic: Add support for multiple hardware receive queues

Add support for multiple hardware receive queues. The ingress traffic is hashed into one of the receive queues based on IP or TCP or both headers. The max no. of receive queues supported is 8.

Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoibmveth: Free irq on error path
Denis Kirjanov [Wed, 20 Oct 2010 04:21:51 +0000 (04:21 +0000)]
ibmveth: Free irq on error path

Free irq on error path.

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoibmveth: Cleanup error handling inside ibmveth_open
Denis Kirjanov [Wed, 20 Oct 2010 04:21:13 +0000 (04:21 +0000)]
ibmveth: Cleanup error handling inside ibmveth_open

Remove duplicated code in one place.

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: avoid RCU for NOCACHE dst
Eric Dumazet [Fri, 15 Oct 2010 05:44:11 +0000 (05:44 +0000)]
net: avoid RCU for NOCACHE dst

There is no point using RCU for dst we allocate for a very short time
(used once).

Change dst_release() to take DST_NOCACHE into account, but also change
skb_dst_set_noref() to force a refcount increment for such dst.

This is a _huge_ gain, because we dont waste memory to store xx thousand
of dsts. Instead of queueing them to RCU, we can free them instantly.

CPU caches can stay hot, re-using same memory blocks to hold temporary
dsts.

Note : remove unneeded smp_mb__before_atomic_dec(); in dst_release(),
since atomic_dec_return() implies a full memory barrier.

Stress test, 160.000.000 udp frames sent, IP route cache disabled
(DDOS).

Before:

real    0m38.091s
user    0m13.189s
sys     7m53.018s

After:

real 0m29.946s
user 0m12.157s
sys 7m40.605s

For reference, if IP route cache was enabled :

real 0m32.030s
user 0m10.521s
sys 8m15.243s

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: allocate tx queues in register_netdevice
Tom Herbert [Mon, 18 Oct 2010 18:04:39 +0000 (18:04 +0000)]
net: allocate tx queues in register_netdevice

This patch introduces netif_alloc_netdev_queues which is called from
register_device instead of alloc_netdev_mq.  This makes TX queue
allocation symmetric with RX allocation.  Also, queue locks allocation
is done in netdev_init_one_queue.  Change set_real_num_tx_queues to
fail if requested number < 1 or greater than number of allocated
queues.

Signed-off-by: Tom Herbert <therbert@google.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: cleanups in RX queue allocation
Tom Herbert [Mon, 18 Oct 2010 18:00:16 +0000 (18:00 +0000)]
net: cleanups in RX queue allocation

Clean up in RX queue allocation.  In netif_set_real_num_rx_queues
return error on attempt to set zero queues, or requested number is
greater than number of allocated queues.  In netif_alloc_rx_queues,
do BUG_ON if queue_count is zero.

Signed-off-by: Tom Herbert <therbert@google.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: fail alloc_netdev_mq if queue count < 1
Tom Herbert [Mon, 18 Oct 2010 17:55:58 +0000 (17:55 +0000)]
net: fail alloc_netdev_mq if queue count < 1

In alloc_netdev_mq fail if requested queue_count < 1.

Signed-off-by: Tom Herbert <therbert@google.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Wed, 20 Oct 2010 08:59:48 +0000 (01:59 -0700)]
Merge branch 'for-davem' of git://git./linux/kernel/git/linville/wireless-next-2.6

14 years agophonet: remove the unused variable pn
Changli Gao [Tue, 19 Oct 2010 21:51:03 +0000 (21:51 +0000)]
phonet: remove the unused variable pn

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetpoll: Revert napi_poll fix for bonding driver
Neil Horman [Tue, 19 Oct 2010 07:04:26 +0000 (07:04 +0000)]
netpoll: Revert napi_poll fix for bonding driver

In an erlier patch I modified napi_poll so that devices with IFF_MASTER polled
the per_cpu list instead of the device list for napi.  I did this because the
bonding driver has no napi instances to poll, it instead expects to check the
slave devices napi instances, which napi_poll was unaware of.  Looking at this
more closely however, I now see this isn't strictly needed.  As the bond driver
poll_controller calls the slaves poll_controller via netpoll_poll_dev, which
recursively calls poll_napi on each slave, allowing those napi instances to get
serviced.  The earlier patch isn't at all harmfull, its just not needed, so lets
revert it to make the code cleaner.  Sorry for the noise,

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reviewed-by: WANG Cong <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetpoll: Remove netpoll blocking from uninit path
Neil Horman [Tue, 19 Oct 2010 07:04:25 +0000 (07:04 +0000)]
netpoll: Remove netpoll blocking from uninit path

Some recent testing in netpoll with bonding showed this backtrace

 ------------[ cut here ]------------
 kernel BUG at drivers/net/bonding/bonding.h:134!
 invalid opcode: 0000 [#1] SMP
 last sysfs file: /sys/devices/pci0000:00/0000:00:1d.2/usb7/devnum
 CPU 0
 Pid: 1876, comm: rmmod Not tainted 2.6.36-rc3+ #10 D26928/
 RIP: 0010:[<ffffffffa0514ba4>]  [<ffffffffa0514ba4>] bond_uninit+0x6f4/0x7a0
 RSP: 0018:ffff88003b1b5d58  EFLAGS: 00010296
 RAX: ffff88003b9b6200 RBX: ffff8800373e8e00 RCX: 00000000000f4240
 RDX: 00000000ffffffff RSI: 0000000000000286 RDI: 0000000000000286
 RBP: ffff88003b1b5dc8 R08: 0000000000000000 R09: 00000001af7de920
 R10: 0000000000000000 R11: ffff880002495e98 R12: ffff880037922700
 R13: ffff880038c31000 R14: ffff880037922730 R15: 0000000000000286
 FS:  00007f90e6d72700(0000) GS:ffff880002400000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 000000346f0d9ad0 CR3: 000000003b263000 CR4: 00000000000006f0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process rmmod (pid: 1876, threadinfo ffff88003b1b4000, task ffff88003b36aa80)
 Stack:
 00000000ffffffff ffff88003b1b5d7a ffff8800379221e8 ffff880037922000
 <0> ffff88003b1b5dc8 ffffffff813eb5fb ffff88003b1b5da8 0000000031b177a3
 <0> ffff88003b1b5da8 ffff880037922000 ffff88003b1b5e48 ffff88003b1b5e48
 Call Trace:
 [<ffffffff813eb5fb>] ? rtmsg_ifinfo+0xcb/0xf0
 [<ffffffff813daad8>] rollback_registered_many+0x168/0x280
 [<ffffffff813dac09>] unregister_netdevice_many+0x19/0x80
 [<ffffffff813e97b3>] __rtnl_kill_links+0x63/0x90
 [<ffffffff813e980b>] __rtnl_link_unregister+0x2b/0x60
 [<ffffffff813e9bde>] rtnl_link_unregister+0x1e/0x30
 [<ffffffffa052124b>] bonding_exit+0x37/0x51 [bonding]
 [<ffffffff81098b2e>] sys_delete_module+0x19e/0x270
 [<ffffffff810bb2b2>] ? audit_syscall_entry+0x252/0x280
 [<ffffffff8100b0b2>] system_call_fastpath+0x16/0x1b
 RIP  [<ffffffffa0514ba4>] bond_uninit+0x6f4/0x7a0 [bonding]
 RSP <ffff88003b1b5d58>
 ---[ end trace 1395ad691cea24d1 ]---

It occurs because of my recent netpoll blocking patches, which I added to avoid
recursive deadlock in the bonding driver.  It relies on some per cpu bits, but
the shutdown path forces some rescheduling as we cancel workqueues for the
driver and wait for some device refcounts.  If after the forced reschedule, we
wind up on a different cpu we trigger the bughalt in unblock_netpoll_tx.

The fix is to remove the netpoll block/unblock calls from bond_release_all.
This is safe to do because bond_uninit, which is called via ndo_uninit in
rollback_registered_many, doesn't occur until we send a NETDEV_UNREGISTER event,
which triggers netconsole to remove us as a netpoll client, so we are guaranteed
not to recurse into our own tx path here.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reviewed-by: WANG Cong <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: update version to 1.60.00-3
Dmitry Kravkov [Tue, 19 Oct 2010 05:13:00 +0000 (05:13 +0000)]
bnx2x: update version to 1.60.00-3

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: prevent false parity error in MSI-X memory of HC block
Vladislav Zolotarov [Tue, 19 Oct 2010 05:13:09 +0000 (05:13 +0000)]
bnx2x: prevent false parity error in MSI-X memory of HC block

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: fix possible deadlock in HC hw block
Dmitry Kravkov [Tue, 19 Oct 2010 05:13:05 +0000 (05:13 +0000)]
bnx2x: fix possible deadlock in HC hw block

The possible deadlock (on 57710 devices only) will prevent from the
device to generate interrupts.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoinet: RCU changes in inetdev_by_index()
Eric Dumazet [Tue, 19 Oct 2010 00:39:26 +0000 (00:39 +0000)]
inet: RCU changes in inetdev_by_index()

Convert inetdev_by_index() to not increment in_dev refcount.

Callers hold RCU or RTNL, and should not decrement in_dev refcount.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonet: avoid a dev refcount in ip_mc_find_dev()
Eric Dumazet [Tue, 19 Oct 2010 00:39:18 +0000 (00:39 +0000)]
net: avoid a dev refcount in ip_mc_find_dev()

We hold RTNL in ip_mc_find_dev(), no need to touch device refcount.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years ago3c52x: remove IRQF_SAMPLE_RANDOM from legacy MCA drivers.
Paul Gortmaker [Thu, 14 Oct 2010 14:21:51 +0000 (14:21 +0000)]
3c52x: remove IRQF_SAMPLE_RANDOM from legacy MCA drivers.

If you are genuinely using one of these legacy MCA drivers
then you are tragically on hardware where you really don't
have the extra CPU cycles to be wasting on this.

In addition, it makes two less cases for people to inadvertently
blindly copy flags from without explicitly thinking whether it
makes sense -- see the addition to feature-removal.txt as per
commit 9d9b8fb0e5ebf4b0398e579f6061d4451fea3242.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: Re-enable netpoll over bonding
Neil Horman [Wed, 13 Oct 2010 16:01:53 +0000 (16:01 +0000)]
bonding: Re-enable netpoll over bonding

With the inclusion of previous fixup patches, netpoll over bonding apears to
work reliably with failover conditions.  This reverts Gospos previous commit
c22d7ac844f1cb9c6a5fd20f89ebadc2feef891b, and allows access again to the netpoll
functionality in the bonding driver.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: Fix netconsole to not deadlock on rmmod
Neil Horman [Wed, 13 Oct 2010 16:01:52 +0000 (16:01 +0000)]
bonding: Fix netconsole to not deadlock on rmmod

Netconsole calls netpoll_cleanup on receipt of a NETDEVICE_UNREGISTER event.
The notifier subsystem calls these event handlers with rtnl_lock held, which
netpoll_cleanup also takes, resulting in deadlock.  Fix this by calling the
__netpoll_cleanup interior function instead, and fixing up the additional
pointers.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: Fix napi poll for bonding driver
Neil Horman [Wed, 13 Oct 2010 16:01:51 +0000 (16:01 +0000)]
bonding: Fix napi poll for bonding driver

Usually the netpoll path, when preforming a napi poll can get away with just
polling all the napi instances of the configured device.  Thats not the case for
the bonding driver however, as the napi instances which may wind up getting
flagged as needing polling after the poll_controller call don't belong to the
bonded device, but rather to the slave devices.  Fix this by checking the device
in question for the IFF_MASTER flag, if set, we know we need to check the full
poll list for this cpu, rather than just the devices napi instance list.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: Fix deadlock in bonding driver resulting from internal locking when using...
Neil Horman [Wed, 13 Oct 2010 16:01:50 +0000 (16:01 +0000)]
bonding: Fix deadlock in bonding driver resulting from internal locking when using netpoll

The monitoring paths in the bonding driver take write locks that are shared by
the tx path.  If netconsole is in use, these paths can call printk which puts us
in the netpoll tx path, which, if netconsole is attached to the bonding driver,
result in deadlock (the xmit_lock guards are useless in netpoll_send_skb, as the
monitor paths in the bonding driver don't claim the xmit_lock, nor should they).
The solution is to use a per cpu flag internal to the driver to indicate when a
cpu is holding the lock in a path that might recusrse into the tx path for the
driver via netconsole.  By checking this flag on transmit, we can defer the
sending of the netconsole frames until a later time using the retransmit feature
of netpoll_send_skb that is triggered on the return code NETDEV_TX_BUSY.  I've
tested this and am able to transmit via netconsole while causing failover
conditions on the bond slave links.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobonding: Fix bonding drivers improper modification of netpoll structure
Neil Horman [Wed, 13 Oct 2010 16:01:49 +0000 (16:01 +0000)]
bonding: Fix bonding drivers improper modification of netpoll structure

The bonding driver currently modifies the netpoll structure in its xmit path
while sending frames from netpoll.  This is racy, as other cpus can access the
netpoll structure in parallel. Since the bonding driver points np->dev to a
slave device, other cpus can inadvertently attempt to send data directly to
slave devices, leading to improper locking with the bonding master, lost frames,
and deadlocks.  This patch fixes that up.

This patch also removes the real_dev pointer from the netpoll structure as that
data is really only used by bonding in the poll_controller, and we can emulate
its behavior by check each slave for IS_UP.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoe1000e: Fix for offline diag test failure at first call
Carolyn Wyborny [Fri, 15 Oct 2010 17:35:31 +0000 (17:35 +0000)]
e1000e: Fix for offline diag test failure at first call

Move link test call to later in the offline sequence, move the
restore settings block to afterwards and add another reset to ensure
the hardware is in a known state afterwards.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Acked-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoigbvf: Remove unneeded pm_qos* calls
Greg Rose [Fri, 15 Oct 2010 17:26:47 +0000 (17:26 +0000)]
igbvf: Remove unneeded pm_qos* calls

Power Management Quality of Service is not supported or used by the VF
driver.

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: fix stats handling
Eric Dumazet [Fri, 15 Oct 2010 17:27:10 +0000 (17:27 +0000)]
igb: fix stats handling

There are currently some problems with igb.

- On 32bit arches, maintaining 64bit counters without proper
synchronization between writers and readers.

- Stats updated every two seconds, as reported by Jesper.
   (Jesper provided a patch for this)

- Potential problem between worker thread and ethtool -S

This patch uses u64_stats_sync, and convert everything to be 64bit safe,
SMP safe, even on 32bit arches. It integrates Jesper idea of providing
accurate stats at the time user reads them.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Tested-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 agonetxen: mask correctable error
amit salecha [Mon, 18 Oct 2010 02:03:42 +0000 (02:03 +0000)]
netxen: mask correctable error

HW workaround:
Disable logging of correctable error for some NX3031 based adapter.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agonetxen: fix race in tx stop queue
Rajesh Borundia [Mon, 18 Oct 2010 02:03:41 +0000 (02:03 +0000)]
netxen: fix race in tx stop queue

There is race between netif_stop_queue and netif_stopped_queue
check.So check once again if buffers are available to avoid race.
With above logic we can also get rid of tx lock in process_cmd_ring.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoqlcnic: update ethtool stats
amit salecha [Mon, 18 Oct 2010 01:47:48 +0000 (01:47 +0000)]
qlcnic: update ethtool stats

Added statistics for Nic Partition supported adapter.
These statistics are maintined in device.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoIPv4: route.c: Change checks against 0xffffffff to ipv4_is_lbcast()
Andy Walls [Sun, 17 Oct 2010 15:11:22 +0000 (15:11 +0000)]
IPv4: route.c: Change checks against 0xffffffff to ipv4_is_lbcast()

Change a few checks against the hardcoded broadcast address,
0xffffffff, to ipv4_is_lbcast().  Remove some existing checks
using ipv4_is_lbcast() that are now obviously superfluous.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agoMerge branch 'can/mcp251x-for-net-next' of git://git.pengutronix.de/git/mkl/linux-2.6
David S. Miller [Mon, 18 Oct 2010 14:11:44 +0000 (07:11 -0700)]
Merge branch 'can/mcp251x-for-net-next' of git://git.pengutronix.de/git/mkl/linux-2.6

14 years agobnx2x: update version to 1.60.00-2
Dmitry Kravkov [Sun, 17 Oct 2010 23:08:55 +0000 (23:08 +0000)]
bnx2x: update version to 1.60.00-2

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: remove unnecessary FUNC_FLG_RSS flag and related
Dmitry Kravkov [Sun, 17 Oct 2010 23:08:53 +0000 (23:08 +0000)]
bnx2x: remove unnecessary FUNC_FLG_RSS flag and related

As suggested by: Joe Perches <joe@perches.com>

Although RSS is meaningless when there is a single HW queue we
still need it enabled in order to have HW Rx hash generated.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Use correct FW constant for header padding
Dmitry Kravkov [Sun, 17 Oct 2010 23:09:30 +0000 (23:09 +0000)]
bnx2x: Use correct FW constant for header padding

the value of the constant is the same, but it's clearer to use original
constant provided by HSI

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: do not deal with power if no capability
Dmitry Kravkov [Sun, 17 Oct 2010 23:10:02 +0000 (23:10 +0000)]
bnx2x: do not deal with power if no capability

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: remove redundant commands during error handling
Dmitry Kravkov [Sun, 17 Oct 2010 23:05:09 +0000 (23:05 +0000)]
bnx2x: remove redundant commands during error handling

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
14 years agobnx2x: Optimized the branching in the bnx2x_rx_int()
Vladislav Zolotarov [Sun, 17 Oct 2010 23:02:20 +0000 (23:02 +0000)]
bnx2x: Optimized the branching in the bnx2x_rx_int()

Optimized the branching in the bnx2x_rx_int() based on the fact
that FP CQE will always have at least one of START or STOP flags set,
so if not both bits are set and START bit is not set,
then it's a STOP bit that is set.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>