sfrench/cifs-2.6.git
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>
6 years agoRevert "bridge: also trigger RTM_NEWLINK when interface is released from bridge"
David S. Miller [Wed, 20 Sep 2017 22:39:59 +0000 (15:39 -0700)]
Revert "bridge: also trigger RTM_NEWLINK when interface is released from bridge"

This reverts commit 00ba4cb36da682c68dc87d1703a8aaffe2b4e9c5.

Discussion with David Ahern determined that this change is
actually not needed.

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoudp: do rmem bulk free even if the rx sk queue is empty
Paolo Abeni [Tue, 19 Sep 2017 10:11:43 +0000 (12:11 +0200)]
udp: do rmem bulk free even if the rx sk queue is empty

The commit 6b229cf77d68 ("udp: add batching to udp_rmem_release()")
reduced greatly the cacheline contention between the BH and the US
reader batching the rmem updates in most scenarios.

Such optimization is explicitly avoided if the US reader is faster
then BH processing.

My fault, I initially suggested this kind of behavior due to concerns
of possible regressions with small sk_rcvbuf values. Tests showed
such concerns are misplaced, so this commit relaxes the condition
for rmem bulk updates, obtaining small but measurable performance
gain in the scenario described above.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agovirtio-net: support XDP_REDIRECT
Jason Wang [Tue, 19 Sep 2017 09:42:43 +0000 (17:42 +0800)]
virtio-net: support XDP_REDIRECT

This patch tries to add XDP_REDIRECT for virtio-net. The changes are
not complex as we could use exist XDP_TX helpers for most of the
work. The rest is passing the XDP_TX to NAPI handler for implementing
batching.

Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agovirtio-net: add packet len average only when needed during XDP
Jason Wang [Tue, 19 Sep 2017 09:42:42 +0000 (17:42 +0800)]
virtio-net: add packet len average only when needed during XDP

There's no need to add packet len average in the case of XDP_PASS
since it will be done soon after skb is created.

Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agovirtio-net: remove unnecessary parameter of virtnet_xdp_xmit()
Jason Wang [Tue, 19 Sep 2017 09:42:41 +0000 (17:42 +0800)]
virtio-net: remove unnecessary parameter of virtnet_xdp_xmit()

CC: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: lan9303: Add adjust_link() method
Egil Hjelmeland [Tue, 19 Sep 2017 08:09:24 +0000 (10:09 +0200)]
net: dsa: lan9303: Add adjust_link() method

Make the driver react to device tree "fixed-link" declaration on CPU port.

- turn off autonegotiation
- force speed 10 or 100 mb/s
- force duplex mode

Signed-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agobridge: also trigger RTM_NEWLINK when interface is released from bridge
Vincent Bernat [Sat, 16 Sep 2017 14:18:33 +0000 (16:18 +0200)]
bridge: also trigger RTM_NEWLINK when interface is released from bridge

Currently, when an interface is released from a bridge via
ioctl(), we get a RTM_DELLINK event through netlink:

Deleted 2: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 6e:23:c2:54:3a:b3

Userspace has to interpret that as a removal from the bridge, not as a
complete removal of the interface. When an bridged interface is
completely removed, we get two events:

Deleted 2: dummy0: <BROADCAST,NOARP> mtu 1500 master bridge0 state DOWN
    link/ether 6e:23:c2:54:3a:b3
Deleted 2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default
    link/ether 6e:23:c2:54:3a:b3 brd ff:ff:ff:ff:ff:ff

In constrast, when an interface is released from a bond, we get a
RTM_NEWLINK with only the new characteristics (no master):

3: dummy1: <BROADCAST,NOARP,SLAVE,UP,LOWER_UP> mtu 1500 qdisc noqueue master bond0 state UNKNOWN group default
    link/ether ae:dc:7a:8c:9a:3c brd ff:ff:ff:ff:ff:ff
3: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
    link/ether ae:dc:7a:8c:9a:3c brd ff:ff:ff:ff:ff:ff
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether ae:dc:7a:8c:9a:3c brd ff:ff:ff:ff:ff:ff
3: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether ae:dc:7a:8c:9a:3c brd ff:ff:ff:ff:ff:ff
3: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether ca:c8:7b:66:f8:25 brd ff:ff:ff:ff:ff:ff
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether ae:dc:7a:8c:9a:3c brd ff:ff:ff:ff:ff:ff

Userland may be confused by the fact we say a link is deleted while
its characteristics are only modified. A first solution would have
been to turn the RTM_DELLINK event in del_nbp() into a RTM_NEWLINK
event. However, maybe some piece of userland is relying on this
RTM_DELLINK to detect when a bridged interface is released. Instead,
we also emit a RTM_NEWLINK event once the interface is
released (without master info).

Deleted 2: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
    link/ether 8a:bb:e7:94:b1:f8
2: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
    link/ether 8a:bb:e7:94:b1:f8 brd ff:ff:ff:ff:ff:ff

This is done only when using ioctl(). When using Netlink, such an
event is already automatically emitted in do_setlink().

Signed-off-by: Vincent Bernat <vincent@bernat.im>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agomacvlan: code refine to check data before using
Zhang Shengju [Wed, 20 Sep 2017 00:12:23 +0000 (08:12 +0800)]
macvlan: code refine to check data before using

This patch checks data first at one place, return if it's null.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoipv6: Use ipv6_authlen for len in ipv6_skip_exthdr
Xiang Gao [Wed, 20 Sep 2017 16:18:17 +0000 (12:18 -0400)]
ipv6: Use ipv6_authlen for len in ipv6_skip_exthdr

In ipv6_skip_exthdr, the lengh of AH header is computed manually
as (hp->hdrlen+2)<<2. However, in include/linux/ipv6.h, a macro
named ipv6_authlen is already defined for exactly the same job. This
commit replaces the manual computation code with the macro.

Signed-off-by: Xiang Gao <qasdfgtyuiop@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'net-speedup-netns-create-delete-time'
David S. Miller [Tue, 19 Sep 2017 23:32:24 +0000 (16:32 -0700)]
Merge branch 'net-speedup-netns-create-delete-time'

Eric Dumazet says:

====================
net: speedup netns create/delete time

When rate of netns creation/deletion is high enough,
we observe softlockups in cleanup_net() caused by huge list
of netns and way too many rcu_barrier() calls.

This patch series does some optimizations in kobject,
and add batching to tunnels so that netns dismantles are
less costly.

IPv6 addrlabels also get a per netns list, and tcp_metrics
also benefit from batch flushing.

This gives me one order of magnitude gain.
(~50 ms -> ~5 ms for one netns create/delete pair)

Tested:

for i in `seq 1 40`
do
 (for j in `seq 1 100` ; do  unshare -n /bin/true >/dev/null ; done) &
done
wait ; grep net_namespace /proc/slabinfo

Before patch series :

$ time ./add_del_unshare.sh
net_namespace        116    258   5504    1    2 : tunables    8    4    0 : slabdata    116    258      0

real 3m24.910s
user 0m0.747s
sys 0m43.162s

After :
$ time ./add_del_unshare.sh
net_namespace        135    291   5504    1    2 : tunables    8    4    0 : slabdata    135    291      0

real 0m22.117s
user 0m0.728s
sys 0m35.328s
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoipv4: speedup ipv6 tunnels dismantle
Eric Dumazet [Tue, 19 Sep 2017 23:27:09 +0000 (16:27 -0700)]
ipv4: speedup ipv6 tunnels dismantle

Implement exit_batch() method to dismantle more devices
per round.

(rtnl_lock() ...
 unregister_netdevice_many() ...
 rtnl_unlock())

Tested:
$ cat add_del_unshare.sh
for i in `seq 1 40`
do
 (for j in `seq 1 100` ; do unshare -n /bin/true >/dev/null ; done) &
done
wait ; grep net_namespace /proc/slabinfo

Before patch :
$ time ./add_del_unshare.sh
net_namespace        126    282   5504    1    2 : tunables    8    4    0 : slabdata    126    282      0

real    1m38.965s
user    0m0.688s
sys     0m37.017s

After patch:
$ time ./add_del_unshare.sh
net_namespace        135    291   5504    1    2 : tunables    8    4    0 : slabdata    135    291      0

real 0m22.117s
user 0m0.728s
sys 0m35.328s

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoipv6: speedup ipv6 tunnels dismantle
Eric Dumazet [Tue, 19 Sep 2017 23:27:08 +0000 (16:27 -0700)]
ipv6: speedup ipv6 tunnels dismantle

Implement exit_batch() method to dismantle more devices
per round.

(rtnl_lock() ...
 unregister_netdevice_many() ...
 rtnl_unlock())

Tested:
$ cat add_del_unshare.sh
for i in `seq 1 40`
do
 (for j in `seq 1 100` ; do unshare -n /bin/true >/dev/null ; done) &
done
wait ; grep net_namespace /proc/slabinfo

Before patch :
$ time ./add_del_unshare.sh
net_namespace        110    267   5504    1    2 : tunables    8    4    0 : slabdata    110    267      0

real    3m25.292s
user    0m0.644s
sys     0m40.153s

After patch:

$ time ./add_del_unshare.sh
net_namespace        126    282   5504    1    2 : tunables    8    4    0 : slabdata    126    282      0

real 1m38.965s
user 0m0.688s
sys 0m37.017s

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agotcp: batch tcp_net_metrics_exit
Eric Dumazet [Tue, 19 Sep 2017 23:27:07 +0000 (16:27 -0700)]
tcp: batch tcp_net_metrics_exit

When dealing with a list of dismantling netns, we can scan
tcp_metrics once, saving cpu cycles.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoipv6: addrlabel: per netns list
Eric Dumazet [Tue, 19 Sep 2017 23:27:06 +0000 (16:27 -0700)]
ipv6: addrlabel: per netns list

Having a global list of labels do not scale to thousands of
netns in the cloud era. This causes quadratic behavior on
netns creation and deletion.

This is time having a per netns list of ~10 labels.

Tested:

$ time perf record (for f in `seq 1 3000` ; do ip netns add tast$f; done)
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 3.637 MB perf.data (~158898 samples) ]

real    0m20.837s # instead of 0m24.227s
user    0m0.328s
sys     0m20.338s # instead of 0m23.753s

    16.17%       ip  [kernel.kallsyms]  [k] netlink_broadcast_filtered
    12.30%       ip  [kernel.kallsyms]  [k] netlink_has_listeners
     6.76%       ip  [kernel.kallsyms]  [k] _raw_spin_lock_irqsave
     5.78%       ip  [kernel.kallsyms]  [k] memset_erms
     5.77%       ip  [kernel.kallsyms]  [k] kobject_uevent_env
     5.18%       ip  [kernel.kallsyms]  [k] refcount_sub_and_test
     4.96%       ip  [kernel.kallsyms]  [k] _raw_read_lock
     3.82%       ip  [kernel.kallsyms]  [k] refcount_inc_not_zero
     3.33%       ip  [kernel.kallsyms]  [k] _raw_spin_unlock_irqrestore
     2.11%       ip  [kernel.kallsyms]  [k] unmap_page_range
     1.77%       ip  [kernel.kallsyms]  [k] __wake_up
     1.69%       ip  [kernel.kallsyms]  [k] strlen
     1.17%       ip  [kernel.kallsyms]  [k] __wake_up_common
     1.09%       ip  [kernel.kallsyms]  [k] insert_header
     1.04%       ip  [kernel.kallsyms]  [k] page_remove_rmap
     1.01%       ip  [kernel.kallsyms]  [k] consume_skb
     0.98%       ip  [kernel.kallsyms]  [k] netlink_trim
     0.51%       ip  [kernel.kallsyms]  [k] kernfs_link_sibling
     0.51%       ip  [kernel.kallsyms]  [k] filemap_map_pages
     0.46%       ip  [kernel.kallsyms]  [k] memcpy_erms

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agokobject: factorize skb setup in kobject_uevent_net_broadcast()
Eric Dumazet [Tue, 19 Sep 2017 23:27:05 +0000 (16:27 -0700)]
kobject: factorize skb setup in kobject_uevent_net_broadcast()

We can build one skb and let it be cloned in netlink.

This is much faster, and use less memory (all clones will
share the same skb->head)

Tested:

time perf record (for f in `seq 1 3000` ; do ip netns add tast$f; done)
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 4.110 MB perf.data (~179584 samples) ]

real    0m24.227s # instead of 0m52.554s
user    0m0.329s
sys 0m23.753s # instead of 0m51.375s

    14.77%       ip  [kernel.kallsyms]  [k] __ip6addrlbl_add
    14.56%       ip  [kernel.kallsyms]  [k] netlink_broadcast_filtered
    11.65%       ip  [kernel.kallsyms]  [k] netlink_has_listeners
     6.19%       ip  [kernel.kallsyms]  [k] _raw_spin_lock_irqsave
     5.66%       ip  [kernel.kallsyms]  [k] kobject_uevent_env
     4.97%       ip  [kernel.kallsyms]  [k] memset_erms
     4.67%       ip  [kernel.kallsyms]  [k] refcount_sub_and_test
     4.41%       ip  [kernel.kallsyms]  [k] _raw_read_lock
     3.59%       ip  [kernel.kallsyms]  [k] refcount_inc_not_zero
     3.13%       ip  [kernel.kallsyms]  [k] _raw_spin_unlock_irqrestore
     1.55%       ip  [kernel.kallsyms]  [k] __wake_up
     1.20%       ip  [kernel.kallsyms]  [k] strlen
     1.03%       ip  [kernel.kallsyms]  [k] __wake_up_common
     0.93%       ip  [kernel.kallsyms]  [k] consume_skb
     0.92%       ip  [kernel.kallsyms]  [k] netlink_trim
     0.87%       ip  [kernel.kallsyms]  [k] insert_header
     0.63%       ip  [kernel.kallsyms]  [k] unmap_page_range

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agokobject: copy env blob in one go
Eric Dumazet [Tue, 19 Sep 2017 23:27:04 +0000 (16:27 -0700)]
kobject: copy env blob in one go

No need to iterate over strings, just copy in one efficient memcpy() call.

Tested:
time perf record "(for f in `seq 1 3000` ; do ip netns add tast$f; done)"
[ perf record: Woken up 10 times to write data ]
[ perf record: Captured and wrote 8.224 MB perf.data (~359301 samples) ]

real    0m52.554s  # instead of 1m7.492s
user    0m0.309s
sys 0m51.375s # instead of 1m6.875s

     9.88%       ip  [kernel.kallsyms]  [k] netlink_broadcast_filtered
     8.86%       ip  [kernel.kallsyms]  [k] string
     7.37%       ip  [kernel.kallsyms]  [k] __ip6addrlbl_add
     5.68%       ip  [kernel.kallsyms]  [k] netlink_has_listeners
     5.52%       ip  [kernel.kallsyms]  [k] memcpy_erms
     4.76%       ip  [kernel.kallsyms]  [k] __alloc_skb
     4.54%       ip  [kernel.kallsyms]  [k] vsnprintf
     3.94%       ip  [kernel.kallsyms]  [k] format_decode
     3.80%       ip  [kernel.kallsyms]  [k] kmem_cache_alloc_node_trace
     3.71%       ip  [kernel.kallsyms]  [k] kmem_cache_alloc_node
     3.66%       ip  [kernel.kallsyms]  [k] kobject_uevent_env
     3.38%       ip  [kernel.kallsyms]  [k] strlen
     2.65%       ip  [kernel.kallsyms]  [k] _raw_spin_lock_irqsave
     2.20%       ip  [kernel.kallsyms]  [k] kfree
     2.09%       ip  [kernel.kallsyms]  [k] memset_erms
     2.07%       ip  [kernel.kallsyms]  [k] ___cache_free
     1.95%       ip  [kernel.kallsyms]  [k] kmem_cache_free
     1.91%       ip  [kernel.kallsyms]  [k] _raw_read_lock
     1.45%       ip  [kernel.kallsyms]  [k] ksize
     1.25%       ip  [kernel.kallsyms]  [k] _raw_spin_unlock_irqrestore
     1.00%       ip  [kernel.kallsyms]  [k] widen_string

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agokobject: add kobject_uevent_net_broadcast()
Eric Dumazet [Tue, 19 Sep 2017 23:27:03 +0000 (16:27 -0700)]
kobject: add kobject_uevent_net_broadcast()

This removes some #ifdef pollution and will ease follow up patches.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet_sched: no need to free qdisc in RCU callback
Cong Wang [Tue, 19 Sep 2017 20:15:42 +0000 (13:15 -0700)]
net_sched: no need to free qdisc in RCU callback

gen estimator has been rewritten in commit 1c0d32fde5bd
("net_sched: gen_estimator: complete rewrite of rate estimators"),
the caller no longer needs to wait for a grace period. So this
patch gets rid of it.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoteam: fall back to hash if table entry is empty
Jim Hanko [Tue, 19 Sep 2017 18:33:39 +0000 (11:33 -0700)]
team: fall back to hash if table entry is empty

If the hash to port mapping table does not have a valid port (i.e. when
a port goes down), fall back to the simple hashing mechanism to avoid
dropping packets.

Signed-off-by: Jim Hanko <hanko@drivescale.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'test_rhashtable-dont-allocate-huge-static-array'
David S. Miller [Tue, 19 Sep 2017 23:15:48 +0000 (16:15 -0700)]
Merge branch 'test_rhashtable-dont-allocate-huge-static-array'

Florian Westphal says:

====================
test_rhashtable: don't allocate huge static array

Add a test case for the rhlist interface.
While at it, cleanup current rhashtable test a bit and add a check
for max_size support.

No changes since v1, except in last patch.
kbuild robot complained about large onstack allocation caused by
struct rhltable when lockdep is enabled.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agotest_rhashtable: add test case for rhl_table interface
Florian Westphal [Tue, 19 Sep 2017 23:12:14 +0000 (01:12 +0200)]
test_rhashtable: add test case for rhl_table interface

also test rhltable.  rhltable remove operations are slow as
deletions require a list walk, thus test with 1/16th of the given
entry count number to get a run duration similar to rhashtable one.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agotest_rhashtable: add a check for max_size
Florian Westphal [Tue, 19 Sep 2017 23:12:13 +0000 (01:12 +0200)]
test_rhashtable: add a check for max_size

add a test that tries to insert more than max_size elements.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agotest_rhashtable: don't use global entries variable
Florian Westphal [Tue, 19 Sep 2017 23:12:12 +0000 (01:12 +0200)]
test_rhashtable: don't use global entries variable

pass the entries to test as an argument instead.
Followup patch will add an rhlist test case; rhlist delete opererations
are slow so we need to use a smaller number to test it.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agotest_rhashtable: don't allocate huge static array
Florian Westphal [Tue, 19 Sep 2017 23:12:11 +0000 (01:12 +0200)]
test_rhashtable: don't allocate huge static array

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agoMerge branch 'dsa-b53-bcm_sf2-cleanups'
David S. Miller [Tue, 19 Sep 2017 23:08:54 +0000 (16:08 -0700)]
Merge branch 'dsa-b53-bcm_sf2-cleanups'

Florian Fainelli says:

====================
net: dsa: b53/bcm_sf2 cleanups

This patch series is a first pass set of clean-ups to reduce the number of LOCs
between b53 and bcm_sf2 and sharing as many functions as possible.

There is a number of additional cleanups queued up locally that require more
thorough testing.

Changes in v3:

- remove one extra argument for the b53_build_io_op macro (David Laight)
- added additional Reviewed-by tags from Vivien

Changes in v2:

- added Reviewed-by tags from Vivien
- added a missing EXPORT_SYMBOL() in patch 8
- fixed a typo in patch 5
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: bcm_sf2: Utilize b53_{enable, disable}_port
Florian Fainelli [Tue, 19 Sep 2017 17:46:54 +0000 (10:46 -0700)]
net: dsa: bcm_sf2: Utilize b53_{enable, disable}_port

Export b53_{enable,disable}_port and use these two functions in
bcm_sf2_port_setup and bcm_sf2_port_disable. The generic functions
cannot be used without wrapping because we need to manage additional
switch integration details (PHY, Broadcom tag etc.).

Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: bcm_sf2: Use SF2_NUM_EGRESS_QUEUES for CFP
Florian Fainelli [Tue, 19 Sep 2017 17:46:53 +0000 (10:46 -0700)]
net: dsa: bcm_sf2: Use SF2_NUM_EGRESS_QUEUES for CFP

The magic number 8 in 3 locations in bcm_sf2_cfp.c actually designates
the number of switch port egress queues, so use that define instead of
open-coding it.

Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: b53: Export b53_imp_vlan_setup()
Florian Fainelli [Tue, 19 Sep 2017 17:46:52 +0000 (10:46 -0700)]
net: dsa: b53: Export b53_imp_vlan_setup()

bcm_sf2 and b53 do exactly the same thing, so share that piece.

Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: b53: Wire-up EEE
Florian Fainelli [Tue, 19 Sep 2017 17:46:51 +0000 (10:46 -0700)]
net: dsa: b53: Wire-up EEE

Add support for enabling and disabling EEE, as well as re-negotiating it in
.adjust_link() and in .port_enable().

Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: b53: Move EEE functions to b53
Florian Fainelli [Tue, 19 Sep 2017 17:46:50 +0000 (10:46 -0700)]
net: dsa: b53: Move EEE functions to b53

Move the bcm_sf2 EEE-related functions to the b53 driver because this is shared
code amongst Gigabit capable switch, only 5325 and 5365 are too old to support
that.

Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: b53: Define EEE register page
Florian Fainelli [Tue, 19 Sep 2017 17:46:49 +0000 (10:46 -0700)]
net: dsa: b53: Define EEE register page

In preparation for migrating the EEE code from bcm_sf2 to b53, define the full
EEE register page and offsets within that page.

Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: b53: Move Broadcom header setup to b53
Florian Fainelli [Tue, 19 Sep 2017 17:46:48 +0000 (10:46 -0700)]
net: dsa: b53: Move Broadcom header setup to b53

The code to enable Broadcom tags/headers is largely switch independent,
and in preparation for enabling it for multiple devices with b53, move
the code we have in bcm_sf2.c to b53_common.c

Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: b53: Use a macro to define I/O operations
Florian Fainelli [Tue, 19 Sep 2017 17:46:47 +0000 (10:46 -0700)]
net: dsa: b53: Use a macro to define I/O operations

Instead of repeating the same pattern: acquire mutex, read/write,
release mutex, define a macro: b53_build_op() which takes the type
(read|write), I/O size, and value (scalar or pointer). This helps with
fixing bugs that could exist (e.g: missing barrier, lock etc.).

Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6 years agonet: dsa: bcm_sf2: Defer port enabling to calling port_enable
Florian Fainelli [Tue, 19 Sep 2017 17:46:46 +0000 (10:46 -0700)]
net: dsa: bcm_sf2: Defer port enabling to calling port_enable

There is no need to configure the enabled ports once in bcm_sf2_sw_setup() and
then a second time around when dsa_switch_ops::port_enable is called, just do
it when port_enable is called which is better in terms of power consumption and
correctness.

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