Skip to content

Commit cbfe8e3

Browse files
authored
Merge pull request #109 from cloudnativelabs/ip-ip-tunnel-perf
reduce ipip tunnel MTU by 20 bytes to accommodate the tunnel overhead
2 parents fcac507 + 898d78d commit cbfe8e3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/controllers/network_routes_controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,10 @@ func (nrc *NetworkRoutingController) injectRoute(path *table.Path) error {
390390
if err := netlink.LinkSetUp(link); err != nil {
391391
return errors.New("Failed to bring tunnel interface " + tunnelName + " up due to: " + err.Error())
392392
}
393+
// reduce the MTU by 20 bytes to accommodate ipip tunnel overhead
394+
if err := netlink.LinkSetMTU(link, link.Attrs().MTU-20); err != nil {
395+
return errors.New("Failed to set MTU of tunnel interface " + tunnelName + " up due to: " + err.Error())
396+
}
393397
} else {
394398
glog.Infof("Tunnel interface: " + tunnelName + " for the node " + nexthop.String() + " already exists.")
395399
}

0 commit comments

Comments
 (0)