Experimental devlink per-port parameter support#2
Open
lhoward wants to merge 2 commits into
Open
Conversation
Replace the per-entry MDBFlags bitmask (with its streamReserved member) and the filterStreamReserved bridge port option with an MDBState enum (temporary, permanent, dynamicReservation) carried in br_mdb_entry.state. A reserved stream is now added by passing state: .dynamicReservation to RTNLLinkBridge.add(), and RTNLMDBEntry exposes mdbState plus an isDynamicReservation accessor. This tracks the kernel UAPI rework that replaced MDB_FLAGS_STREAM_RESERVED with the MDB_DYNAMIC_RESERVATION entry state and removed the IFLA_BRPORT_FILTER_STREAM_RESERVED port flag (the software bridge now tags such frames for a tc-flower egress rule rather than filtering on the ingress port). Update the nltool example to the new state-based API. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a minimal devlink (generic netlink) client, sufficient to enumerate devlink ports and set a per-port parameter, so callers can drive the mv88e6xxx per-port "avb_cfg" knob that replaces the old BR_FILTER_STREAM_RESERVED bridge port flag. RTNLDevlink opens a dedicated NETLINK_GENERIC socket, resolves the "devlink" genl family, dumps DEVLINK_CMD_PORT_GET (RTNLDevlinkPort), and issues DEVLINK_CMD_PORT_PARAM_SET. The devlink uAPI command/attribute constants are duplicated as Swift enums because the build host's <linux/devlink.h> may predate the per-port parameter commands. NLSocket_CB_VALID grows a NETLINK_GENERIC arm that recognises devlink PORT_NEW dump replies and yields RTNLDevlinkPort. CNetLink pulls in the genl/ctrl headers and Package.swift links nl-genl-3. Experimental and not yet exercised against hardware.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a minimal devlink (generic netlink) client — enough to enumerate devlink ports and set a per-port parameter — so callers can drive the mv88e6xxx per-port
avb_cfgknob that replaces the oldBR_FILTER_STREAM_RESERVEDbridge port flag in the 802.1Qat stream-reservation rework.What's here
RTNLDevlink: dedicatedNETLINK_GENERICsocket, resolves thedevlinkgenl family, dumpsDEVLINK_CMD_PORT_GET(RTNLDevlinkPort), issuesDEVLINK_CMD_PORT_PARAM_SET.<linux/devlink.h>may predate the per-port parameter commands).NLSocket_CB_VALIDgains aNETLINK_GENERICarm for devlinkPORT_NEWdump replies.CNetLinkpulls in the genl/ctrl headers;Package.swiftlinksnl-genl-3.Status
Experimental — not yet built or exercised against hardware in this environment.
Note on base
This branch is based on local
main, which is ahead oforigin/mainby one unpushed commit (NetLink: model MDB entry state, replacing the stream-reserved flag). That commit therefore also appears in this PR's diff; it is a prerequisite for the wider rework and is expected to land with / ahead of this work.🤖 Generated with Claude Code