]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/log
mirror_ubuntu-bionic-kernel.git
11 years agoipv4: fix rcu splat
Eric Dumazet [Tue, 17 Jul 2012 20:42:13 +0000 (22:42 +0200)]
ipv4: fix rcu splat

free_nh_exceptions() should use rcu_dereference_protected(..., 1)
since its called after one RCU grace period.

Also add some const-ification in recent code.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv4: Fix nexthop exception hash computation.
David S. Miller [Tue, 17 Jul 2012 20:23:08 +0000 (13:23 -0700)]
ipv4: Fix nexthop exception hash computation.

Need to mask it with (FNHE_HASH_SIZE - 1).

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'nexthop_exceptions'
David S. Miller [Tue, 17 Jul 2012 17:48:26 +0000 (10:48 -0700)]
Merge branch 'nexthop_exceptions'

These patches implement the final mechanism necessary to really allow
us to go without the route cache in ipv4.

We need a place to have long-term storage of PMTU/redirect information
which is independent of the routes themselves, yet does not get us
back into a situation where we have to write to metrics or anything
like that.

For this we use an "next-hop exception" table in the FIB nexthops.

The one thing I desperately want to avoid is having to create clone
routes in the FIB trie for this purpose, because that is very
expensive.   However, I'm willing to entertain such an idea later
if this current scheme proves to have downsides that the FIB trie
variant would not have.

In order to accomodate this any such scheme, we need to be able to
produce a full flow key at PMTU/redirect time.  That required an
adjustment of the interface call-sites used to propagate these events.

For a PMTU/redirect with a fully specified socket, we pass that socket
and use it to produce the flow key.

Otherwise we use a passed in SKB to formulate the key.  There are two
cases that need to be distinguished, ICMP message processing (in which
case the IP header is at skb->data) and output packet processing
(mostly tunnels, and in all such cases the IP header is at ip_hdr(skb)).

We also have to make the code able to handle the case where the dst
itself passed into the dst_ops->{update_pmtu,redirect} method is
invalidated.  This matters for calls from sockets that have cached
that route.  We provide a inet{,6} helper function for this purpose,
and edit SCTP specially since it caches routes at the transport rather
than socket level.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoteam: add netpoll support
Jiri Pirko [Tue, 17 Jul 2012 05:22:36 +0000 (05:22 +0000)]
team: add netpoll support

It's done in very similar way this is done in bonding and bridge.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonetpoll: move np->dev and np->dev_name init into __netpoll_setup()
Jiri Pirko [Tue, 17 Jul 2012 05:22:35 +0000 (05:22 +0000)]
netpoll: move np->dev and np->dev_name init into __netpoll_setup()

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv4: Add FIB nexthop exceptions.
David S. Miller [Tue, 17 Jul 2012 11:19:00 +0000 (04:19 -0700)]
ipv4: Add FIB nexthop exceptions.

In a regime where we have subnetted route entries, we need a way to
store persistent storage about destination specific learned values
such as redirects and PMTU values.

This is implemented here via nexthop exceptions.

The initial implementation is a 2048 entry hash table with relaiming
starting at chain length 5.  A more sophisticated scheme can be
devised if that proves necessary.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotcp: implement RFC 5961 4.2
Eric Dumazet [Tue, 17 Jul 2012 01:41:30 +0000 (01:41 +0000)]
tcp: implement RFC 5961 4.2

Implement the RFC 5691 mitigation against Blind
Reset attack using SYN bit.

Section 4.2 of RFC 5961 advises to send a Challenge ACK and drop
incoming packet, instead of resetting the session.

Add a new SNMP counter to count number of challenge acks sent
in response to SYN packets.
(netstat -s | grep TCPSYNChallenge)

Remove obsolete TCPAbortOnSyn, since we no longer abort a TCP session
because of a SYN flag.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Kiran Kumar Kella <kkiran@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Pass optional SKB and SK arguments to dst_ops->{update_pmtu,redirect}()
David S. Miller [Tue, 17 Jul 2012 10:29:28 +0000 (03:29 -0700)]
net: Pass optional SKB and SK arguments to dst_ops->{update_pmtu,redirect}()

This will be used so that we can compose a full flow key.

Even though we have a route in this context, we need more.  In the
future the routes will be without destination address, source address,
etc. keying.  One ipv4 route will cover entire subnets, etc.

In this environment we have to have a way to possess persistent storage
for redirects and PMTU information.  This persistent storage will exist
in the FIB tables, and that's why we'll need to be able to rebuild a
full lookup flow key here.  Using that flow key will do a fib_lookup()
and create/update the persistent entry.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoixgbevf: Use igb style interrupt masks instead of ixgbe style
Alexander Duyck [Fri, 11 May 2012 08:32:55 +0000 (08:32 +0000)]
ixgbevf: Use igb style interrupt masks instead of ixgbe style

The interrupt registers accessed in ixgbevf are more similar to the igb
style registers than they are to the ixgbe style registers.  As such we
would be better off setting up the code for the EICS, EIMS, EICS, EIAM, and
EIAC like we do in igb instead of ixgbe.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbevf: Move Tx clean-up into NAPI context
Alexander Duyck [Fri, 11 May 2012 08:32:50 +0000 (08:32 +0000)]
ixgbevf: Move Tx clean-up into NAPI context

Currently the VF driver is processing all of the transmits in interrupt
context.  This can be messy since the Rx is all handled in NAPI and this
may result in interrupts being disabled.  In order to resolve this move all
of the Tx packet processing into NAPI and combine all of the interrupt and
polling routines into just a pair of functions.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbevf: Update q_vector to contain ring pointers instead of bitmaps
Alexander Duyck [Fri, 11 May 2012 08:32:45 +0000 (08:32 +0000)]
ixgbevf: Update q_vector to contain ring pointers instead of bitmaps

For most cases the ixgbevf driver will only ever contain a single Tx and
single Rx queue.  In order to track that it makes more sense to use a
pointer instead of using a bitmap which must be search in order to locate
the ring on an adapter index.  As such I am changing the code to use
pointers and an iterator to access all rings on a given q_vector.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbevf: Cleanup accounting for space needed at start of xmit_frame
Alexander Duyck [Fri, 11 May 2012 08:32:40 +0000 (08:32 +0000)]
ixgbevf: Cleanup accounting for space needed at start of xmit_frame

This change cleans up the accounting needed at the start of xmit_frame so
that we can avoid doing too much work to determine how many descriptors we
will need.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbevf: Drop use of eitr_low and eitr_high for hard coded values
Alexander Duyck [Fri, 11 May 2012 08:32:34 +0000 (08:32 +0000)]
ixgbevf: Drop use of eitr_low and eitr_high for hard coded values

This patch drops the use of eitr_low and eitr_high as values being stored
in the adapter structure.  Since the values have no external way to be
changed they might as well just be hard coded values and save us the space
on the adapter structure.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbevf: Make use of NETIF_F_RXCSUM instead of keeping our own flag
Alexander Duyck [Fri, 11 May 2012 08:32:29 +0000 (08:32 +0000)]
ixgbevf: Make use of NETIF_F_RXCSUM instead of keeping our own flag

The IXGBE_FLAG_RX_CSUM_ENABLED flag is redundant since NETIF_F_RXCSUM is
keeping the value we want to already have.  As such we can drop the
redundant flag and just make use of NETIF_F_RXCSUM.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbevf: Drop netdev_registered value since that is already stored in netdev
Alexander Duyck [Fri, 11 May 2012 08:32:24 +0000 (08:32 +0000)]
ixgbevf: Drop netdev_registered value since that is already stored in netdev

There is no need to keep a separate netdev_registered value since that is
already stored in the netdev itself.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbevf: Drop all dead or unnecessary code
Alexander Duyck [Fri, 11 May 2012 08:32:19 +0000 (08:32 +0000)]
ixgbevf: Drop all dead or unnecessary code

There is a large amount of code present in this driver to support features
that either do no exist or are not supported such ask packet split, DCA, or
RSC.  This patch strips out almost all of that code and in the case of
conditionals based on unused flags I am flatting the code out to just the
path that would have been selected.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agotcp: implement RFC 5961 3.2
Eric Dumazet [Tue, 17 Jul 2012 08:13:05 +0000 (10:13 +0200)]
tcp: implement RFC 5961 3.2

Implement the RFC 5691 mitigation against Blind
Reset attack using RST bit.

Idea is to validate incoming RST sequence,
to match RCV.NXT value, instead of previouly accepted
window : (RCV.NXT <= SEG.SEQ < RCV.NXT+RCV.WND)

If sequence is in window but not an exact match, send
a "challenge ACK", so that the other part can resend an
RST with the appropriate sequence.

Add a new sysctl, tcp_challenge_ack_limit, to limit
number of challenge ACK sent per second.

Add a new SNMP counter to count number of challenge acks sent.
(netstat -s | grep TCPChallengeACK)

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Kiran Kumar Kella <kkiran@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: fix unappropriate errno returned for non-multicast address
Li Wei [Tue, 17 Jul 2012 07:28:59 +0000 (15:28 +0800)]
ipv6: fix unappropriate errno returned for non-multicast address

We need to check the passed in multicast address and return
appropriate errno(EINVAL) if it is not valid. And it's no need
to walk through the ipv6_mc_list in this situation.

Signed-off-by: Li Wei <lw@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next
David S. Miller [Tue, 17 Jul 2012 08:34:11 +0000 (01:34 -0700)]
Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next

Marc Kleine-Budde says:

====================
the fifth pull request for upcoming v3.6 net-next. The first two
patches (created by me) add const qualifiers to the flexcan and
mpc5xxx_can driver. The next patch by Julia Lawall fixes a return value
problem in the error path of the softing driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: organize BDs calculation for stop/resume
Dmitry Kravkov [Mon, 25 Jun 2012 22:32:50 +0000 (22:32 +0000)]
bnx2x: organize BDs calculation for stop/resume

Put the numbers used for stop/resume queue in a single place and
fix the condition for sanity check.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocan: softing: softing_main: ensure a consistent return value in error case
Julia Lawall [Sat, 14 Jul 2012 16:43:04 +0000 (18:43 +0200)]
can: softing: softing_main: ensure a consistent return value in error case

Typically, the return value desired for the failure of a function with an
integer return value is a negative integer.  In these cases, the return
value is sometimes a negative integer and sometimes 0, due to a subsequent
initialization of the return variable within the loop.

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

//<smpl>
@r exists@
identifier ret;
position p;
constant C;
expression e1,e3,e4;
statement S;
@@

ret = -C
... when != ret = e3
    when any
if@p (...) S
... when any
if (\(ret != 0\|ret < 0\|ret > 0\) || ...) { ... return ...; }
... when != ret = e3
    when any
*if@p (...)
{
  ... when != ret = e4
  return ret;
}
//</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
11 years agocan: mpc5xxx_can: make data in mpc5xxx_can_probe const
Marc Kleine-Budde [Fri, 13 Jul 2012 12:54:59 +0000 (14:54 +0200)]
can: mpc5xxx_can: make data in mpc5xxx_can_probe const

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
11 years agocan: flexcan: make flexcan_priv.devtype_data member point to const data
Marc Kleine-Budde [Fri, 13 Jul 2012 12:52:48 +0000 (14:52 +0200)]
can: flexcan: make flexcan_priv.devtype_data member point to const data

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
11 years agoasix: Add a new driver for the AX88172A
Christian Riesch [Fri, 13 Jul 2012 05:26:31 +0000 (05:26 +0000)]
asix: Add a new driver for the AX88172A

The Asix AX88172A is a USB 2.0 Ethernet interface that supports both an
internal PHY as well as an external PHY (connected via MII).

This patch adds a driver for the AX88172A and provides support for
both modes and the phylib.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoasix: Factor out common code
Christian Riesch [Fri, 13 Jul 2012 05:26:30 +0000 (05:26 +0000)]
asix: Factor out common code

Allow the new driver for the AX88172A to share code with the
existing drivers for ASIX devices.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoasix: Rename asix.c to asix_devices.c
Christian Riesch [Fri, 13 Jul 2012 05:26:29 +0000 (05:26 +0000)]
asix: Rename asix.c to asix_devices.c

This patch further creates two additional copies of asix.c.
In another patch these copies will be used to factor out
common code.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agogigaset: silence GCC warning for unused 'format_ie'
Paul Bolle [Sat, 14 Jul 2012 23:11:55 +0000 (23:11 +0000)]
gigaset: silence GCC warning for unused 'format_ie'

Building Gigaset's CAPI support without Gigaset's debugging enabled
triggers this GCC warning:
    'format_ie' defined but not used [-Wunused-function]

Silence this warning by wrapping format_ie() in an "#ifdef
CONFIG_GIGASET_DEBUG" and "#endif" pair.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agodrivers: connector: fixed coding style issues
Valentin Ilie [Sat, 14 Jul 2012 13:08:29 +0000 (13:08 +0000)]
drivers: connector: fixed coding style issues

V2: Replaced assignment in if statement.
Fixed coding style issues.

Signed-off-by: Valentin Ilie <valentin.ilie@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoirda: Fix typo in irda
Masanari Iida [Fri, 13 Jul 2012 07:22:47 +0000 (07:22 +0000)]
irda: Fix typo in irda

Correct spelling typo in irda.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosctp: fix sparse warning for sctp_init_cause_fixed
Ioan Orghici [Fri, 13 Jul 2012 07:16:37 +0000 (07:16 +0000)]
sctp: fix sparse warning for sctp_init_cause_fixed

Fix the following sparse warning:
* symbol 'sctp_init_cause_fixed' was not declared. Should it be
  static?

Signed-off-by: Ioan Orghici <ioanorghici@gmail.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2: Try to recover from PCI block reset
Michael Chan [Mon, 16 Jul 2012 14:25:56 +0000 (14:25 +0000)]
bnx2: Try to recover from PCI block reset

If the PCI block has reset, the memory enable bit will be reset and
the device will not respond to MMIO access.  bnx2_reset_task() currently
will not recover when this happens.  Add code to detect this condition
and restore the PCI state.  This scenario has been reported by some
users.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotg3: Add hwmon support for temperature
Michael Chan [Mon, 16 Jul 2012 16:24:02 +0000 (16:24 +0000)]
tg3: Add hwmon support for temperature

Some tg3 devices have management firmware that can export sensor data.
Export temperature sensor reading via hwmon sysfs.

[hwmon interface suggested by Ben Hutchings <bhutchings@solarflare.com>]

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotg3: Add APE scratchpad read function
Matt Carlson [Mon, 16 Jul 2012 16:24:01 +0000 (16:24 +0000)]
tg3: Add APE scratchpad read function

for retreiving temperature sensor data.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotg3: Add common function tg3_ape_event_lock()
Matt Carlson [Mon, 16 Jul 2012 16:24:00 +0000 (16:24 +0000)]
tg3: Add common function tg3_ape_event_lock()

by refactoring code in tg3_ape_send_event().  The common function will
be used in subsequent patches.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotg3: Fix the setting of the APE_HAS_NCSI flag
Michael Chan [Mon, 16 Jul 2012 16:23:59 +0000 (16:23 +0000)]
tg3: Fix the setting of the APE_HAS_NCSI flag

The driver currently skips setting this flag if the VPD contains the
firmware version string.  We fix this by separating the probing of NCSI
from the reading of the NCSI version string.  The APE_HAS_NCSI flag is
needed to properly read sensor data.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonetem: refine early skb orphaning
Eric Dumazet [Sat, 14 Jul 2012 03:16:27 +0000 (03:16 +0000)]
netem: refine early skb orphaning

netem does an early orphaning of skbs. Doing so breaks TCP Small Queue
or any mechanism relying on socket sk_wmem_alloc feedback.

Ideally, we should perform this orphaning after the rate module and
before the delay module, to mimic what happens on a real link :

skb orphaning is indeed normally done at TX completion, before the
transit on the link.

+-------+   +--------+  +---------------+  +-----------------+
+ Qdisc +---> Device +--> TX completion +--> links / hops    +->
+       +   +  xmit  +  + skb orphaning +  + propagation     +
+-------+   +--------+  +---------------+  +-----------------+
      < rate limiting >                  < delay, drops, reorders >

If netem is used without delay feature (drops, reorders, rate
limiting), then we should avoid early skb orphaning, to keep pressure
on sockets as long as packets are still in qdisc queue.

Ideally, netem should be refactored to implement delay module
as the last stage. Current algorithm merges the two phases
(rate limiting + delay) so its not correct.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Hagen Paul Pfeifer <hagen@jauu.net>
Cc: Mark Gordon <msg@google.com>
Cc: Andreas Terzis <aterzis@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Tue, 17 Jul 2012 06:04:00 +0000 (23:04 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next

Jett Kirsher says:

====================
This series contains updates to e1000e and ixgbe.
 ...
Alexander Duyck (5):
  ixgbe: Simplify logic for getting traffic class from user priority
  ixgbe: Cleanup unpacking code for DCB
  ixgbe: Populate the prio_tc_map in ixgbe_setup_tc
  ixgbe: Add function for obtaining FCoE TC based on FCoE user priority
  ixgbe: Merge FCoE set_num and cache_ring calls into RSS/DCB config
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: dont pull too much data in skb linear part
Eric Dumazet [Fri, 13 Jul 2012 03:19:41 +0000 (03:19 +0000)]
be2net: dont pull too much data in skb linear part

skb_fill_rx_data() pulls 64 byte of data in skb->data

Its too much for TCP (with no options) on IPv4, as total size of headers
is 14 + 40 = 54

This means tcp stack and splice() are suboptimal, since tcp payload
is in part in tcp->data, and in part in skb frag.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: update driver version
Padmanabh Ratnakar [Fri, 13 Jul 2012 02:46:03 +0000 (02:46 +0000)]
be2net: update driver version

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Add description about various RSS hash types
Padmanabh Ratnakar [Fri, 13 Jul 2012 02:45:51 +0000 (02:45 +0000)]
be2net: Add description about various RSS hash types

Incorporated review comment from Eric Dumazet. Added description
about different RSS hash types which adapter is capable of.
Will add support for ETHTOOL_GRXFH and ETHTOOL_SRXFX as suggested
by Ben Hutchings in a later patch.

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobridge: Fix enforcement of multicast hash_max limit
Thomas Graf [Tue, 10 Jul 2012 22:29:19 +0000 (22:29 +0000)]
bridge: Fix enforcement of multicast hash_max limit

The hash size is doubled when it needs to grow and compared against
hash_max. The >= comparison will limit the hash table size to half
of what is expected i.e. the default 512 hash_max will not allow
the hash table to grow larger than 256.

Also print the hash table limit instead of the desirable size when
the limit is reached.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_en: dereferencing freed memory
Dan Carpenter [Tue, 10 Jul 2012 20:34:07 +0000 (20:34 +0000)]
net/mlx4_en: dereferencing freed memory

We dereferenced "mclist" after the kfree().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4: off by one in parse_trans_rule()
Dan Carpenter [Tue, 10 Jul 2012 20:33:36 +0000 (20:33 +0000)]
net/mlx4: off by one in parse_trans_rule()

This should be ">=" here instead of ">".  MLX4_NET_TRANS_RULE_NUM is 6.
We use "spec->id" as an array offset into the __rule_hw_sz[] and
__sw_id_hw[] arrays which have 6 elements.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Hadar Hen Zion <hadarh@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: fix RTPROT_RA markup of RA routes w/nexthops
Denis Ovsienko [Tue, 10 Jul 2012 04:45:50 +0000 (04:45 +0000)]
ipv6: fix RTPROT_RA markup of RA routes w/nexthops

Userspace implementations of network routing protocols sometimes need to
tell RA-originated IPv6 routes from other kernel routes to make proper
routing decisions. This makes most sense for RA routes with nexthops,
namely, default routes and Route Information routes.

The intended mean of preserving RA route origin in a netlink message is
through indicating RTPROT_RA as protocol code. Function rt6_fill_node()
tried to do that for default routes, but its test condition was taken
wrong. This change is modeled after the original mailing list posting
by Jeff Haran. It fixes the test condition for default route case and
sets the same behaviour for Route Information case (both types use
nexthops). Handling of the 3rd RA route type, Prefix Information, is
left unchanged, as it stands for interface connected routes (without
nexthops).

Signed-off-by: Denis Ovsienko <infrastation@yandex.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agohyperv: Add support for setting MAC from within guests
Haiyang Zhang [Tue, 10 Jul 2012 07:19:22 +0000 (07:19 +0000)]
hyperv: Add support for setting MAC from within guests

This adds support for setting synthetic NIC MAC address from within Linux
guests. Before using this feature, the option "spoofing of MAC address"
should be enabled at the Hyper-V manager / Settings of the synthetic
NIC.

Thanks to Kin Cho <kcho@infoblox.com> for the initial implementation and
tests. And, thanks to Long Li <longli@microsoft.com> for the debugging
works.

Reported-and-tested-by: Kin Cho <kcho@infoblox.com>
Reported-by: Long Li <longli@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years ago6lowpan: Change byte order when storing/accessing to len field
Tony Cheneau [Wed, 11 Jul 2012 06:51:16 +0000 (06:51 +0000)]
6lowpan: Change byte order when storing/accessing to len field

Lenght field should be encoded using big endian byte order, such as intend in the specs.
As it is currently written, the len field would not be decoded properly on an implementation using the correct byte ordering. Hence, it could lead to interroperability issues.

Also, I rewrote the code so that iphc0 argument of lowpan_alloc_new_frame could be removed.

Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years ago6lowpan: Change byte order when storing/accessing u16 tag
Tony Cheneau [Wed, 11 Jul 2012 06:51:15 +0000 (06:51 +0000)]
6lowpan: Change byte order when storing/accessing u16 tag

The tag field should be stored and accessed using big endian byte order (as
intended in the specs). Or else, when displayed with a trafic analyser, such a
Wireshark, the field not properly displayed (e.g. 0x01 00 instead of 0x00 01,
and so on).

Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years ago6lowpan: Fix null pointer dereference in UDP uncompression function
Tony Cheneau [Wed, 11 Jul 2012 06:51:14 +0000 (06:51 +0000)]
6lowpan: Fix null pointer dereference in UDP uncompression function

When a UDP packet gets fragmented, a crash will occur at reassembly time.
This is because skb->transport_header is not set during earlier period of fragment reassembly.
As a consequence, call to udp_hdr() return NULL and uh (which is NULL) gets
dereferenced without much test.

Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoarch: Use eth_random_addr
Joe Perches [Fri, 13 Jul 2012 05:33:12 +0000 (22:33 -0700)]
arch: Use eth_random_addr

Convert the existing uses of random_ether_addr to
the new eth_random_addr.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agousb: Use eth_random_addr
Joe Perches [Fri, 13 Jul 2012 05:33:11 +0000 (22:33 -0700)]
usb: Use eth_random_addr

Convert the existing uses of random_ether_addr to
the new eth_random_addr.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agos390: Use eth_random_addr
Joe Perches [Fri, 13 Jul 2012 05:33:10 +0000 (22:33 -0700)]
s390: Use eth_random_addr

Convert the existing uses of random_ether_addr to
the new eth_random_addr.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agodrivers/net: Use eth_random_addr
Joe Perches [Thu, 12 Jul 2012 19:33:09 +0000 (19:33 +0000)]
drivers/net: Use eth_random_addr

Convert the existing uses of random_ether_addr to
the new eth_random_addr.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agowireless: Use eth_random_addr
Joe Perches [Thu, 12 Jul 2012 19:33:08 +0000 (19:33 +0000)]
wireless: Use eth_random_addr

Convert the existing uses of random_ether_addr to
the new eth_random_addr.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: usb: Use eth_random_addr
Joe Perches [Thu, 12 Jul 2012 19:33:07 +0000 (19:33 +0000)]
net: usb: Use eth_random_addr

Convert the existing uses of random_ether_addr to
the new eth_random_addr.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoethernet: Use eth_random_addr
Joe Perches [Thu, 12 Jul 2012 19:33:06 +0000 (19:33 +0000)]
ethernet: Use eth_random_addr

Convert the existing uses of random_ether_addr to
the new eth_random_addr.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoetherdevice: Rename random_ether_addr to eth_random_addr
Joe Perches [Thu, 12 Jul 2012 19:33:05 +0000 (19:33 +0000)]
etherdevice: Rename random_ether_addr to eth_random_addr

Add some API symmetry to eth_broadcast_addr and
add a #define to the old name for backward compatibility.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'tipc_net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg...
David S. Miller [Tue, 17 Jul 2012 05:33:32 +0000 (22:33 -0700)]
Merge branch 'tipc_net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux

Paul Gortmaker says:

====================
This is the same eight commits as sent for review last week[1],
with just the incorporation of the pr_fmt change as suggested
by JoeP.  There was no additional change requests, so unless you
can see something else you'd like me to change, please pull.
 ...
Erik Hugne (5):
      tipc: use standard printk shortcut macros (pr_err etc.)
      tipc: remove TIPC packet debugging functions and macros
      tipc: simplify print buffer handling in tipc_printf
      tipc: phase out most of the struct print_buf usage
      tipc: remove print_buf and deprecated log buffer code

Paul Gortmaker (3):
      tipc: factor stats struct out of the larger link struct
      tipc: limit error messages relating to memory leak to one line
      tipc: simplify link_print by divorcing it from using tipc_printf
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: make sock diag per-namespace
Andrey Vagin [Mon, 16 Jul 2012 04:28:49 +0000 (04:28 +0000)]
net: make sock diag per-namespace

Before this patch sock_diag works for init_net only and dumps
information about sockets from all namespaces.

This patch expands sock_diag for all name-spaces.
It creates a netlink kernel socket for each netns and filters
data during dumping.

v2: filter accoding with netns in all places
    remove an unused variable.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Pavel Emelyanov <xemul@parallels.com>
CC: Eric Dumazet <eric.dumazet@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Andrew Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agolpc_eth: remove duplicated include
Duan Jiong [Mon, 16 Jul 2012 02:29:05 +0000 (02:29 +0000)]
lpc_eth: remove duplicated include

Remove duplicated #include <linux/delay.h> in
drivers/net/ethernet/nxp/lpc_eth.c

Signed-off-by: Duan Jiong<djduanjiong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotcp: add OFO snmp counters
Eric Dumazet [Mon, 16 Jul 2012 01:41:36 +0000 (01:41 +0000)]
tcp: add OFO snmp counters

Add three SNMP TCP counters, to better track TCP behavior
at global stage (netstat -s), when packets are received
Out Of Order (OFO)

TCPOFOQueue : Number of packets queued in OFO queue

TCPOFODrop  : Number of packets meant to be queued in OFO
              but dropped because socket rcvbuf limit hit.

TCPOFOMerge : Number of packets in OFO that were merged with
              other packets.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosctp: Adjust PMTU updates to accomodate route invalidation.
David S. Miller [Mon, 16 Jul 2012 10:57:14 +0000 (03:57 -0700)]
sctp: Adjust PMTU updates to accomodate route invalidation.

This adjusts the call to dst_ops->update_pmtu() so that we can
transparently handle the fact that, in the future, the dst itself can
be invalidated by the PMTU update (when we have non-host routes cached
in sockets).

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: Add helper inet6_csk_update_pmtu().
David S. Miller [Mon, 16 Jul 2012 10:44:56 +0000 (03:44 -0700)]
ipv6: Add helper inet6_csk_update_pmtu().

This is the ipv6 version of inet_csk_update_pmtu().

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv4: Add helper inet_csk_update_pmtu().
David S. Miller [Mon, 16 Jul 2012 10:28:06 +0000 (03:28 -0700)]
ipv4: Add helper inet_csk_update_pmtu().

This abstracts away the call to dst_ops->update_pmtu() so that we can
transparently handle the fact that, in the future, the dst itself can
be invalidated by the PMTU update (when we have non-host routes cached
in sockets).

So we try to rebuild the socket cached route after the method
invocation if necessary.

This isn't used by SCTP because it needs to cache dsts per-transport,
and thus will need it's own local version of this helper.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoixgbe: Merge FCoE set_num and cache_ring calls into RSS/DCB config
Alexander Duyck [Sat, 30 Jun 2012 00:14:01 +0000 (00:14 +0000)]
ixgbe: Merge FCoE set_num and cache_ring calls into RSS/DCB config

This change merges the ixgbe_cache_ring_fcoe and ixgbe_set_fcoe_queues
logic into the DCB and RSS initialization calls.

Cc: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbe: Add function for obtaining FCoE TC based on FCoE user priority
Alexander Duyck [Sat, 2 Jun 2012 00:11:02 +0000 (00:11 +0000)]
ixgbe: Add function for obtaining FCoE TC based on FCoE user priority

In upcoming patches it will become increasingly common to need to determine
the FCoE traffic class in order to determine the correct queues for FCoE.
In order to make this easier I am adding a function for obtaining the FCoE
traffic class based on the user priority.

Cc: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbe: Populate the prio_tc_map in ixgbe_setup_tc
Alexander Duyck [Fri, 18 May 2012 06:33:31 +0000 (06:33 +0000)]
ixgbe: Populate the prio_tc_map in ixgbe_setup_tc

There were cases where the prio_tc_map was not populated when we were
calling open.  This will result in us incorrectly configuring the traffic
classes when DCB is enabled.  In order to correct this I have updated the
code so that we now populate the values prior to allocating the q_vectors
and calling ixgbe_open.

Cc: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbe: Cleanup unpacking code for DCB
Alexander Duyck [Thu, 17 May 2012 05:14:39 +0000 (05:14 +0000)]
ixgbe: Cleanup unpacking code for DCB

This is meant to be a generic clean-up of the remaining functions for
unpacking data from the DCB structures. The only real changes are:
replaced the variable i with tc for functions that were looping through the
traffic classes, and added a pointer for tc_class instead of path since
that way we only need to pull the pointer once instead of once per loop.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbe: Simplify logic for getting traffic class from user priority
Alexander Duyck [Thu, 17 May 2012 05:14:34 +0000 (05:14 +0000)]
ixgbe: Simplify logic for getting traffic class from user priority

This patch is meant to help simplify the logic for getting traffic classes
from user priorities. To do this I am adding a function named
ixgbe_dcb_get_tc_from_up that will go through the traffic classes in
reverse order in order to determine which traffic class contains a bit for
a given user priority.

Adding a declaration for this new function to the header so that
we have a centralized means for sorting out traffic classes belonging to
features such as FCoE.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoe1000e: Program the correct register for ITR when using MSI-X.
Matthew Vick [Thu, 12 Jul 2012 00:02:42 +0000 (00:02 +0000)]
e1000e: Program the correct register for ITR when using MSI-X.

When configuring interrupt throttling on 82574 in MSI-X mode, we need to
be programming the EITR registers instead of the ITR register.

-rc2: Renamed e1000_write_itr() to e1000e_write_itr(), fixed whitespace
      issues, and removed unnecessary !! operation.
-rc3: Reduced the scope of the loop variable in e1000e_write_itr().

Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Acked-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoe1000e: Cleanup code logic in e1000_check_for_serdes_link_82571()
Tushar Dave [Thu, 12 Jul 2012 08:00:15 +0000 (08:00 +0000)]
e1000e: Cleanup code logic in e1000_check_for_serdes_link_82571()

Cleanup code to make it more clean and readable.

Signed-off-by: Tushar Dave <tushar.n.dave@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoxfrm: Initialize the struct xfrm_dst behind the dst_enty field
Steffen Klassert [Thu, 5 Jul 2012 23:39:34 +0000 (23:39 +0000)]
xfrm: Initialize the struct xfrm_dst behind the dst_enty field

We start initializing the struct xfrm_dst at the first field
behind the struct dst_enty. This is error prone because it
might leave a new field uninitialized. So start initializing
the struct xfrm_dst right behind the dst_entry.

Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: Initialize the struct rt6_info behind the dst_enty field
Steffen Klassert [Thu, 5 Jul 2012 23:37:09 +0000 (23:37 +0000)]
ipv6: Initialize the struct rt6_info behind the dst_enty field

We start initializing the struct rt6_info at the first field
behind the struct dst_enty. This is error prone because it
might leave a new field uninitialized. So start initializing
the struct rt6_info right behind the dst_entry.

Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Sat, 14 Jul 2012 06:02:28 +0000 (23:02 -0700)]
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next

John Linville says:

====================
Several drivers see updates: mwifiex, ath9k, iwlwifi, brcmsmac,
wlcore/wl12xx/wl18xx, and a handful of others.  The bcma bus got a
lot of attention from Hauke Mehrtens.  The cfg80211 component gets
a flurry of patches for multi-channel support, and the mac80211
component gets the first few VHT (11ac) and 60GHz (11ad) patches.
This also includes the removal of the iwmc3200 drivers, since the
hardware never became available to normal people.

Additionally, the NFC subsystem gets a series of updates.  According to
Samuel, "Here are the interesting bits:

- A better error management for the HCI stack.
- An LLCP "late" binding implementation for a better NFC SAP usage. SAPs are
  now reserved only when there's a client for it.
- Support for Sony RC-S360 (a.k.a. PaSoRi) pn533 based dongle. We can read and
  write NFC tags and also establish a p2p link with this dongle now.
- A few LLCP fixes."

Finally, this includes another pull of the fixes from the wireless
tree in order to resolve some merge issues.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotipc: remove print_buf and deprecated log buffer code
Erik Hugne [Fri, 29 Jun 2012 04:50:24 +0000 (00:50 -0400)]
tipc: remove print_buf and deprecated log buffer code

The internal log buffer handling functions can now safely be
removed since there is no code using it anymore.  Requests to
interact with the internal tipc log buffer over netlink (in
config.c) will report 'obsolete command'.

This represents the final removal of any references to a
struct print_buf, and the removal of the struct itself.
We also get rid of a TIPC specific Kconfig in the process.

Finally, log.h is removed since it is not needed anymore.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
11 years agotipc: phase out most of the struct print_buf usage
Erik Hugne [Fri, 29 Jun 2012 04:50:23 +0000 (00:50 -0400)]
tipc: phase out most of the struct print_buf usage

The tipc_printf is renamed to tipc_snprintf, as the new name
describes more what the function actually does.  It is also
changed to take a buffer and length parameter and return
number of characters written to the buffer.  All callers of
this function that used to pass a print_buf are updated.

Final removal of the struct print_buf itself will be done
synchronously with the pending removal of the deprecated
logging code that also was using it.

Functions that build up a response message with a list of
ports, nametable contents etc. are changed to return the number
of characters written to the output buffer. This information
was previously hidden in a field of the print_buf struct, and
the number of chars written was fetched with a call to
tipc_printbuf_validate.  This function is removed since it
is no longer referenced nor needed.

A generic max size ULTRA_STRING_MAX_LEN is defined, named
in keeping with the existing TIPC_TLV_ULTRA_STRING, and the
various definitions in port, link and nametable code that
largely duplicated this information are removed.  This means
that amount of link statistics that can be returned is now
increased from 2k to 32k.

The buffer overflow check is now done just before the reply
message is passed over netlink or TIPC to a remote node and
the message indicating a truncated buffer is changed to a less
dramatic one (less CAPS), placed at the end of the message.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
11 years agotipc: simplify print buffer handling in tipc_printf
Erik Hugne [Fri, 29 Jun 2012 04:50:22 +0000 (00:50 -0400)]
tipc: simplify print buffer handling in tipc_printf

tipc_printf was previously used both to construct debug traces
and to append data to buffers that should be sent over netlink
to the tipc-config application.  A global print_buffer was
used to format the string before it was copied to the actual
output buffer.  This could lead to concurrent access of the
global print_buffer, which then had to be lock protected.
This is simplified by changing tipc_printf to append data
directly to the output buffer using vscnprintf.

With the new implementation of tipc_printf, there is no longer
any risk of concurrent access to the internal log buffer, so
the lock (and the comments describing it) are no longer
strictly necessary.  However, there are still a few functions
that do grab this lock before resizing/dumping the log
buffer.  We leave the lock, and these functions untouched since
they will be removed with a subsequent commit that drops the
deprecated log buffer handling code

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
11 years agotipc: simplify link_print by divorcing it from using tipc_printf
Paul Gortmaker [Wed, 11 Jul 2012 23:27:56 +0000 (19:27 -0400)]
tipc: simplify link_print by divorcing it from using tipc_printf

To pave the way for a pending cleanup of tipc_printf, and
removal of struct print_buf entirely, we make that task simpler
by converting link_print to issue its messages with standard
printk infrastructure.  [Original idea separated from a larger
patch from Erik Hugne <erik.hugne@ericsson.com>]

Cc: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
11 years agotipc: remove TIPC packet debugging functions and macros
Erik Hugne [Fri, 29 Jun 2012 04:50:21 +0000 (00:50 -0400)]
tipc: remove TIPC packet debugging functions and macros

The link queue traces and packet level debug functions served
a purpose during early development, but are now redundant
since there are other, more capable tools available for
debugging at the packet level.

The TIPC_DEBUG Kconfig option is removed since it does not
provide any extra debugging features anymore.

This gets rid of a lot of tipc_printf usages, which will
make the pending cleanup work of that function easier.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
11 years agotipc: use standard printk shortcut macros (pr_err etc.)
Erik Hugne [Fri, 29 Jun 2012 04:16:37 +0000 (00:16 -0400)]
tipc: use standard printk shortcut macros (pr_err etc.)

All messages should go directly to the kernel log.  The TIPC
specific error, warning, info and debug trace macro's are
removed and all references replaced with pr_err, pr_warn,
pr_info and pr_debug.

Commonly used sub-strings are explicitly declared as a const
char to reduce .text size.

Note that this means the debug messages (changed to pr_debug),
are now enabled through dynamic debugging, instead of a TIPC
specific Kconfig option (TIPC_DEBUG).  The latter will be
phased out completely

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
[PG: use pr_fmt as suggested by Joe Perches <joe@perches.com>]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
11 years agoipv4: Don't store a rule pointer in fib_result.
David S. Miller [Fri, 13 Jul 2012 15:21:29 +0000 (08:21 -0700)]
ipv4: Don't store a rule pointer in fib_result.

We only use it to fetch the rule's tclassid, so just store the
tclassid there instead.

This also decreases the size of fib_result by a full 8 bytes on
64-bit.  On 32-bits it's a wash.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotcp: add LAST_ACK as a valid state for TSQ
Eric Dumazet [Thu, 12 Jul 2012 22:46:09 +0000 (22:46 +0000)]
tcp: add LAST_ACK as a valid state for TSQ

Socket state LAST_ACK should allow TSQ to send additional frames,
or else we rely on incoming ACKS or timers to send them.

Reported-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Matt Mathis <mattmathis@google.com>
Cc: Mahesh Bandewar <maheshb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotg3: add device id of Apple Thunderbolt Ethernet device
Greg KH [Thu, 12 Jul 2012 15:39:44 +0000 (15:39 +0000)]
tg3: add device id of Apple Thunderbolt Ethernet device

The Apple Thunderbolt ethernet device is already listed in the driver,
but not hooked up in the MODULE_DEVICE_TABLE().  This fixes that and
allows it to work properly.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Update alloc frag to reduce get/put page usage and recycle pages
Alexander Duyck [Thu, 12 Jul 2012 14:23:50 +0000 (14:23 +0000)]
net: Update alloc frag to reduce get/put page usage and recycle pages

This patch is meant to help improve performance by reducing the number of
locked operations required to allocate a frag on x86 and other platforms.
This is accomplished by using atomic_set operations on the page count
instead of calling get_page and put_page.  It is based on work originally
provided by Eric Dumazet.

In addition it also helps to reduce memory overhead when using TCP.  This
is done by recycling the page if the only holder of the frame is the
netdev_alloc_frag call itself.  This can occur when skb heads are stolen by
either GRO or TCP and the driver providing the packets is using paged frags
to store all of the data for the packets.

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Thu, 12 Jul 2012 17:44:50 +0000 (13:44 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem

11 years agoipv4: Remove tb_peers from fib_table.
David S. Miller [Thu, 12 Jul 2012 16:39:28 +0000 (09:39 -0700)]
ipv4: Remove tb_peers from fib_table.

No longer used.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next
David S. Miller [Thu, 12 Jul 2012 15:18:45 +0000 (08:18 -0700)]
Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next

11 years agobe2net: Enable RSS UDP hashing for Lancer and Skyhawk
Padmanabh Ratnakar [Thu, 12 Jul 2012 03:57:47 +0000 (03:57 +0000)]
be2net: Enable RSS UDP hashing for Lancer and Skyhawk

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Fix port name in message during driver load
Padmanabh Ratnakar [Thu, 12 Jul 2012 03:57:35 +0000 (03:57 +0000)]
be2net: Fix port name in message during driver load

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Fix cleanup path when EQ creation fails
Padmanabh Ratnakar [Thu, 12 Jul 2012 03:57:21 +0000 (03:57 +0000)]
be2net: Fix cleanup path when EQ creation fails

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Activate new FW after FW download for Lancer
Padmanabh Ratnakar [Thu, 12 Jul 2012 03:57:09 +0000 (03:57 +0000)]
be2net: Activate new FW after FW download for Lancer

After FW download, activate new FW by invoking FW reset.
Recreate rings once new FW is operational.

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Fix initialization sequence for Lancer
Padmanabh Ratnakar [Thu, 12 Jul 2012 03:56:58 +0000 (03:56 +0000)]
be2net: Fix initialization sequence for Lancer

Invoke only required initialization routines for Lancer.
Remove invocation of unnecessary routines.

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net : Fix die temperature stat for Lancer
Padmanabh Ratnakar [Thu, 12 Jul 2012 03:56:46 +0000 (03:56 +0000)]
be2net : Fix die temperature stat for Lancer

Query die temperature stat for Lancer to report it correctly
in ethtool.

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Fix error while toggling autoneg of pause parameters
Padmanabh Ratnakar [Thu, 12 Jul 2012 03:56:11 +0000 (03:56 +0000)]
be2net: Fix error while toggling autoneg of pause parameters

Autonegotiation of pause parameters is possible only on some PHYs.
Ability of autoneg of pause parameters is reported by adapter.
Autoneg of pause parameters cannot be changed from driver.
Fix driver to give error when autoneg mode is toggled by user.

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoteam: make team_port_enabled() and team_port_txable() static inline
Jiri Pirko [Wed, 11 Jul 2012 05:34:04 +0000 (05:34 +0000)]
team: make team_port_enabled() and team_port_txable() static inline

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoteam: add broadcast mode
Jiri Pirko [Wed, 11 Jul 2012 05:34:03 +0000 (05:34 +0000)]
team: add broadcast mode

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoteam: use function team_port_txable() for determing enabled and up port
Jiri Pirko [Wed, 11 Jul 2012 05:34:02 +0000 (05:34 +0000)]
team: use function team_port_txable() for determing enabled and up port

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv4: Put proper checks into icmp_socket_deliver().
David S. Miller [Thu, 12 Jul 2012 15:06:04 +0000 (08:06 -0700)]
ipv4: Put proper checks into icmp_socket_deliver().

All handler->err() routines expect that we've done a pskb_may_pull()
test to make sure that IP header length + 8 bytes can be safely
pulled.

Reported-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Thu, 12 Jul 2012 15:00:56 +0000 (08:00 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next

11 years agonet: sched: add ipset ematch
Florian Westphal [Wed, 11 Jul 2012 10:56:57 +0000 (10:56 +0000)]
net: sched: add ipset ematch

Can be used to match packets against netfilter ip sets created via ipset(8).
skb->sk_iif is used as 'incoming interface', skb->dev is 'outgoing interface'.

Since ipset is usually called from netfilter, the ematch
initializes a fake xt_action_param, pulls the ip header into the
linear area and also sets skb->data to the IP header (otherwise
matching Layer 4 set types doesn't work).

Tested-by: Mr Dash Four <mr.dash.four@googlemail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonetxen: fix link notification order
Flavio Leitner [Wed, 11 Jul 2012 08:56:55 +0000 (08:56 +0000)]
netxen: fix link notification order

First update the adapter variables with the current speed and
mode before fire the notification. Otherwise, the get_settings()
may provide old values.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>