]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
vxlan: Copy needed_tailroom from lowerdev
authorSven Eckelmann <sven@narfation.org>
Thu, 26 Nov 2020 12:52:47 +0000 (13:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:25:46 +0000 (11:25 +0100)
[ Upstream commit a5e74021e84bb5eadf760aaf2c583304f02269be ]

While vxlan doesn't need any extra tailroom, the lowerdev might need it. In
that case, copy it over to reduce the chance for additional (re)allocations
in the transmit path.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://lore.kernel.org/r/20201126125247.1047977-2-sven@narfation.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/vxlan.c

index 8481a21fe7afb278c071615918b3c48a9f34075d..66fffbd64a33f5593cc4371a8bb699b7b7fd6826 100644 (file)
@@ -3182,6 +3182,8 @@ static void vxlan_config_apply(struct net_device *dev,
                needed_headroom = lowerdev->hard_header_len;
                needed_headroom += lowerdev->needed_headroom;
 
+               dev->needed_tailroom = lowerdev->needed_tailroom;
+
                max_mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM :
                                           VXLAN_HEADROOM);
                if (max_mtu < ETH_MIN_MTU)