[Devel] [PATCH RH7] net/veth: Increase veth max_mtu for k8s and weave-net

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Tue Jun 15 12:49:48 MSK 2021


We see that k8s weave-net tries to create veth with mtu = 65535 for some
reason, which is allowed in newer mainstream (and vz8) kernel with patch
[1], but not allowed in RHEL7. Before this patch in RH7 ether_setup_rh
sets it to ETH_DATA_LEN (1500).

We already have similar hunk increasing mtu in br_dev_setup() from [1],
so let's also port the hunk from veth_setup().

https://jira.sw.ru/browse/PSBM-130575

(cherry-pick one hunk from commit 91572088e3fd ("net: use core MTU range
checking in core net infra")) [1]
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 drivers/net/veth.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 4bbe6cc762f9..b42a3f5fe3df 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -411,6 +411,7 @@ static void veth_setup(struct net_device *dev)
 			     ~(NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX);
 	dev->extended->needs_free_netdev = true;
 	dev->extended->priv_destructor = veth_dev_free;
+	dev->extended->max_mtu = ETH_MAX_MTU;
 
 	dev->hw_features = VETH_FEATURES;
 	dev->hw_enc_features = VETH_FEATURES;
-- 
2.31.1



More information about the Devel mailing list