Skip to content

[multicast] M2P forwarding, OPTE port subscription, and sled-agent propagation - #10070

Closed
zeeshanlakhani wants to merge 38 commits into
multicast-e2efrom
zl/multicast-m2p-forwarding
Closed

zeeshanlakhani wants to merge 38 commits into
multicast-e2efrom
zl/multicast-m2p-forwarding

Conversation

@zeeshanlakhani

@zeeshanlakhani zeeshanlakhani commented Mar 17, 2026 •

Copy link
Copy Markdown
Collaborator

Complete the multicast data path by adding per-sled M2P (multicast-to-physical) mapping, forwarding entry management, and OPTE port subscription for multicast group members.

Sled-agent

  • New API version (MCAST_M2P_FORWARDING), which adds set_mcast_m2p / clear_mcast_m2p / list_mcast_m2p and set_mcast_fwd / clear_mcast_fwd / list_mcast_fwd methods
  • vmm_join/leave_multicast_group now move to that version and carry InstanceMulticastMembership, with _v7 shims retained for the prior versioning
  • OPTE port_manager gains set/clear operations for M2P and forwarding
  • Port subscription cleanup on PortTicket release

Nexus

  • New sled.rs (MulticastSledClient) encapsulating all sled-agent multicast interactions: subscribe/unsubscribe, M2P/forwarding propagation and teardown
  • Groups RPW propagates M2P and forwarding entries to all member sleds after DPD configuration, with convergent retry on failure
  • Members RPW uses MemberReconcileCtx to thread shared reconciliation state. This handles subscribe on join, unsubscribe on leave, and re-subscribe on migration
  • Pending OPTE cleanup now survives group teardown: members are soft-deleted as "Left" with sled_id retained, and the "Deleting"-state sweep skips rows that still hold a sled_id so the members RPW can finish the unsubscribe appropriately
  • Dataplane client refactoring: we've added compute_sources_for_dpd, UnderlayMulticastIpv6::try_from validation, and select_one_switch for read-only queries where both switches hold identical state (distinct from the hashed select_forwarding_switch_ip)

Source limits

  • New external API version (MULTICAST_SOURCE_LIMITS), with an instance_multicast_group_join shim for the prior version
  • MAX_SSM_SOURCE_IPS (64) gives way to MAX_SOURCE_IPS_PER_MEMBER (32) and MAX_SOURCE_IPS_PER_GROUP (256). validate_member_source_ips rejects oversized lists and duplicate sources, and member attach now rejects joins whose source union would exceed the per-group cap via a union-size CTE.

@zeeshanlakhani
zeeshanlakhani force-pushed the zl/multicast-m2p-forwarding branch 4 times, most recently from 3efe7fa to 98e9742 Compare March 17, 2026 05:42
@zeeshanlakhani

zeeshanlakhani commented Mar 17, 2026 •

Copy link
Copy Markdown
Collaborator Author

Note: Both helios/deploy check-opte-ver/check-opte-ver in CI will fail for now. After R19 ships and OPTE PR #924 merges, we can switch from branch = "zl/filter-mcast-srcs" to rev = "<merged-sha>" and bump tools/opte_version + deploy.sh target to 0.40.

@zeeshanlakhani
zeeshanlakhani marked this pull request as ready for review March 17, 2026 09:02
@zeeshanlakhani zeeshanlakhani self-assigned this Mar 23, 2026
@zeeshanlakhani
zeeshanlakhani force-pushed the zl/multicast-m2p-forwarding branch from 98e9742 to b510a9f Compare March 24, 2026 02:40
Comment thread common/src/api/internal/shared/mod.rs Resolved
@zeeshanlakhani

zeeshanlakhani commented Mar 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

@jgallagher I started down the better path for network types in relation to #10139, where we could expand on the initial version in a separate PR. For the moment, I'm going to move the types back to omicron_common until #10158 finalizes.

@zeeshanlakhani
zeeshanlakhani force-pushed the zl/multicast-m2p-forwarding branch 2 times, most recently from 102d7fb to 043af28 Compare March 26, 2026 11:51

@FelixMcFelix FelixMcFelix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to be posting comments in chunks given the apparent size of the PR, so please bear with me there if I miss something that's covered by a later file. Apart from that I'm seeing various changes from main interspersed here, so I don't know if something is up with the branch targeting.

Comment thread illumos-utils/src/opte/illumos.rs Resolved
Comment thread illumos-utils/src/opte/non_illumos.rs Resolved
Comment thread illumos-utils/src/opte/port_manager.rs Resolved
Comment thread illumos-utils/src/opte/non_illumos.rs Resolved
Comment thread dev-tools/releng/src/main.rs Resolved
Comment thread illumos-utils/src/opte/port_manager.rs Resolved
Comment thread illumos-utils/src/opte/port_manager.rs Resolved
Comment thread illumos-utils/src/opte/port_manager.rs Resolved
Comment thread illumos-utils/src/opte/port_manager.rs Resolved
Comment thread illumos-utils/src/opte/port_manager.rs Resolved
…main builds

Bump maghemite and OPTE to versions with the latest multicast support.

OPTE now has the option to be installed via p5p package override from buildomat
rather than directly downloading xde/opteadm binaries. The override
mechanism (tools/opte_version_override) is sourced and packaged for use with
install_opte.sh, deploy.sh, releng, and CI to install the unpublished OPTE
build until it lands in the helios pkg repo.

Note: CI check added to reject OPTE_COMMIT override on PRs targeting main.
@zeeshanlakhani
zeeshanlakhani force-pushed the zl/multicast-m2p-forwarding branch 2 times, most recently from 9cdf741 to 18943d0 Compare March 28, 2026 15:37

@FelixMcFelix FelixMcFelix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Zeeshan; I haven't looked at integration_tests/multicast/networking_integration.rs, but otherwise some thoughts going through the work.

Comment thread .github/buildomat/jobs/deploy.sh Resolved
Comment thread .github/workflows/check-opte-ver.yml Resolved
Comment thread illumos-utils/src/opte/port_manager.rs Resolved
Comment thread illumos-utils/src/opte/port_manager.rs Resolved
Comment thread tools/install_opte.sh Resolved
Comment thread nexus/src/app/multicast/sled.rs Resolved
Comment thread nexus/src/app/multicast/sled.rs Resolved
Comment thread sled-agent/src/instance.rs Resolved
@zeeshanlakhani
zeeshanlakhani force-pushed the zl/multicast-m2p-forwarding branch 2 times, most recently from 46eb139 to 6b07a46 Compare April 1, 2026 11:06

@FelixMcFelix FelixMcFelix left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this addresses the questions I had, sorry for the delay in getting back to you. There's one point on getting at least some group distribution across switches, but other than that I think all we need is that you request a lab-2.0-opte-0.xx image on https://github.com/oxidecomputer/meta, and use the published OPTE package & maghemite/main.

Comment thread nexus/src/app/multicast/sled.rs Resolved
Comment thread tools/maghemite_ddm_openapi_version Resolved
This renumbers the sled-agent API version MCAST_M2P_FORWARDING from 42 to 43,
since main claimed 42 for NON_EMPTY_UPLINK_PORTS and moves the nexus
MULTICAST_SOURCE_LIMITS version up to 2026-07-16.

This adapts the multicast integration tests to the status-carrying
`CondCheckError::NotYet` variant from #10598, populating statuses where
they identify the unmet condition.
An explicit leave or instance delete soft-deletes the membership row
before the sled's OPTE subscription is torn down. The row previously
cleared `sled_id` at soft-delete time, so a failed unsubscribe left no
record of which sled still held the subscription and the hard-delete
sweep could reap the row with dataplane state that's still programmed.

This involves separate membership intent from just dataplane convergence:

- The soft-delete producers (explicit leave, instance delete) retain
  the `sled_id` field. Instance-stop still clears it, since the VMM
  and its OPTE port are destroyed together.
- The membership reconciler adds a pending-cleanup pass over rows with
  `time_deleted` set and `sled_id` present. It unsubscribes via the
  member's stored multicast IP, skips sleds the instance no longer
  occupies, and guards against a rejoin of the same (multicast IP,
  instance) pair.
- When clearing `sled_id` after a successful or unnecessary unsubscribe,
  we perform a compare-and-swap keyed on the expected sled.
- The hard-delete sweep only reaps rows whose `sled_id` is already
  cleared.

Note: sled-agent now replaces a group's source filter on repeat joins
rather than accumulating entries, while leaves are keyed by group IP.
This validates per-member source lists (size cap, no duplicates) at
instance create, instance reconfigure, and in the join saga action,
so that malformed specs fail the request instead of unwinding a
partially executed saga.

The up-front group source-union check now excludes the joining member's
stored sources, matching the union the attach CTE computes for a repeat
join that replaces a filter. The attach CTE's write and final SELECT
now reference the validation CTE explicitly, so the sentinel check
cannot be optimized away from the mutation.
@zeeshanlakhani
zeeshanlakhani force-pushed the zl/multicast-m2p-forwarding branch from 7ccb1f4 to 18b7c06 Compare August 18, 2026 05:34
@zeeshanlakhani
zeeshanlakhani changed the base branch from multicast-e2e to main August 20, 2026 14:47
@zeeshanlakhani
zeeshanlakhani changed the base branch from main to multicast-e2e August 20, 2026 14:47
@zeeshanlakhani
zeeshanlakhani marked this pull request as draft August 31, 2026 19:14
@zeeshanlakhani
zeeshanlakhani deleted the zl/multicast-m2p-forwarding branch November 19, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants