1. 29 Oct, 2021 10 commits
    • Jakub Kicinski's avatar
      Merge branch 'code-movement-to-br_switchdev-c' · a812a046
      Jakub Kicinski authored
      Vladimir Oltean says:
      
      ====================
      Code movement to br_switchdev.c
      
      This is one more refactoring patch set for the Linux bridge, where more
      logic that is specific to switchdev is moved into br_switchdev.c, which
      is compiled out when CONFIG_NET_SWITCHDEV is disabled.
      ====================
      
      Link: https://lore.kernel.org/r/20211027162119.2496321-1-vladimir.oltean@nxp.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a812a046
    • Vladimir Oltean's avatar
      net: bridge: switchdev: consistent function naming · 326b212e
      Vladimir Oltean authored
      Rename all recently imported functions in br_switchdev.c to start with a
      br_switchdev_* prefix.
      
      br_fdb_replay_one() -> br_switchdev_fdb_replay_one()
      br_fdb_replay() -> br_switchdev_fdb_replay()
      br_vlan_replay_one() -> br_switchdev_vlan_replay_one()
      br_vlan_replay() -> br_switchdev_vlan_replay()
      struct br_mdb_complete_info -> struct br_switchdev_mdb_complete_info
      br_mdb_complete() -> br_switchdev_mdb_complete()
      br_mdb_switchdev_host_port() -> br_switchdev_host_mdb_one()
      br_mdb_switchdev_host() -> br_switchdev_host_mdb()
      br_mdb_replay_one() -> br_switchdev_mdb_replay_one()
      br_mdb_replay() -> br_switchdev_mdb_replay()
      br_mdb_queue_one() -> br_switchdev_mdb_queue_one()
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      326b212e
    • Vladimir Oltean's avatar
      net: bridge: mdb: move all switchdev logic to br_switchdev.c · 9776457c
      Vladimir Oltean authored
      The following functions:
      
      br_mdb_complete
      br_switchdev_mdb_populate
      br_mdb_replay_one
      br_mdb_queue_one
      br_mdb_replay
      br_mdb_switchdev_host_port
      br_mdb_switchdev_host
      br_switchdev_mdb_notify
      
      are only accessible from code paths where CONFIG_NET_SWITCHDEV is
      enabled. So move them to br_switchdev.c, in order for that code to be
      compiled out if that config option is disabled.
      
      Note that br_switchdev.c gets build regardless of whether
      CONFIG_BRIDGE_IGMP_SNOOPING is enabled or not, whereas br_mdb.c only got
      built when CONFIG_BRIDGE_IGMP_SNOOPING was enabled. So to preserve
      correct compilation with CONFIG_BRIDGE_IGMP_SNOOPING being disabled, we
      must now place an #ifdef around these functions in br_switchdev.c.
      The offending bridge data structures that need this are
      br->multicast_lock and br->mdb_list, these are also compiled out of
      struct net_bridge when CONFIG_BRIDGE_IGMP_SNOOPING is turned off.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9776457c
    • Vladimir Oltean's avatar
      net: bridge: split out the switchdev portion of br_mdb_notify · 9ae9ff99
      Vladimir Oltean authored
      Similar to fdb_notify() and br_switchdev_fdb_notify(), split the
      switchdev specific logic from br_mdb_notify() into a different function.
      This will be moved later in br_switchdev.c.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      9ae9ff99
    • Vladimir Oltean's avatar
      net: bridge: move br_vlan_replay to br_switchdev.c · 4a6849e4
      Vladimir Oltean authored
      br_vlan_replay() is relevant only if CONFIG_NET_SWITCHDEV is enabled, so
      move it to br_switchdev.c.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      4a6849e4
    • Vladimir Oltean's avatar
      net: bridge: provide shim definition for br_vlan_flags · c5f6e5eb
      Vladimir Oltean authored
      br_vlan_replay() needs this, and we're preparing to move it to
      br_switchdev.c, which will be compiled regardless of whether or not
      CONFIG_BRIDGE_VLAN_FILTERING is enabled.
      Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
      Acked-by: default avatarNikolay Aleksandrov <nikolay@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c5f6e5eb
    • Jakub Kicinski's avatar
      Merge branch 'mlxsw-offload-root-tbf-as-port-shaper' · d57beb0e
      Jakub Kicinski authored
      Ido Schimmel says:
      
      ====================
      mlxsw: Offload root TBF as port shaper
      
      Petr says:
      
      Egress configuration in an mlxsw deployment would generally have an ETS
      qdisc at root, with a number of bands and a priority dispatch between them.
      Some of those bands could then have a RED and/or TBF qdiscs attached.
      
      When TBF is used like this, mlxsw configures shaper on a subgroup, which is
      the pair of traffic classes (UC + BUM) corresponding to the band where TBF
      is installed. This way it is possible to limit traffic on several bands
      (subgroups) independently by configuring several TBF qdiscs, each on a
      different band.
      
      It is however not possible to limit traffic flowing through the port as
      such. The ASIC supports this through port shapers (as opposed to the
      abovementioned subgroup shapers). An obvious way to express this as a user
      would be to configure a root TBF qdisc, and then add the whole ETS
      hierarchy as its child.
      
      TBF (and RED) can currently be used as a root qdisc. This usage has always
      been accepted as a special case, when only one subgroup is configured, and
      that is the subgroup that root TBF and RED configure. However it was never
      possible to install ETS under that TBF.
      
      In this patchset, this limitation is relaxed. TBF qdisc in root position is
      now always offloaded as a port shaper. Such TBF qdisc does not limit
      offload of further children. It is thus possible to configure the usual
      priority classification through ETS, with RED and/or TBF on individual
      bands, all that below a port-level TBF. For example:
      
          (1) # tc qdisc replace dev swp1 root handle 1: tbf rate 800mbit burst 16kb limit 1M
          (2) # tc qdisc replace dev swp1 parent 1:1 handle 11: ets strict 8 priomap 7 6 5 4 3 2 1 0
          (3) # tc qdisc replace dev swp1 parent 11:1 handle 111: tbf rate 600mbit burst 16kb limit 1M
          (4) # tc qdisc replace dev swp1 parent 11:2 handle 112: tbf rate 600mbit burst 16kb limit 1M
      
      Here, (1) configures a 800-Mbps port shaper, (2) adds an ETS element with 8
      strictly-prioritized bands, and (3) and (4) configure two more shapers,
      each 600 Mbps, one under 11:1 (band 0, TCs 7 and 15), one under 11:2 (band
      1, TCs 6 and 14). This way, traffic on bands 0 and 1 are each independently
      capped at 600 Mbps, and at the same time, traffic through the port as a
      whole is capped at 800 Mbps.
      
      In patch #1, TBF is permitted as root qdisc, under which the usual qdisc
      tree can be installed.
      
      In patch #2, the qdisc offloadability selftest is extended to cover the
      root TBF as well.
      
      Patch #3 then tests that the offloaded TBF shapes as expected.
      ====================
      
      Link: https://lore.kernel.org/r/20211027152001.1320496-1-idosch@idosch.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d57beb0e
    • Petr Machata's avatar
      selftests: mlxsw: Test port shaper · 2b11e24e
      Petr Machata authored
      TBF can be used as a root qdisc, in which case it is supposed to configure
      port shaper. Add a test that verifies that this is so by installing a root
      TBF with a ETS or PRIO below it, and then expecting individual bands to all
      be shaped according to the root TBF configuration.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      2b11e24e
    • Petr Machata's avatar
      selftests: mlxsw: Test offloadability of root TBF · 3d5290ea
      Petr Machata authored
      TBF can be used as a root qdisc, with the usual ETS/RED/TBF hierarchy below
      it. This use should now be offloaded. Add a test that verifies that it is.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      3d5290ea
    • Petr Machata's avatar
      mlxsw: spectrum_qdisc: Offload root TBF as port shaper · 48e4d00b
      Petr Machata authored
      The Spectrum ASIC allows configuration of maximum shaper on all levels of
      the scheduling hierarchy: TCs, subgroups, groups and also ports. Currently,
      TBF always configures a subgroup. But a user could reasonably express the
      intent to configure port shaper by putting TBF to a root position, around
      ETS / PRIO. Accept this usage and offload appropriately.
      Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
      Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      48e4d00b
  2. 28 Oct, 2021 30 commits