]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
13 years agoMerge branch 'tipc-May10-2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg...
David S. Miller [Wed, 11 May 2011 16:41:28 +0000 (12:41 -0400)]
Merge branch 'tipc-May10-2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/net-next-2.6

13 years agonet: fix two lockdep splats
Eric Dumazet [Tue, 10 May 2011 03:55:03 +0000 (20:55 -0700)]
net: fix two lockdep splats

Commit e67f88dd12f6 (net: dont hold rtnl mutex during netlink dump
callbacks) switched rtnl protection to RCU, but we forgot to adjust two
rcu_dereference() lockdep annotations :

inet_get_link_af_size() or inet_fill_link_af() might be called with
rcu_read_lock or rtnl held, so use rcu_dereference_rtnl()
instead of rtnl_dereference()

Reported-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: xfrm: Eliminate ->rt_src reference in policy code.
David S. Miller [Mon, 9 May 2011 22:13:28 +0000 (15:13 -0700)]
ipv4: xfrm: Eliminate ->rt_src reference in policy code.

Rearrange xfrm4_dst_lookup() so that it works by calling a helper
function __xfrm_dst_lookup() that takes an explicit flow key storage
area as an argument.

Use this new helper in xfrm4_get_saddr() so we can fetch the selected
source address from the flow instead of from rt->rt_src

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoinfiniband: Remove rt->rt_src usage in addr4_resolve()
David S. Miller [Mon, 9 May 2011 21:52:02 +0000 (14:52 -0700)]
infiniband: Remove rt->rt_src usage in addr4_resolve()

Use an explicit flow key and fetch it from there.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: Remove rt->rt_src usage in sctp_v4_get_saddr()
David S. Miller [Mon, 9 May 2011 21:49:13 +0000 (14:49 -0700)]
sctp: Remove rt->rt_src usage in sctp_v4_get_saddr()

Flow key is available, so fetch it from there.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: udp: Eliminate remaining uses of rt->rt_src
David S. Miller [Mon, 9 May 2011 20:31:04 +0000 (13:31 -0700)]
ipv4: udp: Eliminate remaining uses of rt->rt_src

We already track and pass around the correct flow key,
so simply use it in udp_send_skb().

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: icmp: Eliminate remaining uses of rt->rt_src
David S. Miller [Mon, 9 May 2011 20:28:22 +0000 (13:28 -0700)]
ipv4: icmp: Eliminate remaining uses of rt->rt_src

On input packets, rt->rt_src always equals ip_hdr(skb)->saddr

Anything that mangles or otherwise changes the IP header must
relookup the route found at skb_rtable().  Therefore this
invariant must always hold true.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Pass explicit daddr arg to ip_send_reply().
David S. Miller [Mon, 9 May 2011 20:22:43 +0000 (13:22 -0700)]
ipv4: Pass explicit daddr arg to ip_send_reply().

This eliminates an access to rt->rt_src.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotipc: Revise timings used when sending link request messages
Allan Stephens [Fri, 22 Apr 2011 01:34:03 +0000 (20:34 -0500)]
tipc: Revise timings used when sending link request messages

Revises the algorithm governing the sending of link request messages
to take into account the number of nodes each bearer is currently in
contact with, and to ensure more rapid rediscovery of neighboring nodes
if a bearer fails and then recovers.

The discovery object now sends requests at least once a second if it
is not in contact with any other nodes, and at least once a minute if
it has at least one neighbor; if contact with the only neighbor is
lost, the object immediately reverts to its initial rapid-fire search
timing to accelerate the rediscovery process.

In addition, the discovery object now stops issuing link request
messages if it is in contact with the only neighboring node it is
configured to communicate with, since further searching is unnecessary.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Add monitoring of number of nodes discovered by bearer
Allan Stephens [Fri, 22 Apr 2011 00:05:25 +0000 (19:05 -0500)]
tipc: Add monitoring of number of nodes discovered by bearer

Augments TIPC's discovery object to track the number of neighboring nodes
having an active link to the associated bearer.

This means tipc_disc_update_link_req() becomes either one of:

       tipc_disc_add_dest()
or:
       tipc_disc_remove_dest()

depending on the code flow direction of things.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Enhance sending of discovery object link request messages
Allan Stephens [Thu, 21 Apr 2011 21:28:02 +0000 (16:28 -0500)]
tipc: Enhance sending of discovery object link request messages

Augments TIPC's discovery object to send its initial neighbor discovery
request message as soon as the associated bearer is created, rather than
waiting for its first periodic timeout to occur, thereby speeding up the
discovery process. Also adds a check to suppress the initial request or
subsequent requests if the bearer is blocked at the time the request is
scheduled for transmission.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Enhance handling of discovery object creation failures
Allan Stephens [Thu, 21 Apr 2011 18:58:26 +0000 (13:58 -0500)]
tipc: Enhance handling of discovery object creation failures

Modifies bearer creation and deletion code to improve handling of
scenarios when a neighbor discovery object cannot be created. The
creation routine now aborts the creation of a bearer if its discovery
object cannot be created, and deletes the newly created bearer, rather
than failing quietly and leaving an unusable bearer hanging around.

Since the exit via the goto label really isn't a definitive failure
in all cases, relabel it appropriately.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Introduce routine to enqueue a chain of messages on link tx queue
Allan Stephens [Thu, 21 Apr 2011 15:50:42 +0000 (11:50 -0400)]
tipc: Introduce routine to enqueue a chain of messages on link tx queue

Create a helper routine to enqueue a chain of sk_buffs to a link's
transmit queue.  It improves readability and the new function is
anticipated to be used more than just once in the future as well.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Avoid recomputation of outgoing message length
Allan Stephens [Thu, 21 Apr 2011 15:42:07 +0000 (10:42 -0500)]
tipc: Avoid recomputation of outgoing message length

Rework TIPC's message sending routines to take advantage of the total
amount of data value passed to it by the kernel socket infrastructure.
This change eliminates the need for TIPC to compute the size of outgoing
messages itself, as well as the check for an oversize message in
tipc_msg_build().  In addition, this change warrants an explanation:

   -     res = send_packet(NULL, sock, &my_msg, 0);
   +     res = send_packet(NULL, sock, &my_msg, bytes_to_send);

Previously, the final argument to send_packet() was ignored (since the
amount of data being sent was recalculated by a lower-level routine)
and we could just pass in a dummy value (0). Now that the
recalculation is being eliminated, the argument value being passed to
send_packet() is significant and we have to supply the actual amount
of data we want to send.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Abort excessive send requests as early as possible
Allan Stephens [Tue, 20 Apr 2010 21:58:24 +0000 (17:58 -0400)]
tipc: Abort excessive send requests as early as possible

Adds checks to TIPC's socket send routines to promptly detect and
abort attempts to send more than 66,000 bytes in a single TIPC
message or more than 2**31-1 bytes in a single TIPC byte stream request.
In addition, this ensures that the number of iovecs in a send request
does not exceed the limits of a standard integer variable.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Strengthen checks for neighboring node discovery
Allan Stephens [Wed, 20 Apr 2011 21:24:07 +0000 (16:24 -0500)]
tipc: Strengthen checks for neighboring node discovery

Enhances existing checks on the discovery domain associated with a TIPC
bearer. A bearer can no longer be configured to accept links from itself
only (which would be pointless), or to nodes outside its own cluster
(since multi-cluster support has now been removed from TIPC). Also, the
neighbor discovery routine now validates link setup requests against the
configured discovery domain for the bearer, rather than simply ensuring
the requesting node belongs to the node's own cluster.

Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: make zone/cluster mask constants a define
Paul Gortmaker [Tue, 19 Apr 2011 17:11:23 +0000 (13:11 -0400)]
tipc: make zone/cluster mask constants a define

This allows them to be available for easy re-use in other places
and avoids trivial mistakes caused by  "count the f's and 0's".

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Fix sk_buff leaks when link congestion is detected
Allan Stephens [Tue, 19 Apr 2011 14:17:58 +0000 (10:17 -0400)]
tipc: Fix sk_buff leaks when link congestion is detected

Modifies a TIPC send routine that did not discard the outgoing sk_buff
if it was not transmitted because of link congestion; this eliminates
the potential for buffer leakage in the many callers who did not clean up
the unsent buffer. (The two routines that previously did discard the unsent
buffer have been updated to eliminate their now-redundant clean up.)

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Update destination node field on incoming multicast messages
Allan Stephens [Mon, 18 Apr 2011 14:14:26 +0000 (10:14 -0400)]
tipc: Update destination node field on incoming multicast messages

Sets the destination node field of an incoming multicast message
to the receiving node's network address before handing off the message
to each receiving port. This ensures that, in the event the destination
port returns the message to the sender, the sender can identify which
node the destination port belonged to.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Fix problem with bundled multicast message
Allan Stephens [Mon, 18 Apr 2011 14:08:22 +0000 (10:08 -0400)]
tipc: Fix problem with bundled multicast message

Set the destination node and destination port fields of an outgoing
multicast message header to zero; this is necessary to ensure that
the receiving node can route the message properly if it was packed
into a bundle due to link congestion. (Previously, there was a chance
that the receiving node would send the unbundled message to a random
node & port, rather than processing the message itself.)

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Set name lookup scope field properly in all data messages
Allan Stephens [Sun, 17 Apr 2011 20:02:11 +0000 (16:02 -0400)]
tipc: Set name lookup scope field properly in all data messages

Ensures that all outgoing data messages have the "name lookup scope"
field of their header set correctly; that is, named multicast messages
now specify cluster-wide name lookup, while messages not using TIPC
naming zero out the lookup field.  (Previously, the lookup scope specified
for these types of messages was inherited from the last message sent
by the sending port.)

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Fix issues with fragmentation of an existing message buffer
Allan Stephens [Sun, 17 Apr 2011 17:06:23 +0000 (13:06 -0400)]
tipc: Fix issues with fragmentation of an existing message buffer

Modifies the routine that fragments an existing message buffer to
use similar logic to that used when generating fragments from an iovec.
The routine now creates a complete chain of fragments and adds them to
the link transmit queue as a unit, so that the link sends all fragments
or none; this prevents the incomplete transmission of a fragmented
message that might otherwise result because of link congestion or
memory exhaustion. This change also ensures that the counter recording
the number of fragmented messages sent by the link is now incremented
only if the message is actually sent.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Avoid pointless masking of fragmented message identifier
Allan Stephens [Sun, 17 Apr 2011 15:44:24 +0000 (11:44 -0400)]
tipc: Avoid pointless masking of fragmented message identifier

Eliminates code that restricts a link's counter of its fragmented
messages to a 16-bit value, since the counter value is automatically
restricted to this range when it is written into the message header.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Don't initialize link selector field in fragmented messages
Allan Stephens [Sun, 17 Apr 2011 14:29:16 +0000 (10:29 -0400)]
tipc: Don't initialize link selector field in fragmented messages

Eliminates code that sets the link selector field in the header of
fragmented messages, since this information is never referenced.
(The unnecessary initialization was harmless as it was over-written
by the fragmented message identifier value before the fragments were
transmitted.)

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Remove code to emulate loss of broadcast messages
Allan Stephens [Tue, 12 Apr 2011 18:59:03 +0000 (14:59 -0400)]
tipc: Remove code to emulate loss of broadcast messages

Eliminates optional code used to test TIPC's ability to recover
from lost broadcast messages. This code duplicates functionality
already provided by the network stack's QoS option "network emulator".

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Cosmetic consolidation of internal message type definitions
Allan Stephens [Fri, 8 Apr 2011 15:04:15 +0000 (11:04 -0400)]
tipc: Cosmetic consolidation of internal message type definitions

Half of the #define entries in msg.h were down at the bottom
of the header, instead of up at the top before any of the static
inlines etc.   Relocate them up to the top, to be consistent with
the other normal linux header file layout conventions.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Eliminate unused routing message definitions
Allan Stephens [Fri, 8 Apr 2011 14:59:04 +0000 (10:59 -0400)]
tipc: Eliminate unused routing message definitions

Gets rid of unused constants defining the types used in routing
messages. These messages no longer exist in TIPC now that multicluster
and multizone support has been eliminated.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Update comments in message header include file
Allan Stephens [Fri, 8 Apr 2011 14:50:52 +0000 (10:50 -0400)]
tipc: Update comments in message header include file

Removes comments in TIPC's message header include file that are
outdated and/or unnecessary. Also introduces short comments (or
supplements existing ones) to better describe several set of existing
symbolic constants.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotipc: Drop __TIME__ usage
Michal Marek [Tue, 5 Apr 2011 14:59:16 +0000 (16:59 +0200)]
tipc: Drop __TIME__ usage

The kernel already prints its build timestamp during boot, no need to
repeat it in random drivers and produce different object files each
time.

Signed-off-by: Michal Marek <mmarek@suse.cz>
Cc: Jon Maloy <jon.maloy@ericsson.com>
Cc: netdev@vger.kernel.org
Cc: tipc-discussion@lists.sourceforge.net
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
13 years agotulip: Use pr_<level> where appropriate
Joe Perches [Mon, 9 May 2011 09:45:23 +0000 (09:45 +0000)]
tulip: Use pr_<level> where appropriate

Use the current logging styles.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotulip: Convert uses of KERN_DEBUG
Joe Perches [Mon, 9 May 2011 09:45:22 +0000 (09:45 +0000)]
tulip: Convert uses of KERN_DEBUG

Convert logging messages to more current styles.

Added -DDEBUG to Makefile to maintain current message logging.
This could be converted to a specific CONFIG_TULIP_DEBUG option.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotulip: Convert printks to netdev_<level>
Joe Perches [Mon, 9 May 2011 09:45:21 +0000 (09:45 +0000)]
tulip: Convert printks to netdev_<level>

Use the current more descriptive logging styles.

Add pr_fmt and remove PFX where appropriate.
Use netif_<level>, netdev_<level>
Indent a few blocks in xircom_cb where appropriate.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotulip: xircom_cb: Convert #ifdef DEBUG blocks and enter/leave uses
Joe Perches [Mon, 9 May 2011 09:45:20 +0000 (09:45 +0000)]
tulip: xircom_cb: Convert #ifdef DEBUG blocks and enter/leave uses

Change the blocks that are guarded by #if DEBUG to
be #if defined DEBUG && DEBUG > 1 so that pr_debug
can be used later.

Remove enter/leave macros and uses.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'davem-next.r8169' of git://git.kernel.org/pub/scm/linux/kernel/git...
David S. Miller [Mon, 9 May 2011 19:48:05 +0000 (12:48 -0700)]
Merge branch 'davem-next.r8169' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6

13 years agonet: add mac_pton() for parsing MAC address
Alexey Dobriyan [Sat, 7 May 2011 23:00:07 +0000 (23:00 +0000)]
net: add mac_pton() for parsing MAC address

mac_pton() parses MAC address in form XX:XX:XX:XX:XX:XX and only in that form.

mac_pton() doesn't dirty result until it's sure string representation is valid.

mac_pton() doesn't care about characters _after_ last octet,
it's up to caller to deal with it.

mac_pton() diverges from 0/-E return value convention.
Target usage:

if (!mac_pton(str, whatever->mac))
return -EINVAL;
/* ->mac being u8 [ETH_ALEN] is filled at this point. */
/* optionally check str[3 * ETH_ALEN - 1] for termination */

Use mac_pton() in pktgen and netconsole for start.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetconsole: switch to kstrto*() functions
Alexey Dobriyan [Sat, 7 May 2011 20:33:13 +0000 (20:33 +0000)]
netconsole: switch to kstrto*() functions

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: bonding: factor out rlock(bond->lock) in xmit path
Michał Mirosław [Sat, 7 May 2011 01:48:02 +0000 (01:48 +0000)]
net: bonding: factor out rlock(bond->lock) in xmit path

Pull read_lock(&bond->lock) and BOND_IS_OK() to bond_start_xmit() from
mode-dependent xmit functions.

netif_running() is always true in hard_start_xmit.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agor8169: avoid late chip identifier initialisation.
Francois Romieu [Sun, 8 May 2011 15:47:36 +0000 (17:47 +0200)]
r8169: avoid late chip identifier initialisation.

Unknown 8168 chips did not have any PLL power method set as they
did not inherit a default family soon enough. Fix it.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
13 years agor8169: merge firmware information into the chipset description data.
Francois Romieu [Wed, 27 Apr 2011 06:22:39 +0000 (08:22 +0200)]
r8169: merge firmware information into the chipset description data.

- RTL_GIGA_MAC_NONE is a fake index so put it at the end of the
  enumeration and shift everybody.
- RTL_GIGA_MAC_VER_17 / RTL_GIGA_MAC_VER_16 ordering fixed. Though
  not wrong it was confusing enough to wonder if things were right.

Renaming rtl_chip_info was not strictly necessary. It allows to
check the patch for the correct use of the indexes though.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
13 years agor8169: provide some firmware information via ethtool.
Francois Romieu [Tue, 26 Apr 2011 16:58:59 +0000 (18:58 +0200)]
r8169: provide some firmware information via ethtool.

There is no real firmware version yet but the manpage of ethtool
is rather terse about the driver information.

Former output:
$ ethtool -i eth1
driver: r8169
version: 2.3LK-NAPI
firmware-version:
bus-info: 0000:01:00.0
$ ethtool -i eth0
driver: r8169
version: 2.3LK-NAPI
firmware-version:
bus-info: 0000:03:00.0

Current output:
$ ethtool -i eth1
driver: r8169
version: 2.3LK-NAPI
firmware-version: N/A
bus-info: 0000:01:00.0

$ ethtool -i eth0
driver: r8169
version: 2.3LK-NAPI
firmware-version: rtl_nic/rtl8168d-1.fw
bus-info: 0000:03:00.0

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Fixed-by Ciprian Docan <docan@eden.rutgers.edu>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
Cc: Fejes József <fejes@joco.name>
Cc: Borislav Petkov <borislav.petkov@amd.com>
13 years agor8169: remove non-NAPI context invocation of rtl8169_rx_interrupt.
Francois Romieu [Tue, 15 Mar 2011 16:29:31 +0000 (17:29 +0100)]
r8169: remove non-NAPI context invocation of rtl8169_rx_interrupt.

Invocation of rtl8169_rx_interrupt from rtl8169_reset_task was originally
intended to retrieve as much packets as possible from the rx ring when a
reset was needed. Nowadays rtl8169_reset_task is only scheduled, with
some delay
a. from the tx timeout watchdog
b. when resuming
c. from rtl8169_rx_interrupt itself

It's dubious that the loss of outdated packets will matter much for a)
and b). c) does not need to call itself again.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
13 years agor8169: link speed selection timer rework.
Francois Romieu [Fri, 11 Mar 2011 20:07:11 +0000 (21:07 +0100)]
r8169: link speed selection timer rework.

The implementation was a bit krusty.

The 10s rtl8169_phy_timer timer has been (was ?) required with older
8169 for adequate phy operation when full gigabit is advertised in
autonegotiated mode. The timer does nothing if the link is up.
Otherwise it keeps resetting the phy until things improve.

- the device private data field phy_1000_ctrl_reg was used to
  schedule the timer. Avoid it and save a few bytes.

- rtl8169_set_settings
  pending timer is disabled before changing the link settings as
  rtl8169_phy_timer is not always needed (see the removed test in
  rtl8169_phy_timer).

- rtl8169_set_speed
  the requested link parameters may not match the chipset : bail out
  early on failure.

- rtl8169_open
  Calling rtl8169_request_timer is redundant with
  -> rtl8169_open
     -> rtl8169_init_phy
        -> rtl8169_set_speed
           -> mod_timer
  The latter always enables the phy timer whereas the former did not
  for RTL_GIGA_MAC_VER_01. It should not make things worse but only
  time will tell if reality agrees.

- rtl8169_request_timer : unused yet. Removed.

- rtl8169_delete_timer : useless. Bloat. Removed.

Side effect : the timer may kick in if the TBI is enabled. I do not
know if the TBI has ever been used in real life.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
13 years agor8169: rtl8169_set_speed_xmii cleanup.
Francois Romieu [Fri, 11 Mar 2011 19:30:24 +0000 (20:30 +0100)]
r8169: rtl8169_set_speed_xmii cleanup.

Shorten chipset version test.

No functional change.

Careful readers will notice that the 'supports_gmii' flag is deduced
from the device PCI id. Though less specific than the chipset related
RTL_GIGA_MAC_VER_XY, it is good enough to detect a GMII deprieved 810x.
Some features push for a device specific configuration (improved jumbo
frame support for instance). 'supports_gmii' will follow this path
if / when the device PCI id test stops working.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
13 years agor8169: remove some code duplication.
Francois Romieu [Fri, 29 Apr 2011 13:05:51 +0000 (15:05 +0200)]
r8169: remove some code duplication.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
13 years agor8169: style cleanups.
Francois Romieu [Fri, 1 Apr 2011 08:21:07 +0000 (10:21 +0200)]
r8169: style cleanups.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
13 years agovlan: remove one synchronize_net() call
Eric Dumazet [Mon, 9 May 2011 04:40:44 +0000 (04:40 +0000)]
vlan: remove one synchronize_net() call

At VLAN dismantle phase, unregister_vlan_dev() makes one
synchronize_net() call after vlan_group_set_device(grp, vlan_id, NULL).

This call can be safely removed because we are calling
unregister_netdevice_queue() to queue device for deletion, and this
process needs at least one rcu grace period to complete.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ben Greear <greearb@candelatech.com>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Jesse Gross <jesse@nicira.com>
Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agogarp: remove one synchronize_rcu() call
Eric Dumazet [Mon, 9 May 2011 03:35:55 +0000 (03:35 +0000)]
garp: remove one synchronize_rcu() call

Speedup vlan dismantling in CONFIG_VLAN_8021Q_GVRP=y cases,
by using a call_rcu() to free the memory instead of waiting with
expensive synchronize_rcu() [ while RTNL is held ]

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ben Greear <greearb@candelatech.com>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: use batched device unregister in veth and macvlan
Eric Dumazet [Sun, 8 May 2011 23:17:57 +0000 (23:17 +0000)]
net: use batched device unregister in veth and macvlan

veth devices dont use the batched device unregisters yet.

Since veth are a pair of devices, it makes sense to use a batch of two
unregisters, this roughly divides dismantle time by two.

Fix this by changing dellink() callers to always provide a non NULL
head. (Idea from Michał Mirosław)

This patch also handles macvlan case : We now dismantle all macvlans on
top of a lower dev at once.

Reported-by: Alex Bligh <alex@alex.org.uk>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Michał Mirosław <mirqus@gmail.com>
Cc: Jesse Gross <jesse@nicira.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: Fix debug message args.
David S. Miller [Mon, 9 May 2011 04:14:41 +0000 (21:14 -0700)]
sctp: Fix debug message args.

I messed things up when I converted over to the transport
flow, I passed the ipv4 address value instead of it's address.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Pass flow key down into ip_append_*().
David S. Miller [Mon, 9 May 2011 00:24:10 +0000 (17:24 -0700)]
ipv4: Pass flow key down into ip_append_*().

This way rt->rt_dst accesses are unnecessary.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Pass flow keys down into datagram packet building engine.
David S. Miller [Mon, 9 May 2011 00:12:19 +0000 (17:12 -0700)]
ipv4: Pass flow keys down into datagram packet building engine.

This way ip_output.c no longer needs rt->rt_{src,dst}.

We already have these keys sitting, ready and waiting, on the stack or
in a socket structure.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoudp: Use flow key information instead of rt->rt_{src,dst}
David S. Miller [Sun, 8 May 2011 23:38:45 +0000 (16:38 -0700)]
udp: Use flow key information instead of rt->rt_{src,dst}

We have two cases.

Either the socket is in TCP_ESTABLISHED state and connect() filled
in the inet socket cork flow, or we looked up the route here and
used an on-stack flow.

Track which one it was, and use it to obtain src/dst addrs.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Allow ethtool to set interface in loopback mode.
Mahesh Bandewar [Wed, 4 May 2011 15:30:11 +0000 (15:30 +0000)]
net: Allow ethtool to set interface in loopback mode.

This patch enables ethtool to set the loopback mode on a given interface.
By configuring the interface in loopback mode in conjunction with a policy
route / rule, a userland application can stress the egress / ingress path
exposing the flows of the change in progress and potentially help developer(s)
understand the impact of those changes without even sending a packet out
on the network.

Following set of commands illustrates one such example -
    a) ip -4 addr add 192.168.1.1/24 dev eth1
    b) ip -4 rule add from all iif eth1 lookup 250
    c) ip -4 route add local 0/0 dev lo proto kernel scope host table 250
    d) arp -Ds 192.168.1.100 eth1
    e) arp -Ds 192.168.1.200 eth1
    f) sysctl -w net.ipv4.ip_nonlocal_bind=1
    g) sysctl -w net.ipv4.conf.all.accept_local=1
    # Assuming that the machine has 8 cores
    h) taskset 000f netserver -L 192.168.1.200
    i) taskset 00f0 netperf -t TCP_CRR -L 192.168.1.100 -H 192.168.1.200 -l 30

Signed-off-by: Mahesh Bandewar <maheshb@google.com>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agopktgen: use %pI6c for printing IPv6 addresses
Alexey Dobriyan [Tue, 3 May 2011 11:23:40 +0000 (11:23 +0000)]
pktgen: use %pI6c for printing IPv6 addresses

I don't know why %pI6 doesn't compress, but the format specifier is
kernel-standard, so use it.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: Add 20G bit definitions
Yaniv Rosner [Mon, 2 May 2011 21:30:08 +0000 (21:30 +0000)]
ethtool: Add 20G bit definitions

Add 20G supported and advertising bit definitions.
20G will be supported with the 57840 chips.

Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
------
 include/linux/ethtool.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge
David S. Miller [Sun, 8 May 2011 22:39:11 +0000 (15:39 -0700)]
Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge

13 years agotcp: Use cork flow info instead of rt->rt_dst in tcp_v4_get_peer()
David S. Miller [Sat, 7 May 2011 05:36:30 +0000 (22:36 -0700)]
tcp: Use cork flow info instead of rt->rt_dst in tcp_v4_get_peer()

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: Don't use rt->rt_{src,dst} in sctp_v4_xmit()
David S. Miller [Sat, 7 May 2011 05:34:29 +0000 (22:34 -0700)]
sctp: Don't use rt->rt_{src,dst} in sctp_v4_xmit()

Now we can pick it out of the transport's flow key.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Don't use rt->rt_{src,dst} in ip_queue_xmit().
David S. Miller [Sat, 7 May 2011 05:30:20 +0000 (22:30 -0700)]
ipv4: Don't use rt->rt_{src,dst} in ip_queue_xmit().

Now we can pick it out of the provided flow key.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoinet: Pass flowi to ->queue_xmit().
David S. Miller [Sat, 7 May 2011 05:23:20 +0000 (22:23 -0700)]
inet: Pass flowi to ->queue_xmit().

This allows us to acquire the exact route keying information from the
protocol, however that might be managed.

It handles all of the possibilities, from the simplest case of storing
the key in inet->cork.fl to the more complex setup SCTP has where
individual transports determine the flow.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Use inet_csk_route_child_sock() in DCCP and TCP.
David S. Miller [Sun, 8 May 2011 22:28:03 +0000 (15:28 -0700)]
ipv4: Use inet_csk_route_child_sock() in DCCP and TCP.

Operation order is now transposed, we first create the child
socket then we try to hook up the route.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Create inet_csk_route_child_sock().
David S. Miller [Sun, 8 May 2011 21:34:22 +0000 (14:34 -0700)]
ipv4: Create inet_csk_route_child_sock().

This is just like inet_csk_route_req() except that it operates after
we've created the new child socket.

In this way we can use the new socket's cork flow for proper route
key storage.

This will be used by DCCP and TCP child socket creation handling.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: Store a flowi in transports to provide persistent keying.
David S. Miller [Fri, 6 May 2011 23:32:47 +0000 (16:32 -0700)]
sctp: Store a flowi in transports to provide persistent keying.

Several future simplifications are possible now because of this.

For example, the sctp_addr unions can simply refer directly to
the flowi information.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Use cork flow in ip_queue_xmit()
David S. Miller [Fri, 6 May 2011 23:24:06 +0000 (16:24 -0700)]
ipv4: Use cork flow in ip_queue_xmit()

All invokers of ip_queue_xmit() must make certain that the
socket is locked.  All of SCTP, TCP, DCCP, and L2TP now make
sure this is the case.

Therefore we can use the cork flow during output route lookup in
ip_queue_xmit() when the socket route check fails.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Use cork flow in inet_sk_{reselect_saddr,rebuild_header}()
David S. Miller [Fri, 6 May 2011 23:18:04 +0000 (16:18 -0700)]
ipv4: Use cork flow in inet_sk_{reselect_saddr,rebuild_header}()

These two functions must be invoked only when the socket is locked
(because socket identity modifications are made non-atomically).

Therefore we can use the cork flow for output route lookups.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Lock socket and use cork flow in ip4_datagram_connect().
David S. Miller [Sat, 7 May 2011 05:27:25 +0000 (22:27 -0700)]
ipv4: Lock socket and use cork flow in ip4_datagram_connect().

This is to make sure that an l2tp socket's inet cork flow is
fully filled in, when it's encapsulated in UDP.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agol2tp: Use cork flow in l2tp_ip_connect() and l2tp_ip_sendmsg()
David S. Miller [Sun, 8 May 2011 20:48:37 +0000 (13:48 -0700)]
l2tp: Use cork flow in l2tp_ip_connect() and l2tp_ip_sendmsg()

Now that the socket is consistently locked in these two routines,
this transformation is legal.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agol2tp: Fix locking in l2tp_core.c
David S. Miller [Sun, 8 May 2011 20:45:20 +0000 (13:45 -0700)]
l2tp: Fix locking in l2tp_core.c

l2tp_xmit_skb() must take the socket lock.  It makes use of ip_queue_xmit()
which expects to execute in a socket atomic context.

Since we execute this function in software interrupts, we cannot use the
usual lock_sock()/release_sock() sequence, instead we have to use
bh_lock_sock() and see if a user has the socket locked, and if so drop
the packet.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agol2tp: Fix locking in l2tp_ip.c
David S. Miller [Sun, 8 May 2011 20:39:01 +0000 (13:39 -0700)]
l2tp: Fix locking in l2tp_ip.c

Both l2tp_ip_connect() and l2tp_ip_sendmsg() must take the socket
lock.  They both modify socket state non-atomically, and in particular
l2tp_ip_sendmsg() increments socket private counters without using
atomic operations.
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotcp: Use cork flow in tcp_v4_connect()
David S. Miller [Fri, 6 May 2011 23:11:19 +0000 (16:11 -0700)]
tcp: Use cork flow in tcp_v4_connect()

Since this is invoked from inet_stream_connect() the socket is locked
and therefore this usage is safe.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodccp: Use cork flow in dccp_v4_connect()
David S. Miller [Fri, 6 May 2011 23:10:41 +0000 (16:10 -0700)]
dccp: Use cork flow in dccp_v4_connect()

Since this is invoked from inet_stream_connect() the socket is locked
and therefore this usage is safe.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoethtool: remove phys_id from ethtool_ops
Stephen Hemminger [Fri, 15 Apr 2011 06:46:06 +0000 (23:46 -0700)]
ethtool: remove phys_id from ethtool_ops

After that all the upstream kernel drivers now use phys_id,
and the old ethtool_ops interface (phys_id) can be removed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobatman-adv: remove duplicate code from function is_bidirectional_neigh()
Daniele Furlan [Sat, 7 May 2011 20:45:19 +0000 (22:45 +0200)]
batman-adv: remove duplicate code from function is_bidirectional_neigh()

In function is_bidirectional_neigh the code that find out the one hop
neighbor is duplicated.

Signed-off-by: Daniele Furlan <daniele.furlan@gmail.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agobatman-adv: Remove multiline comments from line ending
Sven Eckelmann [Sun, 8 May 2011 10:45:45 +0000 (12:45 +0200)]
batman-adv: Remove multiline comments from line ending

It is slightly irritating that comments after a long line span over
multiple lines without any code. It is easier to put them before the
actual code and reduce the number of lines which the eye has to read.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agobatman-adv: rename everything from *hna* into *tt* (translation table)
Antonio Quartulli [Thu, 5 May 2011 06:42:45 +0000 (08:42 +0200)]
batman-adv: rename everything from *hna* into *tt* (translation table)

To be coherent, all the functions/variables/constants have been renamed
to the TranslationTable style

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agobatman-adv: Fix refcount imbalance in find_router
Marek Lindner [Thu, 5 May 2011 12:14:46 +0000 (14:14 +0200)]
batman-adv: Fix refcount imbalance in find_router

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agobatman-adv: Avoid deadlock between rtnl_lock and s_active
Sven Eckelmann [Tue, 3 May 2011 11:10:06 +0000 (13:10 +0200)]
batman-adv: Avoid deadlock between rtnl_lock and s_active

The hard_if_event is called by the notifier with rtnl_lock and tries to
remove sysfs entries when a NETDEV_UNREGISTER event is received. This
will automatically take the s_active lock.

The s_active lock is also used when a new interface is added to a meshif
through sysfs. In that situation we cannot wait for the rntl_lock before
creating the actual batman-adv interface to prevent a deadlock. It is
still possible to try to get the rtnl_lock and immediately abort the
current operation when the trylock call failed.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agobatman-adv: Remove unnecessary hardif_list_lock
Sven Eckelmann [Tue, 3 May 2011 09:51:38 +0000 (11:51 +0200)]
batman-adv: Remove unnecessary hardif_list_lock

hardif_list_lock is unneccessary because we already ensure that no
multiple admin operations can take place through rtnl_lock.
hardif_list_lock only adds additional overhead and complexity.

Critical functions now check whether they are called with rtnl_lock
using ASSERT_RTNL.

It indirectly fixes the problem that orig_hash_del_if() expects that
only one interface is deleted from hardif_list at a time, but
hardif_remove_interfaces() removes all at once and then calls
orig_hash_del_if().

Reported-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agobatman-adv: multi vlan support for bridge loop detection
Marek Lindner [Thu, 21 Apr 2011 13:52:17 +0000 (15:52 +0200)]
batman-adv: multi vlan support for bridge loop detection

The bridge loop detection for batman-adv allows the bat0 interface
to be bridged into an ethernet segment which other batman-adv nodes
are connected to. In order to also allow multiple VLANs on top of
the bat0 interface to be bridged into the ethernet segment this
patch extends the aforementioned bridge loop detection.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agobatman-adv: remove misplaced comment
Marek Lindner [Mon, 2 May 2011 14:37:13 +0000 (16:37 +0200)]
batman-adv: remove misplaced comment

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
13 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Sun, 8 May 2011 05:57:22 +0000 (22:57 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-next-2.6

13 years agohamachi: Put back RX_CHECKSUM
David S. Miller [Sat, 7 May 2011 08:02:28 +0000 (01:02 -0700)]
hamachi: Put back RX_CHECKSUM

I deleted it by mistake in the TX_CHECKSUM removal
commit.

Reported-by: Michał Mirosław <mirqus@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoixgbe: add ethtool counters for OS2BMC
Emil Tantilov [Thu, 21 Apr 2011 08:43:43 +0000 (08:43 +0000)]
ixgbe: add ethtool counters for OS2BMC

OS2BMC registers are available for X540.
This patch adds ethtool counters based on those registers.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoixgbe: add rxhash support
Emil Tantilov [Sat, 23 Apr 2011 04:50:40 +0000 (04:50 +0000)]
ixgbe: add rxhash support

feed RSS hash into skb->rxhash

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Evan Swanson <evan.swanson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoigb: convert to ethtool set_phys_id
Jeff Kirsher [Sat, 7 May 2011 06:37:14 +0000 (06:37 +0000)]
igb: convert to ethtool set_phys_id

Based on patch from Stephen Hemminger.
Convert igb driver to use new set_phys_id ethtool interface.

CC: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoe1000: convert to set_phys_id
Jeff Kirsher [Tue, 3 May 2011 05:26:13 +0000 (05:26 +0000)]
e1000: convert to set_phys_id

Based on the original patch from Stephen Hemminger.
Convert to new LED control infrastucture and remove no longer
necessary bits.

CC: Stephen Hemminger <shemminger@vyatta.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoe100: implemenet set_phys_id
Jeff Kirsher [Tue, 3 May 2011 05:28:23 +0000 (05:28 +0000)]
e100: implemenet set_phys_id

Based on the original patch from Stephen Hemminger.
Implement set_phys_id to control LED.

CC: Stephen Hemminger <shemminger@vyatta.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
13 years agoipv4: Initialize cork->opt using NULL not 0.
David S. Miller [Fri, 6 May 2011 23:01:15 +0000 (16:01 -0700)]
ipv4: Initialize cork->opt using NULL not 0.

Noticed by Joe Perches.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv4: Initialize on-stack cork more efficiently.
David S. Miller [Fri, 6 May 2011 22:06:01 +0000 (15:06 -0700)]
ipv4: Initialize on-stack cork more efficiently.

ip_setup_cork() explicitly initializes every member of
inet_cork except flags, addr, and opt.  So we can simply
set those three members to zero instead of using a
memset() via an empty struct assignment.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
13 years agoinet: Decrease overhead of on-stack inet_cork.
David S. Miller [Fri, 6 May 2011 22:02:07 +0000 (15:02 -0700)]
inet: Decrease overhead of on-stack inet_cork.

When we fast path datagram sends to avoid locking by putting
the inet_cork on the stack we use up lots of space that isn't
necessary.

This is because inet_cork contains a "struct flowi" which isn't
used in these code paths.

Split inet_cork to two parts, "inet_cork" and "inet_cork_full".
Only the latter of which has the "struct flowi" and is what is
stored in inet_sock.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
13 years agohamachi: Delete TX checksumming code commented out since 1999
David S. Miller [Fri, 6 May 2011 18:58:55 +0000 (11:58 -0700)]
hamachi: Delete TX checksumming code commented out since 1999

TX checksumming support has been ifdef commented out of this driver
for more than 10 years, and it makes references to aspects of the IPv4
stack from back then as well.

If someone has one of these rare cards and wants to properly resurrect
TX checksumming support, they can still get at this code in the
version control history.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Thu, 5 May 2011 21:59:02 +0000 (14:59 -0700)]
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/tg3.c

13 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Thu, 5 May 2011 21:09:28 +0000 (14:09 -0700)]
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6

13 years agonet: Add sendmmsg socket system call
Anton Blanchard [Mon, 2 May 2011 20:21:35 +0000 (20:21 +0000)]
net: Add sendmmsg socket system call

This patch adds a multiple message send syscall and is the send
version of the existing recvmmsg syscall. This is heavily
based on the patch by Arnaldo that added recvmmsg.

I wrote a microbenchmark to test the performance gains of using
this new syscall:

http://ozlabs.org/~anton/junkcode/sendmmsg_test.c

The test was run on a ppc64 box with a 10 Gbit network card. The
benchmark can send both UDP and RAW ethernet packets.

64B UDP

batch   pkts/sec
1       804570
2       872800 (+ 8 %)
4       916556 (+14 %)
8       939712 (+17 %)
16      952688 (+18 %)
32      956448 (+19 %)
64      964800 (+20 %)

64B raw socket

batch   pkts/sec
1       1201449
2       1350028 (+12 %)
4       1461416 (+22 %)
8       1513080 (+26 %)
16      1541216 (+28 %)
32      1553440 (+29 %)
64      1557888 (+30 %)

We see a 20% improvement in throughput on UDP send and 30%
on raw socket send.

[ Add sparc syscall entries. -DaveM ]

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocan: fix SJA1000 dlc for RTR packets
Kurt Van Dijck [Mon, 2 May 2011 04:50:48 +0000 (04:50 +0000)]
can: fix SJA1000 dlc for RTR packets

RTR frames do have a valid data length code on CAN.
The driver for SJA1000 did not handle that situation properly.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: call dev_alloc_name from register_netdevice
Jiri Pirko [Sat, 30 Apr 2011 01:21:32 +0000 (01:21 +0000)]
net: call dev_alloc_name from register_netdevice

Force dev_alloc_name() to be called from register_netdevice() by
dev_get_valid_name(). That allows to remove multiple explicit
dev_alloc_name() calls.

The possibility to call dev_alloc_name in advance remains.

This also fixes veth creation regresion caused by
84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: function descriptions format fixed
Dmitry Kravkov [Wed, 4 May 2011 23:52:40 +0000 (23:52 +0000)]
bnx2x: function descriptions format fixed

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>
13 years agobnx2x: update year to 2011 and version to 1.62.12-0
Dmitry Kravkov [Wed, 4 May 2011 23:51:13 +0000 (23:51 +0000)]
bnx2x: update year to 2011 and version to 1.62.12-0

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>
13 years agobnx2x: improve memory handling, low memory recovery flows
Dmitry Kravkov [Wed, 4 May 2011 23:50:33 +0000 (23:50 +0000)]
bnx2x: improve memory handling, low memory recovery flows

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>
13 years agobnx2x: Do storage mac address validation for SF mode.
Dmitry Kravkov [Wed, 4 May 2011 23:49:53 +0000 (23:49 +0000)]
bnx2x: Do storage mac address validation for SF mode.

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>