1. 22 Dec, 2021 7 commits
  2. 21 Dec, 2021 25 commits
  3. 20 Dec, 2021 8 commits
    • David S. Miller's avatar
      Merge branch 'lan966x-switchdev-and-vlan' · 4b430f5c
      David S. Miller authored
      Horatiu Vultur says:
      
      ====================
      net: lan966x: Add switchdev and vlan support
      
      This patch series extends lan966x with switchdev and vlan support.
      The first patches just adds new registers and extend the MAC table to
      handle the interrupts when a new address is learn/forget.
      
      v7->v8:
      - remove extra mac learn when the port leaves the bridge
      - replace memcpy with ether_addr_copy
      - change the order of operations in lan966x_switch_driver_init/exit
      - refactor lan966x_port_bridge_flags
      
      v6->v7:
      - fix build issues when compiling as a module
      
      v5->v6:
      - fix issues with the singletones, they were not really singletons
      - simplify the case where lan966x ports are added to bridges with foreign
        ports
      - drop the cases NETDEV_PRE_UP and NETDEV_DOWN
      - fix the change of MAC address
      - drop the callbacks .ndo_set_features, .ndo_vlan_rx_add_vid,
        .ndo_vlan_rx_kill_vid
      - remove duplicate code when port was added in a vlan, the MAC entries
        will be added by the fdb
      
      v4->v5:
      - make the notifier_block from lan966x to be singletones
      - use switchdev_handle_port_obj_add and switchdev_handle_fdb_event_to_device
        when getting callbacks in the lan966x
      - merge the two vlan patches in a single one
      
      v3->v4:
      - split the last patch in multiple patches
      - replace spin_lock_irqsave/restore with spin_lock/spin_unlock
      - remove lan966x_port_change_rx_flags because it was copying all the frames to
        the CPU instead of removing all RX filters.
      - implement SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS
      - remove calls to __dev_mc_unsync/sync as they are not needed
      - replace 0/1 with false/true
      - make sure that the lan966x ports are not added to bridges that have other
        interfaces except lan966x
      - and allow the lan966x ports to be part of only the same bridge.
      
      v2->v3:
      - separate the PVID used when the port is in host mode or vlan unaware
      - fix issue when the port was leaving the bridge
      
      v1->v2:
      - when allocating entries for the mac table use kzalloc instead of
        devm_kzalloc
      - also use GFP_KERNEL instead of GFP_ATOMIC, because is never called
        in atomic context
      - when deleting an mac table entry, the order of operations was wrong
      - if ana irq is enabled make sure it gets disabled when the driver is
        removed
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4b430f5c
    • Horatiu Vultur's avatar
      net: lan966x: Extend switchdev with fdb support · 811ba277
      Horatiu Vultur authored
      Extend lan966x driver with fdb support by implementing the switchdev
      calls SWITCHDEV_FDB_ADD_TO_DEVICE and SWITCHDEV_FDB_DEL_TO_DEVICE.
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      811ba277
    • Horatiu Vultur's avatar
      net: lan966x: Extend switchdev bridge flags · e14f7239
      Horatiu Vultur authored
      Currently allow a port to be part or not of the multicast flooding mask.
      By implementing the switchdev calls SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS
      and SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS.
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e14f7239
    • Horatiu Vultur's avatar
      net: lan966x: Add vlan support. · 6d2c186a
      Horatiu Vultur authored
      Extend the driver to support vlan filtering  by implementing the
      switchdev calls SWITCHDEV_OBJ_ID_PORT_VLAN,
      SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6d2c186a
    • Horatiu Vultur's avatar
      net: lan966x: Add support to offload the forwarding. · cf2f6089
      Horatiu Vultur authored
      This patch adds basic support to offload in the HW the forwarding of the
      frames. The driver registers to the switchdev callbacks and implements
      the callbacks for attributes SWITCHDEV_ATTR_ID_PORT_STP_STATE and
      SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME.
      It is not allowed to add a lan966x port to a bridge that contains a
      different interface than lan966x.
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cf2f6089
    • Horatiu Vultur's avatar
      net: lan966x: Remove .ndo_change_rx_flags · 571bb516
      Horatiu Vultur authored
      The function lan966x_port_change_rx_flags() was used only when
      IFF_PROMISC flag was set. In that case it was setting to copy all the
      frames to the CPU instead of removing any RX filters. Therefore remove
      it.
      
      Fixes: d28d6d2e ("net: lan966x: add port module support")
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      571bb516
    • Horatiu Vultur's avatar
      net: lan966x: More MAC table functionality · 25ee9561
      Horatiu Vultur authored
      This patch adds support for adding/removing mac entries in the SW list
      of entries and in the HW table. This is used by the bridge
      functionality.
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      25ee9561
    • Horatiu Vultur's avatar
      net: lan966x: add support for interrupts from analyzer · 5ccd66e0
      Horatiu Vultur authored
      This patch adds support for handling the interrupts generated by the
      analyzer. Currently, only the MAC table generates these interrupts.
      The MAC table will generate an interrupt whenever it learns or forgets
      an entry in the table. It is the SW responsibility figure out which
      entries were added/removed.
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5ccd66e0