Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.

Commit

Permalink
Fix network performance issue on arm64 for runv
Browse files Browse the repository at this point in the history
Network performance in runv is lower significantly
than in virtual machine started by qemu,as vnet_hdr
feature is not enabled in runv when get access to
a tun/tap device. Adding CIFF_VNET_HDR flag to GetTapFd
func will fixed that issue.

Signed-off-by: Jianyong Wu <[email protected]>
Signed-off-by: Wei Chen <[email protected]>
  • Loading branch information
jongwu committed Mar 22, 2018
1 parent bf3d46a commit ccb3e93
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hypervisor/qemu/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const (
CIFF_TAP = 0x0002
CIFF_NO_PI = 0x1000
CIFF_ONE_QUEUE = 0x2000
CIFF_VNET_HDR = 0x4000
)

type ifReq struct {
Expand All @@ -38,7 +39,7 @@ func GetTapFd(device, bridge, options string) (int, error) {
return -1, err
}

req.Flags = CIFF_TAP | CIFF_NO_PI | CIFF_ONE_QUEUE
req.Flags = CIFF_TAP | CIFF_NO_PI | CIFF_ONE_QUEUE | CIFF_VNET_HDR
copy(req.Name[:len(req.Name)-1], []byte(device))
_, _, errno = syscall.Syscall(syscall.SYS_IOCTL, tapFile.Fd(),
uintptr(syscall.TUNSETIFF),
Expand Down

0 comments on commit ccb3e93

Please sign in to comment.