Skip to content
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

load vhost-net kernel module #344

Merged

Conversation

SchSeba
Copy link
Collaborator

@SchSeba SchSeba commented Jul 25, 2022

This commit is needed when using DPDK with vhost-net in virtio mode.
We must load the vhost-net kernel module if we don't want the dpdk
application to run with privilege

Signed-off-by: Sebastian Sch [email protected]

@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@coveralls
Copy link

coveralls commented Jul 25, 2022

Pull Request Test Coverage Report for Build 2739070269

  • 0 of 6 (0.0%) changed or added relevant lines in 1 file are covered.
  • 9 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.07%) to 15.565%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/daemon/daemon.go 0 6 0.0%
Files with Coverage Reduction New Missed Lines %
pkg/daemon/daemon.go 1 0%
api/v1/helper.go 2 34.8%
controllers/sriovnetwork_controller.go 6 67.0%
Totals Coverage Status
Change from base Build 2691407340: -0.07%
Covered Lines: 1142
Relevant Lines: 7337

💛 - Coveralls

@@ -905,6 +906,12 @@ func tryEnableTun() {
}
}

func tryEnableVhostNet() {
if err := utils.LoadKernelModule("vhost-net"); err != nil {
glog.Errorf("tryEnableTun(): VHOST-NET kernel module not loaded: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: please change to tryEnableVhostNet()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!

@@ -905,6 +906,12 @@ func tryEnableTun() {
}
}

func tryEnableVhostNet() {
if err := utils.LoadKernelModule("vhost-net"); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better to change to vhost_net, as lsmod print modules with underscore and we would not grep it in load-kmod.sh

lsmod | grep "vhost_net"                                                                                                                                                                                             
vhost_net              28672  0
vhost                  49152  1 vhost_net
tap                    28672  1 vhost_net
tun                    49152  4 vhost_net
Suggested change
if err := utils.LoadKernelModule("vhost-net"); err != nil {
if err := utils.LoadKernelModule("vhost_net"); err != nil {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both of them work I am fine chaining :)

This commit is needed when using DPDK with vhost-net in virtio mode.
We must load the vhost-net kernel module if we don't want the dpdk
application to run with privilege

Signed-off-by: Sebastian Sch <[email protected]>
@SchSeba SchSeba force-pushed the load_vhost_kernel_module branch from 848923c to 3e8d487 Compare July 26, 2022 11:18
@github-actions
Copy link

Thanks for your PR,
To run vendors CIs use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@zeeke
Copy link
Member

zeeke commented Jul 26, 2022

LGTM

@adrianchiris adrianchiris merged commit 6b07c79 into k8snetworkplumbingwg:master Jul 26, 2022
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.

4 participants