]> Pileus Git - ~andy/linux/log
~andy/linux
11 years agobonding: Manage /proc/net/bonding/ entries from the netdev events
Eric W. Biederman [Mon, 9 Jul 2012 10:51:45 +0000 (10:51 +0000)]
bonding: Manage /proc/net/bonding/ entries from the netdev events

It was recently reported that moving a bonding device between network
namespaces causes warnings from /proc.  It turns out after the move we
were trying to add and to remove the /proc/net/bonding entries from the
wrong network namespace.

Move the bonding /proc registration code into the NETDEV_REGISTER and
NETDEV_UNREGISTER events where the proc registration and unregistration
will always happen at the right time.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosmsc95xx: support ethtool get_regs
Emeric Vigier [Mon, 9 Jul 2012 21:44:45 +0000 (17:44 -0400)]
smsc95xx: support ethtool get_regs

Inspired by implementation in smsc911x.c and smsc9420.c
Tested on ARM/pandaboard running android

Signed-off-by: Emeric Vigier <emeric.vigier@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agor6040: use module_pci_driver macro
Devendra Naga [Sun, 8 Jul 2012 05:57:57 +0000 (05:57 +0000)]
r6040: use module_pci_driver macro

as the manual of module_pci_driver says that
it can be used when the init and exit functions of
the module does nothing but the pci_register_driver
and pci_unregister_driver.

use it for rdc's r6040 driver, as the init and exit
paths does as above, and also this reduces a little
amount of code.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: populate skb->l4_rxhash
Eric Dumazet [Mon, 9 Jul 2012 06:02:24 +0000 (06:02 +0000)]
bnx2x: populate skb->l4_rxhash

l4_rxhash is set on skb when rxhash is obtained from canonical 4-tuple
over transport ports/addresses.

We can set skb->l4_rxhash for all incoming TCP packets on bnx2x for
free, as cqe status contains a hash type information.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: Willem de Bruijn <willemb@google.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agor8169: support RTL8168G
Hayes Wang [Mon, 2 Jul 2012 09:23:22 +0000 (17:23 +0800)]
r8169: support RTL8168G

For RTL8111G, the settings of phy and firmware are replaced with
ocp functions. r8168g_mdio_{write / read} redirects the relative
settings to suitable ocp functions. A per-device variable is needed
to evaluate the real address of ocp functions.
rtl_writephy(tp, 0x1f, xxxx) is dedicated to keeping said variable
up-to-date.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
11 years agor8169: abstract out loop conditions.
Francois Romieu [Fri, 6 Jul 2012 12:19:23 +0000 (14:19 +0200)]
r8169: abstract out loop conditions.

Twelve functions can fail silently. Now they have a chance to complain.

Macro and pasting abuse has been kept at a level where tags and
friends should not be hurt.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
11 years agor8169: ephy, eri and efuse functions signature changes.
Francois Romieu [Fri, 6 Jul 2012 20:40:38 +0000 (22:40 +0200)]
r8169: ephy, eri and efuse functions signature changes.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
11 years agor8169: csi_ops signature change.
Francois Romieu [Fri, 6 Jul 2012 11:37:00 +0000 (13:37 +0200)]
r8169: csi_ops signature change.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
11 years agor8169: mdio_ops signature change.
Francois Romieu [Fri, 6 Jul 2012 18:19:42 +0000 (20:19 +0200)]
r8169: mdio_ops signature change.

Further changes need more context down in the call stack.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
11 years agor8169: add RTL8106E support.
Hayes Wang [Mon, 2 Jul 2012 09:23:21 +0000 (17:23 +0800)]
r8169: add RTL8106E support.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
11 years agostmmac: Fix for higher mtu size handling
Deepak Sikri [Sun, 8 Jul 2012 21:14:46 +0000 (21:14 +0000)]
stmmac: Fix for higher mtu size handling

For the higher mtu sizes requiring the buffer size greater than 8192,
the buffers are sent or received using multiple dma descriptors/ same
descriptor with option of multi buffer handling.
It was observed during tests that the driver was missing on data
packets during the normal ping operations if the data buffers being used
catered to jumbo frame handling.

The memory barrriers are added in between preparation of dma descriptors
in the jumbo frame handling path to ensure all instructions before
enabling the dma are complete.

Signed-off-by: Deepak Sikri <deepak.sikri@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agostmmac: Fix for nfs hang on multiple reboot
Deepak Sikri [Sun, 8 Jul 2012 21:14:45 +0000 (21:14 +0000)]
stmmac: Fix for nfs hang on multiple reboot

It was observed that during multiple reboots nfs hangs. The status of
receive descriptors shows that all the descriptors were in control of
CPU, and none were assigned to DMA.
Also the DMA status register confirmed that the Rx buffer is
unavailable.

This patch adds the fix for the same by adding the memory barriers to
ascertain that the all instructions before enabling the Rx or Tx DMA are
completed which involves the proper setting of the ownership bit in DMA
descriptors.

Signed-off-by: Deepak Sikri <deepak.sikri@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Mon, 9 Jul 2012 19:09:08 +0000 (15:09 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem

11 years agoiwlegacy: don't mess up the SCD when removing a key
Emmanuel Grumbach [Wed, 4 Jul 2012 11:59:08 +0000 (13:59 +0200)]
iwlegacy: don't mess up the SCD when removing a key

When we remove a key, we put a key index which was supposed
to tell the fw that we are actually removing the key. But
instead the fw took that index as a valid index and messed
up the SRAM of the device.

This memory corruption on the device mangled the data of
the SCD. The impact on the user is that SCD queue 2 got
stuck after having removed keys.

Reported-by: Paul Bolle <pebolle@tiscali.nl>
Cc: stable@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoiwlegacy: always monitor for stuck queues
Stanislaw Gruszka [Wed, 4 Jul 2012 11:20:20 +0000 (13:20 +0200)]
iwlegacy: always monitor for stuck queues

This is iwlegacy version of:

commit 342bbf3fee2fa9a18147e74b2e3c4229a4564912
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Sun Mar 4 08:50:46 2012 -0800

    iwlwifi: always monitor for stuck queues

    If we only monitor while associated, the following
    can happen:
     - we're associated, and the queue stuck check
       runs, setting the queue "touch" time to X
     - we disassociate, stopping the monitoring,
       which leaves the time set to X
     - almost 2s later, we associate, and enqueue
       a frame
     - before the frame is transmitted, we monitor
       for stuck queues, and find the time set to
       X, although it is now later than X + 2000ms,
       so we decide that the queue is stuck and
       erroneously restart the device

Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00usb: fix indexes ordering on RX queue kick
Stanislaw Gruszka [Wed, 4 Jul 2012 11:10:02 +0000 (13:10 +0200)]
rt2x00usb: fix indexes ordering on RX queue kick

On rt2x00_dmastart() we increase index specified by Q_INDEX and on
rt2x00_dmadone() we increase index specified by Q_INDEX_DONE. So entries
between Q_INDEX_DONE and Q_INDEX are those we currently process in the
hardware. Entries between Q_INDEX and Q_INDEX_DONE are those we can
submit to the hardware.

According to that fix rt2x00usb_kick_queue(), as we need to submit RX
entries that are not processed by the hardware. It worked before only
for empty queue, otherwise was broken.

Note that for TX queues indexes ordering are ok. We need to kick entries
that have filled skb, but was not submitted to the hardware, i.e.
started from Q_INDEX_DONE and have ENTRY_DATA_PENDING bit set.

From practical standpoint this fixes RX queue stall, usually reproducible
in AP mode, like for example reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=828824

Reported-and-tested-by: Franco Miceli <fmiceli@plan.ceibal.edu.uy>
Reported-and-tested-by: Tom Horsley <horsley1953@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: fix Coverity SCAN CID 709078: Resource leak (RESOURCE_LEAK)
Bing Zhao [Tue, 3 Jul 2012 22:53:13 +0000 (15:53 -0700)]
mwifiex: fix Coverity SCAN CID 709078: Resource leak (RESOURCE_LEAK)

> *. CID 709078: Resource leak (RESOURCE_LEAK)
>  - drivers/net/wireless/mwifiex/cfg80211.c, line: 935
> Assigning: "bss_cfg" = storage returned from "kzalloc(132UL, 208U)"
>  - but was not free
> drivers/net/wireless/mwifiex/cfg80211.c:935

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomac80211: destroy assoc_data correctly if assoc fails
Eliad Peller [Mon, 2 Jul 2012 11:42:03 +0000 (14:42 +0300)]
mac80211: destroy assoc_data correctly if assoc fails

If association failed due to internal error (e.g. no
supported rates IE), we call ieee80211_destroy_assoc_data()
with assoc=true, while we actually reject the association.

This results in the BSSID not being zeroed out.

After passing assoc=false, we no longer have to call
sta_info_destroy_addr() explicitly. While on it, move
the "associated" message after the assoc_success check.

Cc: stable@vger.kernel.org [3.4+]
Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoNFC: Prevent NULL deref when getting socket name
Sasha Levin [Sat, 30 Jun 2012 09:56:47 +0000 (11:56 +0200)]
NFC: Prevent NULL deref when getting socket name

llcp_sock_getname can be called without a device attached to the nfc_llcp_sock.

This would lead to the following BUG:

[  362.341807] BUG: unable to handle kernel NULL pointer dereference at           (null)
[  362.341815] IP: [<ffffffff836258e5>] llcp_sock_getname+0x75/0xc0
[  362.341818] PGD 31b35067 PUD 30631067 PMD 0
[  362.341821] Oops: 0000 [#627] PREEMPT SMP DEBUG_PAGEALLOC
[  362.341826] CPU 3
[  362.341827] Pid: 7816, comm: trinity-child55 Tainted: G      D W    3.5.0-rc4-next-20120628-sasha-00005-g9f23eb7 #479
[  362.341831] RIP: 0010:[<ffffffff836258e5>]  [<ffffffff836258e5>] llcp_sock_getname+0x75/0xc0
[  362.341832] RSP: 0018:ffff8800304fde88  EFLAGS: 00010286
[  362.341834] RAX: 0000000000000000 RBX: ffff880033cb8000 RCX: 0000000000000001
[  362.341835] RDX: ffff8800304fdec4 RSI: ffff8800304fdec8 RDI: ffff8800304fdeda
[  362.341836] RBP: ffff8800304fdea8 R08: 7ebcebcb772b7ffb R09: 5fbfcb9c35bdfd53
[  362.341838] R10: 4220020c54326244 R11: 0000000000000246 R12: ffff8800304fdec8
[  362.341839] R13: ffff8800304fdec4 R14: ffff8800304fdec8 R15: 0000000000000044
[  362.341841] FS:  00007effa376e700(0000) GS:ffff880035a00000(0000) knlGS:0000000000000000
[  362.341843] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  362.341844] CR2: 0000000000000000 CR3: 0000000030438000 CR4: 00000000000406e0
[  362.341851] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  362.341856] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  362.341858] Process trinity-child55 (pid: 7816, threadinfo ffff8800304fc000, task ffff880031270000)
[  362.341858] Stack:
[  362.341862]  ffff8800304fdea8 ffff880035156780 0000000000000000 0000000000001000
[  362.341865]  ffff8800304fdf78 ffffffff83183b40 00000000304fdec8 0000006000000000
[  362.341868]  ffff8800304f0027 ffffffff83729649 ffff8800304fdee8 ffff8800304fdf48
[  362.341869] Call Trace:
[  362.341874]  [<ffffffff83183b40>] sys_getpeername+0xa0/0x110
[  362.341877]  [<ffffffff83729649>] ? _raw_spin_unlock_irq+0x59/0x80
[  362.341882]  [<ffffffff810f342b>] ? do_setitimer+0x23b/0x290
[  362.341886]  [<ffffffff81985ede>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[  362.341889]  [<ffffffff8372a539>] system_call_fastpath+0x16/0x1b
[  362.341921] Code: 84 00 00 00 00 00 b8 b3 ff ff ff 48 85 db 74 54 66 41 c7 04 24 27 00 49 8d 7c 24 12 41 c7 45 00 60 00 00 00 48 8b 83 28 05 00 00 <8b> 00 41 89 44 24 04 0f b6 83 41 05 00 00 41 88 44 24 10 0f b6
[  362.341924] RIP  [<ffffffff836258e5>] llcp_sock_getname+0x75/0xc0
[  362.341925]  RSP <ffff8800304fde88>
[  362.341926] CR2: 0000000000000000
[  362.341928] ---[ end trace 6d450e935ee18bf3 ]---

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomac80211: correct size the argument to kzalloc in minstrel_ht
Thomas Huehn [Fri, 29 Jun 2012 13:26:27 +0000 (06:26 -0700)]
mac80211: correct size the argument to kzalloc in minstrel_ht

msp has type struct minstrel_ht_sta_priv not struct minstrel_ht_sta.

(This incorporates the fixup originally posted as "mac80211: fix kzalloc
memory corruption introduced in minstrel_ht". -- JWL)

Reported-by: Fengguang Wu <wfg@linux.intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'master' of git://1984.lsi.us.es/nf
David S. Miller [Mon, 9 Jul 2012 09:47:59 +0000 (02:47 -0700)]
Merge branch 'master' of git://1984.lsi.us.es/nf

Pablo Neira Ayuso says:

====================
* One to get the timeout special parameter for the SET target back working
  (this was introduced while trying to fix another bug in 3.4) from
  Jozsef Kadlecsik.

* One crash fix if containers and nf_conntrack are used reported by Hans
  Schillstrom by myself.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonetfilter: nf_ct_ecache: fix crash with multiple containers, one shutting down
Pablo Neira Ayuso [Thu, 5 Jul 2012 13:42:10 +0000 (15:42 +0200)]
netfilter: nf_ct_ecache: fix crash with multiple containers, one shutting down

Hans reports that he's still hitting:

BUG: unable to handle kernel NULL pointer dereference at 000000000000027c
IP: [<ffffffff813615db>] netlink_has_listeners+0xb/0x60
PGD 0
Oops: 0000 [#3] PREEMPT SMP
CPU 0

It happens when adding a number of containers with do:

nfct_query(h, NFCT_Q_CREATE, ct);

and most likely one namespace shuts down.

this problem was supposed to be fixed by:
70e9942 netfilter: nf_conntrack: make event callback registration per-netns

Still, it was missing one rcu_access_pointer to check if the callback
is set or not.

Reported-by: Hans Schillstrom <hans@schillstrom.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
11 years agonetfilter: ipset: timeout fixing bug broke SET target special timeout value
Jozsef Kadlecsik [Fri, 29 Jun 2012 09:42:28 +0000 (09:42 +0000)]
netfilter: ipset: timeout fixing bug broke SET target special timeout value

The patch "127f559 netfilter: ipset: fix timeout value overflow bug"
broke the SET target when no timeout was specified.

Reported-by: Jean-Philippe Menil <jean-philippe.menil@univ-nantes.fr>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
11 years agocnic: Don't use netdev->base_addr
Michael Chan [Thu, 5 Jul 2012 14:21:55 +0000 (14:21 +0000)]
cnic: Don't use netdev->base_addr

commit c0357e975afdbbedab5c662d19bef865f02adc17
    bnx2: stop using net_device.{base_addr, irq}.

removed netdev->base_addr so we need to update cnic to get the MMIO
base address from pci_resource_start().  Otherwise, mmap of the uio
device will fail.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: qmi_wwan: add ZTE MF60
Bjørn Mork [Thu, 5 Jul 2012 01:13:33 +0000 (01:13 +0000)]
net: qmi_wwan: add ZTE MF60

Adding a device with limited QMI support. It does not support
normal QMI_WDS commands for connection management. Instead,
sending a QMI_CTL SET_INSTANCE_ID command is required to
enable the network interface:

  01 0f 00 00 00 00 00 00  20 00 04 00 01 01 00 00

A number of QMI_DMS and QMI_NAS commands are also supported
for optional device management.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocgroup: fix panic in netprio_cgroup
Gao feng [Wed, 4 Jul 2012 23:28:40 +0000 (23:28 +0000)]
cgroup: fix panic in netprio_cgroup

we set max_prioidx to the first zero bit index of prioidx_map in
function get_prioidx.

So when we delete the low index netprio cgroup and adding a new
netprio cgroup again,the max_prioidx will be set to the low index.

when we set the high index cgroup's net_prio.ifpriomap,the function
write_priomap will call update_netdev_tables to alloc memory which
size is sizeof(struct netprio_map) + sizeof(u32) * (max_prioidx + 1),
so the size of array that map->priomap point to is max_prioidx +1,
which is low than what we actually need.

fix this by adding check in get_prioidx,only set max_prioidx when
max_prioidx low than the new prioidx.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosmall cleanup in ax25_addr_parse()
Dan Carpenter [Wed, 4 Jul 2012 22:27:18 +0000 (22:27 +0000)]
small cleanup in ax25_addr_parse()

The comments were wrong here because "AX25_MAX_DIGIS" is 8 but the
comments say 6.  Also I've changed the "7" to "AX25_ADDR_LEN".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: Fix Endian
Li RongQing [Wed, 4 Jul 2012 16:05:42 +0000 (16:05 +0000)]
be2net: Fix Endian

ETH_P_IP is host Endian, skb->protocol is big Endian, when
compare them, we should change ETH_P_IP from host endian
to big endian, htons, not ntohs.

CC: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Acked-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonetdev/phy: Fixup lockdep warnings in mdio-mux.c
David Daney [Wed, 4 Jul 2012 12:06:16 +0000 (12:06 +0000)]
netdev/phy: Fixup lockdep warnings in mdio-mux.c

With lockdep enabled we get:

=============================================
[ INFO: possible recursive locking detected ]
3.4.4-Cavium-Octeon+ #313 Not tainted
---------------------------------------------
kworker/u:1/36 is trying to acquire lock:
(&bus->mdio_lock){+.+...}, at: [<ffffffff813da7e8>] mdio_mux_read+0x38/0xa0

but task is already holding lock:
 (&bus->mdio_lock){+.+...}, at: [<ffffffff813d79e4>] mdiobus_read+0x44/0x88

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&bus->mdio_lock);
  lock(&bus->mdio_lock);

 *** DEADLOCK ***

 May be due to missing lock nesting notation
.
.
.

This is a false positive, since we are indeed using 'nested' locking,
we need to use mutex_lock_nested().

Now in theory we can stack multiple MDIO multiplexers, but that would
require passing the nesting level (which is difficult to know) to
mutex_lock_nested().  Instead we assume the simple case of a single
level of nesting.  Since these are only warning messages, it isn't so
important to solve the general case.

Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobcm87xx: fix reg-init comment typo
Peter Korsgaard [Wed, 4 Jul 2012 05:05:45 +0000 (05:05 +0000)]
bcm87xx: fix reg-init comment typo

broadcom, not marvell.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: David Daney <david.daney@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agophylib: Support registering a bunch of drivers
Christian Hohnstaedt [Wed, 4 Jul 2012 05:44:34 +0000 (05:44 +0000)]
phylib: Support registering a bunch of drivers

If registering of one of them fails, all already registered drivers
of this module will be unregistered.

Use the new register/unregister functions in all drivers
registering more than one driver.

amd.c, realtek.c: Simplify: directly return registration result.

Tested with broadcom.c
All others compile-tested.

Signed-off-by: Christian Hohnstaedt <chohnstaedt@innominate.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoixgbe: DCB and SR-IOV can not co-exist and will cause hangs
Alexander Duyck [Wed, 4 Jul 2012 02:00:25 +0000 (02:00 +0000)]
ixgbe: DCB and SR-IOV can not co-exist and will cause hangs

DCB and SR-IOV cannot currently be enabled at the same time as the queueing
schemes are incompatible.  If they are both enabled it will result in Tx
hangs since only the first Tx queue will be able to transmit any traffic.

This simple fix for this is to block us from enabling TCs in ixgbe_setup_tc
if SR-IOV is enabled.  This change will be reverted once we can support
SR-IOV and DCB coexistence.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobcm87xx: disable autonegotiation by default
Peter Korsgaard [Wed, 4 Jul 2012 00:33:57 +0000 (00:33 +0000)]
bcm87xx: disable autonegotiation by default

The bcm87xx phys don't support autonegotiation, so don't use it by
default, as otherwise phy_state_machine() will try to enable it (using
c22 requests, which also don't make any sense for the bcm78xx).

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosky2: Fix for interrupt handler
Mirko Lindner [Tue, 3 Jul 2012 23:38:46 +0000 (23:38 +0000)]
sky2: Fix for interrupt handler

Re-enable interrupts if it is not our interrupt

Signed-off-by: Mirko Lindner <mlindner@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosky2: Added support for Optima EEE
Mirko Lindner [Tue, 3 Jul 2012 23:38:41 +0000 (23:38 +0000)]
sky2: Added support for Optima EEE

This patch adds support for the Optima EEE chipset.

Signed-off-by: Mirko Lindner <mlindner@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/macb: manage carrier state with call to netif_carrier_{on|off}()
Nicolas Ferre [Tue, 3 Jul 2012 23:14:13 +0000 (23:14 +0000)]
net/macb: manage carrier state with call to netif_carrier_{on|off}()

OFF carrier state is setup in probe() open() and suspend() functions.
The carrier ON state is managed in macb_handle_link_change().

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonetem: add limitation to reordered packets
Eric Dumazet [Tue, 3 Jul 2012 20:55:21 +0000 (20:55 +0000)]
netem: add limitation to reordered packets

Fix two netem bugs :

1) When a frame was dropped by tfifo_enqueue(), drop counter
   was incremented twice.

2) When reordering is triggered, we enqueue a packet without
   checking queue limit. This can OOM pretty fast when this
   is repeated enough, since skbs are orphaned, no socket limit
   can help in this situation.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Mark Gordon <msg@google.com>
Cc: Andreas Terzis <aterzis@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Hagen Paul Pfeifer <hagen@jauu.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoatl1c: fix issue of transmit queue 0 timed out
Cloud Ren [Tue, 3 Jul 2012 16:51:48 +0000 (16:51 +0000)]
atl1c: fix issue of transmit queue 0 timed out

some people report atl1c could cause system hang with following
kernel trace info:
---------------------------------------
WARNING: at.../net/sched/sch_generic.c:258 dev_watchdog+0x1db/0x1d0()
...
NETDEV WATCHDOG: eth0 (atl1c): transmit queue 0 timed out
...
---------------------------------------
This is caused by netif_stop_queue calling when cable Link is down.
So remove netif_stop_queue, because link_watch will take it over.

Signed-off-by: xiong <xiong@qca.qualcomm.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Cloud Ren <cjren@qca.qualcomm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosctp: refactor sctp_packet_append_chunk and clenup some memory leaks
Neil Horman [Mon, 2 Jul 2012 09:59:24 +0000 (09:59 +0000)]
sctp: refactor sctp_packet_append_chunk and clenup some memory leaks

While doing some recent work on sctp sack bundling I noted that
sctp_packet_append_chunk was pretty inefficient.  Specifially, it was called
recursively while trying to bundle auth and sack chunks.  Because of that we
call sctp_packet_bundle_sack and sctp_packet_bundle_auth a total of 4 times for
every call to sctp_packet_append_chunk, knowing that at least 3 of those calls
will do nothing.

So lets refactor sctp_packet_bundle_auth to have an outer part that does the
attempted bundling, and an inner part that just does the chunk appends.  This
saves us several calls per iteration that we just don't need.

Also, noticed that the auth and sack bundling fail to free the chunks they
allocate if the append fails, so make sure we add that in

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Vlad Yasevich <vyasevich@gmail.com>
CC: "David S. Miller" <davem@davemloft.net>
CC: linux-sctp@vger.kernel.org
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: dont use __netdev_alloc_skb for bounce buffer
Eric Dumazet [Mon, 2 Jul 2012 08:36:12 +0000 (08:36 +0000)]
net: dont use __netdev_alloc_skb for bounce buffer

commit a1c7fff7e1 (net: netdev_alloc_skb() use build_skb()) broke b44 on
some 64bit machines.

It appears b44 and b43 use __netdev_alloc_skb() instead of alloc_skb()
for their bounce buffers.

There is no need to add an extra NET_SKB_PAD reservation for bounce
buffers :

- In TX path, NET_SKB_PAD is useless

- In RX path in b44, we force a copy of incoming frames if
  GFP_DMA allocations were needed.

Reported-and-bisected-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2i: use strlcpy() instead of memcpy() for strings
Dan Carpenter [Sat, 30 Jun 2012 01:49:35 +0000 (01:49 +0000)]
bnx2i: use strlcpy() instead of memcpy() for strings

DRV_MODULE_VERSION here is "2.7.2.2" which is only 8 chars but we copy
12 bytes from the stack so it's a small information leak.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Michael Chan <mchan@broadcom.com>
Acked-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoieee802154: verify packet size before trying to allocate it
Sasha Levin [Mon, 2 Jul 2012 01:29:55 +0000 (01:29 +0000)]
ieee802154: verify packet size before trying to allocate it

Currently when sending data over datagram, the send function will attempt to
allocate any size passed on from the userspace.

We should make sure that this size is checked and limited. We'll limit it
to the MTU of the device, which is checked later anyway.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next
David S. Miller [Sat, 7 Jul 2012 23:29:29 +0000 (16:29 -0700)]
Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next

11 years agoasix: avoid copies in tx path
Eric Dumazet [Thu, 5 Jul 2012 04:31:01 +0000 (04:31 +0000)]
asix: avoid copies in tx path

I noticed excess calls to skb_copy_expand() or memmove() in asix driver.

This driver needs to push 4 bytes in front of frame (packet_len)
and maybe add 4 bytes after the end (if padlen is 4)

So it should set needed_headroom & needed_tailroom to avoid
copies. But its not enough, because many packets are cloned
before entering asix_tx_fixup() and this driver use skb_cloned()
as a lazy way to check if it can push and put additional bytes in frame.

Avoid skb_copy_expand() expensive call, using following rules :

- We are allowed to push 4 bytes in headroom if skb_header_cloned()
  is false (and if we have 4 bytes of headroom)

- We are allowed to put 4 bytes at tail if skb_cloned()
  is false (and if we have 4 bytes of tailroom)

TCP packets for example are cloned, but skb_header_release()
was called in tcp stack, allowing us to use headroom for our needs.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Allan Chou <allan@asix.com.tw>
Cc: Trond Wuellner <trond@chromium.org>
Cc: Grant Grundler <grundler@chromium.org>
Cc: Paul Stewart <pstew@chromium.org>
Cc: Ming Lei <tom.leiming@gmail.com>
Tested-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_en: Add support for drop action through ethtool
Hadar Hen Zion [Thu, 5 Jul 2012 04:03:50 +0000 (04:03 +0000)]
net/mlx4_en: Add support for drop action through ethtool

The drop action is implemented by allocating a QP and keeping it in a reset state
such that the HW drops any packets which are steered to that QP. When a drop action
is requested, we attach the relevant flow to that QP.

Sign-off-by: Hadar Hen Zion <hadarh@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_en: Manage flow steering rules with ethtool
Hadar Hen Zion [Thu, 5 Jul 2012 04:03:49 +0000 (04:03 +0000)]
net/mlx4_en: Manage flow steering rules with ethtool

Implement the ethtool APIs for attaching L2/L3/L4 based flow steering
rules to the netdevice RX rings. Added set_rxnfc callback and enhanced
the existing get_rxnfc callback.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.co.il>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4: Implement promiscuous mode with device managed flow-steering
Hadar Hen Zion [Thu, 5 Jul 2012 04:03:48 +0000 (04:03 +0000)]
net/mlx4: Implement promiscuous mode with device managed flow-steering

The device managed flow steering API has three promiscuous modes:

1. Uplink - captures all the packets that arrive to the port.
2. Allmulti - captures all multicast packets arriving to the port.
3. Function port - for future use, this mode is not implemented yet.

Use these modes with the flow_attach and flow_detach firmware commands
according to the promiscuous state of the netdevice.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_core: Add resource tracking for device managed flow steering rules
Hadar Hen Zion [Thu, 5 Jul 2012 04:03:47 +0000 (04:03 +0000)]
net/mlx4_core: Add resource tracking for device managed flow steering rules

As with other device resources, the resource tracker is needed for supporting
device managed flow steering rules under SRIOV: make sure virtual functions
delete only rules created by them, and clean all rules attached by a crashed VF.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years ago{NET, IB}/mlx4: Add device managed flow steering firmware API
Hadar Hen Zion [Thu, 5 Jul 2012 04:03:46 +0000 (04:03 +0000)]
{NET, IB}/mlx4: Add device managed flow steering firmware API

The driver is modified to support three operation modes.

If supported by firmware use the device managed flow steering
API, that which we call device managed steering mode. Else, if
the firmware supports the B0 steering mode use it, and finally,
if none of the above, use the A0 steering mode.

When the steering mode is device managed, the code is modified
such that L2 based rules set by the mlx4_en driver for Ethernet
unicast and multicast, and the IB stack multicast attach calls
done through the mlx4_ib driver are all routed to use the device
managed API.

When attaching rule using device managed flow steering API,
the firmware returns a 64 bit registration id, which is to be
provided during detach.

Currently the firmware is always programmed during HCA initialization
to use standard L2 hashing. Future work should be done to allow
configuring the flow-steering hash function with common, non
proprietary means.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_core: Add firmware commands to support device managed flow steering
Hadar Hen Zion [Thu, 5 Jul 2012 04:03:45 +0000 (04:03 +0000)]
net/mlx4_core: Add firmware commands to support device managed flow steering

Add support for firmware commands to attach/detach a new device managed
steering mode. Such network steering rules allow the user to provide an
L2/L3/L4 flow specification to the firmware and have the device to steer
traffic that matches that specification to the provided QP.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4: Set steering mode according to device capabilities
Hadar Hen Zion [Thu, 5 Jul 2012 04:03:44 +0000 (04:03 +0000)]
net/mlx4: Set steering mode according to device capabilities

Instead of checking the firmware supported steering mode in various
places in the code, add a dedicated field in the mlx4 device capabilities
structure which is written once during the initialization flow and read
across the code.

This also set the grounds for add new steering modes. Currently two modes
are supported, and are named after the ConnectX HW versions A0 and B0.

A0 steering uses mac_index, vlan_index and priority to steer traffic
into pre-defined range of QPs.

B0 steering uses Ethernet L2 hashing rules and is enabled only
if the firmware supports both unicast and multicast B0 steering,

The current steering modes are relevant for Ethernet traffic only,
such that Infiniband steering remains untouched.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_en: Re-design multicast attachments flow
Yevgeny Petrilin [Thu, 5 Jul 2012 04:03:43 +0000 (04:03 +0000)]
net/mlx4_en: Re-design multicast attachments flow

Currently, for every change in the net device multicast list, the driver
detaches all the addresses from the HW device, and then attaches the
updated list. This behavior is wrong from two aspects: first, it causes
a load of firmware commands and second, there is period of time where
the correct addresses are not attached, which turned into packet loss.

To improve - a copy of the multicast list is saved by the driver. For
every change in the multicast list, the multicast list copy is used
to find the delta between those two lists and add or remove multicast
addresses as needed.

Reported-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
Cc: Shawn Bohrer <sbohrer@rgmadvisors.com>
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.co.il>
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_core: Change resource tracking ID to be 64 bit
Hadar Hen Zion [Thu, 5 Jul 2012 04:03:42 +0000 (04:03 +0000)]
net/mlx4_core: Change resource tracking ID to be 64 bit

Currently the IDs used by the resource tracker are of type u32, so far this was
ok since all the different resources we were tracking could be encoded in 32bit.

As a preparation step for tracking of resources whose IDs need > 32 bits such
as network flow steering rules, who are 64 bit in size, move to use 64 bit
based resource IDs.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_core: Change resource tracking mechanism to use red-black tree
Hadar Hen Zion [Thu, 5 Jul 2012 04:03:41 +0000 (04:03 +0000)]
net/mlx4_core: Change resource tracking mechanism to use red-black tree

Change the data structure used for managing the SRIOV resource tracking
mechanism from radix tree to red-black tree. This is preparation step
for supporting resource IDs which are 64bit long, such as network flow
steering rules. Such IDs can't be used as radix-tree keys on 32bit
architectures and hence the reason for the change.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'master' of git://1984.lsi.us.es/nf-next
David S. Miller [Sat, 7 Jul 2012 23:18:50 +0000 (16:18 -0700)]
Merge branch 'master' of git://1984.lsi.us.es/nf-next

11 years agor6040: remove duplicate call to the pci_set_drvdata
Devendra Naga [Fri, 6 Jul 2012 20:07:35 +0000 (20:07 +0000)]
r6040: remove duplicate call to the pci_set_drvdata

pci_set_drvdata is called twice at the remove path of driver,
call it once.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: fix a bad cast in ip6_dst_lookup_tail()
Eric Dumazet [Fri, 6 Jul 2012 07:19:05 +0000 (09:19 +0200)]
ipv6: fix a bad cast in ip6_dst_lookup_tail()

Fix a bug in ip6_dst_lookup_tail(), where typeof(dst) is
"struct dst_entry **", not "struct dst_entry *"

Reported-by: Fengguang Wu <wfg@linux.intel.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: remove redundant declarations
Eric Dumazet [Thu, 5 Jul 2012 20:34:35 +0000 (20:34 +0000)]
ipv6: remove redundant declarations

remove redundant declarations, they belong in include/net/tcp.h

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv4: Avoid overhead when no custom FIB rules are installed.
David S. Miller [Fri, 6 Jul 2012 05:13:13 +0000 (22:13 -0700)]
ipv4: Avoid overhead when no custom FIB rules are installed.

If the user hasn't actually installed any custom rules, or fiddled
with the default ones, don't go through the whole FIB rules layer.

It's just pure overhead.

Instead do what we do with CONFIG_IP_MULTIPLE_TABLES disabled, check
the individual tables by hand, one by one.

Also, move fib_num_tclassid_users into the ipv4 network namespace.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipoib: Need to do dst_neigh_lookup_skb() outside of priv->lock.
David S. Miller [Fri, 6 Jul 2012 04:08:05 +0000 (21:08 -0700)]
ipoib: Need to do dst_neigh_lookup_skb() outside of priv->lock.

Otherwise local_bh_enable() complains.

Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobatman-adv: check incoming packet type for bla
Simon Wunderlich [Wed, 4 Jul 2012 18:38:19 +0000 (20:38 +0200)]
batman-adv: check incoming packet type for bla

If the gateway functionality is used, some broadcast packets (DHCP
requests) may be transmitted as unicast packets. As the bridge loop
avoidance code now only considers the payload Ethernet destination,
it may drop the DHCP request for clients which are claimed by other
backbone gateways, because it falsely infers from the broadcast address
that the right backbone gateway should havehandled the broadcast.

Fix this by checking and delegating the batman-adv packet type used
for transmission.

Reported-by: Guido Iribarren <guidoiribarren@buenosaireslibre.org>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
11 years agoipv6: Initialize the neighbour pointer of rt6_info on allocation
Steffen Klassert [Thu, 5 Jul 2012 03:18:28 +0000 (03:18 +0000)]
ipv6: Initialize the neighbour pointer of rt6_info on allocation

git commit 97cac082 (ipv6: Store route neighbour in rt6_info struct)
added a neighbour pointer to rt6_info. Currently we don't initialize
this pointer at allocation time. We assume this pointer to be valid
if it is not a null pointer, so initialize it on allocation.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
David S. Miller [Thu, 5 Jul 2012 10:44:25 +0000 (03:44 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

11 years agodrivers/ieee802154/at231rf230: remove unused return status
alex.bluesman.smirnov@gmail.com [Sun, 1 Jul 2012 20:18:32 +0000 (20:18 +0000)]
drivers/ieee802154/at231rf230: remove unused return status

Remove excessive variable used for the return status.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years ago6lowpan: revert 'reuse eth_mac_addr()'
alex.bluesman.smirnov@gmail.com [Sun, 1 Jul 2012 19:58:46 +0000 (19:58 +0000)]
6lowpan: revert 'reuse eth_mac_addr()'

This reverts the commit cdf49c283e2e105da86ca575ad35b453f5ff24ea which
replaces lowpan '.ndo_set_mac_address' method by ethernet's one.

Accorind to the IEEE 802.15.4 standard, device has 8-byte length address,
so this hook loses the last 2 bytes which may rise a compatibility problems
with other IEEE 802.15.4 standard implementations.

Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agodccp: remove unnecessary codes in ipv6.c
RongQing.Li [Sun, 1 Jul 2012 17:19:00 +0000 (17:19 +0000)]
dccp: remove unnecessary codes in ipv6.c

opt always equals np->opts, so it is meaningless to define opt, and
check if opt does not equal np->opts and then try to free opt.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: remove unnecessary codes in tcp_ipv6.c
RongQing.Li [Sun, 1 Jul 2012 17:18:59 +0000 (17:18 +0000)]
ipv6: remove unnecessary codes in tcp_ipv6.c

opt always equals np->opts, so it is meaningless to define opt, and
check if opt does not equal np->opts and then try to free opt.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobe2net: set maximal number of default RSS queues
Yuval Mintz [Sun, 1 Jul 2012 03:19:00 +0000 (03:19 +0000)]
be2net: set maximal number of default RSS queues

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Cc: Sathya Perla <sathya.perla@emulex.com>
Cc: Subbu Seetharaman <subbu.seetharaman@emulex.com>
Cc: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2x: set maximal number of default RSS queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:59 +0000 (03:18 +0000)]
bnx2x: set maximal number of default RSS queues

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobnx2: set maximal number of default RSS queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:58 +0000 (03:18 +0000)]
bnx2: set maximal number of default RSS queues

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Cc: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agotg3: set maximal number of default RSS queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:57 +0000 (03:18 +0000)]
tg3: set maximal number of default RSS queues

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Cc: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agomyri10ge: set maximal number of default RSS queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:56 +0000 (03:18 +0000)]
myri10ge: set maximal number of default RSS queues

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Cc: Jon Mason <mason@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgb4: set maximal number of default RSS queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:55 +0000 (03:18 +0000)]
cxgb4: set maximal number of default RSS queues

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Cc: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgb3: set maximal number of default RSS queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:54 +0000 (03:18 +0000)]
cxgb3: set maximal number of default RSS queues

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Cc: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqlge: set maximal number of default RSS queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:53 +0000 (03:18 +0000)]
qlge: set maximal number of default RSS queues

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Cc: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Cc: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Cc: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agovxge: set maximal number of default RSS queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:52 +0000 (03:18 +0000)]
vxge: set maximal number of default RSS queues

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Cc: Jon Mason <jdmason@kudzu.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agomlx4: set maximal number of default RSS queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:51 +0000 (03:18 +0000)]
mlx4: set maximal number of default RSS queues

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet-next: Add netif_get_num_default_rss_queues
Yuval Mintz [Sun, 1 Jul 2012 03:18:50 +0000 (03:18 +0000)]
net-next: Add netif_get_num_default_rss_queues

Most multi-queue networking driver consider the number of online cpus when
configuring RSS queues.
This patch adds a wrapper to the number of cpus, setting an upper limit on the
number of cpus a driver should consider (by default) when allocating resources
for his queues.

Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv4: defer fib_compute_spec_dst() call
Eric Dumazet [Wed, 4 Jul 2012 22:30:09 +0000 (22:30 +0000)]
ipv4: defer fib_compute_spec_dst() call

ip_options_compile() can avoid calling fib_compute_spec_dst()
by default, and perform the call only if needed.

David suggested to add a helper to make the call only once.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Kill dst->_neighbour, accessors, and final uses.
David S. Miller [Tue, 3 Jul 2012 05:58:02 +0000 (22:58 -0700)]
net: Kill dst->_neighbour, accessors, and final uses.

No longer used.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoxfrm: No need to copy generic neighbour pointer.
David S. Miller [Tue, 3 Jul 2012 05:53:37 +0000 (22:53 -0700)]
xfrm: No need to copy generic neighbour pointer.

Nobody reads it any longer.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv4: No need to set generic neighbour pointer.
David S. Miller [Tue, 3 Jul 2012 08:07:44 +0000 (01:07 -0700)]
ipv4: No need to set generic neighbour pointer.

Nobody reads it any longer.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: Store route neighbour in rt6_info struct.
David S. Miller [Tue, 3 Jul 2012 05:43:47 +0000 (22:43 -0700)]
ipv6: Store route neighbour in rt6_info struct.

This makes for a simplified conversion away from dst_get_neighbour*().

All code outside of ipv6 will use neigh lookups via dst_neigh_lookup*().

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgb3: Convert t3_l2t_get() over to dst_neigh_lookup().
David S. Miller [Tue, 3 Jul 2012 05:35:31 +0000 (22:35 -0700)]
cxgb3: Convert t3_l2t_get() over to dst_neigh_lookup().

This means passing in a suitable destination address.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Pass neighbours and dest address into NETEVENT_REDIRECT events.
David S. Miller [Tue, 3 Jul 2012 08:01:51 +0000 (01:01 -0700)]
net: Pass neighbours and dest address into NETEVENT_REDIRECT events.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agodecnet: Use neighbours privately in dn_route struct.
David S. Miller [Tue, 3 Jul 2012 05:22:18 +0000 (22:22 -0700)]
decnet: Use neighbours privately in dn_route struct.

This allows an easy conversion away from dst_get_neighbour*().

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoneigh: Convert over to dst_neigh_lookup_skb().
David S. Miller [Tue, 3 Jul 2012 05:15:37 +0000 (22:15 -0700)]
neigh: Convert over to dst_neigh_lookup_skb().

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobr_netfilter: Convert to dst_neigh_lookup_skb().
David S. Miller [Tue, 3 Jul 2012 05:12:59 +0000 (22:12 -0700)]
br_netfilter: Convert to dst_neigh_lookup_skb().

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgb4i: Convert over to dst_neigh_lookup().
David S. Miller [Tue, 3 Jul 2012 05:10:55 +0000 (22:10 -0700)]
cxgb4i: Convert over to dst_neigh_lookup().

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agocxgbi: Convert over to dst_neigh_lookup().
David S. Miller [Tue, 3 Jul 2012 05:08:58 +0000 (22:08 -0700)]
cxgbi: Convert over to dst_neigh_lookup().

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: Convert over to dst_neigh_lookup_skb().
David S. Miller [Tue, 3 Jul 2012 05:02:33 +0000 (22:02 -0700)]
qeth: Convert over to dst_neigh_lookup_skb().

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipoib: Convert over to dev_lookup_neigh_skb().
David S. Miller [Tue, 3 Jul 2012 05:00:03 +0000 (22:00 -0700)]
ipoib: Convert over to dev_lookup_neigh_skb().

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosch_teql: Convert over to dev_neigh_lookup_skb().
David S. Miller [Tue, 3 Jul 2012 04:57:45 +0000 (21:57 -0700)]
sch_teql: Convert over to dev_neigh_lookup_skb().

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Add optional SKB arg to dst_ops->neigh_lookup().
David S. Miller [Tue, 3 Jul 2012 04:52:24 +0000 (21:52 -0700)]
net: Add optional SKB arg to dst_ops->neigh_lookup().

Causes the handler to use the daddr in the ipv4/ipv6 header when
the route gateway is unspecified (local subnet).

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: Do delayed neigh confirmation.
David S. Miller [Mon, 2 Jul 2012 09:21:03 +0000 (02:21 -0700)]
net: Do delayed neigh confirmation.

When a dst_confirm() happens, mark the confirmation as pending in the
dst.  Then on the next packet out, when we have the neigh in-hand, do
the update.

This removes the dependency in dst_confirm() of dst's having an
attached neigh.

While we're here, remove the explicit 'dst' NULL check, all except 2
or 3 call sites ensure it's not NULL.  So just fix those cases up.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosunrpc: Don't do a dst_confirm() on an input routes.
David S. Miller [Mon, 2 Jul 2012 09:15:37 +0000 (02:15 -0700)]
sunrpc: Don't do a dst_confirm() on an input routes.

xs_udp_data_ready() is operating on received packets, and tries to
do a dst_confirm() on the dst attached to the SKB.

This isn't right, dst confirmation is for output routes, not input
rights.  It's for resetting the timers on the nexthop neighbour entry
for the route, indicating that we've got good evidence that we've
successfully reached it.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv4: Don't report neigh uptodate state in rtcache procfs.
David S. Miller [Mon, 2 Jul 2012 09:04:13 +0000 (02:04 -0700)]
ipv4: Don't report neigh uptodate state in rtcache procfs.

Soon routes will not have a cached neigh attached, nor will we
be able to necessarily go directly to a neigh from an arbitrary
route.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv4: Make neigh lookups directly in output packet path.
David S. Miller [Mon, 2 Jul 2012 09:02:15 +0000 (02:02 -0700)]
ipv4: Make neigh lookups directly in output packet path.

Do not use the dst cached neigh, we'll be getting rid of that.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv4: Fix crashes in ip_options_compile().
David S. Miller [Wed, 4 Jul 2012 23:13:17 +0000 (16:13 -0700)]
ipv4: Fix crashes in ip_options_compile().

The spec_dst uses should be guarded by skb_rtable() being non-NULL
not just the SKB being non-null.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonetfilter: nfnetlink_queue: do not allow to set unsupported flag bits
Krishna Kumar [Wed, 27 Jun 2012 00:59:56 +0000 (00:59 +0000)]
netfilter: nfnetlink_queue: do not allow to set unsupported flag bits

Allow setting of only supported flag bits in queue->flags.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>