Skip to content

Commit a93bf0f

Browse files
lxindavem330
authored andcommitted
vxlan: update skb dst pmtu on tx path
Unlike ip tunnels, now vxlan doesn't do any pmtu update for upper dst pmtu, even if it doesn't match the lower dst pmtu any more. The problem can be reproduced when reducing the vxlan lower dev's pmtu when running netperf. In jianlin's testing, the performance went to 1/7 of the previous. This patch is to update the upper dst pmtu to match the lower dst pmtu on tx path so that packets can be sent out even when lower dev's pmtu has been changed. It also works for metadata dst. Note that this patch doesn't process any pmtu icmp packet. But even in the future, the support for pmtu icmp packets process of udp tunnels will also needs this. The same thing will be done for geneve in another patch. Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 78aa097 commit a93bf0f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/net/vxlan.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,6 +2155,13 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
21552155
}
21562156

21572157
ndst = &rt->dst;
2158+
if (skb_dst(skb)) {
2159+
int mtu = dst_mtu(ndst) - VXLAN_HEADROOM;
2160+
2161+
skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL,
2162+
skb, mtu);
2163+
}
2164+
21582165
tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
21592166
ttl = ttl ? : ip4_dst_hoplimit(&rt->dst);
21602167
err = vxlan_build_skb(skb, ndst, sizeof(struct iphdr),
@@ -2190,6 +2197,13 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
21902197
goto out_unlock;
21912198
}
21922199

2200+
if (skb_dst(skb)) {
2201+
int mtu = dst_mtu(ndst) - VXLAN6_HEADROOM;
2202+
2203+
skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL,
2204+
skb, mtu);
2205+
}
2206+
21932207
tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
21942208
ttl = ttl ? : ip6_dst_hoplimit(ndst);
21952209
skb_scrub_packet(skb, xnet);

0 commit comments

Comments
 (0)