Skip to content

Commit 9577e9f

Browse files
committed
Set gateway_mtu on rtos-<node> router ports
This allows ovn_cluster_router to send ICMP needs frag when too large of a packet is sent from a pod (such as from a kubevirt VM with too large an MTU). See https://issues.redhat.com/browse/FDP-1295 for more details. Signed-off-by: Tim Rozet <[email protected]>
1 parent bc261a1 commit 9577e9f

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

go-controller/pkg/ovn/base_network_controller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"net"
77
"reflect"
8+
"strconv"
89
"sync"
910
"time"
1011

@@ -383,6 +384,9 @@ func (bnc *BaseNetworkController) syncNodeClusterRouterPort(node *corev1.Node, h
383384
Name: lrpName,
384385
MAC: nodeLRPMAC.String(),
385386
Networks: lrpNetworks,
387+
Options: map[string]string{
388+
"gateway_mtu": strconv.Itoa(config.Default.MTU),
389+
},
386390
}
387391
logicalRouter := nbdb.LogicalRouter{Name: logicalRouterName}
388392
gatewayChassis := nbdb.GatewayChassis{
@@ -392,7 +396,7 @@ func (bnc *BaseNetworkController) syncNodeClusterRouterPort(node *corev1.Node, h
392396
}
393397

394398
err = libovsdbops.CreateOrUpdateLogicalRouterPort(bnc.nbClient, &logicalRouter, &logicalRouterPort,
395-
&gatewayChassis, &logicalRouterPort.MAC, &logicalRouterPort.Networks)
399+
&gatewayChassis, &logicalRouterPort.MAC, &logicalRouterPort.Networks, &logicalRouterPort.Options)
396400
if err != nil {
397401
klog.Errorf("Failed to add gateway chassis %s to logical router port %s, error: %v", chassisID, lrpName, err)
398402
return err

go-controller/pkg/ovn/master_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,9 @@ func addNodeLogicalFlowsHelper(testData []libovsdbtest.TestData, expectedOVNClus
335335
MAC: node.NodeLRPMAC,
336336
Networks: []string{node.NodeGWIP},
337337
GatewayChassis: []string{chassisName + "-UUID"},
338+
Options: map[string]string{
339+
"gateway_mtu": "1400",
340+
},
338341
})
339342
if serviceControllerEnabled {
340343
testData = append(testData, &nbdb.ChassisTemplateVar{

go-controller/pkg/ovn/secondary_layer3_network_controller_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,14 @@ func expectedLayer3EgressEntities(netInfo util.NetInfo, gwConfig util.L3GatewayC
830830
ExternalIDs: standardNonDefaultNetworkExtIDs(netInfo),
831831
Nat: []string{masqSNATUUID1},
832832
},
833-
&nbdb.LogicalRouterPort{UUID: rtosLRPUUID, Name: rtosLRPName, Networks: []string{"192.168.1.1/24"}, MAC: "0a:58:c0:a8:01:01", GatewayChassis: []string{gatewayChassisUUID}},
833+
&nbdb.LogicalRouterPort{
834+
UUID: rtosLRPUUID,
835+
Name: rtosLRPName,
836+
Networks: []string{"192.168.1.1/24"},
837+
MAC: "0a:58:c0:a8:01:01",
838+
GatewayChassis: []string{gatewayChassisUUID},
839+
Options: map[string]string{"gateway_mtu": "1400"},
840+
},
834841
expectedGRStaticRoute(staticRouteUUID1, nodeSubnet.String(), lrsrNextHop, &nbdb.LogicalRouterStaticRoutePolicySrcIP, nil, netInfo),
835842
expectedGRStaticRoute(staticRouteUUID2, gwRouterJoinIPAddress().IP.String(), gwRouterJoinIPAddress().IP.String(), nil, nil, netInfo),
836843
expectedLogicalRouterPolicy(routerPolicyUUID1, netInfo, nodeName, nodeIP, managementPortIP(nodeSubnet).String()),

0 commit comments

Comments
 (0)