1. 24 Jan, 2020 5 commits
    • David S. Miller's avatar
      Merge branch 'net-bridge-add-per-vlan-state-option' · 23f4eacd
      David S. Miller authored
      Nikolay Aleksandrov says:
      
      ====================
      net: bridge: add per-vlan state option
      
      This set adds the first per-vlan option - state, which uses the new vlan
      infrastructure that was recently added. It gives us forwarding control on
      per-vlan basis. The first 3 patches prepare the vlan code to support option
      dumping and modification. We still compress vlan ranges which have equal
      options, each new option will have to add its own equality check to
      br_vlan_opts_eq(). The vlans are created in forwarding state by default to
      be backwards compatible and vlan state is considered only when the port
      state is forwarding (more info in patch 4).
      I'll send the selftest for the vlan state with the iproute2 patch-set.
      
      v2: patch 3: do full (all-vlan) notification only on vlan
          create/delete, otherwise use the per-vlan notifications only,
          rework how option change ranges are detected, add more verbose error
          messages when setting options and add checks if a vlan should be used.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      23f4eacd
    • Nikolay Aleksandrov's avatar
      net: bridge: vlan: add per-vlan state · a580c76d
      Nikolay Aleksandrov authored
      The first per-vlan option added is state, it is needed for EVPN and for
      per-vlan STP. The state allows to control the forwarding on per-vlan
      basis. The vlan state is considered only if the port state is forwarding
      in order to avoid conflicts and be consistent. br_allowed_egress is
      called only when the state is forwarding, but the ingress case is a bit
      more complicated due to the fact that we may have the transition between
      port:BR_STATE_FORWARDING -> vlan:BR_STATE_LEARNING which should still
      allow the bridge to learn from the packet after vlan filtering and it will
      be dropped after that. Also to optimize the pvid state check we keep a
      copy in the vlan group to avoid one lookup. The state members are
      modified with *_ONCE() to annotate the lockless access.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a580c76d
    • Nikolay Aleksandrov's avatar
      net: bridge: vlan: add basic option setting support · a5d29ae2
      Nikolay Aleksandrov authored
      This patch adds support for option modification of single vlans and
      ranges. It allows to only modify options, i.e. skip create/delete by
      using the BRIDGE_VLAN_INFO_ONLY_OPTS flag. When working with a range
      option changes we try to pack the notifications as much as possible.
      
      v2: do full port (all vlans) notification only when creating/deleting
          vlans for compatibility, rework the range detection when changing
          options, add more verbose extack errors and check if a vlan should
          be used (br_vlan_should_use checks)
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a5d29ae2
    • Nikolay Aleksandrov's avatar
      net: bridge: vlan: add basic option dumping support · 7a53e718
      Nikolay Aleksandrov authored
      We'll be dumping the options for the whole range if they're equal. The
      first range vlan will be used to extract the options. The commit doesn't
      change anything yet it just adds the skeleton for the support. The dump
      will happen when the first option is added.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7a53e718
    • Nikolay Aleksandrov's avatar
      net: bridge: check port state before br_allowed_egress · ac0e932d
      Nikolay Aleksandrov authored
      If we make sure that br_allowed_egress is called only when we have
      BR_STATE_FORWARDING state then we can avoid a test later when we add
      per-vlan state.
      Signed-off-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ac0e932d
  2. 23 Jan, 2020 35 commits