Skip to content

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

eric135
Copy link
Contributor

@eric135 eric135 commented Apr 28, 2025

This is an implementation of the storvsc (client complement to storvsp) for SCSI storage over VMBus.

#273

@eric135 eric135 marked this pull request as ready for review May 6, 2025 22:23
@eric135 eric135 requested review from a team as code owners May 6, 2025 22:23
struct StorvscInner {
next_transaction_id: AtomicU64,
new_request_receiver: Receiver<StorvscRequest>,
transactions: Mutex<HashMap<u64, PendingOperation>>,
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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)
Copy link
Member

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?

Copy link
Contributor Author

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),
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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).

Copy link
Contributor Author

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?

@jstarks
Copy link
Member

jstarks commented May 12, 2025

Looking good!

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