platform/kernel/linux-3.10.git
13 years agoX25 remove bkl in facility ioctls
andrew hendry [Thu, 25 Nov 2010 02:18:35 +0000 (02:18 +0000)]
X25 remove bkl in facility ioctls

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoX25 remove bkl in subscription ioctls
andrew hendry [Thu, 25 Nov 2010 02:18:15 +0000 (02:18 +0000)]
X25 remove bkl in subscription ioctls

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Use helpers instead of direct access to the shinfo(skb) fields
Vladislav Zolotarov [Sun, 28 Nov 2010 00:23:35 +0000 (00:23 +0000)]
bnx2x: Use helpers instead of direct access to the shinfo(skb) fields

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2: Remove config access to non-standard registers
Michael Chan [Wed, 24 Nov 2010 13:48:55 +0000 (13:48 +0000)]
bnx2: Remove config access to non-standard registers

In KVM passthrough mode, the driver may not have config access to
non-standard registers.  The BNX2_PCICFG_MISC_CONFIG config register
access to setup mailbox swapping can be done using MMIO.

Update version to 2.0.20.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2: Fix reset bug on 5709
Eddie Wai [Wed, 24 Nov 2010 13:48:54 +0000 (13:48 +0000)]
bnx2: Fix reset bug on 5709

The 5709 chip requires the BNX2_MISC_NEW_CORE_CTL_DMA_ENABLE bit to be
cleared and polling for pending DMAs to complete before chip reset.
Without this step, we've seen NMIs during repeated resets of the chip.

Signed-off-by: Eddie Wai <waie@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years ago8021q: vlan device is lockless do not transfer real_num_{tx|rx}_queues
John Fastabend [Wed, 24 Nov 2010 13:14:50 +0000 (13:14 +0000)]
8021q: vlan device is lockless do not transfer real_num_{tx|rx}_queues

Now that the vlan device is lockless and single queue do not
transfer the real num queues. This is causing a BUG_ON to occur.

kernel BUG at net/8021q/vlan.c:345!
Call Trace:
[<ffffffff813fd6e8>] ? fib_rules_event+0x28/0x1b0
[<ffffffff814ad2b5>] notifier_call_chain+0x55/0x80
[<ffffffff81089156>] raw_notifier_call_chain+0x16/0x20
[<ffffffff813e5af7>] call_netdevice_notifiers+0x37/0x70
[<ffffffff813e6756>] netdev_features_change+0x16/0x20
[<ffffffffa02995be>] ixgbe_fcoe_enable+0xae/0x100 [ixgbe]
[<ffffffffa01da06a>] vlan_dev_fcoe_enable+0x2a/0x30 [8021q]
[<ffffffffa02d08c3>] fcoe_create+0x163/0x630 [fcoe]
[<ffffffff811244d5>] ? mmap_region+0x255/0x5a0
[<ffffffff81080ef0>] param_attr_store+0x50/0x80
[<ffffffff810809b6>] module_attr_store+0x26/0x30
[<ffffffff811b9db2>] sysfs_write_file+0xf2/0x180
[<ffffffff8114fc88>] vfs_write+0xc8/0x190
[<ffffffff81150621>] sys_write+0x51/0x90
[<ffffffff8100c0b2>] system_call_fastpath+0x16/0x1b

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: add netif_tx_queue_frozen_or_stopped
Eric Dumazet [Tue, 23 Nov 2010 10:42:02 +0000 (10:42 +0000)]
net: add netif_tx_queue_frozen_or_stopped

When testing struct netdev_queue state against FROZEN bit, we also test
XOFF bit. We can test both bits at once and save some cycles.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: kill two unused macro definition
Shan Wei [Wed, 24 Nov 2010 21:47:56 +0000 (21:47 +0000)]
ipv6: kill two unused macro definition

1. IPV6_TLV_TEL_DST_SIZE
This has not been using for several years since created.

2. RT6_INFO_LEN
commit 33120b30 kill all RT6_INFO_LEN's references, but only this definition remained.

commit 33120b30cc3b8665204d4fcde7288638b0dd04d5
Author: Alexey Dobriyan <adobriyan@sw.ru>
Date:   Tue Nov 6 05:27:11 2007 -0800

    [IPV6]: Convert /proc/net/ipv6_route to seq_file interface

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: add some KERN_CONT markers to continuation lines
Uwe Kleine-König [Tue, 23 Nov 2010 22:57:47 +0000 (22:57 +0000)]
net: add some KERN_CONT markers to continuation lines

Cc: netdev@vger.kernel.org
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetxen: avoid using reset_devices as it may become obsolete
Rajesh Borundia [Tue, 23 Nov 2010 03:08:27 +0000 (03:08 +0000)]
netxen: avoid using reset_devices as it may become obsolete

In kdump environment do not depend on reset_devices
parameter to reset the device as the parameter may become obsolete.
Instead use an adapter specific mechanism to determine if the device
needs a reset.

Driver maintains a count of number of pci functions probed
and decrements the count when remove handler of that pci function
is called. If the first probe, probe of function 0,
detects the count as non zero then reset the device.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoqlcnic: avoid using reset_devices as it may become obsolete.
Rajesh Borundia [Tue, 23 Nov 2010 01:25:21 +0000 (01:25 +0000)]
qlcnic: avoid using reset_devices as it may become obsolete.

In kdump environment do not depend upon reset_devices parameter
to reset the pci function as this parameter may become obsolete.
Instead use an adapter specific mechanism to determine if the pci
function needs to be reset.

Per function refcount is maintained in driver, which is set in probe
and reset in remove handler of adapter. If the probe detects the count
as non zero then reset the function.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agosctp: kill unused macro definition
Shan Wei [Mon, 22 Nov 2010 23:00:42 +0000 (23:00 +0000)]
sctp: kill unused macro definition

These macros have been existed for several years since v2.6.12-rc2.
But they never be used. So remove them now.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agortnl: make link af-specific updates atomic
Thomas Graf [Mon, 22 Nov 2010 01:31:54 +0000 (01:31 +0000)]
rtnl: make link af-specific updates atomic

As David pointed out correctly, updates to af-specific attributes
are currently not atomic. If multiple changes are requested and
one of them fails, previous updates may have been applied already
leaving the link behind in a undefined state.

This patch splits the function parse_link_af() into two functions
validate_link_af() and set_link_at(). validate_link_af() is placed
to validate_linkmsg() check for errors as early as possible before
any changes to the link have been made. set_link_af() is called to
commit the changes later.

This method is not fail proof, while it is currently sufficient
to make set_link_af() inerrable and thus 100% atomic, the
validation function method will not be able to detect all error
scenarios in the future, there will likely always be errors
depending on states which are f.e. not protected by rtnl_mutex
and thus may change between validation and setting.

Also, instead of silently ignoring unknown address families and
config blocks for address families which did not register a set
function the errors EAFNOSUPPORT respectively EOPNOSUPPORT are
returned to avoid comitting 4 out of 5 update requests without
notifying the user.

Signed-off-by: Thomas Graf <tgraf@infradead.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net: use vzalloc()
Eric Dumazet [Mon, 22 Nov 2010 00:15:06 +0000 (00:15 +0000)]
drivers/net: use vzalloc()

Use vzalloc() and vzalloc_node() in net drivers

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Jon Mason <jon.mason@exar.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: adding support for Lancer family of CNAs
Sathya Perla [Sun, 21 Nov 2010 23:25:50 +0000 (23:25 +0000)]
be2net: adding support for Lancer family of CNAs

Key changes are:
- EQ ids are not assigned consecutively in Lancer. So, fix mapping of MSIx
  vector to EQ-id.
- BAR mapping and some req locations different for Lancer.
- TCP,UDP,IP checksum fields must be compulsorily set in TX wrb for TSO in
  Lancer.
- CEV_IST reg not present in Lancer; so, peek into event queue to check for
  new entries
- cq_create and mcc_create cmd interface is different for Lancer; handle
  accordingly

Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoxps: Transmit Packet Steering
Tom Herbert [Sun, 21 Nov 2010 13:17:27 +0000 (13:17 +0000)]
xps: Transmit Packet Steering

This patch implements transmit packet steering (XPS) for multiqueue
devices.  XPS selects a transmit queue during packet transmission based
on configuration.  This is done by mapping the CPU transmitting the
packet to a queue.  This is the transmit side analogue to RPS-- where
RPS is selecting a CPU based on receive queue, XPS selects a queue
based on the CPU (previously there was an XPS patch from Eric
Dumazet, but that might more appropriately be called transmit completion
steering).

Each transmit queue can be associated with a number of CPUs which will
use the queue to send packets.  This is configured as a CPU mask on a
per queue basis in:

/sys/class/net/eth<n>/queues/tx-<n>/xps_cpus

The mappings are stored per device in an inverted data structure that
maps CPUs to queues.  In the netdevice structure this is an array of
num_possible_cpu structures where each structure holds and array of
queue_indexes for queues which that CPU can use.

The benefits of XPS are improved locality in the per queue data
structures.  Also, transmit completions are more likely to be done
nearer to the sending thread, so this should promote locality back
to the socket on free (e.g. UDP).  The benefits of XPS are dependent on
cache hierarchy, application load, and other factors.  XPS would
nominally be configured so that a queue would only be shared by CPUs
which are sharing a cache, the degenerative configuration woud be that
each CPU has it's own queue.

Below are some benchmark results which show the potential benfit of
this patch.  The netperf test has 500 instances of netperf TCP_RR test
with 1 byte req. and resp.

bnx2x on 16 core AMD
   XPS (16 queues, 1 TX queue per CPU)  1234K at 100% CPU
   No XPS (16 queues)                   996K at 100% CPU

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoxps: Improvements in TX queue selection
Tom Herbert [Sun, 21 Nov 2010 13:17:29 +0000 (13:17 +0000)]
xps: Improvements in TX queue selection

In dev_pick_tx, don't do work in calculating queue
index or setting
the index in the sock unless the device has more than one queue.  This
allows the sock to be set only with a queue index of a multi-queue
device which is desirable if device are stacked like in a tunnel.

We also allow the mapping of a socket to queue to be changed.  To
maintain in order packet transmission a flag (ooo_okay) has been
added to the sk_buff structure.  If a transport layer sets this flag
on a packet, the transmit queue can be changed for the socket.
Presumably, the transport would set this if there was no possbility
of creating OOO packets (for instance, there are no packets in flight
for the socket).  This patch includes the modification in TCP output
for setting this flag.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoinfiniband: remove dev_base_lock use
Eric Dumazet [Wed, 24 Nov 2010 19:41:56 +0000 (11:41 -0800)]
infiniband: remove dev_base_lock use

dev_base_lock is the legacy way to lock the device list, and is planned
to disappear. (writers hold RTNL, readers hold RCU lock)

Convert rdma_translate_ip() and update_ipv6_gids() to RCU locking.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoscm: lower SCM_MAX_FD
Eric Dumazet [Tue, 23 Nov 2010 14:09:15 +0000 (14:09 +0000)]
scm: lower SCM_MAX_FD

Lower SCM_MAX_FD from 255 to 253 so that allocations for scm_fp_list are
halved. (commit f8d570a4 added two pointers in this structure)

scm_fp_dup() should not copy whole structure (and trigger kmemcheck
warnings), but only the used part. While we are at it, only allocate
needed size.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: mcast: RCU conversion
Eric Dumazet [Tue, 23 Nov 2010 13:12:15 +0000 (13:12 +0000)]
ipv6: mcast: RCU conversion

ipv6_sk_mc_lock rwlock becomes a spinlock.

readers (inet6_mc_check()) now takes rcu_read_lock() instead of read
lock. Writers dont need to disable BH anymore.

struct ipv6_mc_socklist objects are reclaimed after one RCU grace
period.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: update the driver version
Giuseppe CAVALLARO [Wed, 24 Nov 2010 02:38:17 +0000 (02:38 +0000)]
stmmac: update the driver version

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: convert to dev_pm_ops.
Giuseppe CAVALLARO [Wed, 24 Nov 2010 02:38:11 +0000 (02:38 +0000)]
stmmac: convert to dev_pm_ops.

This patch updates the PM support using the dev_pm_ops
and reviews the hibernation support.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: add init/exit callback in plat_stmmacenet_data struct
Giuseppe CAVALLARO [Wed, 24 Nov 2010 02:38:05 +0000 (02:38 +0000)]
stmmac: add init/exit callback in plat_stmmacenet_data struct

This patch adds in the plat_stmmacenet_data
the init and exit callbacks that can be used
for invoking specific platform functions.
For example, on ST targets, these call the
PAD manager functions to set PIO lines and
syscfg registers.
The patch removes the stmmac_claim_resource
only used on STM Kernels as well.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agostmmac: tidy-up stmmac_priv structure
Giuseppe CAVALLARO [Wed, 24 Nov 2010 02:37:58 +0000 (02:37 +0000)]
stmmac: tidy-up stmmac_priv structure

This patch tidies-up the stmmac_priv structure
that had many fileds alredy defined in the
plat_stmmacenet_data structure.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Do interrupt mode initialization and NAPIs adding before register_netdev()
Vladislav Zolotarov [Wed, 24 Nov 2010 19:09:50 +0000 (11:09 -0800)]
bnx2x: Do interrupt mode initialization and NAPIs adding before register_netdev()

Move the interrupt mode configuration and NAPIs adding before a
register_netdev() call to prevent netdev->open() from running
before these functions are done.

Advance a driver version number.

Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Reported-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobnx2x: Disable local BHes to prevent a dead-lock situation
Eric Dumazet [Wed, 24 Nov 2010 03:45:10 +0000 (03:45 +0000)]
bnx2x: Disable local BHes to prevent a dead-lock situation

According to Eric's suggestion:
Disable local BHes to prevent a dead-lock situation between sch_direct_xmit()
(Soft_IRQ context) and bnx2x_tx_int (called by bnx2x_run_loopback() - syscall
context), as both are taking a netif_tx_lock().

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Remove tg3_config_info definition
Matt Carlson [Wed, 24 Nov 2010 08:31:54 +0000 (08:31 +0000)]
tg3: Remove tg3_config_info definition

This structure isn't used anywhere in the driver.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Enable phy APD for 5717 and later asic revs
Matt Carlson [Wed, 24 Nov 2010 08:31:53 +0000 (08:31 +0000)]
tg3: Enable phy APD for 5717 and later asic revs

This patch enables the gphy autopowerdown feature in the phy for all
new devices that support it.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: use dma_alloc_coherent() instead of pci_alloc_consistent()
Matt Carlson [Wed, 24 Nov 2010 08:31:52 +0000 (08:31 +0000)]
tg3: use dma_alloc_coherent() instead of pci_alloc_consistent()

Using dma_alloc_coherent() permits to use GFP_KERNEL allocations instead
of GFP_ATOMIC ones. Its better when a machine is out of memory, because
this allows driver to sleep to get its memory and succeed its init,
especially when allocating high order pages.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Reenable TSS for 5719
Matt Carlson [Wed, 24 Nov 2010 08:31:51 +0000 (08:31 +0000)]
tg3: Reenable TSS for 5719

All TSS bugs have been fixed in the 5719.  This patch reenables the
feature.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Enable mult rd DMA engine on 5719
Matt Carlson [Wed, 24 Nov 2010 08:31:50 +0000 (08:31 +0000)]
tg3: Enable mult rd DMA engine on 5719

The multiple DMA read engine bugs have been fixed on the 5719.  This
patch reenables support for this feature.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Reorg tg3_napi members
Matt Carlson [Wed, 24 Nov 2010 08:31:49 +0000 (08:31 +0000)]
tg3: Reorg tg3_napi members

This patch reorders and realigns the tg3_napi members for a ~3-4%
performance improvement on small packet performance tests.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Fix 5719 internal FIFO overflow problem
Matt Carlson [Wed, 24 Nov 2010 08:31:48 +0000 (08:31 +0000)]
tg3: Fix 5719 internal FIFO overflow problem

Under load, there an internal FIFO can overflow on the 5719.  The fix is
to scale back the PCIe maximum read request size based on the current
link speed and width.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Always turn on APE features in mac_mode reg
Matt Carlson [Wed, 24 Nov 2010 08:31:47 +0000 (08:31 +0000)]
tg3: Always turn on APE features in mac_mode reg

The APE needs certain bits in the mac_mode register to be enabled for
traffic to flow correctly.  This patch changes the code to always enable
these bits in the presence of the APE.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Assign correct tx margin for 5719
Matt Carlson [Wed, 24 Nov 2010 08:31:46 +0000 (08:31 +0000)]
tg3: Assign correct tx margin for 5719

Commit d309a46e42542223946d3a9e4e239fdc945cb53e, entitled
"tg3: 5719: Prevent tx data corruption", was supposed to contain the tx
margin adjustment but it looks like it somehow was omitted.  This patch
fixes the problem.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agotg3: Apply 10Mbps fix to all 57765 revisions
Matt Carlson [Wed, 24 Nov 2010 08:31:45 +0000 (08:31 +0000)]
tg3: Apply 10Mbps fix to all 57765 revisions

Commit a977dbe8445b8a81d6127c4aa9112a2c29a1a008, entitled
"tg3: Reduce 57765 core clock when link at 10Mbps" needs to be applied
to all revisions of the 57765 asic rev, not just the A0 revision.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoSELinux: indicate fatal error in compat netfilter code
Eric Paris [Tue, 23 Nov 2010 06:28:08 +0000 (06:28 +0000)]
SELinux: indicate fatal error in compat netfilter code

The SELinux ip postroute code indicates when policy rejected a packet and
passes the error back up the stack.  The compat code does not.  This patch
sends the same kind of error back up the stack in the compat code.

Based-on-patch-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Reviewed-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoSELinux: Only return netlink error when we know the return is fatal
Eric Paris [Tue, 23 Nov 2010 06:28:02 +0000 (06:28 +0000)]
SELinux: Only return netlink error when we know the return is fatal

Some of the SELinux netlink code returns a fatal error when the error might
actually be transient.  This patch just silently drops packets on
potentially transient errors but continues to return a permanant error
indicator when the denial was because of policy.

Based-on-comments-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Reviewed-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agomacvlan: Introduce 'passthru' mode to takeover the underlying device
Sridhar Samudrala [Thu, 28 Oct 2010 13:10:50 +0000 (13:10 +0000)]
macvlan: Introduce 'passthru' mode to takeover the underlying device

With the current default 'vepa' mode, a KVM guest using virtio with
macvtap backend has the following limitations.
- cannot change/add a mac address on the guest virtio-net
- cannot create a vlan device on the guest virtio-net
- cannot enable promiscuous mode on guest virtio-net

To address these limitations, this patch introduces a new mode called
'passthru' when creating a macvlan device which allows takeover of the
underlying device and passing it to a guest using virtio with macvtap
backend.

Only one macvlan device is allowed in passthru mode and it inherits
the mac address from the underlying device and sets it in promiscuous
mode to receive and forward all the packets.

Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
-------------------------------------------------------------------------
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: wanrouter: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:28 +0000 (15:03 +0000)]
Net: wanrouter: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: sunrpc: auth_gss: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:27 +0000 (15:03 +0000)]
Net: sunrpc: auth_gss: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: rxrpc: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:26 +0000 (15:03 +0000)]
Net: rxrpc: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: rds: Makefile: Remove deprecated items
Tracey Dent [Sun, 21 Nov 2010 15:03:25 +0000 (15:03 +0000)]
Net: rds: Makefile: Remove deprecated items

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Also, use the ccflags-$ flag instead of EXTRA_CFLAGS because EXTRA_CFLAGS is
deprecated and should now be switched.

Last but not least, took out if-conditionals.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: phonet: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:24 +0000 (15:03 +0000)]
Net: phonet: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: lapb: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:23 +0000 (15:03 +0000)]
Net: lapb: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: irda: irnet: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:22 +0000 (15:03 +0000)]
Net: irda: irnet: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: irda: irlan: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:21 +0000 (15:03 +0000)]
Net: irda: irlan: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: irda: ircomm: Makefile: Remove deprecated kbuild goal defintions
Tracey Dent [Sun, 21 Nov 2010 15:03:20 +0000 (15:03 +0000)]
Net: irda: ircomm: Makefile: Remove deprecated kbuild goal defintions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: ipv6: netfiliter: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:19 +0000 (15:03 +0000)]
Net: ipv6: netfiliter: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: ipv4: netfilter: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:18 +0000 (15:03 +0000)]
Net: ipv4: netfilter: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: econet: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:17 +0000 (15:03 +0000)]
Net: econet: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: dns_resolver: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:16 +0000 (15:03 +0000)]
Net: dns_resolver: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: ceph: Makefile: remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:15 +0000 (15:03 +0000)]
Net: ceph: Makefile: remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: can: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:14 +0000 (15:03 +0000)]
Net: can: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: caif: Makefile: Remove deprecated items
Tracey Dent [Sun, 21 Nov 2010 15:03:13 +0000 (15:03 +0000)]
Net: caif: Makefile: Remove deprecated items

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Also, use the ccflags-$ flag instead of EXTRA_CFLAGS because EXTRA_CFLAGS is
deprecated and should now be switched.

Last but not least, took out if-conditionals.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoNet: bluetooth: Makefile: Remove deprecated kbuild goal definitions
Tracey Dent [Sun, 21 Nov 2010 15:03:12 +0000 (15:03 +0000)]
Net: bluetooth: Makefile: Remove deprecated kbuild goal definitions

Changed Makefile to use <modules>-y instead of <modules>-objs
because -objs is deprecated and not mentioned in
Documentation/kbuild/makefiles.txt.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agopktgen: allow faster module unload
Eric Dumazet [Sun, 21 Nov 2010 18:26:44 +0000 (10:26 -0800)]
pktgen: allow faster module unload

Unloading pktgen module needs ~6 seconds on a 64 cpus machine, to stop
64 kthreads.

Add a pktgen_exiting variable to let kernel threads die faster, so that
kthread_stop() doesnt have to wait too long for them. This variable is
not tested in fast path.

Note : Before exiting from pktgen_thread_worker(), we must make sure
kthread_stop() is waiting for this thread to be stopped, like its done
in kernel/softirq.c

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetns: let net_generic take pointer-to-const args
Jan Engelhardt [Sat, 20 Nov 2010 18:07:21 +0000 (18:07 +0000)]
netns: let net_generic take pointer-to-const args

This commit is same in nature as v2.6.37-rc1-755-g3654654; the network
namespace itself is not modified when calling net_generic, so the
parameter can be const.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agopacket: use vzalloc()
Eric Dumazet [Sat, 20 Nov 2010 07:31:54 +0000 (07:31 +0000)]
packet: use vzalloc()

alloc_one_pg_vec_page() is supposed to return zeroed memory, so use
vzalloc() instead of vmalloc()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoixgbe: update version number for ixgbe
Don Skidmore [Sun, 21 Nov 2010 17:55:10 +0000 (09:55 -0800)]
ixgbe: update version number for ixgbe

This will reflect addition of new X540 hardware

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet-next: Add multiqueue support to vmxnet3 driver
Shreyas Bhatewara [Fri, 19 Nov 2010 10:55:24 +0000 (10:55 +0000)]
net-next: Add multiqueue support to vmxnet3 driver

Add multiqueue support to vmxnet3 driver

This change adds multiqueue and thus receive side scaling support
to vmxnet3 device driver. Number of rx queues is limited to 1 in cases
where MSI is not configured or one MSIx vector is not available per rx
queue

Signed-off-by: Shreyas Bhatewara <sbhatewara@vmware.com>
Reviewed-by: Bhavesh Davda <bhavesh@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Fri, 19 Nov 2010 21:13:47 +0000 (13:13 -0800)]
Merge branch 'master' of /linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/bonding/bond_main.c
net/core/net-sysfs.c
net/ipv6/addrconf.c

13 years agoX25: remove bkl in routing ioctls
andrew hendry [Thu, 18 Nov 2010 13:21:35 +0000 (13:21 +0000)]
X25: remove bkl in routing ioctls

Routing doesn't use the socket data and is protected by x25_route_list_lock

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoX25: remove bkl in inq and outq ioctls
andrew hendry [Thu, 18 Nov 2010 13:21:28 +0000 (13:21 +0000)]
X25: remove bkl in inq and outq ioctls

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoX25: remove bkl in timestamp ioctls
andrew hendry [Thu, 18 Nov 2010 13:21:20 +0000 (13:21 +0000)]
X25: remove bkl in timestamp ioctls

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoX25: pushdown bkl in ioctls
andrew hendry [Thu, 18 Nov 2010 13:20:57 +0000 (13:20 +0000)]
X25: pushdown bkl in ioctls

Push down the bkl in the ioctls so they can be removed one at a time.

Signed-off-by: Andrew Hendry <andrew.hendry@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agofilter: use reciprocal divide
Eric Dumazet [Thu, 18 Nov 2010 22:04:46 +0000 (22:04 +0000)]
filter: use reciprocal divide

At compile time, we can replace the DIV_K instruction (divide by a
constant value) by a reciprocal divide.

At exec time, the expensive divide is replaced by a multiply, a less
expensive operation on most processors.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agofilter: cleanup codes[] init
Eric Dumazet [Thu, 18 Nov 2010 21:56:38 +0000 (21:56 +0000)]
filter: cleanup codes[] init

Starting the translated instruction to 1 instead of 0 allows us to
remove one descrement at check time and makes codes[] array init
cleaner.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agofilter: optimize sk_run_filter
Eric Dumazet [Fri, 19 Nov 2010 17:49:59 +0000 (09:49 -0800)]
filter: optimize sk_run_filter

Remove pc variable to avoid arithmetic to compute fentry at each filter
instruction. Jumps directly manipulate fentry pointer.

As the last instruction of filter[] is guaranteed to be a RETURN, and
all jumps are before the last instruction, we dont need to check filter
bounds (number of instructions in filter array) at each iteration, so we
remove it from sk_run_filter() params.

On x86_32 remove f_k var introduced in commit 57fe93b374a6b871
(filter: make sure filters dont read uninitialized memory)

Note : We could use a CONFIG_ARCH_HAS_{FEW|MANY}_REGISTERS in order to
avoid too many ifdefs in this code.

This helps compiler to use cpu registers to hold fentry and A
accumulator.

On x86_32, this saves 401 bytes, and more important, sk_run_filter()
runs much faster because less register pressure (One less conditional
branch per BPF instruction)

# size net/core/filter.o net/core/filter_pre.o
   text    data     bss     dec     hex filename
   2948       0       0    2948     b84 net/core/filter.o
   3349       0       0    3349     d15 net/core/filter_pre.o

on x86_64 :
# size net/core/filter.o net/core/filter_pre.o
   text    data     bss     dec     hex filename
   5173       0       0    5173    1435 net/core/filter.o
   5224       0       0    5224    1468 net/core/filter_pre.o

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: fix kernel-doc for sk_filter_rcu_release
Randy Dunlap [Thu, 18 Nov 2010 13:02:37 +0000 (13:02 +0000)]
net: fix kernel-doc for sk_filter_rcu_release

Fix kernel-doc warning for sk_filter_rcu_release():

Warning(net/core/filter.c:586): missing initial short description on line:
 *  sk_filter_rcu_release: Release a socket filter by rcu_head

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobe2net: Fix to avoid firmware update when interface is not open.
Sarveshwar Bandi [Thu, 18 Nov 2010 23:44:45 +0000 (23:44 +0000)]
be2net: Fix to avoid firmware update when interface is not open.

Since interrupts are enabled only when open is called on the interface,
Attempting a firmware update operation when interface is down could lead to
partial success or failure of operation. This fix fails the request if
netif_running is false.

Signed-off-by: Sarveshwar Bandi <Sarveshwar.Bandi@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonetfilter: fix IP_VS dependencies
Patrick McHardy [Thu, 18 Nov 2010 08:20:57 +0000 (08:20 +0000)]
netfilter: fix IP_VS dependencies

When NF_CONNTRACK is enabled, IP_VS uses conntrack symbols.
Therefore IP_VS can't be linked statically when conntrack
is built modular.

Reported-by: Justin P. Mattock <justinmattock@gmail.com>
Tested-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: irda: irttp: sync error paths of data- and udata-requests
Wolfram Sang [Tue, 16 Nov 2010 09:40:02 +0000 (09:40 +0000)]
net: irda: irttp: sync error paths of data- and udata-requests

irttp_data_request() returns meaningful errorcodes, while irttp_udata_request()
just returns -1 in similar situations. Sync the two and the loglevels of the
accompanying output.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: Expose reachable and retrans timer values as msecs
Thomas Graf [Wed, 17 Nov 2010 04:12:02 +0000 (04:12 +0000)]
ipv6: Expose reachable and retrans timer values as msecs

Expose reachable and retrans timer values in msecs instead of jiffies.
Both timer values are already exposed as msecs in the neighbour table
netlink interface.

The creation timestamp format with increased precision is kept but
cleaned up.

Signed-off-by: Thomas Graf <tgraf@infradead.org>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocan: EG20T PCH: use BIT(X)
Tomoya [Wed, 17 Nov 2010 14:06:25 +0000 (14:06 +0000)]
can: EG20T PCH: use BIT(X)

Replace bit assignment value to BIT(X).
For easy to readable/identifiable, replace all bit assigned macros to BIT(X)

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocan: EG20T PCH: add prefix to macro
Tomoya [Wed, 17 Nov 2010 01:13:16 +0000 (01:13 +0000)]
can: EG20T PCH: add prefix to macro

For easy to readable/identifiable, add prefix "PCH_" to all of #define macros.

Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
David S. Miller [Thu, 18 Nov 2010 19:56:09 +0000 (11:56 -0800)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6

13 years agoatm: fore200e: Fix build warning.
David S. Miller [Thu, 18 Nov 2010 19:49:25 +0000 (11:49 -0800)]
atm: fore200e: Fix build warning.

GCC (rightfully) complains that:

drivers/atm/fore200e.c:614:5: warning: operation on 'cmdq->head' may be undefined

This is due to the FORE200E_NEXT_ENTRY macro, which essentially
evaluates to:

i = ++i % m

Make it what's explicitly intended here which is:

i = (i + 1) % m

and the warning goes away.

Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipv6: Expose IFLA_PROTINFO timer values in msecs instead of jiffies
Thomas Graf [Wed, 17 Nov 2010 01:44:24 +0000 (01:44 +0000)]
ipv6: Expose IFLA_PROTINFO timer values in msecs instead of jiffies

IFLA_PROTINFO exposes timer related per device settings in jiffies.
Change it to expose these values in msecs like the sysctl interface
does.

I did not find any users of IFLA_PROTINFO which rely on any of these
values and even if there are, they are likely already broken because
there is no way for them to reliably convert such a value to another
time format.

Signed-off-by: Thomas Graf <tgraf@infradead.org>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoigmp: refine skb allocations
Eric Dumazet [Tue, 16 Nov 2010 20:36:42 +0000 (20:36 +0000)]
igmp: refine skb allocations

IGMP allocates MTU sized skbs. This may fail for large MTU (order-2
allocations), so add a fallback to try lower sizes.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: move definitions of BPF_S_* to net/core/filter.c
Changli Gao [Tue, 16 Nov 2010 20:28:24 +0000 (20:28 +0000)]
net: move definitions of BPF_S_* to net/core/filter.c

BPF_S_* are used internally, should not be exposed to the others.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Hagen Paul Pfeifer <hagen@jauu.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agofilter: Optimize instruction revalidation code.
Tetsuo Handa [Tue, 16 Nov 2010 15:19:51 +0000 (15:19 +0000)]
filter: Optimize instruction revalidation code.

Since repeating u16 value to u8 value conversion using switch() clause's
case statement is wasteful, this patch introduces u16 to u8 mapping table
and removes most of case statements. As a result, the size of net/core/filter.o
is reduced by about 29% on x86.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years ago3c59x: fix build failure on !CONFIG_PCI
Namhyung Kim [Tue, 16 Nov 2010 05:27:51 +0000 (05:27 +0000)]
3c59x: fix build failure on !CONFIG_PCI

VORTEX_PCI() could return NULL so it needs to be casted before
accessing any member of struct pci_dev. This fixes following
build failure. Likewise VORTEX_EISA() was changed also.

  CC [M]  drivers/net/3c59x.o
drivers/net/3c59x.c: In function 'acpi_set_WOL':
drivers/net/3c59x.c:3211:39: warning: dereferencing 'void *' pointer
drivers/net/3c59x.c:3211:39: error: request for member 'current_state' in something not a structure or union
make[3]: *** [drivers/net/3c59x.o] Error 1
make[2]: *** [drivers/net/3c59x.o] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoipg.c: remove id [SUNDANCE, 0x1021]
Ken Kawasaki [Sat, 13 Nov 2010 13:42:08 +0000 (13:42 +0000)]
ipg.c: remove id [SUNDANCE, 0x1021]

ipg.c:
  The id [SUNDANCE, 0x1021] (=[0x13f0, 0x1021]) is defined
  at dl2k.h and ipg.c.
  But this device works better with dl2k driver.

  This problem is similar with the commit
  [25cca5352712561fba97bd37c495593d641c1d39
  ipg: Remove device claimed by dl2k from pci id table]
  at 11 Feb 2010.

Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: add priority field to pktgen
John Fastabend [Tue, 16 Nov 2010 19:12:28 +0000 (19:12 +0000)]
net: add priority field to pktgen

Add option to set skb priority to pktgen. Useful for testing
QOS features. Also by running pktgen on the vlan device the
qdisc on the real device can be tested.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: caif: spi: fix potential NULL dereference
Vasiliy Kulikov [Thu, 18 Nov 2010 18:35:58 +0000 (10:35 -0800)]
net: caif: spi: fix potential NULL dereference

alloc_netdev() is not checked here for NULL return value.  dev is
check instead.  It might lead to NULL dereference of ndev.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoath9k_htc: Avoid setting QoS control for non-QoS frames
Rajkumar Manoharan [Thu, 18 Nov 2010 06:49:52 +0000 (12:19 +0530)]
ath9k_htc: Avoid setting QoS control for non-QoS frames

Setting tid information in the TX header is required only for QoS
frames. Not handling this case causes severe data loss with some APs.

Cc: stable@kernel.org
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonet: zero kobject in rx_queue_release
John Fastabend [Tue, 16 Nov 2010 19:42:53 +0000 (19:42 +0000)]
net: zero kobject in rx_queue_release

netif_set_real_num_rx_queues() can decrement and increment
the number of rx queues. For example ixgbe does this as
features and offloads are toggled. Presumably this could
also happen across down/up on most devices if the available
resources changed (cpu offlined).

The kobject needs to be zero'd in this case so that the
state is not preserved across kobject_put()/kobject_init_and_add().

This resolves the following error report.

ixgbe 0000:03:00.0: eth2: NIC Link is Up 10 Gbps, Flow Control: RX/TX
kobject (ffff880324b83210): tried to init an initialized object, something is seriously wrong.
Pid: 1972, comm: lldpad Not tainted 2.6.37-rc18021qaz+ #169
Call Trace:
 [<ffffffff8121c940>] kobject_init+0x3a/0x83
 [<ffffffff8121cf77>] kobject_init_and_add+0x23/0x57
 [<ffffffff8107b800>] ? mark_lock+0x21/0x267
 [<ffffffff813c6d11>] net_rx_queue_update_kobjects+0x63/0xc6
 [<ffffffff813b5e0e>] netif_set_real_num_rx_queues+0x5f/0x78
 [<ffffffffa0261d49>] ixgbe_set_num_queues+0x1c6/0x1ca [ixgbe]
 [<ffffffffa0262509>] ixgbe_init_interrupt_scheme+0x1e/0x79c [ixgbe]
 [<ffffffffa0274596>] ixgbe_dcbnl_set_state+0x167/0x189 [ixgbe]

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: Fix duplicate volatile warning.
Tetsuo Handa [Thu, 18 Nov 2010 17:40:04 +0000 (09:40 -0800)]
net: Fix duplicate volatile warning.

jiffies is defined as "volatile".

  extern unsigned long volatile __jiffy_data jiffies;

ACCESS_ONCE() uses "volatile".
As a result, some compilers warn duplicate `volatile' for ACCESS_ONCE(jiffies).

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodccp ccid-2: whitespace fix-up
Gerrit Renker [Thu, 18 Nov 2010 17:37:07 +0000 (09:37 -0800)]
dccp ccid-2: whitespace fix-up

This fixes whitespace noise introduced in commit "dccp ccid-2: Algorithm to
update buffer state", 5753fdfe8bd8e9a2ff9e5af19b0ffc78bfcd502a, 14 Nov 2010.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding: IGMP handling cleanup
Eric Dumazet [Thu, 18 Nov 2010 17:33:19 +0000 (09:33 -0800)]
bonding: IGMP handling cleanup

Instead of iterating in_dev->mc_list from bonding driver, its better
to call a helper function provided by igmp.c
Details of implementation (locking) are private to igmp code.

ip_mc_rejoin_group(struct ip_mc_list *im) becomes
ip_mc_rejoin_groups(struct in_device *in_dev);

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoMAINTAINERS: Add stmmac maintainer
Giuseppe Cavallaro [Thu, 18 Nov 2010 17:32:02 +0000 (09:32 -0800)]
MAINTAINERS: Add stmmac maintainer

Add STMMAC to the list of supported Ethernet drivers
and myself as maintainer.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agobonding: fix a race in IGMP handling
Eric Dumazet [Thu, 18 Nov 2010 17:30:42 +0000 (09:30 -0800)]
bonding: fix a race in IGMP handling

RCU conversion in IGMP code done in net-next-2.6 raised a race in
__bond_resend_igmp_join_requests().

It iterates in_dev->mc_list without appropriate protection (RTNL, or
read_lock on in_dev->mc_list_lock).

Another cpu might delete an entry while we use it and trigger a fault.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agocfg80211: fix can_beacon_sec_chan, reenable HT40
Mark Mentovai [Wed, 17 Nov 2010 21:34:37 +0000 (16:34 -0500)]
cfg80211: fix can_beacon_sec_chan, reenable HT40

This follows wireless-testing 9236d838c920e90708570d9bbd7bb82d30a38130
("cfg80211: fix extension channel checks to initiate communication") and
fixes accidental case fall-through. Without this fix, HT40 is entirely
blocked.

Signed-off-by: Mark Mentovai <mark@moxienet.com>
Cc: stable@kernel.org
Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agogianfar: fix signedness issue
Nicolas Kaiser [Mon, 15 Nov 2010 10:59:42 +0000 (10:59 +0000)]
gianfar: fix signedness issue

irq_of_parse_and_map() has an unsigned return type.
Testing for a negative error value doesn't work here.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: ipv4: tcp_probe: cleanup snprintf() use
Vasiliy Kulikov [Sun, 14 Nov 2010 07:06:08 +0000 (07:06 +0000)]
net: ipv4: tcp_probe: cleanup snprintf() use

snprintf() returns number of bytes that were copied if there is no overflow.
This code uses return value as number of copied bytes.  Theoretically format
string '%lu.%09lu %pI4:%u %pI4:%u %d %#x %#x %u %u %u %u\n' may be expanded
up to 163 bytes.  In reality tv.tv_sec is just few bytes instead of 20, 2 ports
are just 5 bytes each instead of 10, length is 5 bytes instead of 10.  The rest
is an unstrusted input.  Theoretically if tv_sec is big then copy_to_user() would
overflow tbuf.

tbuf was increased to fit in 163 bytes.  snprintf() is used to follow return
value semantic.

Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: zero kobject in rx_queue_release
John Fastabend [Tue, 16 Nov 2010 06:31:39 +0000 (06:31 +0000)]
net: zero kobject in rx_queue_release

netif_set_real_num_rx_queues() can decrement and increment
the number of rx queues. For example ixgbe does this as
features and offloads are toggled. Presumably this could
also happen across down/up on most devices if the available
resources changed (cpu offlined).

The kobject needs to be zero'd in this case so that the
state is not preserved across kobject_put()/kobject_init_and_add().

This resolves the following error report.

ixgbe 0000:03:00.0: eth2: NIC Link is Up 10 Gbps, Flow Control: RX/TX
kobject (ffff880324b83210): tried to init an initialized object, something is seriously wrong.
Pid: 1972, comm: lldpad Not tainted 2.6.37-rc18021qaz+ #169
Call Trace:
 [<ffffffff8121c940>] kobject_init+0x3a/0x83
 [<ffffffff8121cf77>] kobject_init_and_add+0x23/0x57
 [<ffffffff8107b800>] ? mark_lock+0x21/0x267
 [<ffffffff813c6d11>] net_rx_queue_update_kobjects+0x63/0xc6
 [<ffffffff813b5e0e>] netif_set_real_num_rx_queues+0x5f/0x78
 [<ffffffffa0261d49>] ixgbe_set_num_queues+0x1c6/0x1ca [ixgbe]
 [<ffffffffa0262509>] ixgbe_init_interrupt_scheme+0x1e/0x79c [ixgbe]
 [<ffffffffa0274596>] ixgbe_dcbnl_set_state+0x167/0x189 [ixgbe]

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: use the macros defined for the members of flowi
Changli Gao [Fri, 12 Nov 2010 18:43:55 +0000 (18:43 +0000)]
net: use the macros defined for the members of flowi

Use the macros defined for the members of flowi to clean the code up.

Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agonet: more Kconfig whitespace cleanup
Philippe De Muyter [Sat, 13 Nov 2010 08:43:29 +0000 (08:43 +0000)]
net: more Kconfig whitespace cleanup

indentation for TSI108_ETH entry was too big.

Signed-off-by: Philippe De Muyter <phdm@macqel.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agodrivers/net/can/sja1000: Use printf extension %pR for struct resource
Joe Perches [Fri, 12 Nov 2010 11:37:59 +0000 (11:37 +0000)]
drivers/net/can/sja1000: Use printf extension %pR for struct resource

Using %pR standardizes the struct resource output.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>