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
runtime-rs: Support vhost-user-net device #8626
runtime-rs: Support vhost-user-net device #8626
Conversation
146a524
to
e91ba13
Compare
e91ba13
to
ba2ff87
Compare
04e5851
to
f4c0c24
Compare
Remove unused string parameter from each item. Fixes: kata-containers#8625 Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
f4c0c24
to
65c15b7
Compare
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.
Thx @justxuewei great work!some comments
| DeviceType::HybridVsock(_) => { | ||
| continue; | ||
| } | ||
| DeviceType::Vsock(_) => { |
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.
IMO, no need to do this, and the change does not related to the commit. I suggest keep it was.
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 agree with that is non-relevant with this patch. But it is necessary to do that from my perspective. The reason is that there is no warning when a developer somehow forgets to give a implementation of a device type. Wdyt?
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.
Did you fix this because you got a warning? Or did you do it to make things easier for future developers?
If you insist on making the change, please put it in a separate commit. This will keep the changes clean and easy for reviewers to understand.
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.
Yeah, I still think it is necessary for us. Plus, I improved the code style of it. It looks more concise now.
DeviceType::HybridVsock(_) | DeviceType::Vsock(_) => {
continue;
}The changes have been laid in a separate commit now. Please take a look, thanks!
| #[derive(Debug)] | ||
| pub struct VhostUserEndpoint { | ||
| // Endpoint index | ||
| #[allow(dead_code)] |
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.
why dead code ?
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 removed this field from VhostUserEndpoint.
|
/test |
65c15b7
to
29fe67a
Compare
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.
Thanks @justxuewei LGTM
This commit introduces VhostUserEndpoint and supports relative to vhost-user-net devices for device manager. For now, Dragonball is able to attach vhost-user-net devices. Fixes: kata-containers#8625 Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
The changes involve: - Expose VhostUserConfig struct to runtime-rs. - Set a default value while num_queues or queue_size are 0. Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
DAN reads vhost-user-net device from JSON config. It only supports VMM running as server right now. Fixes: kata-containers#8625 Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
The affected `Endpoint`s are `VhostUserEndpoint` and `TapEndpoint`. Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
The compiler will give a warning if a developer forget to add an arm for a new variants defined. Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
29fe67a
to
36a4cbc
Compare
|
/test |
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.
Thx @justxuewei LGTM!
|
/test-s390x |
| @@ -68,6 +68,7 @@ pub struct VirtioConfig { | |||
| pub allow_duplicate_mac: bool, | |||
| } | |||
|
|
|||
| /// Config for vhost-user-net device | |||
| #[cfg(feature = "vhost-user-net")] | |||
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.
@justxuewei Hello~ I think src/dragonball/src/api/v1/virtio_net.rs: line 72 should be removed. VhostUserConfig is gated behind the vhost-user-net feature, but is exported when other features are enabled.
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.
Thank you for reporting this. I've raised a PR to fix this. Please refer to #8744.
This commit introduces VhostUserEndpoint and supports relative to
vhost-user-net devices for device manager. For now, Dragonball is able to
attach vhost-user-net devices.
Fixes: #8625