Conversation
| mac_addr: [u8; ETHERADDRL], | ||
| mtu: Option<u16>, | ||
| hdl: VionaHdl, | ||
| mq_active: AtomicBool, |
There was a problem hiding this comment.
would like a comment on this explaining what it means and why it's tracked here?
There was a problem hiding this comment.
yeah, i wasn't even really sure this is a great place to put it. i mostly just took what seemed to get windows happy, threw it in a commit, and put it up as a draft in case someone haad the time to take it further (also why a clippy lint survived to the push lol)
| use std::num::NonZeroU16; | ||
| use std::os::unix::io::{AsRawFd, RawFd}; | ||
| use std::sync::{Arc, Condvar, Mutex, Weak}; | ||
| use std::sync::atomic::{Ordering, AtomicBool}; |
There was a problem hiding this comment.
clippy is kind of obnoxiously mad about alphabetization here :|
|
I think that Windows may be in error here; or, at least, there's some ambiguity in the spec (VirtIO 1.2). Section 2.2 of the spec reads, in part:
(Emphasis added) However, sec. 2.2.2 goes on to say,
(Again, emphasis added) What this says to me is that, once the driver has written the However, I could also imagine that most devices should be able to tolerate a read that doesn't change the value of the register; that is, if I read the register and write it right back, perhaps that should be a tragically complicated no-op. However, if the driver tries to change anything, then that ought to fail, either by clearing (and refusing to set) |
|
I read those sections a bit differently: taken together it implies to me that if you want to change features then you must reset (via writing either way, I think my initial understanding about who was then if that driver tries to also negotiate multiqueue, we're back at #1052. we'll try to SET_PAIRS while some rings are out of reset, get (if you're going only by the viona ioctl output then you do see two |
|
well, I stand by my reading that we're not handling a reset of a virtio device via note that we then, 3.1.1 says:
so when a guest driver reaches step 5, we'll a lightly adjusted but this also explains why I was seeing the "redundant" |
|
Oh yeah, I think you're right; it's write OK, read OK, write OK to acknowledge. |
|
closing this in favor of #1064, as I no longer think it matters if |
I have barely tested this, but I built a propolis-standalone and threw it + a Windows Server 2022 onto a Cosmo and I'm no longer seeing the results of Windows repeatedly resetting the device. so this gets #1052 and apparently #1048 with it.
this probably should just be a mutex that we take somewhere in managing virtio device configuration but this was simple enough to throw together for a quick PoC/validation..