pandora-kernel.git
13 years agoRDS/IB: Remove dead code
Andy Grover [Thu, 14 Jan 2010 00:29:37 +0000 (16:29 -0800)]
RDS/IB: Remove dead code

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS/IB: Disallow connections less than RDS 3.1
Andy Grover [Wed, 13 Jan 2010 23:50:09 +0000 (15:50 -0800)]
RDS/IB: Disallow connections less than RDS 3.1

RDS 3.0 connections (in OFED 1.3 and earlier) put the
header at the end. 3.1 connections put it at the head.
The code has significant added complexity in order to
handle both configurations. In OFED 1.6 we can
drop this and simplify the code by only supporting
"header-first" configuration.

This patch checks the protocol version, and if prior
to 3.1, does not complete the connection.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS/IB: eliminate duplicate code
Andy Grover [Tue, 12 Jan 2010 22:43:06 +0000 (14:43 -0800)]
RDS/IB: eliminate duplicate code

both atomics and rdmas need to convert ib-specific completion codes
into RDS status codes. Rename rds_ib_rdma_send_complete to
rds_ib_send_complete, and have it take a pointer to the function to
call with the new error code.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: inc_purge() transport function unused - remove it
Andy Grover [Tue, 12 Jan 2010 22:41:46 +0000 (14:41 -0800)]
RDS: inc_purge() transport function unused - remove it

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: Whitespace
Andy Grover [Tue, 12 Jan 2010 18:53:05 +0000 (10:53 -0800)]
RDS: Whitespace

Tidy up some whitespace issues.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: Do not mask address when pinning pages
Andy Grover [Tue, 12 Jan 2010 18:52:28 +0000 (10:52 -0800)]
RDS: Do not mask address when pinning pages

This does not appear to be necessary.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: Base init_depth and responder_resources on hw values
Andy Grover [Tue, 12 Jan 2010 18:50:48 +0000 (10:50 -0800)]
RDS: Base init_depth and responder_resources on hw values

Instead of using a constant for initiator_depth and
responder_resources, read the per-QP values when the
device is enumerated, and then use these values when creating
the connection.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: Implement atomic operations
Andy Grover [Tue, 12 Jan 2010 22:33:38 +0000 (14:33 -0800)]
RDS: Implement atomic operations

Implement a CMSG-based interface to do FADD and CSWP ops.

Alter send routines to handle atomic ops.

Add atomic counters to stats.

Add xmit_atomic() to struct rds_transport

Inline rds_ib_send_unmap_rdma into unmap_rm

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: Clear up some confusing code in send_remove_from_sock
Andy Grover [Tue, 12 Jan 2010 22:19:32 +0000 (14:19 -0800)]
RDS: Clear up some confusing code in send_remove_from_sock

The previous code was correct, but made the assumption that
if r_notifier was non-NULL then either r_recverr or r_notify
was true. Valid, but fragile. Changed to explicitly check
r_recverr (shows up in greps for recverr now, too.)

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: make sure all sgs alloced are initialized
Andy Grover [Tue, 12 Jan 2010 22:17:31 +0000 (14:17 -0800)]
RDS: make sure all sgs alloced are initialized

rds_message_alloc_sgs() now returns correctly-initialized
sg lists, so calleds need not do this themselves.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: make m_rdma_op a member of rds_message
Andy Grover [Tue, 12 Jan 2010 22:13:15 +0000 (14:13 -0800)]
RDS: make m_rdma_op a member of rds_message

This eliminates a separate memory alloc, although
it is now necessary to add an "r_active" flag, since
it is no longer to use the m_rdma_op pointer as an
indicator of if an rdma op is present.

rdma SGs allocated from rm sg pool.

rds_rm_size also gets bigger. It's a little inefficient to
run through CMSGs twice, but it makes later steps a lot smoother.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: fold rdma.h into rds.h
Andy Grover [Tue, 12 Jan 2010 20:57:27 +0000 (12:57 -0800)]
RDS: fold rdma.h into rds.h

RDMA is now an intrinsic part of RDS, so it's easier to just have
a single header.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: Explicitly allocate rm in sendmsg()
Andy Grover [Tue, 12 Jan 2010 20:56:06 +0000 (12:56 -0800)]
RDS: Explicitly allocate rm in sendmsg()

r_m_copy_from_user used to allocate the rm as well as kernel
buffers for the data, and then copy the data in. Now, sendmsg()
allocates the rm, although the data buffer alloc still happens
in r_m_copy_from_user.

SGs are still allocated with rm, but now r_m_alloc_sgs() is
used to reserve them. This allows multiple SG lists to be
allocated from the one rm -- this is important once we also
want to alloc our rdma sgl from this pool.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: cleanup/fix rds_rdma_unuse
Andy Grover [Tue, 12 Jan 2010 20:37:17 +0000 (12:37 -0800)]
RDS: cleanup/fix rds_rdma_unuse

First, it looks to me like the atomic_inc is wrong.
We should be decrementing refcount only once here, no? It's
already being done by the mr_put() at the end.

Second, simplify the logic a bit by bailing early (with a warning)
if !mr.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: break out rdma and data ops into nested structs in rds_message
Andy Grover [Tue, 12 Jan 2010 20:15:02 +0000 (12:15 -0800)]
RDS: break out rdma and data ops into nested structs in rds_message

Clearly separate rdma-related variables in rm from data-related ones.
This is in anticipation of adding atomic support.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: cleanup: remove "== NULL"s and "!= NULL"s in ptr comparisons
Andy Grover [Tue, 12 Jan 2010 19:56:44 +0000 (11:56 -0800)]
RDS: cleanup: remove "== NULL"s and "!= NULL"s in ptr comparisons

Favor "if (foo)" style over "if (foo != NULL)".

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: move rds_shutdown_worker impl. to rds_conn_shutdown
Andy Grover [Fri, 11 Jun 2010 20:49:13 +0000 (13:49 -0700)]
RDS: move rds_shutdown_worker impl. to rds_conn_shutdown

This fits better in connection.c, rather than threads.c.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: Fix locking in send on m_rs_lock
Andy Grover [Mon, 29 Mar 2010 23:50:54 +0000 (16:50 -0700)]
RDS: Fix locking in send on m_rs_lock

Do not nest m_rs_lock under c_lock

Disable interrupts in {rdma,atomic}_send_complete

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: Rewrite rds_send_drop_to() for clarity
Andy Grover [Sat, 20 Feb 2010 02:01:41 +0000 (18:01 -0800)]
RDS: Rewrite rds_send_drop_to() for clarity

This function has been the source of numerous bugs; it's just
too complicated. Simplified to nest spinlocks cleanly within
the second loop body, and kick out early if there are no
rms to drop.

This will be a little slower because conn lock is grabbed for
each entry instead of "caching" the lock across rms, but this
should be entirely irrelevant to fastpath performance.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: Fix corrupted rds_mrs
Tina Yang [Thu, 1 Apr 2010 21:09:00 +0000 (14:09 -0700)]
RDS: Fix corrupted rds_mrs

On second look at this bug (OFED #2002), it seems that the
collision is not with the retransmission queue (packet acked
by the peer), but with the local send completion.  A theoretical
sequence of events (from time t0 to t3) is thought to be as
follows,

Thread #1
t0:
    sock_release
    rds_release
    rds_send_drop_to /* wait on send completion */
t2:
    rds_rdma_drop_keys()   /* destroy & free all mrs */

Thread #2
t1:
    rds_ib_send_cq_comp_handler
    rds_ib_send_unmap_rm
    rds_message_unmapped   /* wake up #1 @ t0 */
t3:
    rds_message_put
    rds_message_purge
    rds_mr_put   /* memory corruption detected */

The problem with the rds_rdma_drop_keys() is it could
remove a mr's refcount more than its due (i.e. repeatedly
as long as it still remains in the tree (mr->r_refcount > 0)).
Theoretically it should remove only one reference - reference
by the tree.

        /* Release any MRs associated with this socket */
        while ((node = rb_first(&rs->rs_rdma_keys))) {
                mr = container_of(node, struct rds_mr, r_rb_node);
                if (mr->r_trans == rs->rs_transport)
                        mr->r_invalidate = 0;
                rds_mr_put(mr);
        }

I think the correct way of doing it is to remove the mr from
the tree and rds_destroy_mr it first, then a rds_mr_put()
to decrement its reference count by one.  Whichever thread
holds the last reference will free the mr via rds_mr_put().

Signed-off-by: Tina Yang <tina.yang@oracle.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoRDS: Fix BUG_ONs to not fire when in a tasklet
Andy Grover [Sat, 13 Mar 2010 00:22:32 +0000 (16:22 -0800)]
RDS: Fix BUG_ONs to not fire when in a tasklet

in_interrupt() is true in softirqs. The BUG_ONs are supposed
to check for if irqs are disabled, so we should use
BUG_ON(irqs_disabled()) instead, duh.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
13 years agoixgbevf: Removed unneeded HW struct members
Greg Rose [Tue, 7 Sep 2010 21:36:04 +0000 (21:36 +0000)]
ixgbevf: Removed unneeded HW struct members

The VF has no flash and can only do memory mapped I/O.

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>
13 years agodrivers/net/ixgbe/ixgbe_main.c: Add ixgbe_psum
Joe Perches [Tue, 7 Sep 2010 21:35:40 +0000 (21:35 +0000)]
drivers/net/ixgbe/ixgbe_main.c: Add ixgbe_psum

Reduce indentation in a couple of places
Add static function ixgbe_psum
Add temporary for adapter->stats

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/ixgbe/ixgbe_main.c: Use pr_<level>
Joe Perches [Tue, 7 Sep 2010 21:35:17 +0000 (21:35 +0000)]
drivers/net/ixgbe/ixgbe_main.c: Use pr_<level>

Did not add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
because no printk in this module used message prefixing.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/ixgbe/ixgbe_main.c: Checkpatch cleanups
Joe Perches [Tue, 7 Sep 2010 21:34:53 +0000 (21:34 +0000)]
drivers/net/ixgbe/ixgbe_main.c: Checkpatch cleanups

Whitespace cleanups.
Move inline keyword after function type declarations.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoixgbe: fix TX ring enable issues seen when VMDQ is enabled
Alexander Duyck [Tue, 7 Sep 2010 21:34:29 +0000 (21:34 +0000)]
ixgbe: fix TX ring enable issues seen when VMDQ is enabled

The ordering of operations was messed up in the init and as a result when
VMDQ was enabled we were trying to enable TX rings before setting the VFTE
bits. This resulted in a ring that appeared to fail to enable when in fact
it was blocked because the VFTE bits were cleared after the reset.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqeth: NAPI support for l2 and l3 discipline
Frank Blaschka [Tue, 7 Sep 2010 21:14:42 +0000 (21:14 +0000)]
qeth: NAPI support for l2 and l3 discipline

This patch adds NAPI support to the qeth layer 2 and layer 3
discipline. It is important to understand that we can not enable/disable
IRQs as usual, we have to use the corresponding new QDIO interface.
Also to not overdraw the budget we have to stop and restart buffer
processing at any point during processing a bulk of QDIO buffers.
Having the driver NAPI enabled it is possible to turn on GRO for the
layer 3 discipline.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoKconfig: have CCWGROUP depend on CLAW
Mike Frysinger [Tue, 7 Sep 2010 21:14:41 +0000 (21:14 +0000)]
Kconfig: have CCWGROUP depend on CLAW

Since the claw code calls ccwgroup_remove_ccwdev(), we need to make sure
CCWGROUP is enabled when CLAW is enabled.  Otherwise we hit fun undefined
references at build time:
ERROR: "ccwgroup_remove_ccwdev" [drivers/s390/net/claw.ko] undefined!
ERROR: "ccwgroup_probe_ccwdev" [drivers/s390/net/claw.ko] undefined!
ERROR: "ccwgroup_driver_register" [drivers/s390/net/claw.ko] undefined!
ERROR: "ccwgroup_driver_unregister" [drivers/s390/net/claw.ko] undefined!
ERROR: "ccwgroup_create_from_string" [drivers/s390/net/claw.ko] undefined!

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqeth: Use %pI6
Joe Perches [Tue, 7 Sep 2010 21:14:40 +0000 (21:14 +0000)]
qeth: Use %pI6

Format an ipv6 address using vsprintf extensions.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqdio: extend API to allow polling
Jan Glauber [Tue, 7 Sep 2010 21:14:39 +0000 (21:14 +0000)]
qdio: extend API to allow polling

Extend the qdio API to allow polling in the upper-layer driver. This
is needed by qeth to use NAPI.

To use the new interface the upper-layer driver must specify the
queue_start_poll(). This callback is used to signal the upper-layer
driver that is has initiative and must process the inbound queue by
calling qdio_get_next_buffers(). If the upper-layer driver wants to
stop polling it calls qdio_start_irq().

Since adapter interrupts are not completely stoppable qdio implements
a software bit QDIO_QUEUE_IRQS_DISABLED to safely disable interrupts for an
input queue.

The old interface is preserved and will be used as is by zfcp.

Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoe1000: fix Tx hangs by disabling 64-bit DMA
Jesse Brandeburg [Tue, 7 Sep 2010 21:01:12 +0000 (21:01 +0000)]
e1000: fix Tx hangs by disabling 64-bit DMA

Several users report issues with 32-bit adapters when plugged
into PCI slots in machines with >= 4GB ram.  In particular AMD
systems with HyperTransport to PCI bridges seem to trigger the
issue, but it isn't limited to only them.

This issue is not easily reproducible here, yet still continues
to occur in the field.  For e1000 on PCI devices, just disable DMA
addresses over the 4GB boundary when in PCI (not PCI-X) mode, to
prevent the issue from continuing to pop up.  The performance
impact for this is negligible.

The code was refactored to move the init of the hw struct to its
own function. This allows the init to be called very early in
probe, which then allows using hw-> members for this fix.

A slight refactor to the DMA mask code was done for minor
correctness based on the instructions in DMA-API-HOWTO.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: introduce rcu_dereference_rtnl
Eric Dumazet [Wed, 8 Sep 2010 21:15:32 +0000 (14:15 -0700)]
net: introduce rcu_dereference_rtnl

We use rcu_dereference_check(p, rcu_read_lock_held() ||
lockdep_rtnl_is_held()) several times in network stack.

More usages to come too, so its time to create a helper.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers: isdn: capi: use simple_strtol to convert numbers
Andy Shevchenko [Tue, 7 Sep 2010 05:14:30 +0000 (05:14 +0000)]
drivers: isdn: capi: use simple_strtol to convert numbers

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: Tilman Schmidt <tilman@imap.cc>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: remove address space warnings in net/socket.c
Namhyung Kim [Tue, 7 Sep 2010 03:55:00 +0000 (03:55 +0000)]
net: remove address space warnings in net/socket.c

Casts __kernel to __user pointer require __force markup, so add it. Also
sock_get/setsockopt() takes @optval and/or @optlen arguments as user pointers
but were taking kernel pointers, use new variables 'uoptval' and/or 'uoptlen'
to fix it. These remove following warnings from sparse:

 net/socket.c:1922:46: warning: cast adds address space to expression (<asn:1>)
 net/socket.c:3061:61: warning: incorrect type in argument 4 (different address spaces)
 net/socket.c:3061:61:    expected char [noderef] <asn:1>*optval
 net/socket.c:3061:61:    got char *optval
 net/socket.c:3061:69: warning: incorrect type in argument 5 (different address spaces)
 net/socket.c:3061:69:    expected int [noderef] <asn:1>*optlen
 net/socket.c:3061:69:    got int *optlen
 net/socket.c:3063:67: warning: incorrect type in argument 4 (different address spaces)
 net/socket.c:3063:67:    expected char [noderef] <asn:1>*optval
 net/socket.c:3063:67:    got char *optval
 net/socket.c:3064:45: warning: incorrect type in argument 5 (different address spaces)
 net/socket.c:3064:45:    expected int [noderef] <asn:1>*optlen
 net/socket.c:3064:45:    got int *optlen
 net/socket.c:3078:61: warning: incorrect type in argument 4 (different address spaces)
 net/socket.c:3078:61:    expected char [noderef] <asn:1>*optval
 net/socket.c:3078:61:    got char *optval
 net/socket.c:3080:67: warning: incorrect type in argument 4 (different address spaces)
 net/socket.c:3080:67:    expected char [noderef] <asn:1>*optval
 net/socket.c:3080:67:    got char *optval

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoinclude/net/raw.h: Convert raw_seq_private macro to inline
Joe Perches [Tue, 7 Sep 2010 05:55:38 +0000 (05:55 +0000)]
include/net/raw.h: Convert raw_seq_private macro to inline

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agointroduce cx82310_eth: Conexant CX82310-based ADSL router USB ethernet driver
Ondrej Zary [Sat, 4 Sep 2010 02:39:34 +0000 (02:39 +0000)]
introduce cx82310_eth: Conexant CX82310-based ADSL router USB ethernet driver

This patch introduces cx82310_eth driver - driver for USB ethernet port of
ADSL routers based on Conexant CX82310 chips. Such routers usually have
ethernet port(s) too which are bridged together with the USB ethernet port,
allowing the USB-connected machine to communicate to the network (and also
internet through the ADSL, of course).

This is my first driver, so please check thoroughly. As there's no protocol
documentation, it was done with usbsnoop dumps from Windows driver, some
parts (the commands) inspired by cxacru driver and also other usbnet drivers.
The driver passed my testing - some real work and also pings sized from 0 to
65507 B.

The only problem I found is the ifconfig error counter. When I return 0 (or 1
but empty skb) from rx_fixup(), usbnet increases the error counter although
it's not an error condition (because packets can cross URB boundaries). Maybe
the usbnet should be fixed to allow rx_fixup() to return empty skbs (or some
other value, e.g. 2)?

The USB ID of my device is 0x0572:0xcb01 which conflicts with some ADSL modems
using cxacru driver (they probably use the same chipset but simpler
firmware). The modems seem to use bDeviceClass 0 and iProduct "ADSL USB
MODEM", my router uses bDeviceClass 255 and iProduct "USB NET CARD". The
driver matches only devices with class 255 and checks for the iProduct string
during init. I already posted a patch for the cxacru driver to ignore these
devices.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: rps: add the shortcut for one rps_cpus
Changli Gao [Fri, 3 Sep 2010 23:12:37 +0000 (23:12 +0000)]
net: rps: add the shortcut for one rps_cpus

When there is only one rps_cpus, skb_get_rxhash() can be eliminated.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: implement SIOCINQ ioctl() (take 3)
Diego Elio 'Flameeyes' Pettenò [Fri, 3 Sep 2010 03:47:03 +0000 (03:47 +0000)]
sctp: implement SIOCINQ ioctl() (take 3)

This simple patch copies the current approach for SIOCINQ ioctl() from DCCP
into SCTP so that the userland code working with SCTP can use a similar
interface across different protocols to know how much space to allocate for
a buffer.

Signed-off-by: Diego Elio Pettenò <flameeyes@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agor8169: add gro support
Eric Dumazet [Mon, 6 Sep 2010 18:46:39 +0000 (18:46 +0000)]
r8169: add gro support

- Use napi_gro_receive() and vlan_gro_receive()
- Enable GRO by default

Tested on a RTL8111/8168 adapter

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Update bnx2x version to 1.52.53-6
Yaniv Rosner [Tue, 7 Sep 2010 11:41:26 +0000 (11:41 +0000)]
bnx2x: Update bnx2x version to 1.52.53-6

Note that the date format was fixed.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Change LED scheme for dual-media
Yaniv Rosner [Tue, 7 Sep 2010 11:41:23 +0000 (11:41 +0000)]
bnx2x: Change LED scheme for dual-media

Change LED scheme for dual-media

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Add dual-media changes
Yaniv Rosner [Tue, 7 Sep 2010 11:41:20 +0000 (11:41 +0000)]
bnx2x: Add dual-media changes

Add required changes in order to support dual-media boards.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Organize PHY functions
Yaniv Rosner [Tue, 7 Sep 2010 11:41:13 +0000 (11:41 +0000)]
bnx2x: Organize PHY functions

Group all PHY specific functions together to have an organized code

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Apply logic changes for the new scheme
Yaniv Rosner [Tue, 7 Sep 2010 11:41:07 +0000 (11:41 +0000)]
bnx2x: Apply logic changes for the new scheme

Make the needed changes for the new scheme especially around PHY
initialization, and link detection.
- The get_emac_base function was changed to enable setting different MAC
access setting for each PHY based of external configuration.
- As a part of the dual-media preparation, the save_spirom_version was
modified to accept a PHY specific version address to be saved in the
shmem. This will enable to save more than single spirom version in

different locations.
- The test_link function was changed also as a preparation for the
dual-media upcoming changes
- Duplicate initialization logic was removed from the
link_setting_status and link_initialize functions

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Move common function into aggregated function
Yaniv Rosner [Tue, 7 Sep 2010 11:41:04 +0000 (11:41 +0000)]
bnx2x: Move common function into aggregated function

Move all PHY specific logic from bnx2x_main into bnx2x_link.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Adjust flow-control with the new scheme
Yaniv Rosner [Tue, 7 Sep 2010 11:41:01 +0000 (11:41 +0000)]
bnx2x: Adjust flow-control with the new scheme

Flow control implementation is split to be done in each PHY function.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Adjust alignment of split PHY functions
Yaniv Rosner [Tue, 7 Sep 2010 11:40:58 +0000 (11:40 +0000)]
bnx2x: Adjust alignment of split PHY functions

In previous patch, common PHY functions were split in simple way to
allow easy diff. This patch comes to align code in the new functions.
In addition, the non-production BCM8072 PHY was removed.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Split PHY functions
Yaniv Rosner [Tue, 7 Sep 2010 11:40:54 +0000 (11:40 +0000)]
bnx2x: Split PHY functions

Move the code into PHY oriented functions, and for that a new structure
is defines for each PHY which contain PHY properties and its own
functions. This also enables to encapsulate all PHY specific operations
into the PHY functions. During initialization, the PHYs will be probed
by the "bnx2x_phy_probe" function to detect which PHYs exist on-board,
and configure them accordingly. Note that the ext_phy_reset
implementation was incorporated in the ext_phy_init since it is actually
part of the PHY initialization procedure.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Unify PHY attributes
Yaniv Rosner [Tue, 7 Sep 2010 11:40:50 +0000 (11:40 +0000)]
bnx2x: Unify PHY attributes

Start building the infrastructure for dual media by adding new component
of PHY which will be used all along the function. Modify function to
work with this component instead of the link_params.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: poll() optimizations
Eric Dumazet [Mon, 6 Sep 2010 11:13:50 +0000 (11:13 +0000)]
net: poll() optimizations

No need to test twice sk->sk_shutdown & RCV_SHUTDOWN

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomlx4_en: Fixed Ethtool statistics report
Yevgeny Petrilin [Sun, 5 Sep 2010 22:20:24 +0000 (22:20 +0000)]
mlx4_en: Fixed Ethtool statistics report

The values didn't match the title after removing the LRO
statistics in commit fa37a9586f92051de03a13e55e5ec3880bb6783e

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomlx4_en: Consider napi_get_frags() failure.
Yevgeny Petrilin [Sun, 5 Sep 2010 22:20:11 +0000 (22:20 +0000)]
mlx4_en: Consider napi_get_frags() failure.

If failed to get skb frags using napi_get_frags(),
the packet is dropped.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/caifcaif_dev.c: Use netdev_<level>
Joe Perches [Sun, 5 Sep 2010 22:08:09 +0000 (22:08 +0000)]
net/caifcaif_dev.c: Use netdev_<level>

Convert pr_<level>("%s" ..., (struct netdev *)->name ...)
to netdev_<level>((struct netdev *), ...)

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/caif: Use pr_fmt
Joe Perches [Sun, 5 Sep 2010 21:31:11 +0000 (21:31 +0000)]
net/caif: Use pr_fmt

This patch standardizes caif message logging prefixes.

Add #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
Add missing "\n"s to some logging messages
Convert pr_warning to pr_warn

This changes the logging message prefix from CAIF: to caif:
for all uses but caif_socket.c and chnl_net.c.  Those now use
their filename without extension.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/atm/firestream.c: Fix unsigned return type
Julia Lawall [Sun, 5 Sep 2010 09:00:23 +0000 (09:00 +0000)]
drivers/atm/firestream.c: Fix unsigned return type

The function has an unsigned return type, but returns a negative constant
to indicate an error condition.  The result of calling the function is
always stored in a variable of type (signed) int, and thus unsigned can be
dropped from the return type.

A sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@exists@
identifier f;
constant C;
@@

 unsigned f(...)
 { <+...
*  return -C;
 ...+> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet/9p/trans_fd.c: Fix unsigned return type
Julia Lawall [Sun, 5 Sep 2010 09:00:21 +0000 (09:00 +0000)]
net/9p/trans_fd.c: Fix unsigned return type

The function has an unsigned return type, but returns a negative constant
to indicate an error condition.  The result of calling the function is
always stored in a variable of type (signed) int, and thus unsigned can be
dropped from the return type.

A sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@exists@
identifier f;
constant C;
@@

 unsigned f(...)
 { <+...
*  return -C;
 ...+> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net: Removing undead ifdef CHELSIO_T1_1G
Christian Dietrich [Mon, 6 Sep 2010 04:36:25 +0000 (04:36 +0000)]
drivers/net: Removing undead ifdef CHELSIO_T1_1G

The CHELSIO_T1_1G ifdef isn't necessary at this point, because it is
checked in an outer ifdef level already and has no effect here.

Signed-off-by: Christian Dietrich <qy03fugy@stud.informatik.uni-erlangen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/jme: Use pr_<level>
Joe Perches [Sat, 4 Sep 2010 22:21:05 +0000 (22:21 +0000)]
drivers/net/jme: Use pr_<level>

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Convert jeprintk to pr_err
Remove jeprintk macro define
Remove periods from end of logging messages
Coalesce format strings

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoisdn: cleanup: make buffer smaller
Dan Carpenter [Sat, 4 Sep 2010 08:33:03 +0000 (08:33 +0000)]
isdn: cleanup: make buffer smaller

This showed up in my audit because we use strcpy() to copy "ds" into a
32 character buffer inside the isdn_tty_dial() function.  But it turns
out that we only ever use the first 32 characters so it's OK.  I have
changed the declaration to make the static checkers happy.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoisdn: potential buffer overflows
Dan Carpenter [Sat, 4 Sep 2010 08:38:59 +0000 (08:38 +0000)]
isdn: potential buffer overflows

cs->ics.parm.setup.phone is a 32 character array.  In each of these
cases we're copying from a 35 character array into a 32 character array
so we should use strlcpy() instead of strcpy().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNET: bna, fix lock imbalance
Jiri Slaby [Sat, 4 Sep 2010 02:08:41 +0000 (02:08 +0000)]
NET: bna, fix lock imbalance

bnad_set_rx_mode omit to unlock bna_lock on one fail path. Fix that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Debashis Dutt <ddutt@brocade.com>
Cc: Rasesh Mody <rmody@brocade.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/fs_enet/fs_enet-main.c: Add of_node_put to avoid memory leak
Julia Lawall [Sat, 4 Sep 2010 00:12:43 +0000 (00:12 +0000)]
drivers/net/fs_enet/fs_enet-main.c: Add of_node_put to avoid memory leak

In this case, a device_node structure is stored in another structure that
is then freed without first decrementing the reference count of the
device_node structure.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression x;
identifier f;
position p1,p2;
@@

x@p1->f = \(of_find_node_by_path\|of_find_node_by_name\|of_find_node_by_phandle\|of_get_parent\|of_get_next_parent\|of_get_next_child\|of_find_compatible_node\|of_match_node\|of_find_node_by_type\|of_find_node_with_property\|of_find_matching_node\|of_parse_phandle\|of_node_get\)(...);
... when != of_node_put(x)
kfree@p2(x)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@
cocci.print_main("call",p1)
cocci.print_secs("free",p2)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: pskb_expand_head() optimization
Eric Dumazet [Thu, 2 Sep 2010 23:09:32 +0000 (23:09 +0000)]
net: pskb_expand_head() optimization

pskb_expand_head() blindly takes references on fragments before calling
skb_release_data(), potentially releasing these references.

We can add a fast path, avoiding these atomic operations, if we own the
last reference on skb->head.

Based on a previous patch from David

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Update module information and version
Santiago Leon [Fri, 3 Sep 2010 18:29:53 +0000 (18:29 +0000)]
ibmveth: Update module information and version

Add an entry to the MAINTAINERS file for ibmveth, clean up the copyright
and add all authors. Change the name of the module to reflect the product name
over the last number of years.

Considering all the changes we have made, bump the driver version.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Remove some unnecessary include files
Santiago Leon [Fri, 3 Sep 2010 18:29:47 +0000 (18:29 +0000)]
ibmveth: Remove some unnecessary include files

These files probably came across from the skeleton driver. Remove them.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Convert driver specific assert to BUG_ON
Santiago Leon [Fri, 3 Sep 2010 18:29:41 +0000 (18:29 +0000)]
ibmveth: Convert driver specific assert to BUG_ON

We had a driver specific assert function which wasn't enabled most of the
time. Convert them to BUG_ON and enable them all the time.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Return -EINVAL on all ->probe errors
Santiago Leon [Fri, 3 Sep 2010 18:29:36 +0000 (18:29 +0000)]
ibmveth: Return -EINVAL on all ->probe errors

We had a few cases where we returned success on error.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Coding style fixes
Santiago Leon [Fri, 3 Sep 2010 18:29:30 +0000 (18:29 +0000)]
ibmveth: Coding style fixes

Fix most of the kernel coding style issues in ibmveth.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Some formatting fixes
Santiago Leon [Fri, 3 Sep 2010 18:29:25 +0000 (18:29 +0000)]
ibmveth: Some formatting fixes

IbmVethNumBufferPools -> IBMVETH_NUM_BUFF_POOLS

Also change IBMVETH_MAX_MTU -> IBMVETH_MIN_MTU, it refers to the minimum
size not the maximum.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Convert driver specific error functions to netdev_err
Santiago Leon [Fri, 3 Sep 2010 18:29:19 +0000 (18:29 +0000)]
ibmveth: Convert driver specific error functions to netdev_err

Use netdev_err to standardise the error output.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Convert driver specific debug to netdev_dbg
Santiago Leon [Fri, 3 Sep 2010 18:29:14 +0000 (18:29 +0000)]
ibmveth: Convert driver specific debug to netdev_dbg

Use netdev_dbg to standardise the debug output.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Remove redundant function prototypes
Santiago Leon [Fri, 3 Sep 2010 18:29:08 +0000 (18:29 +0000)]
ibmveth: Remove redundant function prototypes

These functions appear before their use, so we can remove the redundant
prototypes.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Convert to netdev_alloc_skb
Santiago Leon [Fri, 3 Sep 2010 18:29:03 +0000 (18:29 +0000)]
ibmveth: Convert to netdev_alloc_skb

We were using alloc_skb which doesn't create any headroom. Change it to
use netdev_alloc_skb to match most other drivers.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: remove procfs code
Santiago Leon [Fri, 3 Sep 2010 18:28:58 +0000 (18:28 +0000)]
ibmveth: remove procfs code

We export all the driver specific statistics via ethtool, so there is no need
to duplicate this in procfs.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Enable IPv6 checksum offload
Santiago Leon [Fri, 3 Sep 2010 18:28:52 +0000 (18:28 +0000)]
ibmveth: Enable IPv6 checksum offload

This patch enables TCP checksum offload support for IPv6 on ibmveth.
This completely eliminates the generation and checking of the checksum
for IPv6 packets that are completely virtual and never touch a physical
network.  A basic TCPIPV6_STREAM netperf run showed a ~30% throughput
improvement when an MTU of 64000 was used.

This featured is enabled by default, as is the case for IPv4 checksum
offload.  When checksum offload is enabled the driver will negotiate
IPv4 and IPv6 offload with the firmware separately and enable what
is available.  As long as either IPv4 or IPv6 offload is supported
and enabled the device will report that checksum offload is enabled.
The device stats, available through ethtool, will display which
checksum offload features are supported/enabled by firmware.

Performance testing against a stock kernel shows no regression for IPv4
or IPv6 in terms of throughput or processor utilization with checksum
disabled or enabled.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Remove duplicate checksum offload setup code
Santiago Leon [Fri, 3 Sep 2010 18:28:47 +0000 (18:28 +0000)]
ibmveth: Remove duplicate checksum offload setup code

Remove code in the device probe function where we set up the checksum
offload feature and replace it with a call to an existing function that
is doing the same.  This is done to clean up the driver in preparation
of adding IPv6 checksum offload support.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Add optional flush of rx buffer
Santiago Leon [Fri, 3 Sep 2010 18:28:41 +0000 (18:28 +0000)]
ibmveth: Add optional flush of rx buffer

On some machines we can improve the bandwidth by ensuring rx buffers are
not in the cache. Add a module option that is disabled by default that flushes
rx buffers on insertion.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Add scatter-gather support
Santiago Leon [Fri, 3 Sep 2010 18:28:36 +0000 (18:28 +0000)]
ibmveth: Add scatter-gather support

ibmveth can scatter gather up to 6 segments. If we go over this then
we have no option but to call skb_linearize, like other drivers with
similar limitations do.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Use lighter weight read memory barrier in ibmveth_poll
Anton Blanchard [Tue, 7 Sep 2010 01:21:41 +0000 (18:21 -0700)]
ibmveth: Use lighter weight read memory barrier in ibmveth_poll

We want to order the read in ibmveth_rxq_pending_buffer and the read of
ibmveth_rxq_buffer_valid which are both cacheable memory. smp_rmb() is good
enough for this.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Add rx_copybreak
Santiago Leon [Fri, 3 Sep 2010 18:28:25 +0000 (18:28 +0000)]
ibmveth: Add rx_copybreak

For small packets, create a new skb and copy the packet into it so we
avoid tearing down and creating a TCE entry.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Add tx_copybreak
Santiago Leon [Fri, 3 Sep 2010 18:28:20 +0000 (18:28 +0000)]
ibmveth: Add tx_copybreak

Use the existing bounce buffer if we send a buffer under a certain size.
This saves the overhead of a TCE map/unmap.

I can't see any reason for the wmb() in the bounce buffer case, if we need
a barrier it will be before we call h_send_logical_lan but we have
nothing in the common case. Remove it.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Remove LLTX
Santiago Leon [Fri, 3 Sep 2010 18:28:15 +0000 (18:28 +0000)]
ibmveth: Remove LLTX

The ibmveth adapter needs locking in the transmit routine to protect
the bounce_buffer but it sets LLTX and forgets to add any of its own
locking.

Just remove the deprecated LLTX option. Remove the stats lock in the process.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: batch rx buffer replacement
Santiago Leon [Fri, 3 Sep 2010 18:28:09 +0000 (18:28 +0000)]
ibmveth: batch rx buffer replacement

At the moment we try and replenish the receive ring on every rx interrupt.
We even have a pool->threshold but aren't using it.

To limit the maximum latency incurred when refilling, change the threshold
from 1/2 to 7/8 and reduce the largest rx pool from 768 buffers to 512 which
should be more than enough.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoibmveth: Remove integer divide caused by modulus
Santiago Leon [Fri, 3 Sep 2010 18:28:04 +0000 (18:28 +0000)]
ibmveth: Remove integer divide caused by modulus

Replace some modulus operators with an increment and compare to avoid
an integer divide.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Santiago Leon <santil@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agons83820: Use predefined autoneg constants
Denis Kirjanov [Fri, 3 Sep 2010 10:05:41 +0000 (10:05 +0000)]
ns83820: Use predefined autoneg constants

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agons83820: Add copper device settings
Denis Kirjanov [Fri, 3 Sep 2010 10:05:40 +0000 (10:05 +0000)]
ns83820: Add copper device settings

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agons83820: Remove unused have_optical variable.
Denis Kirjanov [Fri, 3 Sep 2010 10:05:39 +0000 (10:05 +0000)]
ns83820: Remove unused have_optical variable.

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotipc: Fix misleading error code when enabling Ethernet bearers
Allan Stephens [Fri, 3 Sep 2010 08:33:42 +0000 (08:33 +0000)]
tipc: Fix misleading error code when enabling Ethernet bearers

Cause TIPC to return EAGAIN if it is unable to enable a new Ethernet
bearer because one or more recently disabled Ethernet bearers are
temporarily consuming resources during shut down.  (The previous error
code, EDQUOT, is now returned only if all available Ethernet bearer
data structures are fully enabled at the time the request to enable an
additional bearer is received.)

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotipc: Ensure outgoing messages on Ethernet have sufficient headroom
Allan Stephens [Fri, 3 Sep 2010 08:33:40 +0000 (08:33 +0000)]
tipc: Ensure outgoing messages on Ethernet have sufficient headroom

Add code to expand the headroom of an outgoing TIPC message if the
sk_buff has insufficient room to hold the header for the associated
Ethernet device.  This change is necessary to ensure that messages
TIPC does not create itself (eg. incoming messages that are being
routed to another node) do not cause problems, since TIPC has no
control over the amount of headroom available in such messages.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotipc: Minor optimizations to name table translation code
Allan Stephens [Fri, 3 Sep 2010 08:33:39 +0000 (08:33 +0000)]
tipc: Minor optimizations to name table translation code

Optimizes TIPC's name table translation code to avoid unnecessary
manipulation of the node address field of the resulting port id when
name translation fails.  This change is possible because a valid port
id cannot have a reference field of zero, so examining the reference
only is sufficient to determine if the translation was successful.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agowan: make read-only data const
stephen hemminger [Thu, 2 Sep 2010 14:29:35 +0000 (14:29 +0000)]
wan: make read-only data const

Change several wan drivers to make strings and other initialize
only parameters const.

Compile tested only (with no new warnings)

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agor8169: fix rx checksum offload
Eric Dumazet [Mon, 6 Sep 2010 03:04:05 +0000 (20:04 -0700)]
r8169: fix rx checksum offload

While porting GRO to r8169, I found this driver has a bug in its rx
path.

All skbs given to network stack had their ip_summed set to
CHECKSUM_NONE, while hardware said they had correct TCP/UDP checksums.

The reason is driver sets skb->ip_summed on the original skb before the
copy eventually done by copybreak. The fresh skb gets the ip_summed =
CHECKSUM_NONE value, forcing network stack to recompute checksum, and
preventing my GRO patch to work.

Fix is to make the ip_summed setting after skb copy.

Note : rx_copybreak current value is 16383, so all frames are copied...

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocxgb3: Avoid flush_workqueue() deadlock.
Casey Leedom [Thu, 2 Sep 2010 13:07:32 +0000 (13:07 +0000)]
cxgb3: Avoid flush_workqueue() deadlock.

Don't call flush_workqueue() on the cxgb3 Work Queue in cxgb_down() when
we're being called from the fatal error task ... which is executing on the
cxgb3 Work Queue.

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocxgb3: Leave interrupts for fatal errors asserted in common code.
Casey Leedom [Thu, 2 Sep 2010 13:07:31 +0000 (13:07 +0000)]
cxgb3: Leave interrupts for fatal errors asserted in common code.

Platform code needs to deal with them now.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocxgb3: Set FATALPERREN.
Casey Leedom [Thu, 2 Sep 2010 13:07:30 +0000 (13:07 +0000)]
cxgb3: Set FATALPERREN.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocxgb3: Add register bit definition for Fatal Parity Error.
Casey Leedom [Thu, 2 Sep 2010 13:07:29 +0000 (13:07 +0000)]
cxgb3: Add register bit definition for Fatal Parity Error.

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: remove two kmemcheck annotations
Eric Dumazet [Fri, 3 Sep 2010 06:27:08 +0000 (06:27 +0000)]
net: remove two kmemcheck annotations

__alloc_skb() uses a memset() to clear all the beginning of skb,
including bitfields contained in 'flags1' & 'flags2'.

We dont need any more to use kmemcheck_annotate_bitfield() on these
fields. However, we still need it for the clone part, which is not
cleared.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotulip: use integrated netdev stats
Eric Dumazet [Fri, 3 Sep 2010 03:52:43 +0000 (03:52 +0000)]
tulip: use integrated netdev stats

struct tulip_private is a bit large (order-1 allocation even on 32bit
arch), try to shrink it, remove its net_device_stats field.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: Update ip-sysctl.txt documentation for recent changes to accept_ra and forwarding
Thomas Graf [Fri, 3 Sep 2010 05:47:30 +0000 (05:47 +0000)]
ipv6: Update ip-sysctl.txt documentation for recent changes to accept_ra and forwarding

Documentation for recent changes to the tunables accept_ra and
forwarding.

Signed-off-by: Thomas Graf <tgraf@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: add special mode forwarding=2 to send RS while configured as router
Thomas Graf [Fri, 3 Sep 2010 03:04:20 +0000 (03:04 +0000)]
ipv6: add special mode forwarding=2 to send RS while configured as router

Similar to accepting router advertisement, the IPv6 stack does not send router
solicitations if forwarding is enabled.

This patch enables this behavior to be overruled by setting forwarding to the
special value 2.

Signed-off-by: Thomas Graf <tgraf@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>