]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: ipv6: seg6_iptunnel: mitigate 2-realloc issue
authorJustin Iurman <justin.iurman@uliege.be>
Tue, 3 Dec 2024 12:49:44 +0000 (13:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:58 +0000 (12:50 +0100)
commit634710a372ba65bee667c2f6e58a97658c639eab
tree0524c72af0138b65f162f1954834afd92a32f81b
parent8513e56e31fcf22dc09ef2b841333a1825a06fa7
net: ipv6: seg6_iptunnel: mitigate 2-realloc issue

[ Upstream commit 40475b63761abb6f8fdef960d03228a08662c9c4 ]

This patch mitigates the two-reallocations issue with seg6_iptunnel by
providing the dst_entry (in the cache) to the first call to
skb_cow_head(). As a result, the very first iteration would still
trigger two reallocations (i.e., empty cache), while next iterations
would only trigger a single reallocation.

Performance tests before/after applying this patch, which clearly shows
the improvement:
- before: https://ibb.co/3Cg4sNH
- after: https://ibb.co/8rQ350r

Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
Cc: David Lebrun <dlebrun@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: c64a0727f9b1 ("net: ipv6: fix dst ref loop on input in seg6 lwt")
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv6/seg6_iptunnel.c