Skip to content

Commit

Permalink
Merge pull request #9078 from hakman/automated-cherry-pick-of-#9074-u…
Browse files Browse the repository at this point in the history
…pstream-release-1.17

Automated cherry pick of #9074: Disable TX checksum offload for Flannel VXLAN
  • Loading branch information
k8s-ci-robot authored May 7, 2020
2 parents 9eacbe3 + 5cf1924 commit ffacedf
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions nodeup/pkg/model/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (
"path/filepath"

"golang.org/x/sys/unix"
"k8s.io/klog"
"k8s.io/kops/pkg/systemd"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/nodeup/nodetasks"
)
Expand Down Expand Up @@ -112,6 +114,13 @@ WantedBy=multi-user.target
}
}

// Tx checksum offloading is buggy for NAT-ed VXLAN endpoints, leading to an invalid checksum sent and causing
// Flannel to stop to working as the traffic is being discarded by the receiver.
// https://github.com/coreos/flannel/issues/1279
if networking != nil && (networking.Canal != nil || (networking.Flannel != nil && networking.Flannel.Backend == "vxlan")) {
c.AddTask(b.buildFlannelTxChecksumOffloadDisableService())
}

return nil
}

Expand All @@ -134,3 +143,27 @@ func (b *NetworkBuilder) addCNIBinAsset(c *fi.ModelBuilderContext, assetName str

return nil
}

func (b *NetworkBuilder) buildFlannelTxChecksumOffloadDisableService() *nodetasks.Service {
const serviceName = "flannel-tx-checksum-offload-disable.service"

manifest := &systemd.Manifest{}
manifest.Set("Unit", "Description", "Disable TX checksum offload on flannel.1")

manifest.Set("Unit", "After", "sys-devices-virtual-net-flannel.1.device")
manifest.Set("Install", "WantedBy", "sys-devices-virtual-net-flannel.1.device")
manifest.Set("Service", "Type", "oneshot")
manifest.Set("Service", "ExecStart", "/sbin/ethtool -K flannel.1 tx-checksum-ip-generic off")

manifestString := manifest.Render()
klog.V(8).Infof("Built service manifest %q\n%s", serviceName, manifestString)

service := &nodetasks.Service{
Name: serviceName,
Definition: s(manifestString),
}

service.InitDefaults()

return service
}

0 comments on commit ffacedf

Please sign in to comment.