Skip to content

[viona, mac-filter, mcast] install guest multicast MAC filter tables via V7 ioctls - #1210

Open
zeeshanlakhani wants to merge 3 commits into
masterfrom
zl/mcast-mac-filter
Open

[viona, mac-filter, mcast] install guest multicast MAC filter tables via V7 ioctls#1210
zeeshanlakhani wants to merge 3 commits into
masterfrom
zl/mcast-mac-filter

Conversation

@zeeshanlakhani

@zeeshanlakhani zeeshanlakhani commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Guest multicast interest has been driven by VIONA_PROMISC_MULTI, delivering multicast frames for the guests to filter. We saw duplication issues at guest Rx when packets reached both the classified and promiscuous callbacks. This led to the viona interface V7 scoped changes in illumos-gate / change 775.

Given the upstream changes, this work introduces VNA_IOC_SET_MAC_FILTERS to install guest multicast tables on the underlay MAC client backing viona. VNA_IOC_GET_MAC_FILTERS is used for reading back installed entries from the table. Classified delivery can replace all-multicast mode once the guest supplies a table that fits and no broader receive mode is necessary. All-multicast remains the fallback for guests that haven't sent a table request or have exceeded the kernel's capacity.

Most of the work here goes into handling ioctl failures, semantic result codes, and fallback. This includes explicit multicast table management, reset handling, and Falcon-build AllVlan logic.

Most importantly (most scary), this raises the minimum required host viona API to V7. We're keeping the V1 viona state payload for now, with import / export handling for the multicast table state.

Note: This work will fail on CI as don't have special handling. Chat with @iximeow for more.

This is the first of a few different PRs upcoming, including

  • CTRL_RX receive-mode handling
  • send notification on NEEDS_RESET status

This work fixes a [known issue](#1053)
where legacy interface writes could arrive after feature negotiation
ended or a `DRIVER_OK` flag was set, causing side-effects and unwanted
reconfiguration.

We fix this with a guard before `set_features` that checks that
negotiation has closed first, setting `NEEDS_RESET` (discarding the write)
if a different mask is requested. A write that produces the same mask is
just a no-op here.

For modern, common interfaces, writes after `FEATURES_OK`
could mutate the state's `negotiated_features` without calling
`set_features` itself, causing the mask to diverge from what the device
had already applied. This came up in iximeow's
[comment](#1053 (comment)),
which proposed `NEEDS_RESET` for feature writes between `FEATURES_OK`
and `DRIVER_OK`.

To handle this, we apply a similar methodology, but for
`CommonConfigReg::DriverFeature` once negotiation is closed.
We also reject retried `FEATURES_OK` flag sets while `NEEDS_RESET`
status is already set.

We need these changes for upcoming viona work involving setting MAC filters.
@zeeshanlakhani zeeshanlakhani changed the title [viona, mac-filter, mcast] install guest multicast MAC filter tables … [viona, mac-filter, mcast] install guest multicast MAC filter tables via V7 ioctls Sep 7, 2026
@zeeshanlakhani zeeshanlakhani self-assigned this Sep 7, 2026
…via V7 ioctls

Guest multicast interest has been driven by `VIONA_PROMISC_MULTI`,
delivering multicast frames for the guests to filter. We saw duplication
issues at guest Rx when packets reached both the classified and
promiscuous callbacks. This led to the viona interface V7 scoped changes
in [illumos-gate](https://github.com/oxidecomputer/illumos-gate/blob/5ffff4b86e486e1f9d7860be1368386699a7829a) /
[change 775](https://code.oxide.computer/c/illumos-gate/+/775).

Given the upstream changes, this work introduces
`VNA_IOC_SET_MAC_FILTERS` to install guest multicast tables
on the underlay MAC client backing viona. `VNA_IOC_GET_MAC_FILTERS` is used
for reading back installed entries from the table. Classified delivery
can replace all-multicast mode once the guest supplies a table
that fits and no broader receive mode is necessary. All-multicast
remains the fallback for guests that haven't sent a table request
or have exceeded the kernel's capacity.

Most of the work here goes into handling ioctl failures, semantic
result codes, and fallback. This includes explicit multicast table
management, reset handling, and Falcon-build `AllVlan` logic.

Most importantly (most scary), this raises the minimum required host
viona API to V7. We're keeping the V1 viona state payload for now,
with import / export handling for the multicast table state.

This is the first of a few different PRs upcoming, including
- [ ] CTRL_RX receive-mode handling
- [ ] send notification on `NEEDS_RESET` status
@zeeshanlakhani
zeeshanlakhani removed this pull request from stack #1211 September 9, 2026 00:12
@zeeshanlakhani
zeeshanlakhani changed the base branch from zl/virtio-feature-guard to master September 9, 2026 00:20
- merge in #1212 when accepted.
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.

1 participant