Article View: linux.kernel.netdev
Article #11954Re: [RFC net] net: force software segmentation of PPPoE packets
From: Qingfang Deng
Date: Fri, 06 Nov 2026 02:08
Date: Fri, 06 Nov 2026 02:08
92 lines
12948 bytes
12948 bytes
On 2026/11/6 2:53, Alexander Duyck wrote:
> On Thu, Nov 5, 2026 at 5:33 AM Qingfang Deng <qingfang.deng@linux.dev> wrote:
>> Hi,
>>
>> On 10/20/2026 11:08 PM, Eric Dumazet wrote:
>>> Le mar. 20 oct. 2026 à 16:30, Qingfang Deng <qingfang.deng@linux.dev> a écrit :
>>>> Ordinary TSO does not update the PPPoE payload length. A PPPoE GRO packet
>>>> forwarded by a bridge can retain hardware GSO features and reach the
>>>> driver without software segmentation, if the egress Ethernet interface
>>>> advertises TSO.
>>>>
>>>> To force software segmentation, clear the GSO feature mask for
>>>> ETH_P_PPP_SES in harmonize_features().
>>>>
>>>> Fixes: 55a5d8fca836 ("net: pppoe: implement GRO/GSO support")
>>>> Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
>>>> ---
>>>> net/core/dev.c | 4 ++++
>>>> 1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/net/core/dev.c b/net/core/dev.c
>>>> index a6951ea08961..27483a2ad747 100644
>>>> --- a/net/core/dev.c
>>>> +++ b/net/core/dev.c
>>>> @@ -3831,6 +3831,10 @@ static netdev_features_t harmonize_features(struct sk_buff *skb,
>>>> type = skb_network_protocol(skb, NULL);
>>>> features = net_mpls_features(skb, features, type);
>>>>
>>>> + /* Ordinary TSO does not update the PPPoE payload length. */
>>>> + if (IS_ENABLED(CONFIG_PPPOE) && type == htons(ETH_P_PPP_SES))
>>>> + features &= ~NETIF_F_GSO_MASK;
>>>> +
>>>> if (skb->ip_summed != CHECKSUM_NONE &&
>>>> !can_checksum_protocol(features, type)) {
>>>> features &= ~(NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK);
>>>> --
>>>> 2.34.1
>>>>
>>> Ouch.
>>>
>>> harmonize_features() is called for every packet, GSO or not.
>>>
>>> This is a GSO-only problem, please do not add more protocol-specific
>>> tests in this path. gso_features_check() is only called for GSO
>>> packets, and the cost there is amortized over all segments.
>>>
>>> Devices without NETIF_F_HW_CSUM already lose GSO for ETH_P_PPP_SES
>>> because of the can_checksum_protocol() check in harmonize_features(),
>>> and fraglist GRO packets (the main use case for PPPoE GRO) are
>>> segmented in software anyway.
>>>
>>> This leaves bridged, non fraglist GRO PPPoE packets sent to a
>>> NETIF_F_HW_CSUM + TSO device. Have you hit this on real hardware?
>> +Cc: Alexander Duyck
>>
>> I ran the real hardware test on Intel igc.
>>
>> igc_tso() requires skb_network_header() to point to the IP header, which
>> is not the case for PPPoE packets, so it won't work on an unmodified
>> driver. I therefore used a kernel module to inject PPPoE GSO skbs
>> directly to the driver's TX path, deliberately pointing
>> skb_network_header() to IP.
>>
>> Test results show that the hardware can still perform TCP segmentation,
>> but it cannot update the length field in the PPPoE header. So
>> theoretically, we might be able to make GSO_PARTIAL work in PPPoE.
>>
>> Kind regards,
>> Qingfang
> Is PPPoE being stacked similar to a VLAN or being ran as an L3? To be
> able to make it work for the GSO_PARTIAL on most these parts it would
> need to be inserted as part of the MAC/VLAN headers instead of as an
> L3/network header. The main problem is that the drivers normally need
> access to the L3 header in order to set the payload length and things
> like the IPv4 ID field.
Currently, PPPoE occupies the skb's network-header (L3) position.
pppoe_xmit() points skb->network_header at the PPPoE header and sets
skb->protocol to ETH_P_PPP_SES. pppoe_gso_segment() temporarily pulls
the 8 bytes of PPPoE/PPP headers before calling the upper layer handler,
then restores network_header to PPPoE on the returned segments. For an
untagged frame, network_header therefore points at offset 14, while the
actual IP header starts at offset 22.
> Really if you are going to support doing GSO with a PPPoE protocol in
> there you probably need to look at adding a new gso feature flag bit
> as any driver that will support it will need to know how to move the
> header out of the way.
LLM suggested the same and wrote the code, which I have not tested. It
could make both hardware segmentation and software fallback work.
Technical Details
Message-ID:
<f15c49f5-724f-4101-806d-24303c5408a4@linux.dev>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357698-linux-kernel-netdev=dewy.ruReferences:
<20261020143031.1829-1-qingfang.deng@linux.dev> <CAL4Wiiptz1zyxRDKrCrnK2Q-qn0_1d1aSxuUPkJKWnODpjMp1g@mail.gmail.com> <c8be6713-2378-4dc5-9959-fc7eddd800e1@linux.dev> <CAKgT0Uf_yYxp+tUJt4xYAnwqtK6LZY0KQYt0h4kt78=oQZxd3g@mail.gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-357698-linux-kernel-netdev=dewy.ru From: qingfang.deng@linux.dev (Qingfang Deng) Newsgroups: linux.kernel.netdev Subject: Re: [RFC net] net: force software segmentation of PPPoE packets Date: Fri, 6 Nov 2026 10:08:16 +0800 Organization: Usenet Network Message-ID: <f15c49f5-724f-4101-806d-24303c5408a4@linux.dev> References: <20261020143031.1829-1-qingfang.deng@linux.dev> <CAL4Wiiptz1zyxRDKrCrnK2Q-qn0_1d1aSxuUPkJKWnODpjMp1g@mail.gmail.com> <c8be6713-2378-4dc5-9959-fc7eddd800e1@linux.dev> <CAKgT0Uf_yYxp+tUJt4xYAnwqtK6LZY0KQYt0h4kt78=oQZxd3g@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3775716"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:nu1T24f4MfR1GNrT42sR1PN3sGo= sha256:Pce9YdBzwmTm7wS6UwI7eJrE0uN3k1CP3kmxKOM3vFo= sha1:3BQZbAPfSexq9B1jH03an/IlEuI= sha256:O+yjsAsZRSv1Ru/4aOTBke7SpLcDpPytuyPYDH6qLXw= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id CC5F811312B; Fri, 6 Nov 2026 05:10:39 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2JP_wyaXeAYc; Fri, 6 Nov 2026 05:10:36 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-357698-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 03909113114; Fri, 6 Nov 2026 05:10:26 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id A62102D9FB; Fri, 6 Nov 2026 02:08:35 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793930915; b=vs8VNXWGXPWUo6L+nOSdMyiRvz+i7fnKL523xg1CNk1YgkPCD9tiqfivC/Re+vuxE6YT fThaGc0jlkeOpv8cQ0xC9nUs77pXRnY6b2Q3LT0L7Ahyuc0QiP7KHHCeoDk5s9mWjFHd/ EF6HOIJOAN9Ll8tIaSlXJoSuqveMVtshw0WEhxcT2Izyycm7DviiTB5Pna2CJKa/pwT1j +OpOXAwcK/xoLfSbJI5H5HqFtkZ0QHjtYa5z9IxAUSyPZDdxrnXruq09shbBetSOLQ7xr r/S45Suozrk2FQYKC8V5XAqyODyC1I+WIvBibyG/ZFoCGRlCTlt4QjAFX5ANKGeq/dg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793930915; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent: Subject:To:Cc:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=WS7CApNUNIMsQEToXiuZ7n60SsvckOdd5s0EGh2oKEk=; b=qJZrrG3SloWsNO3XHNNuQuOV2mtGO0PuNKIbwwAFqW/duh3AlMAaS6BS2slE9GL4KHpC cf49xS8N3K3jf+oTBrxurQF7VVBraLq1LQbzrh9ybIauAlu3ck4RGMSvg9KsGw8fVgZZ+ PJeeKyGFKB2z6ds+tGTLiiBclm3h4v8+cmHebe7tDZCF/IOHX1yowxO9VMmRDUzwArn6N V+MMEwk02d2hnyI3yW5zXlpI+kWPXk5bQmHkf7igQDDIkN283vtYqLezC63/jxPwo6xzI krX63aHHf2xdwFrjw9TSdQfzJReey2Syca2pRbpSnJiDR+ZW/KQe8z7MbPFwRNDx6gg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=oqKc8MRT; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CDEA606A335; Fri, 6 Nov 2026 02:08:35 +0000 (UTC) X-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=oqKc8MRT X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.30 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793930909; b=Zj/ba5N4sat8lUss+HCBMhc48XwlCAUfUCqSZe6L6LsGut/yNZ7LJCAffOokELlH8LGf 7hXSqOHykUn0kNFcsw+A+iDDfnqxNGNSOcqCKHLN6STdA3UEGLCf4cX2sNTm5LyxMLPaj 8OKtvRsNChId3M+UB6RGKWOJYhdcyp9LtgD9KUEgC4fg+85jZIv6zOVlHds5flfqDT7qL LstPH/xySN26WwfYHLaHAoFoBOVzCZzwcuo53+osSVSzwFh9uQXlAPPrle+02fSi6eTYA VzuGIBnrWe6zUleSshlj3jkXKPv9GiL7P6u8/QnT6yN7au+k5IsGhzQxZL42sgt/30Q== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793930909; 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:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=WS7CApNUNIMsQEToXiuZ7n60SsvckOdd5s0EGh2oKEk=; b=0lAgtzGrJowxN2UJxpMjT5zM0V3qXNGOCmiPDQQknWpza7DkqJi4p5DxBAkp07ffcY+2 zyEi+u+eSXtOZfBqgGzQqaCGw6goXz13yWvvqsaMl03LJbcZS8IG/tBZDZ34Hhl9YVmiV XnnoMWWIO1SyKcbzCFI6PEBf1Y5RKthrjqhnIKaQjnGBstfLooDz+cvR6zHhBE5zn6EL8 REQm4Btk8MkYxNkfPWOVAXekzDU7ncxoF15aFW1KksOJm6z3g/rni/WfBPuwxncrEuzID 91Di1QuwRDpYJXwzC3e3+FJ45a0G4Hk5617myIGuyx3JCmi03GB4O4CXPPPE0OuyaIQ== X-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=oqKc8MRT; arc=none smtp.remote-ip=95.215.58.30 X-Received: from mta1.migadu.com (out-30.mta1.migadu.com [95.215.58.30]) (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 1C74F606A326 for <netdev@vger.kernel.org>; Fri, 6 Nov 2026 02:08:26 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1C74F606A326 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=/kWDopwCJ5iePiSx3eT6IBYLtMfFMyr3Ivlvyuz+EIw=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1793930905; v=1; x=1794535705; b=oqKc8MRTf95A1KgxEw0rvV6fGdEtAJU8uYL+ttm2EZCh52y7rLKY3GNRX1v9hQBCnPo+8VQ4 nC3+Qq1pPWNaRKGHGoNZ2UuAfVEqKDtno1X6ibfhbuP9re9gTsal3OVzSlhwTqUAC+oglM4HPon Uv0VqgEE5lfFPPEPdoRkev1A= X-Envelope-To: netdev@vger.kernel.org X-Received: by smtp.migadu.com with ESMTPS id 1da6eafb048a5403; Fri, 06 Nov 2026 02:08:24 +0000 X-Mizu-Trace-ID: 1da6eafb048a5403 X-Migadu-Flow: FLOW_OUT X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-User-Agent: Mozilla Thunderbird X-Cc: Pablo Neira Ayuso <pablo@netfilter.org>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Kuniyuki Iwashima <kuniyu@google.com>, Stanislav Fomichev <sdf.kernel@gmail.com>, Hangbin Liu <liuhangbin@gmail.com>, Martin Karsten <mkarsten@uwaterloo.ca>, Felix Fietkau <nbd@nbd.name>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-In-Reply-To: <CAKgT0Uf_yYxp+tUJt4xYAnwqtK6LZY0KQYt0h4kt78=oQZxd3g@mail.gmail.com>