platform/kernel/linux-exynos.git
6 years agomvneta: Driver and hardware supports IPv6 offload, so enable it
Andrew Pilloud [Fri, 1 Sep 2017 14:49:49 +0000 (07:49 -0700)]
mvneta: Driver and hardware supports IPv6 offload, so enable it

The mvneta driver and hardware supports IPv6 offload, however it
isn't enabled. Set the NETIF_F_IPV6_CSUM feature to inform the
network layer that this driver can offload IPV6 TCP and UDP
checksums. This change has been tested on an Armada 370 and the
feature support confirmed with several device datasheets
including the Armada XP and Armada 3700.

Signed-off-by: Andrew Pilloud <andrewpilloud@igneoussystems.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge tag 'wireless-drivers-next-for-davem-2017-09-01' of git://git.kernel.org/pub...
David S. Miller [Fri, 1 Sep 2017 17:35:38 +0000 (10:35 -0700)]
Merge tag 'wireless-drivers-next-for-davem-2017-09-01' of git://git./linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for 4.14

Few last patches for 4.14, nothing really major here.

Major changes:

wil6210

* support FW RSSI reporting (by mistake this was accidentally
  mentioned already in the previous pull request, but now it's really
  included)

* make debugfs optional, adds new Kconfig option CONFIG_WIL6210_DEBUGFS

qtnfmac

* implement 64-bit DMA support
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoqlcnic: remove redundant zero check on retries counter
Colin Ian King [Fri, 1 Sep 2017 13:44:31 +0000 (14:44 +0100)]
qlcnic: remove redundant zero check on retries counter

At the end of the do while loop the integer counter retries will
always be zero and so the subsequent check to see if it is zero
is always true and therefore redundant.  Remove the redundant check
and always return -EIO on this return path.  Also unbreak the literal
string in dev_err message to clean up a checkpatch warning.

Detected by CoverityScan, CID#744279 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'mdio-mux-Misc-fix'
David S. Miller [Fri, 1 Sep 2017 17:26:32 +0000 (10:26 -0700)]
Merge branch 'mdio-mux-Misc-fix'

Corentin Labbe says:

====================
net: mdio-mux: Misc fix

This patch series fix minor problems found when working on the
dwmac-sun8i syscon mdio-mux.

Changes since v1:
- Removed obsolete comment about of_mdio_find_bus/put_device
- removed more DRV_VERSION
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mdio-mux: fix unbalanced put_device
Corentin Labbe [Fri, 1 Sep 2017 11:56:04 +0000 (13:56 +0200)]
net: mdio-mux: fix unbalanced put_device

mdio_mux_uninit() call put_device (unconditionally) because of
of_mdio_find_bus() in mdio_mux_init.
But of_mdio_find_bus is only called if mux_bus is empty.
If mux_bus is set, mdio_mux_uninit will print a "refcount_t: underflow"
trace.

This patch add a get_device in the other branch of "if (mux_bus)".

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mdio-mux-mmioreg: Can handle 8/16/32 bits registers
Corentin Labbe [Fri, 1 Sep 2017 11:56:03 +0000 (13:56 +0200)]
net: mdio-mux-mmioreg: Can handle 8/16/32 bits registers

This patch fix an old information that mdio-mux-mmioreg can only handle
8bit registers.
This is not true anymore.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mdio-mux: printing driver version is useless
Corentin Labbe [Fri, 1 Sep 2017 11:56:02 +0000 (13:56 +0200)]
net: mdio-mux: printing driver version is useless

Remove the driver version information because this information
is not useful in an upstream kernel driver.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mdio-mux: Remove unnecessary 'out of memory' message
Corentin Labbe [Fri, 1 Sep 2017 11:56:01 +0000 (13:56 +0200)]
net: mdio-mux: Remove unnecessary 'out of memory' message

This patch fix checkpatch warning about unnecessary 'out of memory'
message.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mdio-mux: Fix NULL Comparison style
Corentin Labbe [Fri, 1 Sep 2017 11:56:00 +0000 (13:56 +0200)]
net: mdio-mux: Fix NULL Comparison style

This patch fix checkpatch warning about NULL Comparison style.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'mvpp2-optional-PHYs-and-GoP-link-irq'
David S. Miller [Fri, 1 Sep 2017 17:08:44 +0000 (10:08 -0700)]
Merge branch 'mvpp2-optional-PHYs-and-GoP-link-irq'

Antoine Tenart says:

====================
net: mvpp2: optional PHYs and GoP link irq

This series aims at making the driver work when no PHY is connected
between a port and the physical layer and not described as a fixed-phy.
This is useful for some usecases such as when a switch is connected
directly to the serdes lanes. It can also be used for SFP ports on the
7k-db and 8k-db while waiting for the phylink support to land in (which
should be part of another series).

This series makes the phy optional in the PPv2 driver, and then adds
the support for the GoP port link interrupt to handle link status
changes on such ports.

This was tested using the SFP ports on the 7k-db and 8k-db boards.

Since v1:
  - Now use phy_interface_mode_is_rgmii() in the GoP link patch.
  - Added one cosmetic patch to take advantage of phy_interface_mode_is_rgmii()
    in the whole PPv2 driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoDocumentation/bindings: net: marvell-pp2: add the link interrupt
Antoine Tenart [Fri, 1 Sep 2017 09:04:55 +0000 (11:04 +0200)]
Documentation/bindings: net: marvell-pp2: add the link interrupt

A link interrupt can be described. Document this valid interrupt name.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Tested-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mvpp2: use the GoP interrupt for link status changes
Antoine Tenart [Fri, 1 Sep 2017 09:04:54 +0000 (11:04 +0200)]
net: mvpp2: use the GoP interrupt for link status changes

This patch adds the GoP link interrupt support for when a port isn't
connected to a PHY. Because of this the phylib callback is never called
and the link status management isn't done. This patch use the GoP link
interrupt in such cases to still have a minimal link management. Without
this patch ports not connected to a PHY cannot work.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Tested-by: Marcin Wojtas <mw@semihalf.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mvpp2: make the phy optional
Antoine Tenart [Fri, 1 Sep 2017 09:04:53 +0000 (11:04 +0200)]
net: mvpp2: make the phy optional

There is not necessarily a PHY between the GoP and the physical port.
However, the driver currently makes the "phy" property mandatory,
contrary to what is stated in the device tree bindings. This patch makes
the PHY optional, and aligns the PPv2 driver on its device tree
documentation. However if a PHY is provided, the GoP link interrupt
won't be used.

With this patch switches directly connected to the serdes lanes and SFP
ports on the Armada 8040-db and Armada 7040-db can be used if the link
interrupt is described in the device tree.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Tested-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mvpp2: take advantage of the is_rgmii helper
Antoine Tenart [Fri, 1 Sep 2017 09:04:52 +0000 (11:04 +0200)]
net: mvpp2: take advantage of the is_rgmii helper

Convert all RGMII checks to use the phy_interface_mode_is_rgmii()
helper. This is a cosmetic patch.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'mlxsw-next-fixes'
David S. Miller [Fri, 1 Sep 2017 17:01:36 +0000 (10:01 -0700)]
Merge branch 'mlxsw-next-fixes'

Jiri Pirko says:

====================
mlxsw: spectrum_router: Couple of fixes

Ido Schimmel (2):
  mlxsw: spectrum_router: Trap packets hitting anycast routes
  mlxsw: spectrum_router: Set abort trap in all virtual routers
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_router: Set abort trap in all virtual routers
Ido Schimmel [Fri, 1 Sep 2017 08:58:56 +0000 (10:58 +0200)]
mlxsw: spectrum_router: Set abort trap in all virtual routers

When the abort mechanism is invoked a default route directing packets to
the CPU is programmed in all the virtual routers currently in use. This
can result in packet loss in case a new VRF is configured.

Upon abort, program the default route in all virtual routers, whether
they are in use or not.

The patch is directed at net-next since post-abort fixes aren't critical
and packet loss due to a missing default route will be insignificant
compared to packet loss caused by the CPU port policer.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_router: Trap packets hitting anycast routes
Ido Schimmel [Fri, 1 Sep 2017 08:58:55 +0000 (10:58 +0200)]
mlxsw: spectrum_router: Trap packets hitting anycast routes

I relied on the fact that anycast routes use the loopback device as
their nexthop device to trap packets hitting them to the CPU.

After commit 4832c30d5458 ("net: ipv6: put host and anycast routes on
device with address") this is no longer the case and such routes are
programmed with a forward action (note the 'offload' flag):

anycast cafe:: dev enp3s0np7 proto kernel metric 0 offload pref medium

This will prevent the router from locally receiving packets destined to
the Subnet-Router anycast address.

Fix this by specifically programming anycast routes with action trap,
which results in the following output:

anycast cafe:: dev enp3s0np7 proto kernel metric 0 pref medium

Fixes: 4832c30d5458 ("net: ipv6: put host and anycast routes on device with address")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'bpf-Improve-LRU-map-lookup-performance'
David S. Miller [Fri, 1 Sep 2017 16:57:39 +0000 (09:57 -0700)]
Merge branch 'bpf-Improve-LRU-map-lookup-performance'

Martin KaFai Lau says:

====================
bpf: Improve LRU map lookup performance

This patchset improves the lookup performance of the LRU map.
Please see individual patch for details.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agobpf: Only set node->ref = 1 if it has not been set
Martin KaFai Lau [Fri, 1 Sep 2017 06:27:13 +0000 (23:27 -0700)]
bpf: Only set node->ref = 1 if it has not been set

This patch writes 'node->ref = 1' only if node->ref is 0.
The number of lookups/s for a ~1M entries LRU map increased by
~30% (260097 to 343313).

Other writes on 'node->ref = 0' is not changed.  In those cases, the
same cache line has to be changed anyway.

First column: Size of the LRU hash
Second column: Number of lookups/s

Before:
> echo "$((2**20+1)): $(./map_perf_test 1024 1 $((2**20+1)) 10000000 | awk '{print $3}')"
1048577: 260097

After:
> echo "$((2**20+1)): $(./map_perf_test 1024 1 $((2**20+1)) 10000000 | awk '{print $3}')"
1048577: 343313

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agobpf: Inline LRU map lookup
Martin KaFai Lau [Fri, 1 Sep 2017 06:27:12 +0000 (23:27 -0700)]
bpf: Inline LRU map lookup

Inline the lru map lookup to save the cost in making calls to
bpf_map_lookup_elem() and htab_lru_map_lookup_elem().

Different LRU hash size is tested.  The benefit diminishes when
the cache miss starts to dominate in the bigger LRU hash.
Considering the change is simple, it is still worth to optimize.

First column: Size of the LRU hash
Second column: Number of lookups/s

Before:
> for i in $(seq 9 20); do echo "$((2**i+1)): $(./map_perf_test 1024 1 $((2**i+1)) 10000000 | awk '{print $3}')"; done
513: 1132020
1025: 1056826
2049: 1007024
4097: 853298
8193: 742723
16385: 712600
32769: 688142
65537: 677028
131073: 619437
262145: 498770
524289: 316695
1048577: 260038

After:
> for i in $(seq 9 20); do echo "$((2**i+1)): $(./map_perf_test 1024 1 $((2**i+1)) 10000000 | awk '{print $3}')"; done
513: 1221851
1025: 1144695
2049: 1049902
4097: 884460
8193: 773731
16385: 729673
32769: 721989
65537: 715530
131073: 671665
262145: 516987
524289: 321125
1048577: 260048

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agobpf: Add lru_hash_lookup performance test
Martin KaFai Lau [Fri, 1 Sep 2017 06:27:11 +0000 (23:27 -0700)]
bpf: Add lru_hash_lookup performance test

Create a new case to test the LRU lookup performance.

At the beginning, the LRU map is fully loaded (i.e. the number of keys
is equal to map->max_entries).   The lookup is done through key 0
to num_map_entries and then repeats from 0 again.

This patch also creates an anonymous struct to properly
name the test params in stress_lru_hmap_alloc() in map_perf_test_kern.c.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec...
David S. Miller [Fri, 1 Sep 2017 16:57:04 +0000 (09:57 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/klassert/ipsec-next

Steffen Klassert says:

====================
pull request (net-next): ipsec-next 2017-09-01

This should be the last ipsec-next pull request for this
release cycle:

1) Support netdevice ESP trailer removal when decryption
   is offloaded. From Yossi Kuperman.

2) Fix overwritten return value of copy_sec_ctx().

Please pull or let me know if there are problems.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'bpf-Add-option-to-set-mark-and-priority-in-cgroup-sock-programs'
David S. Miller [Fri, 1 Sep 2017 05:05:16 +0000 (06:05 +0100)]
Merge branch 'bpf-Add-option-to-set-mark-and-priority-in-cgroup-sock-programs'

David Ahern says:

====================
bpf: Add option to set mark and priority in cgroup sock programs

Add option to set mark and priority in addition to bound device for newly
created sockets. Also, allow the bpf programs to use the get_current_uid_gid
helper meaning socket marks, priority and device can be set based on the
uid/gid of the running process.

Sample programs are updated to demonstrate the new options.

v3
- no changes to Patches 1 and 2 which Alexei acked in previous versions
- dropped change related to recursive programs in a cgroup
- updated tests per dropped patch

v2
- added flag to control recursive behavior as requested by Alexei
- added comment to sock_filter_func_proto regarding use of
  get_current_uid_gid helper
- updated test programs for recursive option
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agosamples/bpf: Update cgroup socket examples to use uid gid helper
David Ahern [Thu, 31 Aug 2017 22:05:50 +0000 (15:05 -0700)]
samples/bpf: Update cgroup socket examples to use uid gid helper

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agosamples/bpf: Update cgrp2 socket tests
David Ahern [Thu, 31 Aug 2017 22:05:49 +0000 (15:05 -0700)]
samples/bpf: Update cgrp2 socket tests

Update cgrp2 bpf sock tests to check that device, mark and priority
can all be set on a socket via bpf programs attached to a cgroup.

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agosamples/bpf: Add option to dump socket settings
David Ahern [Thu, 31 Aug 2017 22:05:48 +0000 (15:05 -0700)]
samples/bpf: Add option to dump socket settings

Add option to dump socket settings. Will be used in the next patch
to verify bpf programs are correctly setting mark, priority and
device based on the cgroup attachment for the program run.

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agosamples/bpf: Add detach option to test_cgrp2_sock
David Ahern [Thu, 31 Aug 2017 22:05:47 +0000 (15:05 -0700)]
samples/bpf: Add detach option to test_cgrp2_sock

Add option to detach programs from a cgroup.

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agosamples/bpf: Update sock test to allow setting mark and priority
David Ahern [Thu, 31 Aug 2017 22:05:46 +0000 (15:05 -0700)]
samples/bpf: Update sock test to allow setting mark and priority

Update sock test to set mark and priority on socket create.

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agobpf: Allow cgroup sock filters to use get_current_uid_gid helper
David Ahern [Thu, 31 Aug 2017 22:05:45 +0000 (15:05 -0700)]
bpf: Allow cgroup sock filters to use get_current_uid_gid helper

Allow BPF programs run on sock create to use the get_current_uid_gid
helper. IPv4 and IPv6 sockets are created in a process context so
there is always a valid uid/gid

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agobpf: Add mark and priority to sock options that can be set
David Ahern [Thu, 31 Aug 2017 22:05:44 +0000 (15:05 -0700)]
bpf: Add mark and priority to sock options that can be set

Add socket mark and priority to fields that can be set by
ebpf program when a socket is created.

Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'mlxsw-Add-IPv6-host-dpipe-table'
David S. Miller [Thu, 31 Aug 2017 21:42:20 +0000 (14:42 -0700)]
Merge branch 'mlxsw-Add-IPv6-host-dpipe-table'

Jiri Pirko says:

====================
mlxsw: Add IPv6 host dpipe table

This patchset adds IPv6 host dpipe table support. This will provide the
ability to observe the hardware offloaded IPv6 neighbors.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_dpipe: Add support for controlling IPv6 neighbor counters
Arkadi Sharshevsky [Thu, 31 Aug 2017 15:59:19 +0000 (17:59 +0200)]
mlxsw: spectrum_dpipe: Add support for controlling IPv6 neighbor counters

Add support for controlling IPv6 neighbor counters via dpipe.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_router: Add support for setting counters on IPv6 neighbors
Arkadi Sharshevsky [Thu, 31 Aug 2017 15:59:18 +0000 (17:59 +0200)]
mlxsw: spectrum_router: Add support for setting counters on IPv6 neighbors

Add support for setting counters on IPv6 neighbors based on dpipe's host6
table counter status.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_dpipe: Add support for IPv6 host table dump
Arkadi Sharshevsky [Thu, 31 Aug 2017 15:59:17 +0000 (17:59 +0200)]
mlxsw: spectrum_dpipe: Add support for IPv6 host table dump

Add support for IPv6 host table dump.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_dpipe: Make host entry fill handler more generic
Arkadi Sharshevsky [Thu, 31 Aug 2017 15:59:16 +0000 (17:59 +0200)]
mlxsw: spectrum_dpipe: Make host entry fill handler more generic

Change the host entry filler helper to be applicable for both IPv4/6
addresses.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_router: Add IPv6 neighbor access helper
Arkadi Sharshevsky [Thu, 31 Aug 2017 15:59:15 +0000 (17:59 +0200)]
mlxsw: spectrum_router: Add IPv6 neighbor access helper

Add helper for accessing destination IP in case of IPv6 neighbor.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_dpipe: Add IPv6 host table initial support
Arkadi Sharshevsky [Thu, 31 Aug 2017 15:59:14 +0000 (17:59 +0200)]
mlxsw: spectrum_dpipe: Add IPv6 host table initial support

Add IPv6 host table initial support. The action behavior for both IPv4/6
tables is the same, thus the same action dump op is used. Neighbors with
link local address are ignored.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_router: Export IPv6 link local address check helper
Arkadi Sharshevsky [Thu, 31 Aug 2017 15:59:13 +0000 (17:59 +0200)]
mlxsw: spectrum_router: Export IPv6 link local address check helper

Neighbors with link local addresses are not offloaded to the host table,
yet, the are maintained in the driver for adjacency table usage. When
dumping the IPv6 host neighbors this link local neighbors should be
ignored. This patch exports this helper for dpipe usage.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodevlink: Add IPv6 header for dpipe
Arkadi Sharshevsky [Thu, 31 Aug 2017 15:59:12 +0000 (17:59 +0200)]
devlink: Add IPv6 header for dpipe

This will be used by the IPv6 host table which will be introduced in the
following patches. The fields in the header are added per-use. This header
is global and can be reused by many drivers.

Signed-off-by: Arkadi Sharshevsky <arkadis@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agox86: bpf_jit: small optimization in emit_bpf_tail_call()
Eric Dumazet [Thu, 31 Aug 2017 11:53:42 +0000 (04:53 -0700)]
x86: bpf_jit: small optimization in emit_bpf_tail_call()

Saves 4 bytes replacing following instructions :

lea rax, [rsi + rdx * 8 + offsetof(...)]
mov rax, qword ptr [rax]
cmp rax, 0

by :

mov rax, [rsi + rdx * 8 + offsetof(...)]
test rax, rax

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agosamples/bpf: Fix compilation issue in redirect dummy program
Tariq Toukan [Thu, 31 Aug 2017 11:16:39 +0000 (14:16 +0300)]
samples/bpf: Fix compilation issue in redirect dummy program

Fix compilation error below:

$ make samples/bpf/

LLVM ERROR: 'xdp_redirect_dummy' label emitted multiple times to
assembly file
make[1]: *** [samples/bpf/xdp_redirect_kern.o] Error 1
make: *** [samples/bpf/] Error 2

Fixes: 306da4e685b4 ("samples/bpf: xdp_redirect load XDP dummy prog on TX device")
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: fix two typos in net_device_ops documentation.
Rami Rosen [Thu, 31 Aug 2017 10:41:40 +0000 (13:41 +0300)]
net: fix two typos in net_device_ops documentation.

This patch fixes two trivial typos in net_device_ops documentation,
related to ndo_xdp_flush callback.

Signed-off-by: Rami Rosen <rami.rosen@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dccp: Add handling of IPV6_PKTOPTIONS to dccp_v6_do_rcv()
Andrii [Thu, 31 Aug 2017 05:28:01 +0000 (08:28 +0300)]
net: dccp: Add handling of IPV6_PKTOPTIONS to dccp_v6_do_rcv()

Add handling of IPV6_PKTOPTIONS to dccp_v6_do_rcv() in net/dccp/ipv6.c,
similar
to the handling in net/ipv6/tcp_ipv6.c

Signed-off-by: Andrii Vladyka <tulup@mail.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agobridge: add tracepoint in br_fdb_update
Roopa Prabhu [Thu, 31 Aug 2017 05:18:13 +0000 (22:18 -0700)]
bridge: add tracepoint in br_fdb_update

This extends bridge fdb table tracepoints to also cover
learned fdb entries in the br_fdb_update path. Note that
unlike other tracepoints I have moved this to when the fdb
is modified because this is in the datapath and can generate
a lot of noise in the trace output. br_fdb_update is also called
from added_by_user context in the NTF_USE case which is already
traced ..hence the !added_by_user check.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet_sched: add reverse binding for tc class
Cong Wang [Wed, 30 Aug 2017 21:30:36 +0000 (14:30 -0700)]
net_sched: add reverse binding for tc class

TC filters when used as classifiers are bound to TC classes.
However, there is a hidden difference when adding them in different
orders:

1. If we add tc classes before its filters, everything is fine.
   Logically, the classes exist before we specify their ID's in
   filters, it is easy to bind them together, just as in the current
   code base.

2. If we add tc filters before the tc classes they bind, we have to
   do dynamic lookup in fast path. What's worse, this happens all
   the time not just once, because on fast path tcf_result is passed
   on stack, there is no way to propagate back to the one in tc filters.

This hidden difference hurts performance silently if we have many tc
classes in hierarchy.

This patch intends to close this gap by doing the reverse binding when
we create a new class, in this case we can actually search all the
filters in its parent, match and fixup by classid. And because
tcf_result is specific to each type of tc filter, we have to introduce
a new ops for each filter to tell how to bind the class.

Note, we still can NOT totally get rid of those class lookup in
->enqueue() because cgroup and flow filters have no way to determine
the classid at setup time, they still have to go through dynamic lookup.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Thu, 31 Aug 2017 18:34:22 +0000 (21:34 +0300)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git

ath.git patches for 4.14. Major changes:

wil6210

* support FW RSSI reporting (by mistake this was accidentally
  mentioned already in the previous pull request, but now it's really
  included)

* make debugfs optional, adds new Kconfig option CONFIG_WIL6210_DEBUGFS

6 years agoath10k: configure and enable the wakeup capability
Ryan Hsu [Thu, 31 Aug 2017 12:36:16 +0000 (15:36 +0300)]
ath10k: configure and enable the wakeup capability

ACPI will rely on device driver to tell it if the device could support
wakeup function when system in D3 state.

This has caused some platform can't support remote wakeup correctly,
because the ACPI wakeup GPE is not enabled, hence registers the .set_wakeup
callback to handle it if device supports wakeup.

Tested with QCA6174 hw3.0, firmware ('WLAN.RM.4.4.1-00008-QCARMSWP-1')

Signed-off-by: Ryan Hsu <ryanhsu@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agoath10k: add the PCI PM core suspend/resume ops
Ryan Hsu [Thu, 31 Aug 2017 12:36:14 +0000 (15:36 +0300)]
ath10k: add the PCI PM core suspend/resume ops

The actual PCI suspend/resume in ath10k has been handled in wow.c,
but in the case of the device doesn't support remote wakeup,
the .hif_suspend() and .hif_resume() will never be handled.

  ath10k_wow_op_suspend()
  {
if (WARN_ON(!test_bit(ATH10K_FW_FEATURE_WOWLAN_SUPPORT,
    ar->running_fw->fw_file.fw_features))) {
ret = 1;
goto exit;
}

....

ret = ath10k_hif_suspend(ar);
  }

So register the PCI PM core to support the suspend/resume if the device
doesn't support remote wakeup.

Signed-off-by: Ryan Hsu <ryanhsu@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agortlwifi: rtl8723be: fix duplicated code for different branches
Gustavo A. R. Silva [Wed, 30 Aug 2017 17:04:24 +0000 (12:04 -0500)]
rtlwifi: rtl8723be: fix duplicated code for different branches

Refactor code in order to avoid identical code for different branches.

Addresses-Coverity-ID: 1248728
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agobrcmfmac: Log chip id and revision
Hans de Goede [Wed, 30 Aug 2017 13:54:49 +0000 (15:54 +0200)]
brcmfmac: Log chip id and revision

For debugging some problems, it is useful to know the chip revision
add a brcmf_info message logging this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: implement 64-bit dma support
Sergey Matyukevich [Tue, 29 Aug 2017 12:16:23 +0000 (15:16 +0300)]
qtnfmac: implement 64-bit dma support

Use 64-bit dma for hosts with CONFIG_ARCH_DMA_ADDR_T_64BIT enabled.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: fix free_xfer_buffer cleanup
Sergey Matyukevich [Tue, 29 Aug 2017 12:16:22 +0000 (15:16 +0300)]
qtnfmac: fix free_xfer_buffer cleanup

Check if skb tracking arrays has been already allocated. This additional
check handles the case when init partially failed.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: modify qtnf_map_bar not to return NULL
Sergey Matyukevich [Tue, 29 Aug 2017 12:16:21 +0000 (15:16 +0300)]
qtnfmac: modify qtnf_map_bar not to return NULL

NULL is not a special type of success here but a error pointer.
So it makes sense to check against NULL in qtnf_map_bar
and return error code.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: module param sanity check
Sergey Matyukevich [Tue, 29 Aug 2017 12:16:20 +0000 (15:16 +0300)]
qtnfmac: module param sanity check

Linux built-in circ_buf implementation assumes that that the
circular buffer length is a power of 2. Make sure that
rx and tx descriptor queue lengths are power-of-2.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agoqtnfmac: drop -D__CHECK_ENDIAN from cflags
Sergey Matyukevich [Tue, 29 Aug 2017 12:16:19 +0000 (15:16 +0300)]
qtnfmac: drop -D__CHECK_ENDIAN from cflags

Flag -D__CHECK_ENDIAN was wrong: it should be -D__CHECK_ENDIAN__ instead.
However now this flag is enabled by default, so it can be removed.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
6 years agowil6210: ensure P2P device is stopped before removing interface
Lior David [Mon, 28 Aug 2017 19:18:47 +0000 (22:18 +0300)]
wil6210: ensure P2P device is stopped before removing interface

User space can remove the P2P management interface while it is active
(for example, while listen/search is active) and this can cause
a crash. Ensure the P2P device is fully stopped before removing.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agowil6210: increase connect timeout
Lior David [Mon, 28 Aug 2017 19:18:46 +0000 (22:18 +0300)]
wil6210: increase connect timeout

Connect can take longer than current timeout in some scenarios,
for example with long-range antenna array. Increase the timeout
to support these scenarios.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agowil6210: clear PAL_UNIT_ICR part of device reset
Dedy Lansky [Mon, 28 Aug 2017 19:18:45 +0000 (22:18 +0300)]
wil6210: clear PAL_UNIT_ICR part of device reset

When FW starts running it can get D0 to D3 interrupt that is a leftover
from previous system suspend while FW was not running.
As this interrupt is not relevant anymore, clear it part of device reset
procedure.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agowil6210: move pre-FW configuration to separate function
Dedy Lansky [Mon, 28 Aug 2017 19:18:44 +0000 (22:18 +0300)]
wil6210: move pre-FW configuration to separate function

Re-arrange the code to have dedicated function for device configuration
which takes place before FW starts running.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agowil6210: align to latest auto generated wmi.h
Lazar Alexei [Mon, 28 Aug 2017 19:18:43 +0000 (22:18 +0300)]
wil6210: align to latest auto generated wmi.h

Align to latest version of the auto generated wmi file
describing the interface with FW.

Signed-off-by: Lazar Alexei <qca_ailizaro@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agowil6210: make debugfs compilation optional
Gidon Studinski [Mon, 28 Aug 2017 19:18:42 +0000 (22:18 +0300)]
wil6210: make debugfs compilation optional

Since debugfs is a kernel configuration option, enable the driver to
compile without debugfs.

Signed-off-by: Gidon Studinski <qca_gidons@qca.qualcomm.com>
Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agowil6210: ratelimit errors in TX/RX interrupts
Lior David [Mon, 28 Aug 2017 19:18:41 +0000 (22:18 +0300)]
wil6210: ratelimit errors in TX/RX interrupts

Sometimes there is a firmware crash but the hardware
is not fully stopped and continue to send TX/RX interrupts.
This can cause an overload of messages which can bring the
host down. Add ratelimit to these error messages to fix this.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agoath10k: activate user space firmware loading again
Hauke Mehrtens [Thu, 24 Aug 2017 21:06:41 +0000 (23:06 +0200)]
ath10k: activate user space firmware loading again

In commit 9f5bcfe93315 ("ath10k: silence firmware file probing
warnings") the firmware loading was changed from request_firmware() to
request_firmware_direct() to silence some warnings in case it fails.
request_firmware_direct() directly searches in the file system only and
does not send a hotplug event to user space in case it could not find
the firmware directly.
In LEDE we use a user space script to extract the calibration data from
the flash memory which gets triggered by the hotplug event. This way the
firmware gets extracted from some vendor specific partition when the
driver requests this firmware. This mechanism does not work any more
after this change.

Fixes: 9f5bcfe93315 ("ath10k: silence firmware file probing warnings")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Cc: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agoath10k: sdio: remove unused struct member
Erik Stromdahl [Wed, 23 Aug 2017 19:32:58 +0000 (21:32 +0200)]
ath10k: sdio: remove unused struct member

irq_wq in struct ath10k_sdio is a remnant from an earlier
version of the sdio patchset.

Its use was removed as a result of Kalle's review, but somehow
the struct member survived.

It is not used and can therefore safely be removed.

Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agoath10k: fix napi_poll budget overflow
Ryan Hsu [Tue, 22 Aug 2017 21:44:02 +0000 (14:44 -0700)]
ath10k: fix napi_poll budget overflow

In napi_poll, the budget number is used to control the amount of packets
we should handle per poll to balance the resource in the system.

In the list of the amsdu packets reception, we check if there is budget
count left and handle the complete list of the packets, that it will have
chances the very last list will over the budget leftover.

So adding one more parameter - budget_left, this would help while
traversing the list to avoid handling more than the budget given.

Reported-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Fix-suggested-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Link: https://lkml.kernel.org/r/26670dce-4dd2-f8e4-0e14-90d74257e739@virtuozzo.com
Signed-off-by: Ryan Hsu <ryanhsu@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6 years agoxfrm: Fix return value check of copy_sec_ctx.
Steffen Klassert [Thu, 31 Aug 2017 08:37:00 +0000 (10:37 +0200)]
xfrm: Fix return value check of copy_sec_ctx.

A recent commit added an output_mark. When copying
this output_mark, the return value of copy_sec_ctx
is overwitten without a check. Fix this by copying
the output_mark before the security context.

Fixes: 077fbac405bf ("net: xfrm: support setting an output mark.")
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
6 years agoxfrm: Add support for network devices capable of removing the ESP trailer
Yossi Kuperman [Wed, 30 Aug 2017 08:30:39 +0000 (11:30 +0300)]
xfrm: Add support for network devices capable of removing the ESP trailer

In conjunction with crypto offload [1], removing the ESP trailer by
hardware can potentially improve the performance by avoiding (1) a
cache miss incurred by reading the nexthdr field and (2) the necessity
to calculate the csum value of the trailer in order to keep skb->csum
valid.

This patch introduces the changes to the xfrm stack and merely serves
as an infrastructure. Subsequent patch to mlx5 driver will put this to
a good use.

[1] https://www.mail-archive.com/netdev@vger.kernel.org/msg175733.html

Signed-off-by: Yossi Kuperman <yossiku@mellanox.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
6 years agoMerge tag 'mlx5-GRE-Offload' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed...
David S. Miller [Thu, 31 Aug 2017 05:14:37 +0000 (22:14 -0700)]
Merge tag 'mlx5-GRE-Offload' of git://git./linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-updates-2017-08-31 (GRE Offloads support)

This series provides the support for MPLS RSS and GRE TX offloads and
RSS support.

The first patch from Gal and Ariel provides the mlx5 driver support for
ConnectX capability to perform IP version identification and matching in
order to distinguish between IPv4 and IPv6 without the need to specify the
encapsulation type, thus perform RSS in MPLS automatically without
specifying MPLS ethertyoe. This patch will also serve for inner GRE IPv4/6
classification for inner GRE RSS.

2nd patch from Gal, Adds the TX offloads support for GRE tunneled packets,
by reporting the needed netdev features.

3rd patch from Gal, Adds GRE inner RSS support by creating the needed device
resources (Steering Tables/rules and traffic classifiers) to Match GRE traffic
and perform RSS hashing on the inner headers.

Improvement:
Testing 8 TCP streams bandwidth over GRE:
    System: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
    NIC: Mellanox Technologies MT28800 Family [ConnectX-5 Ex]
    Before: 21.3 Gbps (Single RQ)
    Now   : 90.5 Gbps (RSS spread on 8 RQs)
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoliquidio: fix crash in presence of zeroed-out base address regs
Rick Farrington [Wed, 30 Aug 2017 23:19:53 +0000 (16:19 -0700)]
liquidio: fix crash in presence of zeroed-out base address regs

Fix crash in linux PF driver when BARs have been cleared/de-programmed;
fail early init (prior to mapping BARs) if the BAR0 or
BAR1 registers are zero.

This situation can arise when the PF is added to a VM (PCI pass-through),
then a PF FLR is issued (in the VM).  After this occurs, the BAR registers
will be zero. If we attempt to load the PF driver in the host
(after VM has been shutdown), the host can reset.

Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodevlink: Maintain consistency in mac field name
David Ahern [Thu, 31 Aug 2017 00:07:30 +0000 (17:07 -0700)]
devlink: Maintain consistency in mac field name

IPv4 name uses "destination ip" as does the IPv6 patch set.
Make the mac field consistent.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agohv_netvsc: Fix typos in the document of UDP hashing
Haiyang Zhang [Wed, 30 Aug 2017 20:37:22 +0000 (13:37 -0700)]
hv_netvsc: Fix typos in the document of UDP hashing

There are two typos in the document, netvsc.txt,
regarding UDP hashing level. This patch fixes them.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoxen-netfront: be more drop monitor friendly
Eric Dumazet [Wed, 30 Aug 2017 17:32:58 +0000 (10:32 -0700)]
xen-netfront: be more drop monitor friendly

xennet_start_xmit() might copy skb with inappropriate layout
into a fresh one.

Old skb is freed, and at this point it is not a drop, but
a consume. New skb will then be either consumed or dropped.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet/mlx5e: Support RSS for GRE tunneled packets
Gal Pressman [Sun, 13 Aug 2017 13:22:38 +0000 (16:22 +0300)]
net/mlx5e: Support RSS for GRE tunneled packets

Introduce a new flow table and indirect TIRs which are used to hash the
inner packet headers of GRE tunneled packets.

When a GRE tunneled packet is received, the TTC flow table will match
the new IPv4/6->GRE rules which will forward it to the inner TTC table.
The inner TTC is similar to its counterpart outer TTC table, but
matching the inner packet headers instead of the outer ones (and does
not include the new IPv4/6->GRE rules).
The new rules will not add steering hops since they are added to an
already existing flow group which will be matched regardless of this
patch. Non GRE traffic will not be affected.

The inner flow table will forward the packet to inner indirect TIRs
which hash the inner packet and thus result in RSS for the tunneled
packets.

Testing 8 TCP streams bandwidth over GRE:
System: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
NIC: Mellanox Technologies MT28800 Family [ConnectX-5 Ex]
Before: 21.3 Gbps (Single RQ)
Now   : 90.5 Gbps (RSS spread on 8 RQs)

Signed-off-by: Gal Pressman <galp@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
6 years agonet/mlx5e: Support TSO and TX checksum offloads for GRE tunnels
Gal Pressman [Sun, 13 Aug 2017 10:34:42 +0000 (13:34 +0300)]
net/mlx5e: Support TSO and TX checksum offloads for GRE tunnels

Add TX offloads support for GRE tunneled packets by reporting the needed
netdev features.

Signed-off-by: Gal Pressman <galp@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
6 years agonet/mlx5e: Use IP version matching to classify IP traffic
Gal Pressman [Tue, 15 Aug 2017 11:18:08 +0000 (14:18 +0300)]
net/mlx5e: Use IP version matching to classify IP traffic

This change adds the ability for flow steering to classify IPv4/6
packets with MPLS tag (Ethertype 0x8847 and 0x8848) as standard IP
packets and hit IPv4/6 classification steering rules.

Since IP packets with MPLS tag header have MPLS ethertype, they
missed the IPv4/6 ethertype rule and ended up hitting the default
filter forwarding all the packets to the same single RQ (No RSS).

Since our device is able to look past the MPLS tag and identify the
next protocol we introduce this solution which replaces ethertype
matching by the device's capability to perform IP version
identification and matching in order to distinguish between IPv4 and
IPv6.
Therefore, when driver is performing flow steering configuration on the
device it will use IP version matching in IP classified rules instead
of ethertype matching which will cause relevant MPLS tagged packets to
hit this rule as well.

If the device doesn't support IP version matching the driver will fall back
to use legacy ethertype matching in the steering as before.

Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Ariel Levkovich <lariel@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
6 years agobpf: test_maps: fix typos, "conenct" and "listeen"
Colin Ian King [Wed, 30 Aug 2017 17:15:25 +0000 (18:15 +0100)]
bpf: test_maps: fix typos, "conenct" and "listeen"

Trivial fix to typos in printf error messages:
"conenct" -> "connect"
"listeen" -> "listen"

thanks to Daniel Borkmann for spotting one of these mistakes

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoqed: fix spelling mistake: "calescing" -> "coalescing"
Colin Ian King [Wed, 30 Aug 2017 11:40:12 +0000 (12:40 +0100)]
qed: fix spelling mistake: "calescing" -> "coalescing"

Trivial fix to spelling mistake in DP_NOTICE message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: hns3: Fixes the wrong IS_ERR check on the returned phydev value
Salil Mehta [Wed, 30 Aug 2017 11:06:03 +0000 (12:06 +0100)]
net: hns3: Fixes the wrong IS_ERR check on the returned phydev value

This patch removes the wrong check being done for the phy device being
returned by the mdiobus_get_phy() function. This function never returns
the error pointers.

Fixes: 256727da7395 ("net: hns3: Add MDIO support to HNS3 Ethernet
Driver for hip08 SoC")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: bcm63xx_enet: make bcm_enetsw_ethtool_ops const
Bhumika Goyal [Wed, 30 Aug 2017 09:25:08 +0000 (14:55 +0530)]
net: bcm63xx_enet: make bcm_enetsw_ethtool_ops const

Make this const as it is never modified.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoipv6: sr: fix get_srh() to comply with IPv6 standard "RFC 8200"
Ahmed Abdelsalam [Wed, 30 Aug 2017 08:50:37 +0000 (10:50 +0200)]
ipv6: sr: fix get_srh() to comply with IPv6 standard "RFC 8200"

IPv6 packet may carry more than one extension header, and IPv6 nodes must
accept and attempt to process extension headers in any order and occurring
any number of times in the same packet. Hence, there should be no
assumption that Segment Routing extension header is to appear immediately
after the IPv6 header.

Moreover, section 4.1 of RFC 8200 gives a recommendation on the order of
appearance of those extension headers within an IPv6 packet. According to
this recommendation, Segment Routing extension header should appear after
Hop-by-Hop and Destination Options headers (if they present).

This patch fixes the get_srh(), so it gets the segment routing header
regardless of its position in the chain of the extension headers in IPv6
packet, and makes sure that the IPv6 routing extension header is of Type 4.

Signed-off-by: Ahmed Abdelsalam <amsalam20@gmail.com>
Acked-by: David Lebrun <david.lebrun@uclouvain.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'mvpp2-comphy'
David S. Miller [Wed, 30 Aug 2017 22:17:46 +0000 (15:17 -0700)]
Merge branch 'mvpp2-comphy'

Antoine Tenart says:

====================
net: mvpp2: comphy configuration

This series, following up the one one the GoP/MAC configuration, aims at
stopping to depend on the firmware/bootloader configuration when using
the PPv2 engine. With this series the PPv2 driver does not need to rely
on a previous configuration, and dynamic reconfiguration while the
kernel is running can be done (i.e. switch one port from SGMII to 10G,
or the opposite). A port can now be configured in a different mode than
what's done in the firmware/bootloader as well.

The series first contain patches in the generic PHY framework to support
what is called the comphy (common PHYs), which is an h/w block providing
PHYs that can be configured in various modes ranging from SGMII, 10G
to SATA and others. As of now only the SGMII and 10G modes are
supported by the comphy driver.

Then patches are modifying the PPv2 driver to first add the comphy
initialization sequence (i.e. calls to the generic PHY framework) and to
then take advantage of this to allow dynamic reconfiguration (i.e.
configuring the mode of a port given what's connected, between sgmii and
10G). Note the use of the comphy in the PPv2 driver is kept optional
(i.e. if not described in dt the driver still as before an relies on the
firmware/bootloader configuration).

Finally there are dt/defconfig patches to describe and take advantage of
this.

This was tested on a range of devices: 8040-db, 8040-mcbin and 7040-db.

@Dave: the dt patches should go through the mvebu tree (patches 9-13).

Thanks!
Antoine

Since v3:
  - Now use of_phy_simple_xlate() to retrieve the phy.
  - Added an owner in the phy_ops structure.
  - Now allow the module to be selected with COMPILE_TEST.
  - Removed unused parameter in the comphy set_mode functions.
  - Added Kishon Acked-by in patch 1.

Since v2:
  - Kept the link mode enforcement.
  - Removed the netif_running() check.
  - Reworded the "dynamic reconfiguration of the PHY mode" commit log.
  - Added one patch not to force the GMAC autoneg parameters when using
    the XLG MAC.

Since v1:
  - Updated the mode settings variable name in the comphy driver to
    have 'cp110' in it.
  - Documented the PHY cell argument in the dt documentation.
  - New patch adding comphy phandles for the 7040-db board.
  - Checked if the carrier_on/off functions were needed. They are.
  - s/PHY/generic PHY/ in commit log of patch 1.
  - Rebased on the latest net-next/master.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mvpp2: dynamic reconfiguration of the comphy/GoP/MAC
Antoine Tenart [Wed, 30 Aug 2017 08:29:19 +0000 (10:29 +0200)]
net: mvpp2: dynamic reconfiguration of the comphy/GoP/MAC

This patch adds logic to reconfigure the comphy/GoP/MAC when the link
state is updated at runtime. This is very useful on boards where many
link speed are supported: depending on what is negotiated the PPv2
driver will automatically reconfigures the link between the PHY and the
MAC.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mvpp2: do not set GMAC autoneg when using XLG MAC
Antoine Tenart [Wed, 30 Aug 2017 08:29:18 +0000 (10:29 +0200)]
net: mvpp2: do not set GMAC autoneg when using XLG MAC

When using the XLG MAC, it does not make sense to force the GMAC autoneg
parameters. This patch adds checks to only set the GMAC autoneg
parameters when needed (i.e. when not using the XLG MAC).

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mvpp2: improve the link management function
Antoine Tenart [Wed, 30 Aug 2017 08:29:17 +0000 (10:29 +0200)]
net: mvpp2: improve the link management function

When the link status changes, the phylib calls the link_event function
in the mvpp2 driver. Before this patch only the egress/ingress transmit
was enabled/disabled. This patch adds more functionality to the link
status management code by enabling/disabling the port per-cpu
interrupts, and the port itself. The queues are now stopped as well, and
the netif carrier helpers are called.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mvpp2: simplify the link_event function
Antoine Tenart [Wed, 30 Aug 2017 08:29:16 +0000 (10:29 +0200)]
net: mvpp2: simplify the link_event function

The link_event function is somewhat complicated. This cosmetic patch
simplifies it.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: mvpp2: initialize the comphy
Antoine Tenart [Wed, 30 Aug 2017 08:29:15 +0000 (10:29 +0200)]
net: mvpp2: initialize the comphy

On some platforms, the comphy is between the MAC GoP and the PHYs. The
mvpp2 driver currently relies on the firmware/bootloader to configure
the comphy. As a comphy driver was added to the generic PHY framework,
this patch uses it in the mvpp2 driver to configure the comphy at boot
time to avoid relying on the bootloader.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoDocumentation/bindings: phy: document the Marvell comphy driver
Antoine Tenart [Wed, 30 Aug 2017 08:29:14 +0000 (10:29 +0200)]
Documentation/bindings: phy: document the Marvell comphy driver

The Marvell Armada 7K/8K SoCs contains an hardware block called COMPHY
that provides a number of shared PHYs used by various interfaces in the
SoC: network, SATA, PCIe, etc. This Device Tree binding allows to
describe this COMPHY hardware block.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agophy: add the mvebu cp110 comphy driver
Antoine Tenart [Wed, 30 Aug 2017 08:29:13 +0000 (10:29 +0200)]
phy: add the mvebu cp110 comphy driver

On the CP110 unit, which can be found on various Marvell platforms such
as the 7k and 8k (currently), a comphy (common PHYs) hardware block can
be found. This block provides a number of PHYs which can be used in
various modes by other controllers (network, SATA ...). These common
PHYs must be configured for the controllers using them to work correctly
either at boot time, or when the system runs to switch the mode used.
This patch adds a driver for this comphy hardware block, providing
callbacks for the its PHYs so that consumers can configure the modes
used.

As of this commit, two modes are supported by the comphy driver: sgmii
and 10gkr.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agophy: add sgmii and 10gkr modes to the phy_mode enum
Antoine Tenart [Wed, 30 Aug 2017 08:29:12 +0000 (10:29 +0200)]
phy: add sgmii and 10gkr modes to the phy_mode enum

This patch adds more generic PHY modes to the phy_mode enum, to
allow configuring generic PHYs to the SGMII and/or the 10GKR mode
by using the set_mode callback.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodp83640: don't hold spinlock while calling netif_rx_ni
Stefan Sørensen [Wed, 30 Aug 2017 06:58:47 +0000 (08:58 +0200)]
dp83640: don't hold spinlock while calling netif_rx_ni

We should not hold a spinlock while pushing the skb into the networking
stack, so move the call to netif_rx_ni out of the critical region to where
we have dropped the spinlock.

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'net_sched-idr'
David S. Miller [Wed, 30 Aug 2017 21:38:59 +0000 (14:38 -0700)]
Merge branch 'net_sched-idr'

Chris Mi says:

====================
net/sched: Improve getting objects by indexes

Using current TC code, it is very slow to insert a lot of rules.

In order to improve the rules update rate in TC,
we introduced the following two changes:
        1) changed cls_flower to use IDR to manage the filters.
        2) changed all act_xxx modules to use IDR instead of
           a small hash table

But IDR has a limitation that it uses int. TC handle uses u32.
To make sure there is no regression, we add several new IDR APIs
to support unsigned long.

v2
==

Addressed Hannes's comment:
express idr_alloc in terms of idr_alloc_ext and most of the other functions
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet/sched: Change act_api and act_xxx modules to use IDR
Chris Mi [Wed, 30 Aug 2017 06:31:59 +0000 (02:31 -0400)]
net/sched: Change act_api and act_xxx modules to use IDR

Typically, each TC filter has its own action. All the actions of the
same type are saved in its hash table. But the hash buckets are too
small that it degrades to a list. And the performance is greatly
affected. For example, it takes about 0m11.914s to insert 64K rules.
If we convert the hash table to IDR, it only takes about 0m1.500s.
The improvement is huge.

But please note that the test result is based on previous patch that
cls_flower uses IDR.

Signed-off-by: Chris Mi <chrism@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet/sched: Change cls_flower to use IDR
Chris Mi [Wed, 30 Aug 2017 06:31:58 +0000 (02:31 -0400)]
net/sched: Change cls_flower to use IDR

Currently, all filters with the same priority are linked in a doubly
linked list. Every filter should have a unique handle. To make the
handle unique, we need to iterate the list every time to see if the
handle exists or not when inserting a new filter. It is time-consuming.
For example, it takes about 5m3.169s to insert 64K rules.

This patch changes cls_flower to use IDR. With this patch, it
takes about 0m1.127s to insert 64K rules. The improvement is huge.

But please note that in this testing, all filters share the same action.
If every filter has a unique action, that is another bottleneck.
Follow-up patch in this patchset addresses that.

Signed-off-by: Chris Mi <chrism@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoidr: Add new APIs to support unsigned long
Chris Mi [Wed, 30 Aug 2017 06:31:57 +0000 (02:31 -0400)]
idr: Add new APIs to support unsigned long

The following new APIs are added:

int idr_alloc_ext(struct idr *idr, void *ptr, unsigned long *index,
                  unsigned long start, unsigned long end, gfp_t gfp);
void *idr_remove_ext(struct idr *idr, unsigned long id);
void *idr_find_ext(const struct idr *idr, unsigned long id);
void *idr_replace_ext(struct idr *idr, void *ptr, unsigned long id);
void *idr_get_next_ext(struct idr *idr, unsigned long *nextid);

Signed-off-by: Chris Mi <chrism@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'add-rmnet-driver'
David S. Miller [Wed, 30 Aug 2017 18:41:14 +0000 (11:41 -0700)]
Merge branch 'add-rmnet-driver'

Subash Abhinov Kasiviswanathan says:

====================
net: Add support for rmnet driver

This patch series adds support for the rmnet driver which is required to
support recent chipsets using Qualcomm Technologies, Inc. modems. The data
from hardware follows the multiplexing and aggregation protocol (MAP).

This driver can be used to register onto any physical network device in
IP mode. Physical transports include USB, HSIC, PCIe and IP accelerator.

rmnet driver helps to decode these packets and queue them to network
stack (and encode and transmit it to the physical device).

v1: Same as the RFC patch with some minor fixes for issues reported by
kbuild test robot.

v1->v2: Change datatypes and remove config IOCTL as mentioned by David.
Also fix checkpatch issues and remove some unused code.

v2->v3: Move location to drivers/net and rename to rmnet. Change the
userspace - netlink communication from custom netlink to rtnl_link_ops.
Refactor some code. Use a fixed config for ingress and egress.

v3->v4: Move location to drivers/net/ethernet/qualcomm/.
Fix comments from Stephen and Jiri -
Split the ether and arp type changes into seperate patches.
Remove debug and custom logging and switch to standard netdevice log.
Remove module parameters. Refactor and change some code style issues.

v4->v5: Rename some structs and variables. Move the initializer
before the for loop start. Put the arp type in correct sequence.

v5->v6: Fix comments from Dan -
Use the upper link API. As a result, remove all the refcounting logic.
Device refcount is explicitly held on real_dev on rx_handler
registration only. Modifiy the flow control struct. Remove the unused
ethernet mode handling.

v6->v7: Fix comments from David - Add newline to end of Makefile. Remove
inline from .c files. Move the module init/exit to rmnet config. Fix an
error reported by kbuild test robot for an unused file.

v7->v8: Use a smaller value for ETH_P_MAP as mentioned by David. Change
netdev_info to netdev_dbg as mentioned by Andew. Fix comments from
Stephen regarding netdev_priv and sparse related errors of using 0 as NULL

v8->v9: Fix comments from David - Remove the CFLAG rule. Change the way
rmnet devices are freed. Instead of using a workqueue to unregister devices
individually, go through the list and free all devices within the rtnl_lock().

v9->v10: Actually fix the locking as mentioned by David. The locking scheme is
mentioned in a comment in rmnet_config.c. Change comment near MAP type
definition as mentioned by Dan. Refactor some code.

v10->v11: Allow RMNET to compile as a module as mentioned by David
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: ethernet: qualcomm: rmnet: Initial implementation
Subash Abhinov Kasiviswanathan [Wed, 30 Aug 2017 04:44:18 +0000 (22:44 -0600)]
drivers: net: ethernet: qualcomm: rmnet: Initial implementation

RmNet driver provides a transport agnostic MAP (multiplexing and
aggregation protocol) support in embedded module. Module provides
virtual network devices which can be attached to any IP-mode
physical device. This will be used to provide all MAP functionality
on future hardware in a single consistent location.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: arp: Add support for raw IP device
Subash Abhinov Kasiviswanathan [Wed, 30 Aug 2017 04:44:17 +0000 (22:44 -0600)]
net: arp: Add support for raw IP device

Define the raw IP type. This is needed for raw IP net devices
like rmnet.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: ether: Add support for multiplexing and aggregation type
Subash Abhinov Kasiviswanathan [Wed, 30 Aug 2017 04:44:16 +0000 (22:44 -0600)]
net: ether: Add support for multiplexing and aggregation type

Define the Qualcomm multiplexing and aggregation (MAP) ether type 0x00F9.
This is needed for receiving data in the MAP protocol like RMNET. This is
not an officially registered ID.

Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'tcp-readd-hp'
David S. Miller [Wed, 30 Aug 2017 18:20:09 +0000 (11:20 -0700)]
Merge branch 'tcp-readd-hp'

Florian Westphal says:

====================
tcp: re-add header prediction

Eric reported a performance regression caused by header prediction
removal.

We now call tcp_ack() much more frequently, for some workloads
this brings in enough cache line misses to become noticeable.

We could possibly still kill HP provided we find a different
way to suppress unneeded tcp_ack, but given we're late in
the cycle it seems preferable to revert.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agotcp: Revert "tcp: remove header prediction"
Florian Westphal [Wed, 30 Aug 2017 17:24:58 +0000 (19:24 +0200)]
tcp: Revert "tcp: remove header prediction"

This reverts commit 45f119bf936b1f9f546a0b139c5b56f9bb2bdc78.

Eric Dumazet says:
  We found at Google a significant regression caused by
  45f119bf936b1f9f546a0b139c5b56f9bb2bdc78 tcp: remove header prediction

  In typical RPC  (TCP_RR), when a TCP socket receives data, we now call
  tcp_ack() while we used to not call it.

  This touches enough cache lines to cause a slowdown.

so problem does not seem to be HP removal itself but the tcp_ack()
call.  Therefore, it might be possible to remove HP after all, provided
one finds a way to elide tcp_ack for most cases.

Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>