[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250625034021.3650359-3-dqfext@gmail.com>
Date: Wed, 25 Jun 2025 11:40:19 +0800
From: Qingfang Deng <dqfext@...il.com>
To: Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Michal Ostrowski <mostrows@...thlink.net>,
linux-ppp@...r.kernel.org,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Guillaume Nault <gnault@...hat.com>
Subject: [PATCH net-next 2/3] pppoe: bypass sk_receive_skb for PPPOX_BOUND sockets
When a PPPoE session socket is in PPPOX_BOUND state, the RX path is
fully synchronous and does not require socket receive queueing or
callbacks. Avoid calling sk_receive_skb(), which acquires the socket
lock and adds overhead.
Call ppp_input() directly to reduce lock contention and improve
performance on RX path.
Signed-off-by: Qingfang Deng <dqfext@...il.com>
---
drivers/net/ppp/pppoe.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index 410effa42ade..ba30d7afe9ff 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -413,6 +413,7 @@ static int pppoe_rcv(struct sk_buff *skb, struct net_device *dev,
struct pppoe_hdr *ph;
struct pppox_sock *po;
struct pppoe_net *pn;
+ struct sock *sk;
int len;
if (skb->pkt_type == PACKET_OTHERHOST)
@@ -448,7 +449,14 @@ static int pppoe_rcv(struct sk_buff *skb, struct net_device *dev,
if (!po)
goto drop;
- return sk_receive_skb(sk_pppox(po), skb, 0);
+ sk = sk_pppox(po);
+ if (sk->sk_state & PPPOX_BOUND) {
+ ppp_input(&po->chan, skb);
+ sock_put(sk);
+ return NET_RX_SUCCESS;
+ }
+
+ return sk_receive_skb(sk, skb, 0);
drop:
kfree_skb(skb);
--
2.43.0
Powered by blists - more mailing lists