cascardo/linux.git
9 years agonet: Add IPv6 flow label to flow_keys
Tom Herbert [Thu, 4 Jun 2015 16:16:44 +0000 (09:16 -0700)]
net: Add IPv6 flow label to flow_keys

In flow_dissector set the flow label in flow_keys for IPv6. This also
removes the shortcircuiting of flow dissection when a non-zero label
is present, the flow label can be considered to provide additional
entropy for a hash.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Add VLAN ID to flow_keys
Tom Herbert [Thu, 4 Jun 2015 16:16:43 +0000 (09:16 -0700)]
net: Add VLAN ID to flow_keys

In flow_dissector set vlan_id in flow_keys when VLAN is found.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Get rid of IPv6 hash addresses flow keys
Tom Herbert [Thu, 4 Jun 2015 16:16:42 +0000 (09:16 -0700)]
net: Get rid of IPv6 hash addresses flow keys

We don't need to return the IPv6 address hash as part of flow keys.
In general, using the IPv6 address hash is risky in a hash value
since the underlying use of xor provides no entropy. If someone
really needs the hash value they can get it from the full IPv6
addresses in flow keys (e.g. from flow_get_u32_src).

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Add keys for TIPC address
Tom Herbert [Thu, 4 Jun 2015 16:16:41 +0000 (09:16 -0700)]
net: Add keys for TIPC address

Add a new flow key for TIPC addresses.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Add full IPv6 addresses to flow_keys
Tom Herbert [Thu, 4 Jun 2015 16:16:40 +0000 (09:16 -0700)]
net: Add full IPv6 addresses to flow_keys

This patch adds full IPv6 addresses into flow_keys and uses them as
input to the flow hash function. The implementation supports either
IPv4 or IPv6 addresses in a union, and selector is used to determine
how may words to input to jhash2.

We also add flow_get_u32_dst and flow_get_u32_src functions which are
used to get a u32 representation of the source and destination
addresses. For IPv6, ipv6_addr_hash is called. These functions retain
getting the legacy values of src and dst in flow_keys.

With this patch, Ethertype and IP protocol are now included in the
flow hash input.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Get skb hash over flow_keys structure
Tom Herbert [Thu, 4 Jun 2015 16:16:39 +0000 (09:16 -0700)]
net: Get skb hash over flow_keys structure

This patch changes flow hashing to use jhash2 over the flow_keys
structure instead just doing jhash_3words over src, dst, and ports.
This method will allow us take more input into the hashing function
so that we can include full IPv6 addresses, VLAN, flow labels etc.
without needing to resort to xor'ing which makes for a poor hash.

Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Remove superfluous setting of key_basic
Tom Herbert [Thu, 4 Jun 2015 16:16:38 +0000 (09:16 -0700)]
net: Remove superfluous setting of key_basic

key_basic is set twice in __skb_flow_dissect which seems unnecessary.
Remove second one.

Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agompls: Add definition for IPPROTO_MPLS
Tom Herbert [Thu, 4 Jun 2015 16:16:37 +0000 (09:16 -0700)]
mpls: Add definition for IPPROTO_MPLS

Add uapi define for MPLS over IP.

Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Simplify GRE case in flow_dissector
Tom Herbert [Thu, 4 Jun 2015 16:16:36 +0000 (09:16 -0700)]
net: Simplify GRE case in flow_dissector

Do break when we see routing flag or a non-zero version number in GRE
header.

Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoatm:he - Do not initialise statics to 0.
Shailendra Verma [Thu, 4 Jun 2015 14:41:00 +0000 (20:11 +0530)]
atm:he - Do not initialise statics to 0.

According to <stdbool.h> false is always '0' and
Static variables are initialised to 0 by GCC.

Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocompat: cleanup coding in compat_get_bitmap() and compat_put_bitmap()
Helge Deller [Thu, 4 Jun 2015 21:57:18 +0000 (23:57 +0200)]
compat: cleanup coding in compat_get_bitmap() and compat_put_bitmap()

In the functions compat_get_bitmap() and compat_put_bitmap() the
variable nr_compat_longs stores how many compat_ulong_t words should be
copied in a loop.

The copy loop itself is this:
  if (nr_compat_longs-- > 0) {
      if (__get_user(um, umask)) return -EFAULT;
  } else {
      um = 0;
  }

Since nr_compat_longs gets unconditionally decremented in each loop and
since it's type is unsigned this could theoretically lead to out of
bounds accesses to userspace if nr_compat_longs wraps around to
(unsigned)(-1).

Although the callers currently do not trigger out-of-bounds accesses, we
should better implement the loop in a safe way to completely avoid such
warp-arounds.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
9 years agoUSB: cp210x: add ID for HubZ dual ZigBee and Z-Wave dongle
John D. Blair [Thu, 4 Jun 2015 20:18:19 +0000 (13:18 -0700)]
USB: cp210x: add ID for HubZ dual ZigBee and Z-Wave dongle

Added the USB serial device ID for the HubZ dual ZigBee
and Z-Wave radio dongle.

Signed-off-by: John D. Blair <johnb@candicontrols.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
9 years agobpf: fix build due to missing tc_verd
Alexei Starovoitov [Thu, 4 Jun 2015 15:33:48 +0000 (08:33 -0700)]
bpf: fix build due to missing tc_verd

fix build error:
net/core/filter.c: In function 'bpf_clone_redirect':
net/core/filter.c:1429:18: error: 'struct sk_buff' has no member named 'tc_verd'
  if (G_TC_AT(skb2->tc_verd) & AT_INGRESS)

Fixes: 3896d655f4d4 ("bpf: introduce bpf_clone_redirect() helper")
Reported-by: Or Gerlitz <gerlitz.or@gmail.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Linus Torvalds [Thu, 4 Jun 2015 17:19:34 +0000 (10:19 -0700)]
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine fixes from Vinod Koul:
 "We have two small fixes:

   - pl330 termination hang fix by Krzysztof

   - hsu memory leak fix by Peter"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: hsu: Fix memory leak when stopping a running transfer
  dmaengine: pl330: Fix hang on dmaengine_terminate_all on certain boards

9 years agoperf/x86/intel/pt: Fix a refactoring bug
Alexander Shishkin [Thu, 4 Jun 2015 13:31:47 +0000 (16:31 +0300)]
perf/x86/intel/pt: Fix a refactoring bug

Commit 066450be41 ("perf/x86/intel/pt: Clean up the control flow
in pt_pmu_hw_init()") changed attribute initialization so that
only the first attribute gets initialized using
sysfs_attr_init(), which upsets lockdep.

This patch fixes the glitch so that all allocated attributes are
properly initialized thus fixing the lockdep warning reported by
Tvrtko and Imre.

Reported-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Reported-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
9 years agovirtio_pci: Clear stale cpumask when setting irq affinity
Jiang Liu [Thu, 4 Jun 2015 08:41:44 +0000 (16:41 +0800)]
virtio_pci: Clear stale cpumask when setting irq affinity

The cpumask vp_dev->msix_affinity_masks[info->msix_vector] may contain
staled information when vp_set_vq_affinity() gets called, so clear it
before setting the new cpu bit mask.

Cc: stable@vger.kernel.org
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
9 years agodrm/i915: Move WaBarrierPerformanceFixDisable:skl to skl code from chv code
Ville Syrjälä [Tue, 2 Jun 2015 12:37:35 +0000 (15:37 +0300)]
drm/i915: Move WaBarrierPerformanceFixDisable:skl to skl code from chv code

 commit 65ca7514e21adbee25b8175fc909759c735d00ff
 Author: Damien Lespiau <damien.lespiau@intel.com>
 Date:   Mon Feb 9 19:33:22 2015 +0000

    drm/i915/skl: Implement WaBarrierPerformanceFixDisable

got misapplied and the code landed in chv_init_workarounds() instead of
the intended skl_init_workarounds(). Move it over to the right place.

Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 years agodrm/i915: Include G4X/VLV/CHV in self refresh status
Ander Conselvan de Oliveira [Tue, 2 Jun 2015 11:17:47 +0000 (14:17 +0300)]
drm/i915: Include G4X/VLV/CHV in self refresh status

Add all missing platforms handled by intel_set_memory_cxsr() to the
i915_sr_status debugfs entry.

v2: Add G4X too. (Ville)
    Clarify the change also affects CHV. (Ander)

References: https://bugs.freedesktop.org/show_bug.cgi?id=89792
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 years agodrm/i915: Initialize HWS page address after GPU reset
Arun Siluvery [Tue, 2 Jun 2015 19:06:59 +0000 (20:06 +0100)]
drm/i915: Initialize HWS page address after GPU reset

After GPU reset, HW is losing the address of HWS page in the register.
The page itself is valid except that HW is not aware of its location.

[   64.368623] [drm:gen8_init_common_ring [i915]] *ERROR* HWS Page address = 0x00000000
[   64.368655] [drm:gen8_init_common_ring [i915]] *ERROR* HWS Page address = 0x00000000
[   64.368681] [drm:gen8_init_common_ring [i915]] *ERROR* HWS Page address = 0x00000000
[   64.368704] [drm:gen8_init_common_ring [i915]] *ERROR* HWS Page address = 0x00000000

This patch reloads this value into the register during ring init.

Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
9 years agotcp: double default TSQ output bytes limit
Wei Liu [Wed, 3 Jun 2015 10:10:42 +0000 (11:10 +0100)]
tcp: double default TSQ output bytes limit

Xen virtual network driver has higher latency than a physical NIC.
Having only 128K as limit for TSQ introduced 30% regression in guest
throughput.

This patch raises the limit to 256K. This reduces the regression to 8%.
This buys us more time to work out a proper solution in the long run.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: remove redundant checks
Eric Dumazet [Thu, 4 Jun 2015 06:49:21 +0000 (23:49 -0700)]
tcp: remove redundant checks

tcp_v4_rcv() checks the following before calling tcp_v4_do_rcv():

if (th->doff < sizeof(struct tcphdr) / 4)
    goto bad_packet;
if (!pskb_may_pull(skb, th->doff * 4))
    goto discard_it;

So following check in tcp_v4_do_rcv() is redundant
and "goto csum_err;" is wrong anyway.

if (skb->len < tcp_hdrlen(skb) || ...)
goto csum_err;

A second check can be removed after no_tcp_socket label for same reason.

Same tests can be removed in tcp_v6_do_rcv()

Note : short tcp frames are not properly accounted in tcpInErrs MIB,
because pskb_may_pull() failure simply drops incoming skb, we might
fix this in a separate patch.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoipv4/udp: Verify multicast group is ours in upd_v4_early_demux()
Shawn Bohrer [Wed, 3 Jun 2015 21:27:38 +0000 (16:27 -0500)]
ipv4/udp: Verify multicast group is ours in upd_v4_early_demux()

421b3885bf6d56391297844f43fb7154a6396e12 "udp: ipv4: Add udp early
demux" introduced a regression that allowed sockets bound to INADDR_ANY
to receive packets from multicast groups that the socket had not joined.
For example a socket that had joined 224.168.2.9 could also receive
packets from 225.168.2.9 despite not having joined that group if
ip_early_demux is enabled.

Fix this by calling ip_check_mc_rcu() in udp_v4_early_demux() to verify
that the multicast packet is indeed ours.

Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
Reported-by: Yurij M. Plotnikov <Yurij.Plotnikov@oktetlabs.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'switchdev-next'
David S. Miller [Thu, 4 Jun 2015 06:47:24 +0000 (23:47 -0700)]
Merge branch 'switchdev-next'

Scott Feldman says:

====================
switchdev: documentation updates

Update the switchdev documentation to clarify that for IPV4 FIB object, the add
op is used for both adding and modifying the FIB entry on the device.

I found a few other white-space and grammer issues to fix, and to clarify the
static FDB ops.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoswitchdev: documentation: use switchdev_port_obj_xxx for IPv4 FIB add/modify/delete ops
Scott Feldman [Thu, 4 Jun 2015 03:43:43 +0000 (20:43 -0700)]
switchdev: documentation: use switchdev_port_obj_xxx for IPv4 FIB add/modify/delete ops

Clarify in documentation and code that IPV4 FIB add operation is used for
both adding a new FIB entry to the device and for modifying an existing FIB
entry on the device.

Also, remove left-over references to ipv4_fib ops and replace with details
on SWITCHDEV_PORT_IPV4_FIB object.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoswitchdev: documentation: for static FDB ops, use switchdev_port_fdb_xxx ops
Scott Feldman [Thu, 4 Jun 2015 03:43:42 +0000 (20:43 -0700)]
switchdev: documentation: for static FDB ops, use switchdev_port_fdb_xxx ops

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoswitchdev: documentation: fix grammer error
Scott Feldman [Thu, 4 Jun 2015 03:43:41 +0000 (20:43 -0700)]
switchdev: documentation: fix grammer error

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoswitchdev: documentation: fix longer-than-80-char lines
Scott Feldman [Thu, 4 Jun 2015 03:43:40 +0000 (20:43 -0700)]
switchdev: documentation: fix longer-than-80-char lines

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge tag 'wireless-drivers-next-for-davem-2015-06-03' of git://git.kernel.org/pub...
David S. Miller [Thu, 4 Jun 2015 06:44:57 +0000 (23:44 -0700)]
Merge tag 'wireless-drivers-next-for-davem-2015-06-03' of git://git./linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
new driver mt7601u for MediaTek Wi-Fi devices MT7601U

ath10k:

* qca6174 power consumption improvements, enable ASPM etc (Michal)

wil6210:

* support Wi-Fi Simple Configuration in STA mode

iwlwifi:

* a few fixes (re-enablement of interrupts for certain new
  platforms that have special power states)
* Rework completely the RBD allocation model towards new
  multi RX hardware.
* cleanups
* scan reworks continuation (Luca)

mwifiex:

* improve firmware debug functionality

rtlwifi:

* update regulatory database

brcmfmac:

* cleanup and new feature support in PCIe code
* alternative nvram loading for router support
====================

Conflicts:
drivers/net/wireless/iwlwifi/Kconfig

Trivial conflict in iwlwifi Kconfig, two commits adding
the same two chip numbers to the help text, but order
transposed.

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'cxgb4-next'
David S. Miller [Thu, 4 Jun 2015 06:40:20 +0000 (23:40 -0700)]
Merge branch 'cxgb4-next'

Hariprasad Shenai says:

====================
cxgb4: Adds support for various ethtool stats

This patch series adds the following:
Adds support to dump adapter specific stats in ethtool
Adds support to dump channel stats in ethtool
Adds support to dump loopback port stats in ethtool
Remove wake-on-lan get/set ethtool support

This patch series has been created against net-next tree and includes
patches on cxgb4 driver.

We have included all the maintainers of respective drivers. Kindly review
the change and let us know in case of any review comments.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4: Remove WOL get/set ethtool support
Hariprasad Shenai [Wed, 3 Jun 2015 15:34:42 +0000 (21:04 +0530)]
cxgb4: Remove WOL get/set ethtool support

Remove ethtool get/set support for wake on lan, adapter doesn't support
it.

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4: Add support to dump loopback port stats
Hariprasad Shenai [Wed, 3 Jun 2015 15:34:41 +0000 (21:04 +0530)]
cxgb4: Add support to dump loopback port stats

Add support in ethtool to dump loopback port statistics

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4: Add support in ethtool to dump channel stats
Hariprasad Shenai [Wed, 3 Jun 2015 15:34:40 +0000 (21:04 +0530)]
cxgb4: Add support in ethtool to dump channel stats

Add support in ethtool to dump adapter channel stats

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4: Add ethtool support to get adapter stats
Hariprasad Shenai [Wed, 3 Jun 2015 15:34:39 +0000 (21:04 +0530)]
cxgb4: Add ethtool support to get adapter stats

Add ethtool support to get adapter specific hardware statistics

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
David S. Miller [Thu, 4 Jun 2015 03:22:46 +0000 (20:22 -0700)]
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge

Antonio Quartulli says:

====================
pull request: batman-adv 20150603

here you have our second batch of patches intended for net-next.

In this patchset you won't find any new features, but quite some code
cleanup work, a bunch of code style fixes and also comments corrections
by Markus Pargmann.

Moreover you have a patch from Sven Eckelmann removing an unnecessary
NULL check in batadv_iv_ogm_update_seqnos().

Please pull or let me know of any problem!
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: tulip: rearrange order of searching for substrings
Rasmus Villemoes [Wed, 3 Jun 2015 11:44:03 +0000 (13:44 +0200)]
net: tulip: rearrange order of searching for substrings

Currently, two of the branches are dead code, since an earlier smaller
substring would have been found ("TP" in the "TP_NW" case and either
of "BNC" and "AUI" in the "BNC_AUI" case). Rearrange the strstr()
calls so that the longer strings are searched for first.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
David S. Miller [Thu, 4 Jun 2015 03:19:16 +0000 (20:19 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2015-06-03

This series contains updates to e1000e only.

Yanir provides 8 fixes and 1 version bump for e1000e.  First fix resolves
a possible unit hang if multiple descriptors are available in the rings
during reset or runtime suspend.  Fixed a warning on SPARC compile based
on a suggested solution from Alex Duyck.  Fixed a logical error, where
a "if" condition under which a flush should occur, was revered.  Fixed
a hardware issue that prevented i219 from working in legacy interrupts
mode.  Fixed the hardware clock configuration and suprious non-linear
increment.  Lastly, fixed a system hang which occurred during execution
of "ethtool -t <NIC>", by disabling MULR for the loopback test to avoid
the hand state.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobpf: introduce bpf_clone_redirect() helper
Alexei Starovoitov [Tue, 2 Jun 2015 23:03:14 +0000 (16:03 -0700)]
bpf: introduce bpf_clone_redirect() helper

Allow eBPF programs attached to classifier/actions to call
bpf_clone_redirect(skb, ifindex, flags) helper which will
mirror or redirect the packet by dynamic ifindex selection
from within the program to a target device either at ingress
or at egress. Can be used for various scenarios, for example,
to load balance skbs into veths, split parts of the traffic
to local taps, etc.

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet/mlx4_core: fix typo in mlx4_set_vf_mac
Carol Soto [Tue, 2 Jun 2015 21:07:25 +0000 (16:07 -0500)]
net/mlx4_core: fix typo in mlx4_set_vf_mac

fix typo in mlx4_set_vf_mac

Acked-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet/mlx4_core: need to call close fw if alloc icm is called twice
Carol Soto [Tue, 2 Jun 2015 21:07:24 +0000 (16:07 -0500)]
net/mlx4_core: need to call close fw if alloc icm is called twice

If mlx4_enable_sriov is called by adapter without this
feature MLX4_DEV_CAP_FLAG2_SYS_EQS then during this path the function alloc
icm is called twice without freeing the structures from the first time.

Acked-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet/mlx4_core: double free of dev_vfs
Carol L Soto [Tue, 2 Jun 2015 21:07:23 +0000 (16:07 -0500)]
net/mlx4_core: double free of dev_vfs

If user loads mlx4_core with num_vfs greater than
supported then variable dev->dev_vfs is freed 2 times after unloading the
driver.

Acked-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Carol L Soto <clsoto@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodrivers/net/ethernet/dec/tulip/uli526x.c: fix misleading indentation in uli526x_timer
David Malcolm [Tue, 2 Jun 2015 19:31:17 +0000 (15:31 -0400)]
drivers/net/ethernet/dec/tulip/uli526x.c: fix misleading indentation in uli526x_timer

This code in drivers/net/ethernet/dec/tulip/uli526x.c
function "uli526x_timer":

  1086          } else
  1087                  if ((tmp_cr12 & 0x3) && db->link_failed) {
  [...snip...]
  1109                  }
  1110                  else if(!(tmp_cr12 & 0x3) && db->link_failed)
  1111                  {
  [...snip...]
  1117                  }
  1118                  db->init=0;

is misleadingly indented: the
  db->init=0
is indented as if part of the else clause at line 1086, but it is
independent of it (no braces before the "if" at line 1087).

This patch fixes the indentation to reflect the actual meaning of the code,
though is it actually meant to be part of the "else" clause?  (I'm a
compiler developer, not a kernel person).  It also adds spaces around
the assignment, to placate checkpatch.pl.

Seen via an experimental new gcc warning I'm working on for gcc 6,
-Wmisleading-indentation, using gcc r223098 adding
-Werror=misleading-indentation to KBUILD_CFLAGS in Makefile.
The experimental GCC emits this warning (as an error), rightly IMHO:

drivers/net/ethernet/dec/tulip/uli526x.c: In function ‘uli526x_timer’:
drivers/net/ethernet/dec/tulip/uli526x.c:1118:3: error: statement is
indented as if it were guarded by... [-Werror=misleading-indentation]
   db->init=0;
    ^
drivers/net/ethernet/dec/tulip/uli526x.c:1086:4: note: ...this ‘else’
clause, but it is not
  } else
     ^

Hope this is helpful
Dave

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: phy: dp83867: Add TI dp83867 phy
Dan Murphy [Tue, 2 Jun 2015 14:34:37 +0000 (09:34 -0500)]
net: phy: dp83867: Add TI dp83867 phy

Add support for the TI dp83867 Gigabit ethernet phy
device.

The DP83867 is a robust, low power, fully featured
Physical Layer transceiver with integrated PMD
sublayers to support 10BASE-T, 100BASE-TX and
1000BASE-T Ethernet protocols.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoopenvswitch: disable LRO
Jiri Benc [Tue, 2 Jun 2015 12:36:34 +0000 (14:36 +0200)]
openvswitch: disable LRO

Currently, openvswitch tries to disable LRO from the user space. This does
not work correctly when the device added is a vlan interface, though.
Instead of dealing with possibly complex stacked cross name space relations
in the user space, do the same as bridging does and call dev_disable_lro in
the kernel.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Acked-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoethernet: micrel: use time_after_eq
Antonio Murdaca [Tue, 2 Jun 2015 12:35:52 +0000 (14:35 +0200)]
ethernet: micrel: use time_after_eq

use the time_after_eq macro for jiffies comparison operation

Signed-off-by: Antonio Murdaca <antonio.murdaca@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet/mlx4_core: Fix build failure introduced by the EQ pool changes
Or Gerlitz [Tue, 2 Jun 2015 07:29:48 +0000 (10:29 +0300)]
net/mlx4_core: Fix build failure introduced by the EQ pool changes

When CONFIG_RFS_ACCEL or SMP aren't set, we fail to build, fix it.

Also, avoid build warning as of unused function on that setup.

Fixes: c66fa19c405a ('net/mlx4: Add EQ pool')
Reported-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agos390/bpf: fix bpf frame pointer setup
Michael Holzheu [Tue, 2 Jun 2015 05:48:35 +0000 (22:48 -0700)]
s390/bpf: fix bpf frame pointer setup

Currently the bpf frame pointer is set to the old r15. This is
wrong because of packed stack. Fix this and adjust the frame pointer
to respect packed stack. This now generates a prolog like the following:

 3ff8001c3faeb67f0480024   stmg    %r6,%r7,72(%r15)
 3ff8001c400ebcff0780024   stmg    %r12,%r15,120(%r15)
 3ff8001c406b904001f       lgr     %r1,%r15      <- load backchain
 3ff8001c40a41d0f048       la      %r13,72(%r15) <- load adjusted bfp
 3ff8001c40ea7fbfd98       aghi    %r15,-616
 3ff8001c412e310f0980024   stg     %r1,152(%r15) <- save backchain

Fixes: 054623105728 ("s390/bpf: Add s390x eBPF JIT compiler backend")
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agos390/bpf: fix stack allocation
Michael Holzheu [Tue, 2 Jun 2015 05:48:34 +0000 (22:48 -0700)]
s390/bpf: fix stack allocation

On s390x we have to provide 160 bytes stack space before we can call
the next function. From the 160 bytes that we got from the previous
function we only use 11 * 8 bytes and have 160 - 11 * 8 bytes left.
Currently for BPF we allocate additional 160 - 11 * 8 bytes for the
next function. This is wrong because then the next function only gets:

 (160 - 11 * 8) + (160 - 11 * 8) = 2 * 72 = 144 bytes

Fix this and allocate enough memory for the next function.

Fixes: 054623105728 ("s390/bpf: Add s390x eBPF JIT compiler backend")
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge tag 'drm-amdkfd-fixes-2015-06-03' of git://people.freedesktop.org/~gabbayo...
Dave Airlie [Thu, 4 Jun 2015 02:29:04 +0000 (12:29 +1000)]
Merge tag 'drm-amdkfd-fixes-2015-06-03' of git://people.freedesktop.org/~gabbayo/linux into drm-fixes

One minor fix for last -rc of 4.1. The fix moves the update of an attribute in
topology to *after* it is actually initialized.

* tag 'drm-amdkfd-fixes-2015-06-03' of git://people.freedesktop.org/~gabbayo/linux:
  drm/amdkfd: fix topology bug with capability attr.

9 years agoMerge branch 'drm-fixes-4.1' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Thu, 4 Jun 2015 02:28:41 +0000 (12:28 +1000)]
Merge branch 'drm-fixes-4.1' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

One more small r7xx audio regression fix for 4.1

* 'drm-fixes-4.1' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: use proper ACR regisiter for DCE3.2

9 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-block
Linus Torvalds [Wed, 3 Jun 2015 23:35:00 +0000 (16:35 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-block

Pull block layer fixes from Jens Axboe:
 "Sending this off now, as I'm not aware of other current bugs, nor do I
  expect further fixes before 4.1 final.  This contains two fixes:

   - a fix for a bdi unregister warning that gets spewed on md, due to a
     regression introduced earlier in this cycle.  From Neil Brown.

   - a fix for a compile warning for NVMe on 32-bit platforms, also a
     regression introduced in this cycle.  From Arnd Bergmann"

* 'for-linus' of git://git.kernel.dk/linux-block:
  NVMe: fix type warning on 32-bit
  block: discard bdi_unregister() in favour of bdi_destroy()

9 years agoMAINTAINERS - remove OSDL reference
Stephen Hemminger [Wed, 3 Jun 2015 20:32:02 +0000 (13:32 -0700)]
MAINTAINERS - remove OSDL reference

OSDL has been gone for many years, looks like there still was
one reference to it.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agodrm/amdkfd: fix topology bug with capability attr.
Alexey Skidanov [Sun, 30 Nov 2014 13:03:51 +0000 (15:03 +0200)]
drm/amdkfd: fix topology bug with capability attr.

This patch fixes a bug where the number of watch points
was shown before it was actually calculated

Signed-off-by: Alexey Skidanov <Alexey.Skidanov@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
9 years agolib: Clarify the return value of strnlen_user()
Jan Kara [Wed, 3 Jun 2015 13:50:35 +0000 (15:50 +0200)]
lib: Clarify the return value of strnlen_user()

strnlen_user() can return a number in a range 0 to count +
sizeof(unsigned long) - 1. Clarify the comment at the top of the
function so that users don't think the function returns at most count+1.

Signed-off-by: Jan Kara <jack@suse.cz>
[ Also added commentary about preferably not using this function ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9 years agobatman-adv: Remove unnecessary ret variable in algo_register
Markus Pargmann [Fri, 26 Dec 2014 11:41:41 +0000 (12:41 +0100)]
batman-adv: Remove unnecessary ret variable in algo_register

Remove ret variable and all jumps.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agobatman-adv: Remove unnecessary ret variable
Markus Pargmann [Fri, 26 Dec 2014 11:41:40 +0000 (12:41 +0100)]
batman-adv: Remove unnecessary ret variable

We can avoid this indirect return variable by directly returning the
error values.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agobatman-adv: main, batadv_compare_eth return bool
Markus Pargmann [Fri, 26 Dec 2014 11:41:39 +0000 (12:41 +0100)]
batman-adv: main, batadv_compare_eth return bool

Declare the returntype of batadv_compare_eth as bool.
The function called inside this helper function
(ether_addr_equal_unaligned) also uses bool as return value, so there is
no need to return int.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agobatman-adv: main, Convert is_my_mac() to bool
Markus Pargmann [Fri, 26 Dec 2014 11:41:38 +0000 (12:41 +0100)]
batman-adv: main, Convert is_my_mac() to bool

It is much clearer to see a bool type as return value than 'int' for
functions that are supposed to return true or false.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agobatman-adv: Remove unnecessary check for orig_ifinfo not NULL
Sven Eckelmann [Sun, 1 Mar 2015 15:56:26 +0000 (16:56 +0100)]
batman-adv: Remove unnecessary check for orig_ifinfo not NULL

orig_ifinfo is dereferenced multiple times in batadv_iv_ogm_update_seqnos
before the check for NULL is done. The function also exists at the
beginning when orig_ifinfo would have been NULL. This makes the check at
the end unnecessary and only confuses the reader/code analyzers.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agobatman-adv: types, Fix comment on bcast_own
Markus Pargmann [Fri, 26 Dec 2014 11:41:37 +0000 (12:41 +0100)]
batman-adv: types, Fix comment on bcast_own

batadv_orig_bat_iv->bcast_own is actually not a bitfield, it is an
array. Adjust the comment accordingly.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agoe1000e: Bump the version to 3.2.5
Yanir Lubetkin [Tue, 2 Jun 2015 14:05:50 +0000 (17:05 +0300)]
e1000e: Bump the version to 3.2.5

Bump the version to reflect the driver changes and bug fixes for i219.
Also update the copyright, while we are at it.

Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoe1000e: fix unit hang during loopback test
Yanir Lubetkin [Tue, 2 Jun 2015 14:05:47 +0000 (17:05 +0300)]
e1000e: fix unit hang during loopback test

System would hang during execution of "ethtool -t <NIC>" for the same
reason that required flushing the descriptor rings. This fix disables
MULR for the loopback test to avoid the hang state.

Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoe1000e: fix systim issues
Yanir Lubetkin [Tue, 2 Jun 2015 14:05:45 +0000 (17:05 +0300)]
e1000e: fix systim issues

Two issues involving systim were reported.
1. Clock is not running in the correct frequency
2. In some situations, systim values were not incremented linearly
This patch fixes the hardware clock configuration and the spurious
non-linear increment.

Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoe1000e: fix legacy interrupt handling in i219
Yanir Lubetkin [Tue, 2 Jun 2015 14:05:42 +0000 (17:05 +0300)]
e1000e: fix legacy interrupt handling in i219

This fix handles a hardware issue that prevented i219 from
working in legacy interrupts mode (IntMode=0)

Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoe1000e: fix flush_desc_ring implementation
Yanir Lubetkin [Tue, 2 Jun 2015 14:05:38 +0000 (17:05 +0300)]
e1000e: fix flush_desc_ring implementation

The indication that a descriptor ring flush is required was read from
FEXTNVM7 by mistake. It should be read from the PCI config space.

Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoe1000e: fix logical error in flush_desc_rings
Yanir Lubetkin [Wed, 22 Apr 2015 16:25:17 +0000 (19:25 +0300)]
e1000e: fix logical error in flush_desc_rings

The condition under which the flush should occur was reversed.  The fix
should be applied before any HW reset (unless followed by bus reset)
and before any power state transition from D0.

If E1000_FEXTNVM7_NEED_DESCRING_FLUSH bit is set in FEXTNVM7 and TDLEN > 0
the Tx ring should be flushed. (fixes ~95% of the hang states).
If the E1000_FEXTNVM7_NEED_DESCRING_FLUSH did not clear, we should also
flush the RX ring. Bug was caught by Alexander Duyck during a code review
when examining this fix.

Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoe1000e: remove call to do_div and sign mismatch warning
Yanir Lubetkin [Wed, 22 Apr 2015 02:55:43 +0000 (05:55 +0300)]
e1000e: remove call to do_div and sign mismatch warning

Fixes a warning that was reported by Yanjiang Jin
<yanjiang.jin@windriver.com> by implementing the solution suggested by
Alexander Duyck <alexander.h.duyck@redhat.com>.

Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoe1000e: i219 execute unit hang fix on every reset or power state transition
Yanir Lubetkin [Wed, 22 Apr 2015 01:15:01 +0000 (04:15 +0300)]
e1000e: i219 execute unit hang fix on every reset or power state transition

After testing various cases, the conclusion is that the fix MUST be
executed BEFORE any event that the HW is reset or transition to D3.
To fix that I moved the execution to the relevant places but per
Alexander Duyck's review, ensure now that the DMA is valid and was not
freed before manipulating the ring.

Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoe1000e: i219 fix unit hang on reset and runtime D3
Yanir Lubetkin [Mon, 13 Apr 2015 23:20:21 +0000 (02:20 +0300)]
e1000e: i219 fix unit hang on reset and runtime D3

Unit hang may occur if multiple descriptors are available in the rings
during reset or runtime suspend. This state can be detected by testing
bit 8 in the FEXTNVM7 register. If this bit is set and there are pending
descriptors in one of the rings, we must flush them prior to reset. Same
applies entering runtime suspend.

Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Reviewed-by: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoALSA: usb-audio: fix missing input volume controls in MAYA44 USB(+)
Clemens Ladisch [Wed, 3 Jun 2015 09:36:51 +0000 (11:36 +0200)]
ALSA: usb-audio: fix missing input volume controls in MAYA44 USB(+)

The driver worked around an error in the MAYA44 USB(+)'s mixer unit
descriptor by aborting before parsing the missing field.  However,
aborting parsing too early prevented parsing of the other units
connected to this unit, so the capture mixer controls would be missing.

Fix this by moving the check for this descriptor error after the parsing
of the unit's input pins.

Reported-by: nightmixes <nightmixes@gmail.com>
Tested-by: nightmixes <nightmixes@gmail.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoALSA: usb-audio: add MAYA44 USB+ mixer control names
Clemens Ladisch [Wed, 3 Jun 2015 09:36:42 +0000 (11:36 +0200)]
ALSA: usb-audio: add MAYA44 USB+ mixer control names

Add mixer control names for the ESI Maya44 USB+ (which appears to be
identical width the AudioTrak Maya44 USB).

Reported-by: nightmixes <nightmixes@gmail.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
9 years agoMerge tag 'iwlwifi-next-for-kalle-2015-06-03' of https://git.kernel.org/pub/scm/linux...
Kalle Valo [Wed, 3 Jun 2015 09:15:51 +0000 (12:15 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2015-06-03' of https://git./linux/kernel/git/iwlwifi/iwlwifi-next

* a few fixes (re-enablement of interrupts for certain new
  platforms that have special power states)
* Rework completely the RBD allocation model towards new
  multi RX hardware.
* cleanups
* scan reworks continuation (Luca)

9 years agobatman-adv: iv_ogm, fix comment function name
Markus Pargmann [Fri, 26 Dec 2014 11:41:36 +0000 (12:41 +0100)]
batman-adv: iv_ogm, fix comment function name

This is a small copy paste fix for batadv_ing_buffer_avg.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agobatman-adv: iv_ogm, fix coding style
Markus Pargmann [Fri, 26 Dec 2014 11:41:35 +0000 (12:41 +0100)]
batman-adv: iv_ogm, fix coding style

The kernel coding style says, that there should not be multiple
assignments in one row.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agobatman-adv: iv_ogm, Fix dup_status comment
Markus Pargmann [Fri, 26 Dec 2014 11:41:34 +0000 (12:41 +0100)]
batman-adv: iv_ogm, Fix dup_status comment

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agobatman-adv: iv_ogm_orig_update, style, add missing brackets
Markus Pargmann [Fri, 26 Dec 2014 11:41:33 +0000 (12:41 +0100)]
batman-adv: iv_ogm_orig_update, style, add missing brackets

CodingStyle describes that either none or both branches of a conditional
have to have brackets.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agobatman-adv: iv_ogm_queue_add, Simplify expressions
Markus Pargmann [Fri, 26 Dec 2014 11:41:32 +0000 (12:41 +0100)]
batman-adv: iv_ogm_queue_add, Simplify expressions

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agobatman-adv: iv_ogm_aggregate_new, simplify error handling
Markus Pargmann [Fri, 26 Dec 2014 11:41:31 +0000 (12:41 +0100)]
batman-adv: iv_ogm_aggregate_new, simplify error handling

It is just a bit easier to put the error handling at one place and let
multiple error paths use the same calls.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
9 years agoMIPS: Avoid an FPE exception in FCSR mask probing
Maciej W. Rozycki [Tue, 2 Jun 2015 16:50:59 +0000 (17:50 +0100)]
MIPS: Avoid an FPE exception in FCSR mask probing

Use the default FCSR value in mask probing, avoiding an FPE exception
where reset has left any exception enable and their corresponding cause
bits set and the register is then rewritten with these bits active.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Joshua Kinard <kumba@gentoo.org>
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
9 years agoiwlwifi: mvm: advertise only HW-supported ciphers
Johannes Berg [Wed, 20 May 2015 14:51:28 +0000 (16:51 +0200)]
iwlwifi: mvm: advertise only HW-supported ciphers

After the new ciphers CCMP-256 and GCMP-128/256 were implemented,
wpa_supplicant could start negotiating them and use the software
implementation. This, however, breaks D3 behaviour in the driver
since it means that WoWLAN will not be possible.

To avoid breaking that feature, advertise only ciphers that the
hardware supports.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: bump the iwlmvm API number to 15
Emmanuel Grumbach [Wed, 3 Jun 2015 06:54:18 +0000 (09:54 +0300)]
iwlwifi: bump the iwlmvm API number to 15

The driver is now ready to handle the -15.ucode.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: Add DC2DC_CONFIG_CMD (0x83) cmd & TLV
Matti Gottlieb [Sun, 31 May 2015 06:18:30 +0000 (09:18 +0300)]
iwlwifi: mvm: Add DC2DC_CONFIG_CMD (0x83) cmd & TLV

Add DC2DC_CONFIG_CMD (0x83) cmd.

Add IWL_UCODE_TLV_CAPA_DC2DC_CONFIG_SUPPORT tlv.

The command allows the driver get & set the DCDC's frequency tune.
(freq_tune is the divider that is used to calculate the actual DCDC's
clock rate)
The command always returns the current/updated frequency tune values of
the DCDC.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: Remove old scan commands
Matti Gottlieb [Sun, 31 May 2015 08:29:52 +0000 (11:29 +0300)]
iwlwifi: mvm: Remove old scan commands

The firmwares that used these commands is not supported
anymore. Remove them.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: prepare for higher API/CAPA bits
Johannes Berg [Mon, 1 Jun 2015 15:11:11 +0000 (17:11 +0200)]
iwlwifi: prepare for higher API/CAPA bits

Currently, loading the firmware fails when it has higher API or CAPA
bits than the driver supports. That's an issue with integration.

At the same time, actually using api[0] and capa[0] will become
confusing when we also have api[1] and capa[1], and it's almost
certain that we'll mix up the bits and use the bits for api[1] with
api[0] by accident.

Avoid all this by translating the API/CAPA bits to the regular kernel
test_bit() format, and also providing wrapper functions. Also use the
__bitwise__ facility of sparse to check that we're testing the right
one.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: simplify iwl_mvm_stop_roc()
Johannes Berg [Mon, 1 Jun 2015 21:38:23 +0000 (23:38 +0200)]
iwlwifi: mvm: simplify iwl_mvm_stop_roc()

As pointed out by smatch, there's no need for a loop that always
immediately terminates. Use an if statement instead and while at
it clean up the mvmvif initialization.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: dvm: enable IEEE80211_HW_SUPPORT_FAST_XMIT
Johannes Berg [Fri, 17 Apr 2015 13:50:43 +0000 (15:50 +0200)]
iwlwifi: dvm: enable IEEE80211_HW_SUPPORT_FAST_XMIT

Since the firmware is responsible for duration calculation, the
driver can easily support fast-xmit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: enable IEEE80211_HW_SUPPORT_FAST_XMIT
Johannes Berg [Fri, 17 Apr 2015 13:50:43 +0000 (15:50 +0200)]
iwlwifi: mvm: enable IEEE80211_HW_SUPPORT_FAST_XMIT

Since the firmware is responsible for duration calculation, the
driver can easily support fast-xmit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: pcie: New RBD allocation model
Sara Sharon [Tue, 28 Apr 2015 09:56:54 +0000 (12:56 +0300)]
iwlwifi: pcie: New RBD allocation model

As a preperation for multiple RX queues change the RBD
allocation model.

The new model includes a background allocator. The allocator is
called by the interrupt handler when there are two released
buffers by the queue, and the allocator starts allocating eight
pages per request.
When the queue has released 8 pages it tries claiming the
request. If the pages are not ready - it keeps claiming.
This new model should make sure that RBDs are always available
across the multiple queues.

The RBDs are transferred between the allocator and the queue.
The queue moves the free RBDs upon freeing them to the allocator.
The allocator moves them back to the queue's possession when the
request is claimed.
The allocator has an initial pool to make sure there are always RBDs
available for the request completion.
Release of the buffers at exit is done per pools - the allocator
frees its own initial pool and the queue frees its own pool.

Existing code refactor -
-Queue's initial pool is the size of the queue only as the allocation
of the new buffers no longer uses this pool.
-Removal of replenish background work, and replenish calls in the
interrupt handler and restock().
-The replenish() and the rxq used_list are used only during
initialization.
-Moved page allocation to a new function for code reuse.

New code -
Allocator code - new structure and functions.
Interrupt handler uses the allocator functions for replenishing buffers.
Reuse of the restock() method.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: pcie: re-enable interrupts on resume
Eliad Peller [Thu, 28 May 2015 13:50:12 +0000 (16:50 +0300)]
iwlwifi: pcie: re-enable interrupts on resume

On resume, all the interrupts are masked (CSR_INT_MASK is 0),
and ict is disabled.

Re-configure them both.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: don't use EBS for P2P find
David Spinadel [Tue, 26 May 2015 07:32:19 +0000 (10:32 +0300)]
iwlwifi: mvm: don't use EBS for P2P find

Don't use EBS for P2P find to make sure we find all GOs in
our only attempt.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add inactive state to ebs status
David Spinadel [Wed, 20 May 2015 08:56:59 +0000 (11:56 +0300)]
iwlwifi: mvm: add inactive state to ebs status

Currently EBS status in scan complete notifications is set to
success if EBS wasn't activated. FW will add a special return
value for cases when EBS wasn't activated and we add a print
of this status.

This change is needed for debug only, no behavior changes.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: pcie: Control access to the NIC's PM registers via iwl_cfg
Avri Altman [Mon, 11 May 2015 08:04:34 +0000 (11:04 +0300)]
iwlwifi: pcie: Control access to the NIC's PM registers via iwl_cfg

Allow a cleaner way to access those hw-dependent registers,
instead of using the product family type etc.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: wrt: add mipi type to debug types
Liad Kaufman [Tue, 19 May 2015 10:47:03 +0000 (13:47 +0300)]
iwlwifi: wrt: add mipi type to debug types

This adds the MIPI mode type to the types declared supported
by the driver. Without this patch, when using MIPI mode and
looking at the logs the user would see the debug destination
"UNKNOWN".

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: rs: pass rate directly to column checks
Eyal Shapira [Wed, 27 May 2015 19:00:03 +0000 (22:00 +0300)]
iwlwifi: mvm: rs: pass rate directly to column checks

A minor refactoring for following patches.
This enables the reuse of the checks functions.

type=cleanup

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoray_cs: Change 1 to true for bool type variable.
Shailendra Verma [Wed, 27 May 2015 00:55:57 +0000 (06:25 +0530)]
ray_cs: Change 1 to true for bool type variable.

The variable translate is bool type. So assigning true instead of 1.

Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: device dump support via devcoredump framework
Amitkumar Karwar [Tue, 26 May 2015 13:34:32 +0000 (06:34 -0700)]
mwifiex: device dump support via devcoredump framework

Currently device dump generated in the driver is retrieved
using ethtool set/get dump commands. We will get rid of
ethtool approach and use devcoredump framework.

Device dump can be trigger by
cat /debugfs/mwifiex/mlanX/device_dump
and when the dump operation is completed, data can be read by
cat /sys/class/devcoredump/devcdX/data

We have prepared following script to split device dump data
into multiple files.

 [root]# cat mwifiex_split_dump_data.sh
 #!/bin/bash
 # usage: ./mwifiex_split_dump_data.sh dump_data

 fw_dump_data=$1

 mem_type="driverinfo ITCM DTCM SQRAM APU CIU ICU MAC"

 for name in ${mem_type[@]}
 do
     sed -n "/Start dump $name/,/End dump/p" $fw_dump_data  > tmp.$name.log
     if [ ! -s tmp.$name.log ]
     then
         rm -rf tmp.$name.log
     else
         #Remove the describle info "Start dump" and "End dump"
         sed '1d' tmp.$name.log | sed '$d' > /data/$name.log
         if [ -s /data/$name.log ]
         then
             echo "generate /data/$name.log"
         else
             sed '1d' tmp.$name.log | sed '$d' > /var/$name.log
             echo "generate /var/$name.log"
         fi
         rm -rf tmp.$name.log
     fi
 done

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: use generic name 'device dump'
Amitkumar Karwar [Tue, 26 May 2015 13:34:31 +0000 (06:34 -0700)]
mwifiex: use generic name 'device dump'

Currently we are dumping driver information also inside
firmware dump API. We will call it as device dump and
dump driver and firmware data separately.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: minor changes in debug messages
Amitkumar Karwar [Tue, 26 May 2015 13:34:30 +0000 (06:34 -0700)]
mwifiex: minor changes in debug messages

Small letters are used in debug messages to match coding style
at other places.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: dump driver information for PCIe interface
Amitkumar Karwar [Tue, 26 May 2015 13:34:29 +0000 (06:34 -0700)]
mwifiex: dump driver information for PCIe interface

Currently we are dumping driver information only for SDIO
interface. This patch adds missing mwifiex_dump_drv_info()
call for PCIe interface.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: fix a possible double free issue
Amitkumar Karwar [Tue, 26 May 2015 13:34:28 +0000 (06:34 -0700)]
mwifiex: fix a possible double free issue

As drv_info_dump pointer doesn't get reset, we may end up
freeing the allocated memory twice.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: fix SDIO firmware dump problem
Amitkumar Karwar [Tue, 26 May 2015 13:34:27 +0000 (06:34 -0700)]
mwifiex: fix SDIO firmware dump problem

It's been observed that firmware doesn't go back to normal
state when all firmware memories are dumped. As a result,
further commands are blocked. This happens due to missing
driver change of writing READ DONE to control register for
SDIO interface.

This patch adds a missing change to fix the problem.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>