]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pppoe: drop sock reference counting on fast path
authorQingfang Deng <dqfext@gmail.com>
Thu, 28 Aug 2025 01:20:17 +0000 (09:20 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Aug 2025 20:39:54 +0000 (13:39 -0700)
commit4f54dff818d7b5b1d84becd5d90bc46e6233c0d7
tree1764ff07b3edcea77f8d941fc29aeebe2ae589d1
parent72cdc67e7fa74931b055df3a76852bab551f1a04
pppoe: drop sock reference counting on fast path

Now that PPPoE sockets are freed via RCU (SOCK_RCU_FREE), it is no longer
necessary to take a reference count when looking up sockets on the receive
path. Readers are protected by RCU, so the socket memory remains valid
until after a grace period.

Convert fast-path lookups to avoid refcounting:
 - Replace get_item() and sk_receive_skb() in pppoe_rcv() with
   __get_item() and __sk_receive_skb().
 - Rework get_item_by_addr() into __get_item_by_addr() (no refcount and
   move RCU lock into pppoe_ioctl)
 - Remove unnecessary sock_put() calls.

This avoids cacheline bouncing from atomic reference counting and improves
performance on the receive fast path.

Signed-off-by: Qingfang Deng <dqfext@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250828012018.15922-2-dqfext@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ppp/pppoe.c