From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.130 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795795693; b=oliPRhVKTcd9f8YLm69Ah14lTAy8970tr30GevfV/Te0tNjurqTF/GQvcJlxef1CcuYH V7reFOsU10BLWX17T0JXhApdKtt2QIJ2KZ42hQP3YsitEMx9+l/aKwgaJ7ytzvt6r6VOY 9l6KmMYNnR15SuW5i3IugEfp26EOPgBPoEhmJ2Bepej+pWe9s73xoJV1lBZjfEs1XtVNN YM/6CHtdbLR9I8EHgDrpT/hEHVIzXpj3ZF47XR9R8Y17wMSCBnvVXVHLUbn8Mqgh6nYgA hZtudcDvZlFTzMxvs05HfE7WEJ09e6T0bOl6frq7agdIASV9d2dN4VXi0F2uyD1TDJg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795795693; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=XTqrcgRB76wYzP87xai+N/ckpVG15bTxN+bKetQXfgs=; b=DvtzO9b9NHnSn6vBLOqDUH4dq3BOC8tDfBX6zl+WMIdNKMgZFJ6R9zc2ODp3DkxNOtJE oigXUr5RlPE5yd3wlBQJqxnGhAMnMoKzdoExB1mN9ruYgkZdThlDHLk+WsuosIJ7jvE0P iw5aSGJYUw9Ydzrk2GGl8o09n1kJ/6BA4ZrQ9lY2qm6qkRfAbJaIf7TpYNJEHhZlbtj9q ntwFXY3ZHv1jGFnZTbcjZXJSDo01nelXHS07ST9d3801L99H2apEmI+s5dO7gdrAGy5X7 qm0k/fs2JGigdWv1U05fILEP7v/W6DCyNlWDnf0uzAf0wLYkH7k98s9cPf7lZzXpubw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=MhEwuZkd; arc=none smtp.remote-ip=95.215.58.130 Received: from mta1.migadu.com (out-130.mta1.migadu.com [95.215.58.130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1671A606A31F for ; Fri, 27 Nov 2026 16:08:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1671A606A31F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=MhEwuZkd X-Envelope-To: netdev@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=6RNB7N0/otlPYlDWppGx8VvcotVx4MUqa6ZJF+cWIno=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795795690; v=1; x=1796400490; b=MhEwuZkdImq9E+9w3n2WdrSltZVRDOBJIIn9+N3MG+LsnsRm4TIZ+6Sr7jKjcrDnc1N+FzA7 /DUd6WhPY3PYo0ardLeeqCH/aW/iIBSlrvWJuzTiVuz1VKcDeHJ3FRqzUqqOkJLefsH45MWYDX+ rPhfvUCSoZaQj+kKOwfqOvqQ= X-Envelope-To: netdev@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id de26b562f168ec27; Fri, 27 Nov 2026 16:08:09 +0000 X-Mizu-Trace-ID: de26b562f168ec27 X-Migadu-Flow: FLOW_OUT Message-ID: <78e175b3-7f97-422a-928a-a05616f9c445@linux.dev> Date: Sat, 28 Nov 2026 00:08:02 +0800 X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net] pppox: only wait for a grace period for lockless receive paths To: Nicolas Dichtel Cc: Jakub Kicinski , "David S . Miller" , Paolo Abeni , Eric Dumazet , Andrew Lunn , James Chapman , Willem de Bruijn , Simon Horman , netdev@vger.kernel.org, stable@vger.kernel.org References: <20261127152822.2098330-1-nicolas.dichtel@6wind.com> Content-Language: en-US From: Qingfang Deng In-Reply-To: <20261127152822.2098330-1-nicolas.dichtel@6wind.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 11/27/2026 11:28 PM, Nicolas Dichtel wrote: > Commit 92c1bf630abf ("pppox: drain queued packets on channel handoff") > added a synchronize_net() call to PPPIOCGCHAN, so that the receive paths > that observed the old state finish queueing their packets before the queue > is drained. > > PPPIOCGCHAN is issued once per session by PPP daemons, so each session > setup now waits for a full RCU grace period. With accel-ppp, the PPPoE > session setup rate drops from ~1100 to ~250 sessions per second, and the > latency of pppox_ioctl() goes from a few microseconds to 4-8 ms. > > The regression was triggered in CI testing by a PPPoE performance test > (accel-ppp server in a VM using ConnectX-6 VFs, bngblaster client) on an > unmodified kernel. It was validated by reverting 92c1bf630abf, which > restores the v7.2 setup rate, and by measuring the latency of pppox_ioctl() > while PPPoE sessions are being set up: > > bpftrace -e 'kprobe:pppox_ioctl { @s[tid] = nsecs } > kretprobe:pppox_ioctl /@s[tid]/ { > @us = hist((nsecs - @s[tid]) / 1000); delete(@s[tid]); }' > > Only L2TP needs this grace period: > > - PPPoE receives packets through __sk_receive_skb(), which takes the socket > spinlock and moves the skb to the backlog when the socket is owned by the > user. As pppox_ioctl() holds lock_sock(), pppoe_rcv_core() either > completes before the PPPOX_BOUND transition, or runs from release_sock() > and sees the new state. > > - PPTP never queues packets to sk_receive_queue: pptp_rcv_core() always > hands them to ppp_input(). Moreover, PPPOX_BOUND is set as early as > pptp_bind(). > > - pppol2tp_recv() tests PPPOX_BOUND and queues packets under > rcu_read_lock() only, without taking the socket lock, so it can race with > the transition. Waiting for a grace period is required there. > > Add a lockless_rcv flag to struct pppox_proto, set it for L2TP only, and > wait for a grace period only when it is set. I'm going to remove the serializing __sk_receive_skb() from PPPoE, then this issue will resurface. Please consider either using the non-blocking call_rcu(), or just dropping all the skbs in the receive queue. Best regards, Qingfang