Skip to content

Commit

Permalink
set genev_sys_6081 tx checksum off (#3045)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Jul 18, 2023
1 parent 77eb569 commit f347bcd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/daemon/cniserver.go
Expand Up @@ -31,6 +31,10 @@ func CmdMain() {
daemon.InitMetrics()
util.InitKlogMetrics()

if err := initForOS(); err != nil {
util.LogFatalAndExit(err, "failed to do the OS initialization")
}

nicBridgeMappings, err := daemon.InitOVSBridges()
if err != nil {
util.LogFatalAndExit(err, "failed to initialize OVS bridges")
Expand Down
22 changes: 22 additions & 0 deletions cmd/daemon/init.go
@@ -0,0 +1,22 @@
//go:build !windows
// +build !windows

package daemon

import (
"fmt"
"os/exec"

"k8s.io/klog/v2"
)

func initForOS() error {
// disable checksum for genev_sys_6081 as default
cmd := exec.Command("sh", "-c", "ethtool -K genev_sys_6081 tx off")
if err := cmd.Run(); err != nil {
err := fmt.Errorf("failed to set checksum off for genev_sys_6081, %v", err)
// should not affect cni pod running if failed, just record err log
klog.Error(err)
}
return nil
}

0 comments on commit f347bcd

Please sign in to comment.