Commit 4aa64fad authored by Eric Dumazet's avatar Eric Dumazet Committed by Liu Jian
Browse files

tcp: avoid indirect calls to sock_rfree

mainline inclusion
from mainline-v5.17-rc1
commit 3df684c1
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I65HYE

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3df684c1a3d08a4f649689053a3d527b3b5fda9e



---------------------------

TCP uses sk_eat_skb() when skbs can be removed from receive queue.
However, the call to skb_orphan() from __kfree_skb() incurs
an indirect call so sock_rfee(), which is more expensive than
a direct call, especially for CONFIG_RETPOLINE=y.

Add tcp_eat_recv_skb() function to make the call before
__kfree_skb().

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
(cherry picked from commit 3df684c1)
Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>
parent 9b85ce5f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment