๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5579

Re: [RFC net] net: force software segmentation of PPPoE packets

#5579
From: Qingfang Deng
Date: Tue, 20 Oct 2026 16:10
56 lines
10934 bytes
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?

I reproduced this on a VM veth interface, which advertises both 
features. The real hardware I have is an Intel IGC but I have not tested 
with it.
Technical Details
Message-ID: <ee955f2c-c97b-4505-a996-f7d7c5d2a3f5@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-349385-linux-kernel-netdev=dewy.ru
References: <20261020143031.1829-1-qingfang.deng@linux.dev> <CAL4Wiiptz1zyxRDKrCrnK2Q-qn0_1d1aSxuUPkJKWnODpjMp1g@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-349385-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: Wed, 21 Oct 2026 00:10:32 +0800
Organization: Usenet Network
Message-ID: <ee955f2c-c97b-4505-a996-f7d7c5d2a3f5@linux.dev>
References: <20261020143031.1829-1-qingfang.deng@linux.dev>
 <CAL4Wiiptz1zyxRDKrCrnK2Q-qn0_1d1aSxuUPkJKWnODpjMp1g@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="3892147"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:+dG0qM0x+IFLQcNMgo53x26qjMs= sha256:szFdc94OGlLFgqyD0A6ownK1OFsFCb12yY/lk917hrA=
	sha1:n6++/9n3GROsFD/1VUgnxq1T0rk= sha256:JHBx2Fck4wJSG8N/T4AMUi0/UBpqAD6ZAI6vgL8Z7kE=
Content-Language: en-US
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 8D522110D74; Tue, 20 Oct 2026 19:11:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=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 hNMJVAEmhJiK;
	Tue, 20 Oct 2026 19:11:28 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-349385-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id CC23A110D6E; Tue, 20 Oct 2026 19:11:17 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 1E4912F200; Tue, 20 Oct 2026 16:10:51 +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=1792512650;
	b=H4WKPKAI4Y31dve+JtJijAQc+8UQuiUisrNAbhSwusuo5Ts/XOSoaI2QGgz7TZdTLKpQ
	 aQWl1OplSrpkosqsgC+qygVAtfSVTL7353P3hnIOMHFI4Au5MKLUt2478MQ+pvNAFF1ch
	 0hTrBhw9SdzXNzHa8M5NI2ci2gejluNq5nEhfpHdnY/3s8/jw3eVZE5Q6861f0zDbcW0i
	 bK+Xvta0OJ5i471G5SOBpCLm6/6KRPrDNuwOdaqrkzJW7080ejFnsHg3P58fyNfs+e8C0
	 zGdYnXe9pHiKxfaq6srLdl/OCg5N8htqCShsjxmnKQmFtQMcbVu1VCk4bmVGxkAT5Pg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792512650;
	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:Content-Language:From:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=G/6kGUmNcoC4XU/YLpcwdTE/U/y5YRTksJEoErK8i3Q=;
	b=PRh6cQ/AJdNtXcXD8+OEENhDUyGb3e1o1mP2fFW2HRBrMXGALsZbV4YdSg+kBJV/j/bn
	 dibiya8Fpw3TqvI82jkl72sNS7eidcGIzRzRxk53GipfK2Qrw3ZUIwE3kJGnMZg4YRc/j
	 fqImXzxxc78DC288Qp+zwTMZcUTTt+o4lVGJFccbCUzPXHhikwH6UPC6MoA9H3is8LXhZ
	 SS9pcQmwN+tEVkBB4J25BTMhmDkK7SIfS8DW8y+ojR41Ji1LFhISA6Te9jM8gI3OdIev8
	 lShl9ivFRSDU7Vn7UFNyFSBQysisT2I1qKEapHm5+WhdxM0VvmFoSZDesLl6EJKqOCQ==
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=hc+ik37J;
	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 7D349606A331;
	Tue, 20 Oct 2026 16:10:50 +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=hc+ik37J
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.17
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792512647;
	b=x3v095lBVXfjan0tS4jRs70QqbUIIoxC3W2+hT/1mDzKKCO5xqR1h0lHoqaUTocVG8ew
	 a3jAG+jrVcgJ2OrtNO4CwScQyHnmVtaklSnsspdRLw+iHHOO4IDbOvVuewch7TXxzwhDT
	 9q1q3ZNCy6QGpSUtzoPH0DxXtbnngOONDscDdCo/Oxb7E91XXWNs/2fjptQAV3IkpkZbd
	 uQnhUhxDtVjk0D3lW6GEfvo3Bj31hfgeycLEVRc+WR8cRiigI/RJ5Wu+qN7g12lvvKc9U
	 4kC+mfHamGIbbqUCn0sRfHTEnDN/OzcR0I5O3OH4foY1D+0lp0SOclErasx79jfwhdA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792512647;
	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=G/6kGUmNcoC4XU/YLpcwdTE/U/y5YRTksJEoErK8i3Q=;
	b=5Q2CxS9cLVOOiCbt8m+WN5aWdcFjDWiOVnLiKU8KtqkOBXzyLPbc21H7oQXA4Pek7Esg
	 VJnEtq9/s/coa336Xd808Xvgz8O7CtZ4auCwBa1C6/IvV9cFi9IZG3Qx+XxO17svu+4VQ
	 P0n9gCS8m7Vq2AVi7IgRSrGP74QHd6SCfC+CIUiX7XJx44/5I3As+3u6QMAPTt7NPKDSp
	 5JL77zGcy/Rduk7oQYUg9JzcM5+uFbPKmek03+ryLY2m6ybFCyvcY4k9goSJpUGjTdpF8
	 l7FY0E8iGFkI93A36LiHu3jRBwZSrRSmHfvuWkQqB3iI01afYPbkvaYxAb48OcW87XA==
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=hc+ik37J;
	arc=none smtp.remote-ip=91.218.175.17
X-Received: from mta0.migadu.com (out-17.mta0.migadu.com [91.218.175.17])
	(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 D3E55606A319
	for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 16:10:44 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D3E55606A319
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=L7g9mcR6Nsn/m1DjPlzQxXZCO6qDBPFpGMoZoXjDkyY=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1792512642; v=1; x=1793117442;
 b=hc+ik37Jq9Fp+OyeblebgklxkllaarIMdj0ZoeRZxiARKxD6Sg3CzrNepLYUpcl3oXtCo5U2
 RyJyXvFCyHsGRYJ8q3wxs4/RsjtpLMEOYKBkfA6fnnqmCeEbzv3EUCDuM+dor1Xk3J0ldyiBR9F
 sPkLua8fnohaTEGk5Ccj1O+w=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by smtp.migadu.com with ESMTPS id 00df53f15c7f61e1;
	Tue, 20 Oct 2026 16:10:42 +0000
X-Mizu-Trace-ID: 00df53f15c7f61e1
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: "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, Pablo Neira Ayuso <pablo@netfilter.org>
X-In-Reply-To: <CAL4Wiiptz1zyxRDKrCrnK2Q-qn0_1d1aSxuUPkJKWnODpjMp1g@mail.gmail.com>