-
Notifications
You must be signed in to change notification settings - Fork 121
storage: storvsc user-mode implementation #1256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
struct StorvscInner { | ||
next_transaction_id: AtomicU64, | ||
new_request_receiver: Receiver<StorvscRequest>, | ||
transactions: Mutex<HashMap<u64, PendingOperation>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use a slab::Slab<PendingOperation>
instead of a HashMap
. The slab will give you a usize
key which you can use as the transaction ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see from the Slab docs that it can reuse keys for removed items. Could there be any issues with reused, non-sequential keys on the storvsp side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be a protocol violation--storvsp can only send a completion for a transaction once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So does slab still work for this if it can reuse keys, given that it can result in duplicate transaction IDs?
.0 | ||
.to_owned(); | ||
|
||
// Step 4: CREATE_SUB_CHANNELS (if supported) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really support subchannels yet, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subchannels are seemingly supported by our storvsp implementation.
|
||
enum Packet { | ||
Completion(StorvscCompletionPacket), | ||
//Data(StorvscDataPacket), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this case will be necessary for supporting hot add/remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would the protocol operations be for hot add/remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The driver get an async notification message that something changed, and then it's supposed to rescan the SCSI bus (if even needs to--in the OpenHCL case, we know what LUN to expect, so we can pretty much just silently drop the notification).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After doing nothing, then we need to send a completion for the data packet, correct?
Looking good! |
This is an implementation of the storvsc (client complement to storvsp) for SCSI storage over VMBus.
#273