Commit Graph

56266 Commits

Author SHA1 Message Date
Steve Glendinning
01a1ac472f smsc95xx: remove unused completion struct
Oliver Neukum spotted the useless complete() in our async callback.  On
closer inspection, the entire completion struct is unused.  This patch
removes it.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-25 17:53:58 -08:00
Jesse Brandeburg
92af3e95e4 e1000e: drop lltx, remove unnecessary lock
LLTX is deprecated and complicated, don't use it.  It was observed by Don Ash
<donash4@gmail.com> that e1000e was acquiring this lock in the NAPI cleanup
path.  This is obviously a bug, as this is a leftover from when e1000
supported multiple tx queues and fake netdevs.

another user reported this to us and tested routing with the 2.6.27 kernel and
this patch and reported a 3.5 % improvement in packets forwarded in a
multi-port test on 82571 parts.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 23:38:12 -08:00
Florian Fainelli
5ef3041e4a au1000: reorder functions
This patch reorders functions so that we do longer need
forward declarations.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 14:06:25 -08:00
Cyrill Gorcunov
e35fac80ed net: pppoe - get rid of DECLARE_MAC_BUF
While was playing with PPP namespaces I occasionally brought
back DECLARE_MAC_BUF which is not needed (we have %pM here).
Fix it.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:52:26 -08:00
Eric W. Biederman
f019a7a594 tun: Implement ip link del tunXXX
This greatly simplifies testing to verify I have fixed the problems
with a tun device disappearing when the tun file descriptor is still
held open.

Further it allows removal network namespace operations for the tun
driver.  Reducing the network namespace handling in the driver to the
minimum.  i.e. When we are creating a tun device.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:02:16 -08:00
Eric W. Biederman
aec191aa2a tun: There is no longer any need to deny changing network namespaces
With the awkward case between free_netdev and dev_chr_close fixed
there is no longer any need to limit tun and tap devices to the
network namespace they were created in.  So remove the
NETIF_F_NETNS_LOCAL flag on the network device.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:47 -08:00
Eric W. Biederman
c70f182940 tun: Fix races between tun_net_close and free_netdev.
The tun code does not cope gracefully if the network device goes away before
the tun file descriptor is closed.  It looks like we can trigger this with
rmmod, and moving tun devices between network namespaces will allow this
to be triggered when network namespaces exit.

To fix this I introduce an intermediate data structure tun_file which
holds a count of users and a pointer to the struct tun_struct.  tun_get
increments that reference count if it is greater than 0.  tun_put decrements
that reference count and detaches from the network device if the count is 0.

While we have a file attached to the network device I hold a reference
to the network device keeping it from going away completely.

When a network device is unregistered I decrement the count of the
attached tun_file and if that was the last user I detach the tun_file,
and all processes on read_wait are woken up to ensure they do not
sleep indefinitely. As some of those sleeps happen with the count on
the tun device elevated waking up the read waiters ensures that
tun_file will be detached in a timely manner.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:46 -08:00
Eric W. Biederman
b2430de37e tun: Move read_wait into tun_file
The poll interface requires that the waitqueue exist while the struct
file is open.  In the rare case when a tun device disappears before
the tun file closes we fail to provide this property, so move
read_wait.

This is safe now that tun_net_xmit is atomic with tun_detach.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:46 -08:00
Eric W. Biederman
38231b7a8d tun: Make tun_net_xmit atomic wrt tun_attach && tun_detach
Currently this small race allows for a packet to be received when we
detach from an tun device and still be enqueued.  Not especially
important but not what the code is trying to do.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:45 -08:00
Eric W. Biederman
36b50bab53 tun: Grab the netns in open.
Grabbing namespaces in open, and putting them in close always seems to
be the cleanest approach with the fewest surprises.

So now that we have tun_file so we have somepleace to put the network
namespace, let's grab the network namespace on file open and put on
file close.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:45 -08:00
Eric W. Biederman
631ab46b79 tun: Introduce tun_file
Currently the tun code suffers from only having a single word of
data that exists for the entire life of the tun file descriptor.

This results in peculiar holding of references to the network namespace
as well as races between free_netdevice and tun_chr_close.

Fix this by introducing tun_file which will hold the per file state.
For the moment it still holds just a single word so the differences
are all logic changes with no changes in semantics.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:44 -08:00
Eric W. Biederman
eac9e90265 tun: Use POLLERR not EBADF in tun_chr_poll
EBADF is meaningless in the context of a poll mask so use POLLERR
instead.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:44 -08:00
Eric W. Biederman
a7385ba211 tun: Fix races in tun_set_iff
It is possible for two different tasks with access to the same file
descriptor to call tun_set_iff on it at the same time and race to
attach to a tap device.  Prevent this by placing all of the logic to
attach to a file descriptor in one function and testing the file
descriptor to be certain it is not already attached to another tun
device.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:43 -08:00
Eric W. Biederman
74a3e5a71c tun: Remove unnecessary tun_get_by_name
Currently the tun driver keeps a private list of tun devices for what
appears to be a small gain in performance when reconnecting a file
descriptor to an existing tun or tap device.  So simplify the code by
removing it.

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 16:00:43 -08:00
Cyrill Gorcunov
f5882c3050 net: pppoe,pppol2tp - register channels with explicit net
In PPPo[E|L2TP] we could explicitly point which net namespace
we're going to use for channels - make it so.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 15:55:40 -08:00
Cyrill Gorcunov
273ec51dd7 net: ppp_generic - introduce net-namespace functionality v2
- Each namespace contains ppp channels and units separately
  with appropriate locks

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 15:55:35 -08:00
Cyrill Gorcunov
4e9fb8016a net: pppol2tp - introduce net-namespace functionality
- Each tunnel and appropriate lock are inside own namespace now.
- pppox code allows to create per-namespace sockets for
  both PX_PROTO_OE and PX_PROTO_OL2TP protocols. Actually since
  now pppox_create support net-namespaces new PPPo... protocols
  (if they ever will be) should support net-namespace too otherwise
  explicit check for &init_net would be needed.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 15:55:15 -08:00
Cyrill Gorcunov
a6bcf1c1d3 net: pppoe - introduce net-namespace functionality
- each net-namespace for pppoe module is having own
  hash table and appropriate locks wich are allocated
  at time of namespace intialization. It requires about
  140 bytes of memory for every new namespace but such
  approach allow us to escape from hash chains growing
  and additional lock contends (especially in SMP environment).

- pppox code allows to create per-namespace sockets for
  PX_PROTO_OE protocol only (since at this moment support
  for pppol2tp net-namespace is not implemented yet).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 15:54:54 -08:00
Cyrill Gorcunov
6aba915881 net: pppoe - code cleanup and helpers
- Introduce PPPOE_HASH_MASK.
- Remove redundant declaration of pppoe_chan_ops.
- Introduce stage_session helper.
- Tabs, space, long-line-split cleanup.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 15:54:15 -08:00
Thomas Klein
e287880622 ehea: Improve driver behaviour in low mem conditions
Reworked receive queue fill policies to make the driver more tolerant
in low memory conditions.

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:45:57 -08:00
Thomas Klein
3faf2693bd ehea: Fix mem allocations which require page alignment
PAGE_SIZE allocations via slab are not guaranteed to be page-aligned. Fixed
all memory allocations where page alignment is required by firmware.

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:45:33 -08:00
Thomas Klein
086c1b2c52 ehea: Use net_device_ops structure
Adapt to lately introduced net_device_ops structure.

Signed-off-by: Thomas Klein <tklein@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:43:59 -08:00
Alexander Duyck
8017943e6b e1000: drop lltx, remove unnecessary lock
LLTX is deprecated, don't use it.  This completes the removal of LLTX from
the Intel Network drivers.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:42:47 -08:00
Alexander Duyck
921aa74912 igb: make certain to power on optics for 82576 fiber nics
It appears that a step was missed in the initialization of 82576 fiber nics
that resulted in it not powering on the optics.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:42:28 -08:00
Alexander Duyck
5851765cca igb: igb should not flag lltx
Igb has flags enabling lltx but this is a holdover from the earlier
e1000 driver which the igb driver was based off of.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:42:07 -08:00
Harvey Harrison
52d07b1f50 bnx2: annotate bp->phy_lock functions
It looks like the locking is OK as the locks were being taken before the
various phy setup functions, add the annotations as they release and
reacquire the phy_lock.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:39:26 -08:00
Herbert Xu
7be2df451f cxgb3: Replace LRO with GRO
This patch makes cxgb3 invoke the GRO hooks instead of LRO.  As
GRO has a compatible external interface to LRO this is a very
straightforward replacement.

I've kept the ioctl controls for per-queue LRO switches.  However,
we should not encourage anyone to use these.

Because of that, I've also kept the skb construction code in
cxgb3.  Hopefully we can phase out those per-queue switches
and then kill this too.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:39:13 -08:00
Roel Kluin
57a574993d phylib: unsigneds go unnoticed
both pdata->mdc and pdata->mdio are unsigned. Notice a negative
return value.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:53 -08:00
Mark McLoughlin
9f4d26d0f3 virtio_net: add link status handling
Allow the host to inform us that the link is down by adding
a VIRTIO_NET_F_STATUS which indicates that device status is
available in virtio_net config.

This is currently useful for simulating link down conditions
(e.g. using proposed qemu 'set_link' monitor command) but
would also be needed if we were to support device assignment
via virtio.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (added future masking)
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:53 -08:00
Vernon Sauder
357fe2c6d2 smc91x: enable ethtool EEPROM interface
Signed-off-by: Vernon Sauder <vsauder@inhand.com>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:52 -08:00
Masakazu Mokuno
31e2b7bd21 PS3: gelic: wireless: convert the wireless part to net_device_ops
Convert the gelic wireless driver to net_device_ops

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:52 -08:00
Masakazu Mokuno
5384e8361a PS3: gelic: convert the ethernet part to net_device_ops
Convert the gelic driver to net_device_ops

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:51 -08:00
Francois Romieu
3d16543d32 tg3: remove extra casting
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:31 -08:00
Herbert Xu
5c0999b72b igb: Replace LRO with GRO
This patch makes igb invoke the GRO hooks instead of LRO.  As
GRO has a compatible external interface to LRO this is a very
straightforward replacement.

Three things of note:

1) I've kept the LRO Kconfig option until we decide to enable
GRO across the board at which point it can also be killed.

2) The poll_controller stuff is broken in igb as it tries to do
the same work as the normal poll routine.  Since poll_controller
can be called in the middle of a poll, this can't be good.

I noticed this because poll_controller can invoke the GRO hooks
without flushing held GRO packets.

However, this should be harmless (assuming the poll_controller
bug above doesn't kill you first :) since the next ->poll will
clear the backlog.  The only time when we'll have a problem is
if we're already executing the GRO code on the same ring, but
that's no worse than what happens now.

3) I kept the ip_summed check before calling GRO so that we're
on par with previous behaviour.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:30 -08:00
Harvey Harrison
649aa95d75 typhoon: replace users of __constant_{endian}
The base versions handle constant folding just fine, use them
directly.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: David Dillow <dave@thedillows.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:08 -08:00
Herbert Xu
da3bc07171 sfc: Replace LRO with GRO
This patch makes sfc invoke the GRO hooks instead of LRO.  As
GRO has a compatible external interface to LRO this is a very
straightforward replacement.

Everything should appear identical to the user except that the
offload is now controlled by the GRO ethtool option instead of
LRO.  I've kept the lro module parameter as is since that's for
compatibility only.

I have eliminated efx_rx_mk_skb as the GRO layer can take care
of all packets regardless of whether GRO is enabled or not.

So the only case where we don't call GRO is if the packet checksum
is absent.  This is to keep the behaviour changes of the patch to
a minimum.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:06 -08:00
Herbert Xu
78b6f4ce58 ixgbe: Replace LRO with GRO
This patch makes ixgbe invoke the GRO hooks instead of LRO.  As
GRO has a compatible external interface to LRO this is a very
straightforward replacement.

As GRO uses the napi structure to track the held packets, I've
modified the code paths involved to pass that along.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:06 -08:00
Divy Le Ray
5cda9364f1 cxgb3: ease msi-x settings conditions
The driver currently drops to line interrupt mode
if it did not get all the msi-x vectors it requested.

Allow msi-x settings when a minimal amount of vectors
is provided.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:03 -08:00
Herbert Xu
c405b82816 e1000e: Invoke VLAN GRO handler
Now that VLAN has GRO support as well, we can call its GRO handler
as well.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:34:03 -08:00
Ben Hutchings
288379f050 net: Remove redundant NAPI functions
Following the removal of the unused struct net_device * parameter from
the NAPI functions named *netif_rx_* in commit 908a7a1, they are
exactly equivalent to the corresponding *napi_* functions and are
therefore redundant.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:33:50 -08:00
Cesar Eduardo Barros
627af770c6 sc92031: add a link to the datasheet
Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:42 -08:00
Cesar Eduardo Barros
5ec99fdf8e sc92031: use device id directly instead of made-up name
Instead of making up a name for the device ids, put them directly in the
device id table. Also move the vendor id to pci_ids.h.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:41 -08:00
Cesar Eduardo Barros
f08d7c36cc sc92031: inline SC92031_DESCRIPTION
SC92031_DESCRIPTION is only used in one place.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:39 -08:00
Cesar Eduardo Barros
3230d2b00e sc92031: remove meaningless version string
The version string makes no sense anymore, since this driver is only
maintained within the kernel.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:38 -08:00
Cesar Eduardo Barros
eb5c8bc144 sc92031: more useful banner in kernel log
The banner currently printed when loading the module is mostly useless.

Replace it with a more informative one, printed after probing the device.

Output format copied from 8139cp/8139too.

Signed-off-by: Cesar Eduardo Barros <cesarb@cesarb.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:38 -08:00
Jan Engelhardt
4101dec9ca net: constify VFTs
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:37 -08:00
Krzysztof Hałasa
991990a12d WAN: Convert generic HDLC drivers to netdev_ops.
Also remove unneeded last_rx update from Synclink drivers.
Synclink part mostly by Stephen Hemminger.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:37 -08:00
Krzysztof Hałasa
dff3fde7be WAN: Allow hw HDLC drivers to override dev->get_stats.
Use the internal get_stats() by default.
Fixes LMC and wanXL drivers.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:36 -08:00
Krzysztof Hałasa
7cdc15f5f9 WAN: Generic HDLC now uses IFF_WAN_HDLC private flag.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:35 -08:00
Inaky Perez-Gonzalez
a962dc2520 wimax/i2400m: convert to net_device_ops
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 14:03:35 -08:00