viona: support (enough) VIRTIO_NET_F_CTRL_RX to leave all-multicast mode#1125
viona: support (enough) VIRTIO_NET_F_CTRL_RX to leave all-multicast mode#1125FelixMcFelix wants to merge 3 commits intomasterfrom
VIRTIO_NET_F_CTRL_RX to leave all-multicast mode#1125Conversation
VIRTIO_NET_F_CTRL_RX to remove promiscVIRTIO_NET_F_CTRL_RX to leave all-multicast mode
Well, that was an adventure. Closes 1127.
|
I've tested this so far on Alpine Linux 3.23.3, debian 13.2, and the helios-2.8 image we use for a4x2 testing. The first two are multiqueue-capable, whereas illumos is not -- control requests appear to be correctly served on queue 22 for the former and queue 2 for the latter. The typical initialisation sequence looks to be that guests will send explicit promisc off signals for alongside every MAC filter update. Running on top of OPTE and/or in omicron standalone doesn't really stop Linux from asking for multicast MACs (i.e., they're not a result of anything coming in link-local). So for most guests we will need to get explicit MAC filter support into viona proper, or they'll just put themselves back into all-multicast mode. illumos, at least, keeps the tables empty. On Debian, I'm seeing: With visible group subscriptions on: So the MAC table can be decoded as:
|
| if let Some(ctlq) = queues.get(2) { | ||
| ctlq.set_control(); | ||
| } |
There was a problem hiding this comment.
I don't know what effect putting receiveq2 in this state would have, but we never unset this flag when the control queue index updated. So in theory this would have affected ring_init/reset/kick/... for this queue?
| let input: migrate::VionaStateV1 = offer.take()?; | ||
|
|
||
| let mut state = self.inner.lock().unwrap(); | ||
| state.filter = FilterState::from_bits_retain(input.filter); | ||
| state.unicast_mac_filters = input.unicast_mac_filters.into(); | ||
| state.unicast_mac_filters = input.multicast_mac_filters.into(); | ||
| self.set_promisc(input.promisc, &mut state).map_err(|_| { | ||
| MigrateStateError::ImportFailed(format!( | ||
| "Could not move device promisc level to {:?}.", | ||
| input.promisc | ||
| )) | ||
| }) |
There was a problem hiding this comment.
I'm pretty unfamiliar with the propolis migration machinery, hopefully this does the job?
This PR adds support for the
VIRTIO_NET_F_CTRL_RXcapability, which allows guests to request specific MAC address filters in addition to their primary MAC, and to explicitly inform the host whether the device should be shifted into promiscuous mode.The hope is that this allows us to take a guest out of all-multicast promiscuous mode in viona itself, which generates extra per-packet work (checking "is this packet multicast?") and contention in the Tx and Rx paths as both reach for and refcount the same list of promisc callbacks on the client.
Testing in falcon makes it look as though Debian will just immediately insert multicast entries, although I don't know if that's purely an artefact of my environment. Using one of the helios-dev images appears to correctly move out of promiscuous mode and keep the filter tables empty.
Closes #1122. Closes #1127.