1. 27 Apr, 2020 8 commits
    • Horatiu Vultur's avatar
      bridge: mrp: Add MRP interface. · 2f1a11ae
      Horatiu Vultur authored
      Define the MRP interface.
      This interface is used by the netlink to update the MRP instances and by the MRP
      to make the calls to switchdev to offload it to HW.
      
      It defines an MRP instance 'struct br_mrp' which is a list of MRP instances.
      Which will be part of the 'struct net_bridge'. Each instance has 2 ring ports,
      a bridge and an ID.
      
      In case the HW can't generate MRP Test frames then the SW will generate those.
      
      br_mrp_add - adds a new MRP instance.
      
      br_mrp_del - deletes an existing MRP instance. Each instance has an ID(ring_id).
      
      br_mrp_set_port_state - changes the port state. The port can be in forwarding
        state, which means that the frames can pass through or in blocked state which
        means that the frames can't pass through except MRP frames. This will
        eventually call the switchdev API to notify the HW. This information is used
        also by the SW bridge to know how to forward frames in case the HW doesn't
        have this capability.
      
      br_mrp_set_port_role - a port role can be primary or secondary. This
        information is required to be pushed to HW in case the HW can generate
        MRP_Test frames.  Because the MRP_Test frames contains a file with this
        information. Otherwise the HW will not be able to generate the frames
        correctly.
      
      br_mrp_set_ring_state - a ring can be in state open or closed. State open means
        that the mrp port stopped receiving MRP_Test frames, while closed means that
        the mrp port received MRP_Test frames. Similar with br_mrp_port_role, this
        information is pushed in HW because the MRP_Test frames contain this
        information.
      
      br_mrp_set_ring_role - a ring can have the following roles MRM or MRC. For the
        role MRM it is expected that the HW can terminate the MRP frames, notify the
        SW that it stopped receiving MRP_Test frames and trapp all the other MRP
        frames.  While for MRC mode it is expected that the HW can forward the MRP
        frames only between the MRP ports and copy MRP_Topology frames to CPU. In
        case the HW doesn't support a role it needs to return an error code different
        than -EOPNOTSUPP.
      
      br_mrp_start_test - this starts/stops the generation of MRP_Test frames. To stop
        the generation of frames the interval needs to have a value of 0. In this case
        the userspace needs to know if the HW supports this or not. Not to have
        duplicate frames(generated by HW and SW). Because if the HW supports this then
        the SW will not generate anymore frames and will expect that the HW will
        notify when it stopped receiving MRP frames using the function
        br_mrp_port_open.
      
      br_mrp_port_open - this function is used by drivers to notify the userspace via
        a netlink callback that one of the ports stopped receiving MRP_Test frames.
        This function is called only when the node has the role MRM. It is not
        supposed to be called from userspace.
      
      br_mrp_port_switchdev_add - this corresponds to the function br_mrp_add,
        and will notify the HW that a MRP instance is added. The function gets
        as parameter the MRP instance.
      
      br_mrp_port_switchdev_del - this corresponds to the function br_mrp_del,
        and will notify the HW that a MRP instance is removed. The function
        gets as parameter the ID of the MRP instance that is removed.
      
      br_mrp_port_switchdev_set_state - this corresponds to the function
        br_mrp_set_port_state. It would notify the HW if it should block or not
        non-MRP frames.
      
      br_mrp_port_switchdev_set_port - this corresponds to the function
        br_mrp_set_port_role. It would set the port role, primary or secondary.
      
      br_mrp_switchdev_set_role - this corresponds to the function
        br_mrp_set_ring_role and would set one of the role MRM or MRC.
      
      br_mrp_switchdev_set_ring_state - this corresponds to the function
        br_mrp_set_ring_state and would set the ring to be open or closed.
      
      br_mrp_switchdev_send_ring_test - this corresponds to the function
        br_mrp_start_test. This will notify the HW to start or stop generating
        MRP_Test frames. Value 0 for the interval parameter means to stop generating
        the frames.
      
      br_mrp_port_open - this function is used to notify the userspace that the port
        lost the continuity of MRP Test frames.
      Reviewed-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2f1a11ae
    • Horatiu Vultur's avatar
      net: bridge: Add port attribute IFLA_BRPORT_MRP_RING_OPEN · 3e54442c
      Horatiu Vultur authored
      This patch adds a new port attribute, IFLA_BRPORT_MRP_RING_OPEN, which allows
      to notify the userspace when the port lost the continuite of MRP frames.
      
      This attribute is set by kernel whenever the SW or HW detects that the ring is
      being open or closed.
      Reviewed-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3e54442c
    • Horatiu Vultur's avatar
      bridge: mrp: Extend bridge interface · 4b8d7d4c
      Horatiu Vultur authored
      To integrate MRP into the bridge, first the bridge needs to be aware of ports
      that are part of an MRP ring and which rings are on the bridge.
      Therefore extend bridge interface with the following:
      - add new flag(BR_MPP_AWARE) to the net bridge ports, this bit will be
        set when the port is added to an MRP instance. In this way it knows if
        the frame was received on MRP ring port
      - add new flag(BR_MRP_LOST_CONT) to the net bridge ports, this bit will be set
        when the port lost the continuity of MRP Test frames.
      - add a list of MRP instances
      Reviewed-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4b8d7d4c
    • Horatiu Vultur's avatar
      bridge: mrp: Update Kconfig · 2cc974f8
      Horatiu Vultur authored
      Add the option BRIDGE_MRP to allow to build in or not MRP support.
      The default value is N.
      Reviewed-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2cc974f8
    • Horatiu Vultur's avatar
      bridge: uapi: mrp: Add mrp attributes. · 4714d137
      Horatiu Vultur authored
      Add new nested netlink attribute to configure the MRP. These attributes are used
      by the userspace to add/delete/configure MRP instances and by the kernel to
      notify the userspace when the MRP ring gets open/closed. MRP nested attribute
      has the following attributes:
      
      IFLA_BRIDGE_MRP_INSTANCE - the parameter type is br_mrp_instance which contains
        the instance id, and the ifindex of the two ports. The ports can't be part of
        multiple instances. This is used to create/delete MRP instances.
      
      IFLA_BRIDGE_MRP_PORT_STATE - the parameter type is u32. Which can be forwarding,
        blocking or disabled.
      
      IFLA_BRIDGE_MRP_PORT_ROLE - the parameter type is br_mrp_port_role which
        contains the instance id and the role. The role can be primary or secondary.
      
      IFLA_BRIDGE_MRP_RING_STATE - the parameter type is br_mrp_ring_state which
        contains the instance id and the state. The state can be open or closed.
      
      IFLA_BRIDGE_MRP_RING_ROLE - the parameter type is br_mrp_ring_role which
        contains the instance id and the ring role. The role can be MRM or MRC.
      
      IFLA_BRIDGE_MRP_START_TEST - the parameter type is br_mrp_start_test which
        contains the instance id, the interval at which to send the MRP_Test frames,
        how many test frames can be missed before declaring the ring open and the
        period which represent for how long to send the test frames.
      
      Also add the file include/uapi/linux/mrp_bridge.h which defines all the types
      used by MRP that are also needed by the userpace.
      Reviewed-by: default avatarNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4714d137
    • Colin Ian King's avatar
      net: rtnetlink: remove redundant assignment to variable err · 7d311801
      Colin Ian King authored
      The variable err is being initializeed with a value that is never read
      and it is being updated later with a new value. The initialization
      is redundant and can be removed.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d311801
    • Oleksij Rempel's avatar
      dt-bindings: net: convert qca,ar71xx documentation to yaml · 3608a199
      Oleksij Rempel authored
      Now that we have the DT validation in place, let's convert the device tree
      bindings for the Atheros AR71XX over to a YAML schemas.
      Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3608a199
    • Oleksij Rempel's avatar
      net: ag71xx: extend link validation to support other SoCs · 0767ec04
      Oleksij Rempel authored
      Most (all?) QCA SoCs have two MAC with different supported link
      capabilities. Extend ag71xx_mac_validate() to properly validate this
      variants.
      Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0767ec04
  2. 26 Apr, 2020 27 commits
  3. 25 Apr, 2020 5 commits