GitHub/LineageOS/android_kernel_samsung_universal7580.git
16 years agoixgb: convert uint16_t style integers to u16
Joe Perches [Thu, 3 Apr 2008 17:06:25 +0000 (10:06 -0700)]
ixgb: convert uint16_t style integers to u16

Conglomerate of 4 separate patches by Joe.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosb1000.c: make const arrays static
Denys Vlasenko [Sun, 30 Mar 2008 23:13:00 +0000 (01:13 +0200)]
sb1000.c: make const arrays static

This patch replaces automatic constant arrays a-la

    const unsigned char Command0[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00};

with static ones. Size difference for 32bit x86:

text  data   bss     dec     hex filename
5418   129     0    5547    15ab linux-2.6.inline-ALLYES/drivers/net/sb1000.o
5396   129     0    5525    1595 linux-2.6.followup-ALLYES/drivers/net/sb1000.o

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosb1000.c: stop inlining largish static functions
Denys Vlasenko [Sun, 30 Mar 2008 23:02:43 +0000 (01:02 +0200)]
sb1000.c: stop inlining largish static functions

drivers/net/sb1000.c has lots of inlined static functions.

Mst of them are used at initialization, wait for some
hardware register to change (wait using yield, sleep etc),
or do slow port-based I/O. Inlining thse "for speed" makes no sense.

This patch removes "inline" from biggest static function
(regardless of number of callsites - gcc nowadays auto-inlines
statics with one callsite).

Size difference for 32bit x86:

text   data    bss    dec    hex filename
6299    129      0   6428   191c linux-2.6-ALLYES/drivers/net/sb1000.o
5418    129      0   5547   15ab linux-2.6.inline-ALLYES/drivers/net/sb1000.o

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago#if 0 netxen_nic_link_ok()
Adrian Bunk [Sun, 30 Mar 2008 23:22:14 +0000 (02:22 +0300)]
#if 0 netxen_nic_link_ok()

This patch #if 0's the no longer used netxen_nic_link_ok().

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomake netxen_workq static
Adrian Bunk [Sun, 30 Mar 2008 23:22:18 +0000 (02:22 +0300)]
make netxen_workq static

netxen_workq can now become static.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoqeth: keep ip-address after LAN_OFFLINE failure
Ursula Braun [Tue, 1 Apr 2008 08:27:00 +0000 (10:27 +0200)]
qeth: keep ip-address after LAN_OFFLINE failure

Problem:     If setting of an ip-address fails with LAN_OFFLINE,
             qeth does not save the ip-address in its internal
             list of set ip-addresses. qeth recovers after a
             following STARTLAN event, but cannot set the unsaved
             ip-address.
Solution:    save the ip-address in the qeth-maintained list of
             ip-addresses after a LAN_OFFLINE failure for SETIP.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoqeth: core code should alloc headroom for LLC protocol
Frank Blaschka [Tue, 1 Apr 2008 08:26:59 +0000 (10:26 +0200)]
qeth: core code should alloc headroom for LLC protocol

Allocate headroom for TR_HLEN but using only ETH_HLEN causes rx
performance degradation. Allocate ETH_HLEN for ethernet and
TR_HLEN for token ring (layer 3 mode).

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoqeth: improving debug message handling
Peter Tiedemann [Tue, 1 Apr 2008 08:26:58 +0000 (10:26 +0200)]
qeth: improving debug message handling

Improving debug message handling, moving ipa into messages from kernel
to dbf, some cleanups and typo fixes.

Signed-off-by: Peter Tiedemann <ptiedem@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoqeth: layer 3 do not allow to change mac address
Frank Blaschka [Tue, 1 Apr 2008 08:26:57 +0000 (10:26 +0200)]
qeth: layer 3 do not allow to change mac address

hw does not allow to change the mac address.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoqeth: CCL-sequence numbers required for protocol ETH_P_802_2 only
Ursula Braun [Tue, 1 Apr 2008 08:26:56 +0000 (10:26 +0200)]
qeth: CCL-sequence numbers required for protocol ETH_P_802_2 only

Symptom:     slow CCL response time
Problem:     non-ETH_P_802_2 packets are not delivered to NDH for
             CCL. But CCL detects missing sequence numbers, which
             cause a serious performance problem with CCL.
Solution:    assign sequence numbers only to 802.2 packets.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoqeth: set lan_online flag after a received STARTLAN
Ursula Braun [Tue, 1 Apr 2008 08:26:55 +0000 (10:26 +0200)]
qeth: set lan_online flag after a received STARTLAN

Problem:     A STARTLAN command from the adapter may arrive while a
             qeth recovery is currently running with a failed qeth
             STARTLAN. Usually qeth schedules a recovery when
             receiving a STARTLAN command from the adapter. But
             another recovery scheduled while a recovery is already
             running never starts. Thus the qeth-administered
             lan_online flag remains zero in this scenario, even
             though the adapter-STARTLAN has happened.
Solution:    Set lan_online flag for a received STARTLAN from the
             adapter in case scheduled recovery does not start.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoqeth: allow qdio queue element addresses > 2GB
Ursula Braun [Tue, 1 Apr 2008 08:26:54 +0000 (10:26 +0200)]
qeth: allow qdio queue element addresses > 2GB

OSA-adapters do not have an address limitation for the qdio queue
structures except the MAX storage level of the current processor.
And due to a recent z/VM APAR there is no longer a restriction to
allocate qdio structures below 2 GB.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoqeth: improve ip_list administration after deregister failures
Ursula Braun [Tue, 1 Apr 2008 08:26:53 +0000 (10:26 +0200)]
qeth: improve ip_list administration after deregister failures

1. ip_list handling after deregister failure of multicast address:
   If error code "MC Address not found" is returned do not re-add
   multicast address to ip_list.
   For other error codes readd multicast address at the end of
   function qeth_delete_all_mc.
2. ip_list handling after deregister failure or normal ip address:
   If error code "IP Address not found" is returned do not re-add
   multicast address to ip list.
   This is especially important in IP address takeover scenarios,
   to enable re-takeover of a taken over IP address.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoe1000e: reformat register test code, fix some minor initialization
Bruce Allan [Wed, 2 Apr 2008 20:48:23 +0000 (13:48 -0700)]
e1000e: reformat register test code, fix some minor initialization

The register tests should be run with all the proper flags enabled
to maximize the test coverage code and make sure we are as close
as we can get to testing regular traffic.

Reformat the code for readability. Minor cleanups in the descriptor
ring setup.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoe1000e: rename a few functions
Jeff Kirsher [Wed, 2 Apr 2008 20:48:18 +0000 (13:48 -0700)]
e1000e: rename a few functions

Several minor cosmetic function renames.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoe1000e: Make arrays out of these Rx/Tx registers
Jeff Kirsher [Wed, 2 Apr 2008 20:48:13 +0000 (13:48 -0700)]
e1000e: Make arrays out of these Rx/Tx registers

With multiple queues coming into the code these base control
registers need to be made into arrays.

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agoe1000e: limit EEPROM size accesses
Jeff Kirsher [Wed, 2 Apr 2008 20:48:07 +0000 (13:48 -0700)]
e1000e: limit EEPROM size accesses

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosc92031: use netdev_alloc_skb
Stephen Hemminger [Wed, 2 Apr 2008 17:13:12 +0000 (10:13 -0700)]
sc92031: use netdev_alloc_skb

Use netdev_alloc_skb since it handles any NUMA node memory localtion issues
and sets skb->dev. Since device driver was not setting skb->dev, I bet
filter rules based on device would not work.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosc92031: start transmit return value bugfix
Stephen Hemminger [Wed, 2 Apr 2008 17:11:11 +0000 (10:11 -0700)]
sc92031: start transmit return value bugfix

Any negative return value from start_xmit is interpreted as NETDEV_TX_LOCK
which is not what this driver wants. It should return 0 (NETDEV_TX_OK)
when it consumes a packet.

Also, use skb_padto() as the generic way to pad small frames.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agosc92031: use net_device stats
Stephen Hemminger [Wed, 2 Apr 2008 17:11:20 +0000 (10:11 -0700)]
sc92031: use net_device stats

Statistics structure is available for use in net_device structure.
Compile tested only.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[netdrvr] tulip: Better MWI workaround for 21143 rev 65 chip errata
Peter Horton [Tue, 25 Mar 2008 11:39:09 +0000 (12:39 +0100)]
[netdrvr] tulip: Better MWI workaround for 21143 rev 65 chip errata

This patch works around the MWI bug on the DC21143 rev 65 Tulip by
ensuring that the receive buffers don't end on a cache line boundary
(as documented in the errata).

This patch is required for the MIPS based Cobalt Qube/RaQ as
supporting the extra PCI commands seems to reduce the chance of a hard
lockup between the Tulip and the PCI bridge.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years ago[netdrvr] tulip/winbond-840: don't let tulip.h symbol stomp ours
Jeff Garzik [Thu, 17 Apr 2008 00:37:24 +0000 (20:37 -0400)]
[netdrvr] tulip/winbond-840: don't let tulip.h symbol stomp ours

winbond-840 shares tulip.h with the tulip driver, because they share
many (but not all) of the same register definitions.

This is useful for the register definitions, but not helpful when it
comes to symbols that are shared among the tulip driver's C modules,
but not meant to be shared outside that one driver.

Thus, PKT_BUF_SZ is a symbol internal to tulip, but it was intruding
upon a similar symbol in winbond-840's namespace.  This was not a
problem as long as the two symbols had the same value, but upcoming
patches result in differing symbol values.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agodrivers/net/bonding/bond_main.c - remove unnecessary #define
Joe Perches [Thu, 10 Apr 2008 21:39:30 +0000 (14:39 -0700)]
drivers/net/bonding/bond_main.c - remove unnecessary #define

bond_main.c already #includes <linux/seq_file.h>

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agophy: Clean up header style
Andy Fleming [Thu, 10 Apr 2008 00:38:27 +0000 (19:38 -0500)]
phy: Clean up header style

Multi-line comments weren't all CodingStyle compliant

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agophy: Change mii_bus id field to a string
Andy Fleming [Thu, 10 Apr 2008 00:38:13 +0000 (19:38 -0500)]
phy: Change mii_bus id field to a string

Having the id field be an int was making more complex bus topologies
excessively difficult.  For now, just convert it to a string, and
change all instances of "bus->id = val" to
snprintf(id, MII_BUS_ID_LEN, "%x", val).

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agogianfar: Support NAPI for TX Frames
Dai Haruki [Thu, 10 Apr 2008 00:37:51 +0000 (19:37 -0500)]
gianfar: Support NAPI for TX Frames

Poll the completed TX frames in gfar_poll().  This prevents the tx
completion interrupt from interfering with processing of received
frames.

We also disable hardware rx coalescing when NAPI is enabled.

Signed-off-by: Dai Haruki <dai.haruki@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agospidernet: revise link status logging
Ishizaki Kou [Fri, 11 Apr 2008 03:33:53 +0000 (12:33 +0900)]
spidernet: revise link status logging

This patch revises the logging for link informations of spidernet.

  - The link down message is too verbose because auto-negotiation timeout
    occurs periodically while an ethernet cable is not connected.
  - We want to see the link result, and we think it should be displayed.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Acked-by: Jens Osterkamp <jens@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agospidernet: fix error interrupt handling
Ishizaki Kou [Fri, 11 Apr 2008 03:32:30 +0000 (12:32 +0900)]
spidernet: fix error interrupt handling

In addition to the value of GHIINT0STS, spidernet interrupt handler
should check the values of GHIINT1STS/GHIINT2STS registers at the
beginning of spider_net_interrupt() so as not to drop error
interrupts.

GHIINT1STS/GHIINT2STS registers indicates some of erroneous conditions
in spidernet, and a few bits of GHIINT0STS register reflects these
conditions. But GHIINT0MSK masks these bits, so you should check these
conditions by reading GHIINT1STS/GHIINT2STS registers directly.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Acked-by: Jens Osterkamp <jens@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agospidernet: change interrupt masks
Ishizaki Kou [Fri, 11 Apr 2008 03:30:46 +0000 (12:30 +0900)]
spidernet: change interrupt masks

This patch changes spidernet interrupt masks.

 - unmask GDAINVAINT. There is an operation to do by spidernet
   interrupt handler.
 - mask some interrupts. There are no operations in the interrupt handler.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Acked-by: Jens Osterkamp <jens@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agospidernet: increase auto-negotiation timeout to 5 seconds
Ishizaki Kou [Fri, 11 Apr 2008 03:29:20 +0000 (12:29 +0900)]
spidernet: increase auto-negotiation timeout to 5 seconds

This patch extends the timeout for spidernet auto-negotiation.
Auto-negotiation often fails to finish in 2 seconds.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Acked-by: Jens Osterkamp <jens@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agospidernet: add missing initialization
Ishizaki Kou [Fri, 11 Apr 2008 03:27:34 +0000 (12:27 +0900)]
spidernet: add missing initialization

This patch fixes initialization of "aneg_count" and "medium" fields in
spider_net_card to make spidernet driver correctly sets "link status".

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Acked-by: Jens Osterkamp <jens@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agotc35815: Whitespace cleanup
Atsushi Nemoto [Thu, 10 Apr 2008 15:25:31 +0000 (00:25 +0900)]
tc35815: Whitespace cleanup

Cosmetic TAB/whitespace cleanups and some style cleanups.  No
functional changes.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agotc35815: Use generic PHY layer
Atsushi Nemoto [Fri, 11 Apr 2008 15:47:46 +0000 (00:47 +0900)]
tc35815: Use generic PHY layer

Convert the tc35815 driver to use the generic PHY layer in
drivers/net/phy.  Also rename 'boardtype' to 'chiptype' which hould be
more appropriate.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agotc35815: Use managed pci iomap helper
Atsushi Nemoto [Thu, 10 Apr 2008 15:24:45 +0000 (00:24 +0900)]
tc35815: Use managed pci iomap helper

Use managed pci functions and kill unnecessary volatiles.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agotc35815: Use netdev_priv()
Atsushi Nemoto [Thu, 10 Apr 2008 15:24:36 +0000 (00:24 +0900)]
tc35815: Use netdev_priv()

Use netdev_priv() instead of dev->priv.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agotc35815: Use print_mac() helper
Atsushi Nemoto [Thu, 10 Apr 2008 15:24:24 +0000 (00:24 +0900)]
tc35815: Use print_mac() helper

Use print_mac() and DECLARE_MAC_BUF().

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agotc35815: Statistics cleanup
Atsushi Nemoto [Thu, 10 Apr 2008 15:24:12 +0000 (00:24 +0900)]
tc35815: Statistics cleanup

Use struct net_device_stats embedded in struct net_device.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
16 years agomv643xx_eth: update copyright
Lennert Buytenhek [Tue, 18 Mar 2008 18:40:14 +0000 (11:40 -0700)]
mv643xx_eth: update copyright

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Reviewed-by: Tzachi Perelstein <tzachi@marvell.com>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
16 years agomv643xx_eth: only print banner once
Lennert Buytenhek [Tue, 18 Mar 2008 18:39:14 +0000 (11:39 -0700)]
mv643xx_eth: only print banner once

When there are multiple mv643xx_eth silicon blocks in the system,
don't print an initialisation message for each and every one of
them.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Reviewed-by: Tzachi Perelstein <tzachi@marvell.com>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
16 years agomv643xx_eth: pass port identifier to register accessors
Lennert Buytenhek [Tue, 18 Mar 2008 18:38:05 +0000 (11:38 -0700)]
mv643xx_eth: pass port identifier to register accessors

Pass a struct mv643xx_private * to the register accessor functions,
as a preparation for having multiple mv643xx_eth silicon blocks.

(Since this causes some 80 column straddling, and the mv_ prefix
is useless anyway, rename mv_read to rdl and mv_write to wrl to
compensate.)

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Reviewed-by: Tzachi Perelstein <tzachi@marvell.com>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
16 years agomv643xx_eth: report netdev name in all printks
Lennert Buytenhek [Tue, 18 Mar 2008 18:37:19 +0000 (11:37 -0700)]
mv643xx_eth: report netdev name in all printks

In error and warning printks, always report the netdevice name
instead of the port index (the latter has no meaning when there
are multiple mv643xx_eth silicon blocks in the system.)

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Reviewed-by: Tzachi Perelstein <tzachi@marvell.com>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
16 years agomv643xx_eth: identify ports by struct mv643xx_private *
Lennert Buytenhek [Tue, 18 Mar 2008 18:36:08 +0000 (11:36 -0700)]
mv643xx_eth: identify ports by struct mv643xx_private *

Instead of identifying individual mv643xx ethernet ports by only
their port number, identify them by their struct mv643xx_private *,
as just a port number has no meaning when there are multiple
mv643xx_eth silicon blocks in the system.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Reviewed-by: Tzachi Perelstein <tzachi@marvell.com>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
16 years agomv643xx_eth: various cleanups
Lennert Buytenhek [Tue, 18 Mar 2008 18:34:34 +0000 (11:34 -0700)]
mv643xx_eth: various cleanups

- Remove unused MV643XX_DEFAULT_[RT]X_QUEUE_SIZE definitions.
- Remove ETH_TARGET enum -- it isn't used anywhere in the driver,
  and isn't even valid for non-mv643xx chip models, as those use
  different MBUS target IDs.
- Clean up comment and control flow in mv643xx_eth_change_mtu().
- Use mp->dev instead of mp->mii.dev in mv643xx_eth_tx_timeout_task().
- Make mv643xx_eth_free_tx_descs() static.
- Remove overzealous NULL check in mv643xx_eth_start_xmit().
- Use symbolic NETDEV_TX_* constants in mv643xx_eth_start_xmit().

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Reviewed-by: Tzachi Perelstein <tzachi@marvell.com>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
16 years agomv643xx_eth: mp->tx_desc_count needs spinlock protection
Lennert Buytenhek [Tue, 18 Mar 2008 18:32:41 +0000 (11:32 -0700)]
mv643xx_eth: mp->tx_desc_count needs spinlock protection

mv643xx_eth_start_xmit() should check mp->tx_desc_count only
inside the mp->lock spinlock.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Reviewed-by: Tzachi Perelstein <tzachi@marvell.com>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
16 years ago[TCP]: Increase the max_burst threshold from 3 to tp->reordering.
John Heffner [Tue, 15 Apr 2008 22:26:39 +0000 (15:26 -0700)]
[TCP]: Increase the max_burst threshold from 3 to tp->reordering.

This change is necessary to allow cwnd to grow during persistent
reordering.  Cwnd moderation is applied when in the disorder state
and an ack that fills the hole comes in.  If the hole was greater
than 3 packets, but less than tp->reordering, cwnd will shrink when
it should not have.

Signed-off-by: John Heffner <jheffner@napa.(none)>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NET]: Do not allocate unneeded memory for dev->priv alignment.
Pavel Emelyanov [Wed, 16 Apr 2008 09:17:42 +0000 (02:17 -0700)]
[NET]: Do not allocate unneeded memory for dev->priv alignment.

The alloc_netdev_mq() tries to produce 32-bytes alignment for both
the net_device itself and its private data. The second alignment is
achieved by adding the NETDEV_ALIGN_CONST to the whole size of
the memory to be allocated.

However, for those devices that do not need the private area, this
addition just makes the net_device weight 1024 + 32 = 1068 bytes,
i.e. consume twice as much memory.

Since loopback device is such (sizeof_priv == 0 for it), and each
net namespace creates one, this can save a noticeable amount of
memory for kernel with net namespaces turned on.

After this set the lo device is actually allocated from a size-1024
kmem cache on i386 box even with NETPOLL and WIRELESS_EXT turned on.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug for network devices.
Denis V. Lunev [Wed, 16 Apr 2008 09:02:18 +0000 (02:02 -0700)]
[NETNS]: Add netns refcnt debug for network devices.

dev_set_net is called for
- just allocated devices
- devices moving from one namespace to another
release_net has proper check inside to distinguish these cases.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug to fib rules.
Denis V. Lunev [Wed, 16 Apr 2008 09:01:56 +0000 (02:01 -0700)]
[NETNS]: Add netns refcnt debug to fib rules.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug for dst ops.
Denis V. Lunev [Wed, 16 Apr 2008 09:01:34 +0000 (02:01 -0700)]
[NETNS]: Add netns refcnt debug for dst ops.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug for inet bind buckets.
Denis V. Lunev [Wed, 16 Apr 2008 09:01:11 +0000 (02:01 -0700)]
[NETNS]: Add netns refcnt debug for inet bind buckets.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug into fib_info.
Denis V. Lunev [Wed, 16 Apr 2008 09:00:50 +0000 (02:00 -0700)]
[NETNS]: Add netns refcnt debug into fib_info.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug for timewait buckets.
Denis V. Lunev [Wed, 16 Apr 2008 09:00:28 +0000 (02:00 -0700)]
[NETNS]: Add netns refcnt debug for timewait buckets.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Add netns refcnt debug for kernel sockets.
Denis V. Lunev [Wed, 16 Apr 2008 08:59:46 +0000 (01:59 -0700)]
[NETNS]: Add netns refcnt debug for kernel sockets.

Protocol control sockets and netlink kernel sockets should not prevent the
namespace stop request. They are initialized and disposed in a special way by
sk_change_net/sk_release_kernel.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[NETNS]: Make netns refconting debug like a socket one.
Denis V. Lunev [Wed, 16 Apr 2008 08:58:04 +0000 (01:58 -0700)]
[NETNS]: Make netns refconting debug like a socket one.

Make release_net/hold_net noop for performance-hungry people. This is a debug
staff and should be used in the debug mode only.

Add check for net != NULL in hold/release calls. This will be required
later on.

[ Added minor simplifications suggested by Brian Haley. -DaveM ]

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Allow to create IP6 tunnels in net namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:24:13 +0000 (01:24 -0700)]
[IP6TUNNEL]: Allow to create IP6 tunnels in net namespaces.

And no need in some IPPROTO_XXX enabling, since ipv6 code
doesn't have any filtering.

So, just set proper net and mark device with NETNS_LOCAL.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Use proper net instead of init_net stubs.
Pavel Emelyanov [Wed, 16 Apr 2008 08:23:44 +0000 (01:23 -0700)]
[IP6TUNNEL]: Use proper net instead of init_net stubs.

All the ip_route_output_key(), dev_get_by_...() and ipv6_chk_addr()
calls are now stubbed with init_net.

Fortunately, all the places already have where to get the proper
net from.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Make tunnels hashes per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:23:22 +0000 (01:23 -0700)]
[IP6TUNNEL]: Make tunnels hashes per-net.

Move hashes in the struct ip6_tnl_net, replace tnls_xxx[] with
ip6n->tnlx_xxx[] and handle init and exit appropriately.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Make the fallback tunnel device per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:23:02 +0000 (01:23 -0700)]
[IP6TUNNEL]: Make the fallback tunnel device per-net.

All the code, that reference it already has the ip6_tnl_net pointer,
so s/ip6_fb_tnl_dev/ip6n->fb_tnl_dev/ and move creation/releasing
code into net init/exit ops.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Use proper net in hash-lookup functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:22:43 +0000 (01:22 -0700)]
[IP6TUNNEL]: Use proper net in hash-lookup functions.

Calls to ip6_tnl_lookup were stubbed with init_net - give them
a proper one.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Add (ip6_tnl_)net argument to some calls.
Pavel Emelyanov [Wed, 16 Apr 2008 08:22:23 +0000 (01:22 -0700)]
[IP6TUNNEL]: Add (ip6_tnl_)net argument to some calls.

Hashes and fallback device used in them will be per-net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IP6TUNNEL]: Introduce empty ip6_tnl_net structure and net ops.
Pavel Emelyanov [Wed, 16 Apr 2008 08:22:02 +0000 (01:22 -0700)]
[IP6TUNNEL]: Introduce empty ip6_tnl_net structure and net ops.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Allow for IPPROTO_IPV6 protocol in namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:17:39 +0000 (01:17 -0700)]
[SIT]: Allow for IPPROTO_IPV6 protocol in namespaces.

This makes sit-generated traffic enter the namespace.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Allow to create SIT tunnels in net namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:17:18 +0000 (01:17 -0700)]
[SIT]: Allow to create SIT tunnels in net namespaces.

Set proper net and mark a new device as NETNS_LOCAL before registering.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Use proper net in routing calls.
Pavel Emelyanov [Wed, 16 Apr 2008 08:16:58 +0000 (01:16 -0700)]
[SIT]: Use proper net in routing calls.

I.e. replace init_net stubs in ip_route_output_key() calls.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Make tunnels hashes per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:16:38 +0000 (01:16 -0700)]
[SIT]: Make tunnels hashes per-net.

Just move all the hashes on the sit_net structure and
patch the rest of the code appropriately.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Make the fallback tunnel device per-net
Pavel Emelyanov [Wed, 16 Apr 2008 08:16:18 +0000 (01:16 -0700)]
[SIT]: Make the fallback tunnel device per-net

Allocate and register one in sit_init_net, use sitn->fb_tunnel_dev
over the code and unregister one in sit_exit_net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Use proper net in hash-lookup functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:15:59 +0000 (01:15 -0700)]
[SIT]: Use proper net in hash-lookup functions.

Replace introduced in the previous patch init_net stubs
with the proper net pointer.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Add net/sit_net argument to some functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:15:39 +0000 (01:15 -0700)]
[SIT]: Add net/sit_net argument to some functions.

... to make them prepared for future hashes and fallback device
move on the struct sit_net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SIT]: Introduce empty struct sit_net and init/exit net ops.
Pavel Emelyanov [Wed, 16 Apr 2008 08:15:17 +0000 (01:15 -0700)]
[SIT]: Introduce empty struct sit_net and init/exit net ops.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Allow for IPPROTO_GRE protocol in namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:11:36 +0000 (01:11 -0700)]
[GRE]: Allow for IPPROTO_GRE protocol in namespaces.

This one was also disabled by default for sanity.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Allow to create IPGRE tunnels in net namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:11:13 +0000 (01:11 -0700)]
[GRE]: Allow to create IPGRE tunnels in net namespaces.

I.e. set the proper net and mark as NETNS_LOCAL.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Use proper net in routing calls.
Pavel Emelyanov [Wed, 16 Apr 2008 08:10:44 +0000 (01:10 -0700)]
[GRE]: Use proper net in routing calls.

As for the IPIP tunnel, there are some ip_route_output_key()
calls in there that require a proper net so give one to them.

And a proper net for the __get_dev_by_index hanging around.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Make tunnels hashes per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:10:26 +0000 (01:10 -0700)]
[GRE]: Make tunnels hashes per-net.

Very similar to what was done for the IPIP code.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Make the fallback tunnel device per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:10:05 +0000 (01:10 -0700)]
[GRE]: Make the fallback tunnel device per-net.

Everything is prepared for this change now. Create on in
init callback, use it over the code and destroy on net exit.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Use proper net in hash-lookup functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:09:44 +0000 (01:09 -0700)]
[GRE]: Use proper net in hash-lookup functions.

This is the part#2 of the patch #2 - get the proper net for
these functions. This change in a separate patch in order not
to get lost in a large previous patch.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Add net/gre_net argument to some functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:09:22 +0000 (01:09 -0700)]
[GRE]: Add net/gre_net argument to some functions.

The fallback device and hashes are to become per-net, but many
code doesn't have anything to get the struct net pointer from.

So pass the proper net there with an extra argument.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[GRE]: Introduce empty ipgre_net structure and net init/exit ops.
Pavel Emelyanov [Wed, 16 Apr 2008 08:08:53 +0000 (01:08 -0700)]
[GRE]: Introduce empty ipgre_net structure and net init/exit ops.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Allow for IPPROTO_IPIP protocol in namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:06:56 +0000 (01:06 -0700)]
[IPIP]: Allow for IPPROTO_IPIP protocol in namespaces.

This one was disabled by default for sanity.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Allow to create IPIP tunnels in net namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 08:06:18 +0000 (01:06 -0700)]
[IPIP]: Allow to create IPIP tunnels in net namespaces.

Set the proper net before calling register_netdev and disable
the tunnel device netns changing.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Use proper net in (mostly) routing calls.
Pavel Emelyanov [Wed, 16 Apr 2008 08:05:57 +0000 (01:05 -0700)]
[IPIP]: Use proper net in (mostly) routing calls.

There are some ip_route_output_key() calls in there that require
a proper net so give one to them.

Besides - give a proper net to a single __get_dev_by_index call
in ipip_tunnel_bind_dev().

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Make tunnels hashes per net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:05:32 +0000 (01:05 -0700)]
[IPIP]: Make tunnels hashes per net.

Either net or ipip_net already exists in all the required
places, so just use one.

Besides, tune net_init and net_exit calls to respectively
initialize the hashes and destroy devices.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Use proper net in hash-lookup functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:05:03 +0000 (01:05 -0700)]
[IPIP]: Use proper net in hash-lookup functions.

This is the part#2 of the previous patch - get the proper
net for these functions.

I make it in a separate patch, so that this change does not
get lost in a large previous patch.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Add net/ipip_net argument to some functions.
Pavel Emelyanov [Wed, 16 Apr 2008 08:04:35 +0000 (01:04 -0700)]
[IPIP]: Add net/ipip_net argument to some functions.

The hashes of tunnels will be per-net too, so prepare all the
functions that uses them for this change by adding an argument.

Use init_net temporarily in places, where the net does not exist
explicitly yet.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Make the fallback tunnel device per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 08:04:13 +0000 (01:04 -0700)]
[IPIP]: Make the fallback tunnel device per-net.

Create on in ipip_init_net(), use it all over the code (the
proper place to get the net from already exists) and destroy
in ipip_net_exit().

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[IPIP]: Introduce empty ipip_net structure and net init/exit ops.
Pavel Emelyanov [Wed, 16 Apr 2008 08:03:13 +0000 (01:03 -0700)]
[IPIP]: Introduce empty ipip_net structure and net init/exit ops.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Handle vlan devices net namespace changing.
Pavel Emelyanov [Wed, 16 Apr 2008 07:57:01 +0000 (00:57 -0700)]
[VLAN]: Handle vlan devices net namespace changing.

When van device is moved to another namespace proc files,
related to this device, should also change one.

Use the netdev REGISTER and UNREGISTER event handlers for this.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Allow vlan devices registration in net namespaces.
Pavel Emelyanov [Wed, 16 Apr 2008 07:55:06 +0000 (00:55 -0700)]
[VLAN]: Allow vlan devices registration in net namespaces.

This one is similar to what I've done for TUN - set the proper
net after device allocation and clean VLANs on net exit (use the
rtnl_kill_links helper finally).

Plus, drop explicit init_net usage and net != &init_net checks.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Make the vlan_name_type per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 07:54:39 +0000 (00:54 -0700)]
[VLAN]: Make the vlan_name_type per-net.

This includes moving one on the struct vlan_net and
s/vlan_name_type/vn->name_type/ over the code.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Make the /proc/net/vlan/conf file show per-net info.
Pavel Emelyanov [Wed, 16 Apr 2008 07:52:24 +0000 (00:52 -0700)]
[VLAN]: Make the /proc/net/vlan/conf file show per-net info.

It is created in a proper net, so make is show info, related
to this particular net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Create proc entries in the proper net.
Pavel Emelyanov [Wed, 16 Apr 2008 07:51:51 +0000 (00:51 -0700)]
[VLAN]: Create proc entries in the proper net.

The proc_vlan_dir and proc_vlan_conf migrate on the struct
vlan_net and their creation uses the struct net.

The devices' entries use the corresponding device's net.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Add a net argument to proc init and cleanup calls.
Pavel Emelyanov [Wed, 16 Apr 2008 07:51:12 +0000 (00:51 -0700)]
[VLAN]: Add a net argument to proc init and cleanup calls.

All proc files will be created in each net, so prepare them for
this change now, not to mess it with real creation patch.

The net != &init_net checks in them are for git-bisect sanity,
but I will drop them soon.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Introduce the vlan_net structure and init/exit net ops.
Pavel Emelyanov [Wed, 16 Apr 2008 07:49:09 +0000 (00:49 -0700)]
[VLAN]: Introduce the vlan_net structure and init/exit net ops.

Unlike TUN, it is empty from the very beginning, and will
be eventually populated later.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VLAN]: Tag vlan_group_device with net device, not ifindex.
Pavel Emelyanov [Wed, 16 Apr 2008 07:48:04 +0000 (00:48 -0700)]
[VLAN]: Tag vlan_group_device with net device, not ifindex.

Currently vlan group is searched using one key - the ifindex.
We'll have to lookup the vlan_group by two keys - ifindex and
net. Turning the vlan_group lookup key to struct net_device
pointer will make this process easier.

Besides, this will eliminate one more place in the networking,
that assumes that indexes are unique in the kernel.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[RTNL]: Introduce the rtnl_kill_links helper.
Pavel Emelyanov [Wed, 16 Apr 2008 07:46:52 +0000 (00:46 -0700)]
[RTNL]: Introduce the rtnl_kill_links helper.

This one is responsible for calling ->dellink on each net
device found in net to help with vlan net_exit hook in the
nearest future.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[RTNL]: Relax for_each_netdev_safe in __rtnl_link_unregister.
Pavel Emelyanov [Wed, 16 Apr 2008 07:45:56 +0000 (00:45 -0700)]
[RTNL]: Relax for_each_netdev_safe in __rtnl_link_unregister.

Each potential list_del (happening from inside a ->dellink call)
is followed by goto restart, so there's no need in _safe iteration.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TUN]: Allow to register tun devices in namespace.
Pavel Emelyanov [Wed, 16 Apr 2008 07:41:53 +0000 (00:41 -0700)]
[TUN]: Allow to register tun devices in namespace.

This is basically means that a net is set for a new device, but
actually also involves two more steps:

1. mark the tun device as "local", i.e. do not allow for it to
   move across namespaces.

This is done so, since tun device is most often associated to some
file (and thus to some process) and moving the device alone is not
valid while keeping the file and the process outside. The need in
ability to move a detached persistent device is to be investigated
later.

2. get the tun device's net when tun becomes attached and put one
   when it becomes detached.

This is needed to handle the case when a task owning the tun dies,
but a files lives for some more time - in this case we must not
allow for net to be freed, since its exit hook will spoil that file's
private data by unregistering the tun from under tun_chr_close.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TUN]: Make the tun_dev_list per-net.
Pavel Emelyanov [Wed, 16 Apr 2008 07:41:16 +0000 (00:41 -0700)]
[TUN]: Make the tun_dev_list per-net.

Remove the static tun_dev_list and replace its occurrences in
driver with per-net one.

It is used in two places - in tun_set_iff and tun_cleanup. In
the first case it's legal to use current net_ns. In the cleanup
call - move the loop, that unregisters all devices in net exit
hook.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TUN]: Introduce the tun_net structure and init/exit net ops.
Pavel Emelyanov [Wed, 16 Apr 2008 07:40:46 +0000 (00:40 -0700)]
[TUN]: Introduce the tun_net structure and init/exit net ops.

This is the first step in making tuntap devices work in net
namespaces. The structure mentioned is pointed by generic
net pointer with tun_net_id id, and tun driver fills one on
its load. It will contain only the tun devices list.

So declare this structure and introduce net init and exit hooks.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[TCP]: Remove superflushious skb == write_queue_tail() check
Ilpo Järvinen [Wed, 16 Apr 2008 03:36:55 +0000 (20:36 -0700)]
[TCP]: Remove superflushious skb == write_queue_tail() check

Needed can only be more strict than what was checked by the
earlier common case check for non-tail skbs, thus
cwnd_len <= needed will never match in that case anyway.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[ETHTOOL]: Add support for large eeproms
Mandeep Singh Baines [Wed, 16 Apr 2008 02:24:17 +0000 (19:24 -0700)]
[ETHTOOL]: Add support for large eeproms

Currently, it is not possible to read/write to an eeprom larger than
128k in size because the buffer used for temporarily storing the
eeprom contents is allocated using kmalloc. kmalloc can only allocate
a maximum of 128k depending on architecture.

Modified ethtool_get/set_eeprom to only allocate a page of memory and
then copy the eeprom a page at a time.

Updated original patch as per suggestions from Joe Perches.

Signed-off-by: Mandeep Singh Baines <msb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>