OSDN Git Service

android-x86/kernel.git
6 years agobridge: trigger RTM_NEWLINK when interface is modified by bridge ioctl
Vincent Bernat [Thu, 21 Sep 2017 10:05:25 +0000 (12:05 +0200)]
bridge: trigger RTM_NEWLINK when interface is modified by bridge ioctl

Currently, there is a difference in netlink events received when an
interface is modified through bridge ioctl() or through netlink. This
patch generates additional events when an interface is added to or
removed from a bridge via ioctl().

When adding then removing an interface from a bridge with netlink, we
get:

5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
    link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 9e:da:60:ee:cf:c8
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 9e:da:60:ee:cf:c8
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 9e:da:60:ee:cf:c8
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 9e:da:60:ee:cf:c8
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
    link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff

5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
    link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 9e:da:60:ee:cf:c8
Deleted 5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 9e:da:60:ee:cf:c8
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
    link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff

When using ioctl():

5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
    link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 9e:da:60:ee:cf:c8
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 9e:da:60:ee:cf:c8
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 9e:da:60:ee:cf:c8
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
    link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff

5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
    link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 9e:da:60:ee:cf:c8
Deleted 5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 9e:da:60:ee:cf:c8
5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
    link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff

Without this patch, the last netlink notification is not sent.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agocxgb4: avoid stall while shutting down the adapter
Ganesh Goudar [Thu, 21 Sep 2017 07:20:47 +0000 (12:50 +0530)]
cxgb4: avoid stall while shutting down the adapter

do not wait for completion while deleting the filters
when the adapter is shutting down because we may not get
the response as interrupts will be disabled.

Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet/smc: parameter cleanup in smc_cdc_get_free_slot()
Ursula Braun [Thu, 21 Sep 2017 07:17:34 +0000 (09:17 +0200)]
net/smc: parameter cleanup in smc_cdc_get_free_slot()

Use the smc_connection as first parameter with smc_cdc_get_free_slot().
This is just a small code cleanup, no functional change.

Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoe100: Cocci spatch "pool_zalloc-simple"
Thomas Meyer [Thu, 21 Sep 2017 06:15:26 +0000 (08:15 +0200)]
e100: Cocci spatch "pool_zalloc-simple"

Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0.
Found by coccinelle spatch "api/alloc/pool_zalloc-simple.cocci"

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: add port fdb dump
Vivien Didelot [Wed, 20 Sep 2017 23:32:14 +0000 (19:32 -0400)]
net: dsa: add port fdb dump

Dumping a DSA port's FDB entries is not specific to a DSA slave, so add
a dsa_port_fdb_dump function, similarly to dsa_port_fdb_add and
dsa_port_fdb_del.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: better scoping of slave functions
Vivien Didelot [Wed, 20 Sep 2017 23:31:57 +0000 (19:31 -0400)]
net: dsa: better scoping of slave functions

A few DSA slave functions take a dsa_slave_priv pointer as first
argument, whereas the scope of the slave.c functions is the slave
net_device structure. Fix this and rename dsa_netpoll_send_skb to
dsa_slave_netpoll_send_skb.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: use dedicated CPU port
Vivien Didelot [Wed, 20 Sep 2017 16:28:05 +0000 (12:28 -0400)]
net: dsa: use dedicated CPU port

Each port in DSA has its own dedicated CPU port currently available in
its parent switch's ds->ports[port].cpu_dp. Use it instead of getting
the unique tree CPU port, which will be deprecated soon.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: avoid a full fib lookup when rp_filter is disabled.
Paolo Abeni [Wed, 20 Sep 2017 16:26:53 +0000 (18:26 +0200)]
net: avoid a full fib lookup when rp_filter is disabled.

Since commit 1dced6a85482 ("ipv4: Restore accept_local behaviour
in fib_validate_source()") a full fib lookup is needed even if
the rp_filter is disabled, if accept_local is false - which is
the default.

What we really need in the above scenario is just checking
that the source IP address is not local, and in most case we
can do that is a cheaper way looking up the ifaddr hash table.

This commit adds a helper for such lookup, and uses it to
validate the src address when rp_filter is disabled and no
'local' routes are created by the user space in the relevant
namespace.

A new ipv4 netns flag is added to account for such routes.
We need that to preserve the same behavior we had before this
patch.

It also drops the checks to bail early from __fib_validate_source,
added by the commit 1dced6a85482 ("ipv4: Restore accept_local
behaviour in fib_validate_source()") they do not give any
measurable performance improvement: if we do the lookup with are
on a slower path.

This improves UDP performances for unconnected sockets
when rp_filter is disabled by 5% and also gives small but
measurable performance improvement for TCP flood scenarios.

v1 -> v2:
 - use the ifaddr lookup helper in __ip_dev_find(), as suggested
   by Eric
 - fall-back to full lookup if custom local routes are present

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'ebpf-samples-cross-compile'
David S. Miller [Thu, 21 Sep 2017 18:59:16 +0000 (11:59 -0700)]
Merge branch 'ebpf-samples-cross-compile'

Joel Fernandes says:

====================
Add cross-compilation support to eBPF samples

These patches fix issues seen when cross-compiling eBPF samples on arm64.
Compared to [1], I dropped the controversial inline-asm patch and exploring
other options to fix it. However these patches are a step in the right
direction and I look forward to getting them into -next and the merge window.

Changes since v3:
- just a repost with acks

[1] https://lkml.org/lkml/2017/8/7/417
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agosamples/bpf: Add documentation on cross compilation
Joel Fernandes [Wed, 20 Sep 2017 16:11:59 +0000 (09:11 -0700)]
samples/bpf: Add documentation on cross compilation

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Joel Fernandes <joelaf@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agosamples/bpf: Fix pt_regs issues when cross-compiling
Joel Fernandes [Wed, 20 Sep 2017 16:11:58 +0000 (09:11 -0700)]
samples/bpf: Fix pt_regs issues when cross-compiling

BPF samples fail to build when cross-compiling for ARM64 because of incorrect
pt_regs param selection. This is because clang defines __x86_64__ and
bpf_headers thinks we're building for x86. Since clang is building for the BPF
target, it shouldn't make assumptions about what target the BPF program is
going to run on. To fix this, lets pass ARCH so the header knows which target
the BPF program is being compiled for and can use the correct pt_regs code.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Joel Fernandes <joelaf@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agosamples/bpf: Enable cross compiler support
Joel Fernandes [Wed, 20 Sep 2017 16:11:57 +0000 (09:11 -0700)]
samples/bpf: Enable cross compiler support

When cross compiling, bpf samples use HOSTCC for compiling the non-BPF part of
the sample, however what we really want is to use the cross compiler to build
for the cross target since that is what will load and run the BPF sample.
Detect this and compile samples correctly.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Joel Fernandes <joelaf@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agosamples/bpf: Use getppid instead of getpgrp for array map stress
Joel Fernandes [Wed, 20 Sep 2017 16:11:56 +0000 (09:11 -0700)]
samples/bpf: Use getppid instead of getpgrp for array map stress

When cross-compiling the bpf sample map_perf_test for aarch64, I find that
__NR_getpgrp is undefined. This causes build errors. This syscall is deprecated
and requires defining __ARCH_WANT_SYSCALL_DEPRECATED. To avoid having to define
that, just use a different syscall (getppid) for the array map stress test.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Joel Fernandes <joelaf@google.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'net-setup_timer'
David S. Miller [Thu, 21 Sep 2017 18:44:45 +0000 (11:44 -0700)]
Merge branch 'net-setup_timer'

Allen Pais says:

====================
net: use setup_timer() helper function.

 This series uses setup_timer() helper function. The series
addresses the files under drivers/net/*.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: lmc: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:25 +0000 (22:35 +0530)]
drivers: net: lmc: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: bnx2x: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:24 +0000 (22:35 +0530)]
drivers: net: bnx2x: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: cxgb: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:23 +0000 (22:35 +0530)]
drivers: net: cxgb: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: enic: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:22 +0000 (22:35 +0530)]
drivers: net: enic: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: uli526x: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:21 +0000 (22:35 +0530)]
drivers: net: uli526x: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: i40evf: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:20 +0000 (22:35 +0530)]
drivers: net: i40evf: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: packetengines: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:19 +0000 (22:35 +0530)]
drivers: net: packetengines: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: stmmac: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:18 +0000 (22:35 +0530)]
drivers: net: stmmac: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: cpsw_ale: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:17 +0000 (22:35 +0530)]
drivers: net: cpsw_ale: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: hamradio: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:16 +0000 (22:35 +0530)]
drivers: net: hamradio: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: hdlc_ppp: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:15 +0000 (22:35 +0530)]
drivers: net: hdlc_ppp: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: dscc: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:14 +0000 (22:35 +0530)]
drivers: net: dscc: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: appletalk: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:13 +0000 (22:35 +0530)]
drivers: net: appletalk: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: caif: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:12 +0000 (22:35 +0530)]
drivers: net: caif: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: can: sja1000: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:11 +0000 (22:35 +0530)]
drivers: net: can: sja1000: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: adi: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:10 +0000 (22:35 +0530)]
drivers: net: adi: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: amd: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:09 +0000 (22:35 +0530)]
drivers: net: amd: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: bnxt: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:08 +0000 (22:35 +0530)]
drivers: net: bnxt: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: dmfe: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:07 +0000 (22:35 +0530)]
drivers: net: dmfe: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: fealnx: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:06 +0000 (22:35 +0530)]
drivers: net: fealnx: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: pxa168: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:05 +0000 (22:35 +0530)]
drivers: net: pxa168: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: mlx4: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:04 +0000 (22:35 +0530)]
drivers: net: mlx4: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: mlx5: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:03 +0000 (22:35 +0530)]
drivers: net: mlx5: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: packetengines: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:02 +0000 (22:35 +0530)]
drivers: net: packetengines: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: sis900: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:01 +0000 (22:35 +0530)]
drivers: net: sis900: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: sun: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:05:00 +0000 (22:35 +0530)]
drivers: net: sun: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: ath6kl: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:59 +0000 (22:34 +0530)]
drivers: net: ath6kl: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: arcnet: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:58 +0000 (22:34 +0530)]
drivers: net: arcnet: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: can: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:57 +0000 (22:34 +0530)]
drivers: net: can: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: can: usb: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:56 +0000 (22:34 +0530)]
drivers: net: can: usb: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: eql: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:55 +0000 (22:34 +0530)]
drivers: net: eql: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: amd8111e: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:54 +0000 (22:34 +0530)]
drivers: net: amd8111e: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: amd: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:53 +0000 (22:34 +0530)]
drivers: net: amd: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: e1000e: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:52 +0000 (22:34 +0530)]
drivers: net: e1000e: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: qlogic: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:51 +0000 (22:34 +0530)]
drivers: net: qlogic: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: smsc: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:50 +0000 (22:34 +0530)]
drivers: net: smsc: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: hippi: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:49 +0000 (22:34 +0530)]
drivers: net: hippi: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: atmel: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:48 +0000 (22:34 +0530)]
drivers: net: atmel: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: xen-netback: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:47 +0000 (22:34 +0530)]
drivers: net: xen-netback: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: bnx2: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:46 +0000 (22:34 +0530)]
drivers: net: bnx2: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: enic: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:45 +0000 (22:34 +0530)]
drivers: net: enic: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: winbond-840: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:44 +0000 (22:34 +0530)]
drivers: net: winbond-840: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: natsemi: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:43 +0000 (22:34 +0530)]
drivers: net: natsemi: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: sun: cassini: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:42 +0000 (22:34 +0530)]
drivers: net: sun: cassini: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: spider_net: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:41 +0000 (22:34 +0530)]
drivers: net: spider_net: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: slip: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:40 +0000 (22:34 +0530)]
drivers: net: slip: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: cisco_hdlc: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:39 +0000 (22:34 +0530)]
drivers: net: cisco_hdlc: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: sdla: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:38 +0000 (22:34 +0530)]
drivers: net: sdla: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: tg3: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:37 +0000 (22:34 +0530)]
drivers: net: tg3: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: sundance: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:36 +0000 (22:34 +0530)]
drivers: net: sundance: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: ixgb: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:35 +0000 (22:34 +0530)]
drivers: net: ixgb: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: ns83820: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:34 +0000 (22:34 +0530)]
drivers: net: ns83820: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: atp: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:33 +0000 (22:34 +0530)]
drivers: net: atp: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: rsi_91x: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:32 +0000 (22:34 +0530)]
drivers: net: rsi_91x: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: appletalk: cops: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:31 +0000 (22:34 +0530)]
drivers: net: appletalk: cops: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: et131x: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:30 +0000 (22:34 +0530)]
drivers: net: et131x: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: am79c961: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:29 +0000 (22:34 +0530)]
drivers: net: am79c961: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: declance: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:28 +0000 (22:34 +0530)]
drivers: net: declance: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: bcm63xx: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:27 +0000 (22:34 +0530)]
drivers: net: bcm63xx: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers : net: niu: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:26 +0000 (22:34 +0530)]
drivers : net: niu: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: brcm80211: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:25 +0000 (22:34 +0530)]
drivers: net: brcm80211: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: pcnet32: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:24 +0000 (22:34 +0530)]
drivers: net: pcnet32: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: b44: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:23 +0000 (22:34 +0530)]
drivers: net: b44: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agodrivers: net: de4x: use setup_timer() helper.
Allen Pais [Thu, 21 Sep 2017 17:04:22 +0000 (22:34 +0530)]
drivers: net: de4x: use setup_timer() helper.

Use setup_timer function instead of initializing timer with the
    function and data fields.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'mlxsw-Multicast-flood-update'
David S. Miller [Thu, 21 Sep 2017 01:03:13 +0000 (18:03 -0700)]
Merge branch 'mlxsw-Multicast-flood-update'

Jiri Pirko says:

====================
mlxsw: Multicast flood update

Nogah says:

Currently, there are four erroneous flows in MC flood:
1. When MC is disabled it affects only the flood table for unregistered
   MC packets, but packets that match an entry in the MDB are unaffected.
2. When MC is disabled, MC packets are being sent to all the ports in the
   bridge (like BC and link-local MC packets) regardless of the designated
   flag (BR_MCAST_FLAG).
3. When a port is being deleted from a bridge it might remain in the MDB.
4. When MC is enabled packets are flooded to the mrouter ports only if
   they don't match any entry in the MDB, when they should always be
   flooded to them.

What these problems have in common is the discrepancy between how the
hardware handles MDB and mcast flood, and how the driver does it. Each
of these problems needs fixing either in the MDB code, or in mcast flood
code, and some in both.

Patches 1-6 change the way the MDB is handled in the driver to make the
following changes easier.
Patches 7-8 fix problem number 1 by removing the MDB from the HW when MC
is being disabled and restoring it when it is being enabled.
Patches 9-10 fix problem number 2 by offloading the flood table by the
appropriate flag.
Patch 11 fixes problem number 3 by adding MDB flush to the port removal.
Patches 12-14 fix problem number 4 by adding the mrouter ports to every
MDB entry in the HW to mimic the wanted behaviour.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Consider mrouter status for mdb changes
Nogah Frankel [Wed, 20 Sep 2017 14:15:16 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Consider mrouter status for mdb changes

When a mrouter is registered or leaves a mid, don't update the HW.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Remove mrouter flood in mdb flush
Nogah Frankel [Wed, 20 Sep 2017 14:15:15 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Remove mrouter flood in mdb flush

In mdb flush the port is being removed from all the mids it is registered
to. But if the port is mrouter, all the mids floods to it.
This patch remove mrouter ports from mids it is not registered to in the
mdb flush.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Update the mdb of mrouter port change
Nogah Frankel [Wed, 20 Sep 2017 14:15:14 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Update the mdb of mrouter port change

Whenever a port starts / stops being mrouter, update all the mdb entries
in the HW to flood / stop flooding mc packets there.
The change should happen only if the port is not in the mid. (If it is,
the mid should flood mc packets to this port anyway)

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Flood all mc packets to mrouter ports
Nogah Frankel [Wed, 20 Sep 2017 14:15:13 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Flood all mc packets to mrouter ports

When mc is enabled, whenever a mc packet doesn't hit any mdb entry it is
being flood to the ports marked as mrouters. However, all mc packets should
be flooded to them even if they match an entry in the mdb.
This patch adds the mrouter ports to every mdb entry that is being written
to the HW.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Flush the mdb when a port is being removed
Nogah Frankel [Wed, 20 Sep 2017 14:15:12 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Flush the mdb when a port is being removed

When a port is being removed from a bridge, flush the bridge mdb to remove
the mids of that port.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Flood mc when mc is disabled by user flag
Nogah Frankel [Wed, 20 Sep 2017 14:15:11 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Flood mc when mc is disabled by user flag

When multicast is disabled, flood mc packets only to port that are marked
BR_MCAST_FLOOD (instead to all).

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Use generic mc flood function
Nogah Frankel [Wed, 20 Sep 2017 14:15:10 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Use generic mc flood function

Use the generic mc flood function to decide whether to flood mc to a port
when mc is being enabled / disabled.
Move this function in the file to avoid forward declaration.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Disable mdb when mc is disabled
Nogah Frankel [Wed, 20 Sep 2017 14:15:09 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Disable mdb when mc is disabled

Remove all the mdb entries from the HW when mc is being disabled and
re-write them when it is being enabled.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Don't write mids to the HW when mc is disabled
Nogah Frankel [Wed, 20 Sep 2017 14:15:08 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Don't write mids to the HW when mc is disabled

Don't write multicast related data to the HW when mc is disabled.
Also, don't allocate mid id to new mids (so the remove function could know
that they weren't wrote to the HW)

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Break mid deletion into two function
Nogah Frankel [Wed, 20 Sep 2017 14:15:07 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Break mid deletion into two function

Break mid deletion into two function, so it will be possible in the future
to delete a mid entry for other reasons then switchdev command (like port
deletion).

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Attach mid id allocation to HW write
Nogah Frankel [Wed, 20 Sep 2017 14:15:06 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Attach mid id allocation to HW write

Attach mid getting and releasing mid id to the HW write / remove, and add
a flag to indicate whether the mid is in the HW. It is done because mid id
is also HW index to this mid.
This change allows adding in the following patches the ability to have a
mid in the mdb cache but not in the HW. It will be useful for being able
to disable the multicast.
It means that the mdb is being written / delete to the HW in the mid
allocation / removing function, not after them.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Break smid write function
Nogah Frankel [Wed, 20 Sep 2017 14:15:05 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Break smid write function

Break the smid write function into two, one that cleans the ports that
might be still written there and one that changes an exiting mid entry.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Save mids list per bridge device
Nogah Frankel [Wed, 20 Sep 2017 14:15:04 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Save mids list per bridge device

Instead of saving all the mids in the same list, save them per vlan
device. This change allows a more efficient mid find.
Also, in the next patches, there will be added a lot of loops over all the
mids in bridge device for multicast disable, mrouter change and ndb flush.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Remove reference count from mid
Nogah Frankel [Wed, 20 Sep 2017 14:15:03 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Remove reference count from mid

Since there is a bitmap for the ports registered to each mid, there is no
need for a ref count, since it will always be the number of set bits in
this bitmap. Any check of the ref count was replaced with checking if the
bitmap is empty.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Add a ports bitmap to the mid db
Nogah Frankel [Wed, 20 Sep 2017 14:15:02 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Add a ports bitmap to the mid db

Add a bitmap of ports to the mid struct to hold the ports that are
registered to this mid.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomlxsw: spectrum_switchdev: Change mc_router to mrouter
Nogah Frankel [Wed, 20 Sep 2017 14:15:01 +0000 (16:15 +0200)]
mlxsw: spectrum_switchdev: Change mc_router to mrouter

Change the naming of mc_router to mrouter to keep consistency.

Signed-off-by: Nogah Frankel <nogahf@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agocxgb4: add new T5 pci device id's
Ganesh Goudar [Wed, 20 Sep 2017 06:02:07 +0000 (11:32 +0530)]
cxgb4: add new T5 pci device id's

Add 0x50a5, 0x50a6, 0x50a7, 0x50a8 and 0x50a9 T5 device
id's.

Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'blackfin-Drop-non-functional-DSA-code'
David S. Miller [Wed, 20 Sep 2017 22:57:02 +0000 (15:57 -0700)]
Merge branch 'blackfin-Drop-non-functional-DSA-code'

Florian Fainelli says:

====================
blackfin: Drop non-functional DSA code

I sent those many months ago in the hope that the bfin-linux people
would pick those patches but nobody seems to be responding, can you
queue those via net-next since this affects DSA?
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoblackfin: ezbrd: Remove non-functional DSA/KSZ8893M code
Florian Fainelli [Wed, 20 Sep 2017 01:03:46 +0000 (18:03 -0700)]
blackfin: ezbrd: Remove non-functional DSA/KSZ8893M code

There is no in tree driver for the KSZ8893M switch driver, so just get rid of
the code in that board file.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoblackfin: tcm-bf518: Remove dsa.h inclusion
Florian Fainelli [Wed, 20 Sep 2017 01:03:45 +0000 (18:03 -0700)]
blackfin: tcm-bf518: Remove dsa.h inclusion

Nothing in that file uses definitions from that header, so just get rid of it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: Utilize dsa_slave_dev_check()
Florian Fainelli [Wed, 20 Sep 2017 01:00:37 +0000 (18:00 -0700)]
net: dsa: Utilize dsa_slave_dev_check()

Instead of open coding the check.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>