Commit graph

211132 commits

Author SHA1 Message Date
Rémi Denis-Courmont 4e3d16ce5e Phonet: resource routing backend
When both destination device and object are nul, Phonet routes the
packet according to the resource field. In fact, this is the most
common pattern when sending Phonet "request" packets. In this case,
the packet is delivered to whichever endpoint (socket) has
registered the resource.

This adds a new table so that Linux processes can register their
Phonet sockets to Phonet resources, if they have adequate privileges.

(Namespace support is not implemented at the moment.)

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 21:31:32 -07:00
Rémi Denis-Courmont 6482f554e2 Phonet: remove dangling pipe if an endpoint is closed early
Closing a pipe endpoint is not normally allowed by the Phonet pipe,
other than as a side after-effect of removing the pipe between two
endpoints. But there is no way to prevent Linux userspace processes
from being killed or suffering from bugs, so this can still happen.
We might as well forcefully close Phonet pipe endpoints then.

The cellular modem supports only a few existing pipes at a time. So we
really should not leak them. This change instructs the modem to destroy
the pipe if either of the pipe's endpoint (Linux socket) is closed too
early.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 21:31:31 -07:00
David S. Miller 7fedd7e5df Merge branch 'dccp' of git://eden-feed.erg.abdn.ac.uk/net-next-2.6 2010-09-15 20:21:48 -07:00
Arnd Bergmann 1a19eb753a misdn: kill big kernel lock
The use of the big kernel lock in misdn is completely
bogus, so let's just remove it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 19:29:56 -07:00
Arnd Bergmann 72250d44bc i4l: kill big kernel lock
The isdn4linux driver uses the big kernel lock only
to serialize access to a few fields in its own
modem_info structure.

The easiest replacement is a driver-wide mutex.
More fine-grained locking would be more appropriate
here, but likely harder to implement.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 19:29:55 -07:00
Arnd Bergmann 0a5f1d476a irda/irnet: use noop_llseek
There may be applications trying to seek
on the irnet character device, so we should
use noop_llseek to avoid returning an error
when the default llseek changes to no_llseek.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 19:29:55 -07:00
Eric Dumazet 3a43be3c32 sit: get rid of ipip6_lock
As RTNL is held while doing tunnels inserts and deletes, we can remove
ipip6_lock spinlock. My initial RCU conversion was conservative and
converted the rwlock to spinlock, with no RTNL requirement.

Use appropriate rcu annotations and modern lockdep checks as well.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 19:29:47 -07:00
Eric Dumazet 1507850b40 gre: get rid of ipgre_lock
As RTNL is held while doing tunnels inserts and deletes, we can remove
ipgre_lock spinlock. My initial RCU conversion was conservative and
converted the rwlock to spinlock, with no RTNL requirement.

Use appropriate rcu annotations and modern lockdep checks as well.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 19:29:46 -07:00
Eric Dumazet b7285b7912 ipip: get rid of ipip_lock
As RTNL is held while doing tunnels inserts and deletes, we can remove
ipip_lock spinlock. My initial RCU conversion was conservative and
converted the rwlock to spinlock, with no RTNL requirement.

Use appropriate rcu annotations and modern lockdep checks as well.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 19:29:46 -07:00
Eric Dumazet 7dff59efbb net: add rtnl_dereference()
We sometime want to dereference an rcu protected pointer while
holding RTNL. Use a macro to hide all lockdep details.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 19:29:45 -07:00
Ben Hutchings e0de7c93b9 ethtool: Remove unimplemented flow specification types
struct ethtool_rawip4_spec and struct ethtool_ether_spec are neither
commented nor used by any driver, so remove them.  Adjust padding in
the user-visible unions that included these structures.

Fix references to struct ethtool_rawip4_spec in
ethtool_get_rx_ntuple(), which should use struct ethtool_usrip4_spec.

struct ethtool_usrip4_spec cannot hold IPv6 host addresses and there
is no separate structure that can, so remove ETH_RX_NFC_IP6 and the
reference to it in niu.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 14:42:13 -07:00
Ben Hutchings e035587305 ethtool: Complete kernel-doc comments for RX flow filter and hash control
There are now several interfaces within the ethtool API for getting
and setting RX flow filtering and hashing behaviour, most of which are
poorly documented.  This adds kernel-doc comments for all these
interfaces, based on the existing incomplete comments and on the
initial implementations.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 14:42:13 -07:00
Matt Carlson f833c4c181 tg3: phy tmp variable roundup
The tg3's phy routines define temporary variables in many locations
within the same routine.  This patch unifies all temporary variables
into one location.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 14:16:15 -07:00
Matt Carlson a4a8bb15ae tg3: Dynamically allocate VPD data memory
This patch eases stack pressure by dynamically allocating the memory
used to temporarily store VPD data.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 14:16:15 -07:00
Matt Carlson 02e96080af tg3: Use skb_is_gso_v6()
This patch converts the driver to prefer the skb_is_gso_v6() helper over
the explicit inlined version.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 14:16:14 -07:00
Matt Carlson 8fea32b955 tg3: Move producer ring struct to tg3_napi
Now that each NAPI instance has its own producer ring, it no longer
makes sense to keep the producer ring structure external.  This patch
migrates the producer ring struct to tg3_napi and pivots the code to the
new implementation.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 14:16:13 -07:00
Matt Carlson 6fd45cb814 tg3: Clarify semantics of TG3_IRQ_MAX_VECS
TG3_IRQ_MAX_VECS should be seen as the maximum number of vectors that
any device could be expected to use.  tp->irq_max represents the maximum
number of vectors the current device can use.  This patch clarifies the
semantics of the code to match the above description.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 14:16:13 -07:00
Matt Carlson 2e9f7a7408 tg3: Unlock 5717 B0+ support
This patch adjusts the driver to use the tg3_start_xmit_dma_bug()
transmit routine for all revisions of 5717 asic rev devices and then
allows the driver to attach to B0 and later devices.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 14:16:12 -07:00
Matt Carlson dc6d074457 tg3: Don't send APE events for NCSI firmware
NCSI firmware does not accept APE events.  It relies on a "driver state"
location in shared memory to tell it what the driver's current state is.

This patch pivots the code to use the new driver state scheme.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 14:16:12 -07:00
Matt Carlson f0392d2448 tg3: Disable TSS
It was recently discovered that enabling TSS can lockup the device.
This patch disables the feature until a suitable workaround can be
found.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 14:16:11 -07:00
Matt Carlson 41a8a7ee4a tg3: Fix read DMA FIFO overruns on recent devices
Earlier versions of tg3 devices had a problem where the read DMA FIFO
could be overrun in certain edge conditions.  The fix was to limit the
number of rx BDs the hardware would fetch at a time.  For later devices
(5761, 5784 and later ASIC revs), there is a hardware fix that must be
enabled to fix the same problem.  This patch adds that hardware fix.

There is a gap in the ASIC revision lineage where neither fix is
applied.  This is intentional as these ASIC revisions are not afflicted
by the bug.

Reviewed-by: Benjamin Li <benli@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-15 14:16:10 -07:00
Gerrit Renker 37efb03fbd dccp ccid-3: Simplify and consolidate tx_parse_options
This simplifies and consolidates the TX option-parsing code:

 1. The Loss Intervals option is not currently used, so dead code related to
    this option is removed. I am aware of no plans to support the option, but
    if someone wants to implement it (e.g. for inter-op tests), it is better
    to start afresh than having to also update currently unused code.

 2. The Loss Event and Receive Rate options have a lot of code in common (both
    are 32 bit, both have same length etc.), so this is consolidated.

 3. The test against GSR is not necessary, because
    - on first loading CCID3, ccid_new() zeroes out all fields in the socket;
    - ccid3_hc_tx_packet_recv() treats 0 and ~0U equivalently, due to

	pinv = opt_recv->ccid3or_loss_event_rate;
	if (pinv == ~0U || pinv == 0)
		hctx->p = 0;

    - as a result, the sequence number field is removed from opt_recv.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
2010-09-15 12:36:02 +02:00
Gerrit Renker d2c726309d dccp ccid-3: remove buggy RTT-sampling history lookup
This removes the RTT-sampling function tfrc_tx_hist_rtt(), since

 1. it suffered from complex passing of return values (the return value both
    indicated successful lookup while the value doubled as RTT sample);

 2. when for some odd reason the sample value equalled 0, this triggered a bug
    warning about "bogus Ack", due to the ambiguity of the return value;

 3. on a passive host which has not sent anything the TX history is empty and
    thus will lead to unwanted "bogus Ack" warnings such as
    ccid3_hc_tx_packet_recv: server(e7b7d518): DATAACK with bogus ACK-28197148
    ccid3_hc_tx_packet_recv: server(e7b7d518): DATAACK with bogus ACK-26641606.

The fix is to replace the implicit encoding by performing the steps manually.

Furthermore, the "bogus Ack" warning has been removed, since it can actually be
triggered due to several reasons (network reordering, old packet, (3) above),
hence it is not very useful.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
2010-09-15 12:36:02 +02:00
Gerrit Renker 20cbd3e120 dccp ccid-3: A lower bound for the inter-packet scheduling algorithm
This fixes a subtle bug in the calculation of the inter-packet gap and shows
that t_delta, as it is currently used, is not needed.

The algorithm from RFC 5348, 8.3 below continually computes a send time t_nom,
which is initialised with the current time t_now; t_gran = 1E6 / HZ specifies
the scheduling granularity, s the packet size, and X the sending rate:

  t_distance = t_nom - t_now;		// in microseconds
  t_delta    = min(t_ipi, t_gran) / 2;	// `delta' parameter in microseconds

  if (t_distance >= t_delta) {
	reschedule after (t_distance / 1000) milliseconds;
  } else {
  	t_ipi  = s / X;			// inter-packet interval in usec
	t_nom += t_ipi;			// compute the next send time
	send packet now;
  }

Problem:
--------
Rescheduling requires a conversion into milliseconds (sk_reset_timer()). The
highest jiffy resolution with HZ=1000 is 1 millisecond, so using a higher
granularity does not make much sense here.

As a consequence, values of t_distance < 1000 are truncated to 0. This issue
has so far been resolved by using instead

  if (t_distance >= t_delta + 1000)
	reschedule after (t_distance / 1000) milliseconds;

This is unnecessarily large, a lower bound is t_delta' = max(t_delta, 1000).
And it implies a further simplification:

 a) when HZ >= 500, then t_delta <= t_gran/2 = 10^6/(2*HZ) <= 1000, so that
    t_delta' = MAX(1000, t_delta) = 1000 (constant value);

 b) when HZ < 500, then t_delta = 1/2*MIN(rtt, t_ipi, t_gran) <= t_gran/2,
    so that 1000 <= t_delta' <= t_gran/2.

The maximum error of using a constant t_delta in (b) is less than half a jiffy.

Fix:
----
The patch replaces t_delta with a constant, whose value depends on CONFIG_HZ,
changing the above algorithm to:

  if (t_distance >= t_delta')
	reschedule after (t_distance / 1000) milliseconds;

where t_delta' = 10^6/(2*HZ) if HZ < 500, and t_delta' = 1000 otherwise.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
2010-09-15 12:36:01 +02:00
andrew hendry 21a4591794 X.25 remove bkl in connect
Connect already has socket locking.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-14 20:39:09 -07:00
Andrew Hendry 141646ce56 X.25 remove bkl in accept
Accept already has socket locking.

[ Extend socket locking over TCP_LISTEN state test. -DaveM ]

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-14 20:38:54 -07:00
andrew hendry 90c27297a9 X.25 remove bkl in bind
Accept updates socket values in 3 lines so wrapped with lock_sock.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-14 20:34:52 -07:00
andrew hendry 25aa4efe4f X.25 remove bkl in listen
Listen updates socket values and needs lock_sock.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-14 20:34:52 -07:00
Joe Perches 55b1804c67 net/irda: Use static const char * const where possible
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-14 20:22:05 -07:00
Joe Perches 030bda0d41 drivers/net/wireless: Use static const char * const where possible
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-14 20:22:04 -07:00
Joe Perches 99101d3d89 drivers/net/pcmcia: Use static const char * const where possible
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-14 20:22:03 -07:00
Joe Perches 6fa59c9da8 drivers/net: Use static const char * const where possible
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-14 20:22:03 -07:00
Joe Perches 6f68ad7fbb drivers/isdn: Use static const char * const where possible
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-14 20:22:02 -07:00
Jean Delvare 068e8a3032 e1000e: Simplify MSI interrupt testing
The code is quite convoluted, simplify it. This also avoids calling
e1000_request_irq() without testing the value it returned, which was
bad.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Bruce Allan <bruce.w.allan@intel.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-14 14:29:37 -07:00
Andy Shevchenko bc0ed0be10 uwb: use '%pM' format to print MAC address
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-13 20:02:54 -07:00
Dmitry Kravkov 2514158083 bnx2x: Spread rx buffers between allocated queues
Default number of rx buffers will be divided equally
 between allocated queues. This will decrease amount of
 pre-allocated buffers on systems with multiple CPUs.
 User can override this behavior with ethtool -G.
 Minimum amount of rx buffers per queue set to 128.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>

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>
2010-09-13 20:02:53 -07:00
Ondrej Zary 441993da47 cx82310_eth: allow empty URBs
Empty received URBs are currently counted as errors but the device sends them
sometimes as part of regular traffic - so remove this check.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-13 20:02:53 -07:00
Ondrej Zary 7dbfdc2390 cx82310_eth: check usb_string() return value for error
Fix that usb_string() return value is not checked for error (negative value).
Also change the ignore message a bit and lower its level to info.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-13 20:02:52 -07:00
Joe Perches d81e27cf4e drivers/net/skfp: Remove pr_<level> uses of KERN_<level>
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-13 20:02:52 -07:00
Andreas Schwab 70ce679be6 net/cxgb3: remove undefined operations
Modifying an object twice without an intervening sequence point is
undefined.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-13 20:02:51 -07:00
Andreas Schwab 1570475a47 net/de4x5: remove undefined operations
Modifying an object twice without an intervening sequence point is
undefined.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-13 20:02:51 -07:00
Denis Kirjanov 61a21455ee sundance: Add power management hooks
This patch to adds support for PM hooks into sundance driver

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-13 20:02:50 -07:00
Eric Dumazet 83b6b1f5d1 flow: better memory management
Allocate hash tables for every online cpus, not every possible ones.

NUMA aware allocations.

Dont use a full page on arches where PAGE_SIZE > 1024*sizeof(void *)

misc:
  __percpu , __read_mostly, __cpuinit annotations
  flow_compare_t is just an "unsigned long"

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-13 20:02:50 -07:00
Ben Hutchings efbc2d7cfa sfc: Fix order of channel_name array dimensions
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-13 19:55:22 -07:00
David S. Miller 0ea05ce7fd bna: Check for NULL before deref in bnad_cb_tx_cleanup
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-12 12:06:00 -07:00
stephen hemminger 9ca7f87622 pkt_sched: remov unnecessary bh_disable
Now that est_tree_lock is acquired with BH protection, the other
call is unnecessary.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-10 12:47:59 -07:00
Eric Dumazet a034ee3cca fib: cleanups
Use rcu_dereference_rtnl() helper

Change hard coded constants in fib_flag_trans()
 7 -> RTN_UNREACHABLE
 8 -> RTN_PROHIBIT

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-10 12:32:02 -07:00
Ben Hutchings 4642610c77 sfc: Allow changing the DMA ring sizes dynamically via ethtool
This requires some reorganisation of channel setup and teardown to
ensure that we can always roll-back a failed change.

Based on work by Steve Hodgson <shodgson@solarflare.com>

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-10 12:27:34 -07:00
Steve Hodgson ecc910f520 sfc: Make the dmaq size a run-time setting (rather than compile-time)
- Allow the ring size to be specified in non
   power-of-two sizes (for instance to limit
   the amount of receive buffers).
 - Automatically size the event queue.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-10 12:27:33 -07:00
Ben Hutchings 8313aca38b sfc: Allocate each channel separately, along with its RX and TX queues
This will allow for reallocation of channel structures and rings.

Change module parameter separate_tx_channels to be read-only, since we
now require its value to be constant.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-10 12:27:33 -07:00