This patch series introduces the hooks necessary for a user space implementation of the 802.1Qat Stream Reservation Protocol (SRP) to enforce admission control of reserved streams using specific frame priorities and destination MAC addresses. This is typically combined with a traffic shaper such as the Credit Based Shaper (CBS) so that bandwidth can be reserved for AVB/TSN streams.
The patch adds a new flag, MDB_FLAGS_STREAM_RESERVED, that marks a multicast destination address as belonging to a "reserved" stream. Ingress ports with the new BR_FILTER_STREAM_RESERVED flag set will drop any frames whose 802.1p priorities map (via MQPRIO/TAPRIO) to a non-zero traffic class, and whose destination addresses lack a MDB entry with MDB_FLAGS_STREAM_RESERVED set. 802.1Qat admission control is implemented for both the software bridge and the Marvell MV88E6XXX switch chips with AVB support. New tests are added to the former. Whilst 802.1Qat does permit the use of SRP for unicast destination addresses, this is relatively uncommon in practice and is not supported by this patch series. In order to fully support 802.1Qat with hardware offloading on the MV88E6XXX switch chips, we added support for MQPRIO to those chips which have more than one transmit queue, with the following modes: * AVB mode (MQPRIO DCB mode), which enables AVB features on supporting switch chips such as BR_FILTER_STREAM_RESERVED; traffic classes map to AVB classes, with TC0 representing non-AVB traffic. This is the only MQPRIO mode that supports 802.1Qat stream admission, but it can also be used for general traffic classification by not setting the BR_FILTER_STREAM_RESERVED on the switch ports. However, it is limited to three traffic classes, and the configuration is shared by all ports (even on the 88E6390 family of chips). * Channel mode (MQPRIO channel mode), which does not enable 802.1Qat/AVB features but supports a more flexible priority to queue mapping, particularly on the 88E6390 family of switches where the mapping can be configured per port, rather than per chip. In this mode, traffic classes map directly to switch QPris (i.e. queues). Changes since v1: - dropped CBS implementation (this is provided separately by Cedric Jehasse's patch series [1], and is required for its definition of num_tx_queues and qav_info) - added MQPRIO channel support, as well as per-port queue configuration for the 6390 family - admission control is configured using a bridge port flag rather than a device tree entry - software bridge support for admission control - Link to v1: https://lore.kernel.org/all/[email protected]/ [1] https://lore.kernel.org/all/[email protected]/ Signed-off-by: Luke Howard <[email protected]> --- Luke Howard (6): net: bridge: mdb: add MDB_FLAGS_STREAM_RESERVED flag net: bridge: convert mdb_entry host_joined to a flags field net: bridge: add 802.1Qat stream reservation admission control net: bridge: allow MDB_FLAGS_STREAM_RESERVED on host groups net: dsa: mv88e6xxx: MQPRIO support net: dsa: mv88e6xxx: honour MDB_FLAGS_STREAM_RESERVED for AVB streams drivers/net/dsa/mv88e6xxx/Makefile | 3 +- drivers/net/dsa/mv88e6xxx/avb.c | 221 +++++++ drivers/net/dsa/mv88e6xxx/avb.h | 79 +++ drivers/net/dsa/mv88e6xxx/chip.c | 507 +++++++++++++++- drivers/net/dsa/mv88e6xxx/chip.h | 68 ++- drivers/net/dsa/mv88e6xxx/global1.c | 28 +- drivers/net/dsa/mv88e6xxx/global1.h | 6 +- drivers/net/dsa/mv88e6xxx/global1_atu.c | 17 + drivers/net/dsa/mv88e6xxx/global2.h | 2 + drivers/net/dsa/mv88e6xxx/global2_avb.c | 121 ++++ drivers/net/dsa/mv88e6xxx/port.c | 18 + drivers/net/dsa/mv88e6xxx/port.h | 2 + include/linux/if_bridge.h | 1 + include/net/switchdev.h | 4 + include/uapi/linux/if_bridge.h | 7 + include/uapi/linux/if_link.h | 9 + net/bridge/Kconfig | 22 + net/bridge/br_input.c | 61 +- net/bridge/br_mdb.c | 103 ++-- net/bridge/br_multicast.c | 49 +- net/bridge/br_netlink.c | 8 +- net/bridge/br_private.h | 22 +- net/bridge/br_switchdev.c | 22 +- net/core/rtnetlink.c | 2 +- tools/testing/selftests/net/forwarding/Makefile | 1 + .../net/forwarding/bridge_mdb_stream_reserved.sh | 653 +++++++++++++++++++++ tools/testing/selftests/net/forwarding/config | 2 + 27 files changed, 1933 insertions(+), 105 deletions(-) --- base-commit: 0906c117f81c2ae6e6dbfa82719f79c75e1c9325 change-id: 20260602-mv88e6xxx-8021qat-mqprio-46fc466d70e1 prerequisite-change-id: 20260430-net-next-mv88e6xxx-cbs-2121169caa68:v4 prerequisite-patch-id: 8ad59c43368d4639e0cabcc59a7f6e487560d3f7 prerequisite-patch-id: 90cce4d7dadbead4f10cdd0493129b88abf0be75 Best regards, -- Luke Howard <[email protected]>

