cli: add configuration option to enable/disable vhost_net#706
cli: add configuration option to enable/disable vhost_net#706bergwolf merged 2 commits intokata-containers:masterfrom
Conversation
|
Build failed (third-party-check pipeline) integration testing with
|
|
PSS Measurement: Memory inside container: |
|
@caoruidong I believe you need to change the govmm code as well since it also has hardcoded vhost dependency there. Something like: |
bergwolf
left a comment
There was a problem hiding this comment.
Please change govmm and update vendor here.
|
See #169 (comment). So we assume kata can still run without vhost_net? |
|
PSS Measurement: Memory inside container: |
|
PSS Measurement: Memory inside container: |
|
Build failed (third-party-check pipeline) integration testing with
|
|
@caoruidong yes, I think so and I did succeed running kata w/o vhost locally. |
|
@caoruidong please add @jiulongzaitian to the |
|
OK. The original commit has Soby. I'll squash them into one for clarity. |
Codecov Report
@@ Coverage Diff @@
## master #706 +/- ##
==========================================
+ Coverage 65.25% 65.33% +0.07%
==========================================
Files 85 85
Lines 9956 9951 -5
==========================================
+ Hits 6497 6501 +4
+ Misses 2807 2798 -9
Partials 652 652 |
|
PSS Measurement: Memory inside container: |
|
Build failed (third-party-check pipeline) integration testing with
|
|
@caoruidong looks fine to me! Please rebase. |
|
@bergwolf PTAL and update your review! |
|
Sorry, I am just seeing this PR. I think this should really be an explicit runtime configuration, set to true by default and documented. |
|
@amshinde actually I think you're totally right. A lot of |
|
I agree with @amshinde that this should be a config option and if vhost is enabled by configuration, try to modprobe it if it doesn't exist yet. And maybe we want another option to say if we want to fallback when vhost-net module doesn't exist. |
|
I agree this patch doesn't work now. We create vhost fds without judgement. runtime/virtcontainers/network.go Lines 939 to 943 in e02695b Our codes strongly depend on vhost_net. @bergwolf How do you run kata without vhost_net? Do you change the code? |
|
Good catch @amshinde - agreed! |
|
PSS Measurement: Memory inside container: |
|
Build succeeded (third-party-check pipeline).
|
bergwolf
left a comment
There was a problem hiding this comment.
LGTM. Just one comment on the new option explanation.
|
|
||
| # If host doesn't support vhost_net, set to true. Thus we won't create vhost fds for nics. | ||
| # Default false | ||
| #disable_vhost_net = true |
There was a problem hiding this comment.
So we no longger modprobe vhost-net, neither we fallback to non-vhost case, right? Please document it here that vhost-net kernel module needs to be builtin or inserted if vhost_net is enabled. Otherwise we'll fail to create the network endpoint for containers.
There was a problem hiding this comment.
If vhost_net.ko exists but is not inserted, when someone accesses /dev/vhost-net, vhost_net.ko will be auto loaded. So we don't need to modprobe it by hand.
If vhost is enabled but actually ko doesn't exist, we won't know until we try to create vhost fds. So I wonder whether that is a good time to fallback to non-vhost when we meet error.
runtime/virtcontainers/network.go
Lines 917 to 921 in a5f05bf
There was a problem hiding this comment.
It's OK to just fail in such case. Thanks for the info that vhost_net.ko is automatically loaded.
|
LGTM, thanks! @caoruidong Please rebase though since it conflicts with new changes merged in #719. |
…-net
If the length of vhostfds is zero, it means host doesn't support vhost. So
do not pass vhost="on" in QMP.
Full list:
1a1fee7 qemu/qmp: nic can works without vhost
Fixes kata-containers#169
Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
Add `disable_vhost_net` option to enable or disable the use of vhost_net. Vhost_net can improve network performance. Signed-off-by: Ruidong Cao <caoruidong@huawei.com>
|
PSS Measurement: Memory inside container: |
|
Build failed (third-party-check pipeline) integration testing with
|
FC: Add new vsock connection handshake
Add
disable_vhost_netoption to enable or disable the use ofvhost_net. Vhost_net can improve network performance.
Fixes: #169
Signed-off-by: Ruidong Cao caoruidong@huawei.com