Article View: linux.kernel.netdev
Article #19460Re: [PATCH net] net: stmmac: dwmac-sun8i: Honor the RX checksum offload setting
From: James Hilliard
Date: Thu, 19 Nov 2026 23:32
Date: Thu, 19 Nov 2026 23:32
67 lines
15643 bytes
15643 bytes
On Thu, Nov 19, 2026 at 3:48 PM Jakub Kicinski <kuba@kernel.org> wrote: > > On Sun, 15 Nov 2026 17:58:26 -0700 James Hilliard wrote: > > stmmac_set_features() clears hw->rx_csum when RX checksum offload is > > disabled, but sun8i_dwmac_rx_ipc_enable() unconditionally enables the > > hardware checksum engine. The MAC therefore keeps dropping packets with > > invalid IP or transport checksums before they reach the host, even after > > ethtool reports RX checksumming as disabled. > > Rx checksumming only controls whether the _good_ packet indication / > offload is communicated up the stack. The device should never drop > packets due to a bad L4 checksum. Checksumming L4 is not much of a DoS > vector. Oleksij was fixing this in other stmmac variants. I _think_ you > should always clear this bit if it leads to packet drops. The case I hit was `rx off`: on H616, ethtool reported RX checksumming off, but the driver still set EMAC_RX_CTL0 bit 27. Clearing it let packets with a bad UDP checksum reach the stack, where they failed software validation. With `rx on`, the driver sets bit 27 both before and after my patch, so the drops in that mode predate the patch. H616 also has a separate control for forwarding error frames to DMA: RX_ERR_FRM (EMAC_RX_CTL1 bit 3). With bit 27 set and normal filtering, none of 100 packets with a bad UDP checksum reached an RX descriptor. Setting RX_ERR_FRM let all 100 through to DMA in both the IPv4 and IPv6 tests. The descriptors had the payload checksum error and error summary bits set, but not the CRC error bit. The driver discarded them on the error summary. > (FCS is fine, bad FCS should only be passed up if RX_ALL is set, > but sounds like your device has all checksums controlled by one bit? > in which case we prefer to see all and let driver discard the bad FCS) Ethernet FCS checking stays active on H616 with bit 27 clear. With normal filtering, bad-FCS frames produced no RX descriptor in either setting. With error forwarding enabled, all 100 bad-FCS frames had RDES0_CRC_ERROR set in each setting, and the driver discarded them. > If I completely misunderstand things we should at least get a respin > to update the cover letter. The commit message talks about L4 offload, > and rx_csum is L4 AFAIU but the bit is called CRC which deserves a > mention somewhere IMVHO. The H616 manual calls bit 27 CHECK_CRC and mentions the IPv4 header checksum. What I should have made clearer is that the bit also affects transport checksum checking, but clearing it doesn't disable Ethernet FCS detection. Would it make sense to address the `rx on` drops in a separate follow-up along the lines of Oleksij's dwmac4 fix [0]? On sun8i that would mean enabling error forwarding to DMA and passing packets whose only error is an IP or transport checksum up as CHECKSUM_NONE, while still discarding frames with a bad FCS or other fatal RX errors. If we leave the checker enabled in both modes, `rx off` would only control whether the driver reports a checksum as verified. In that form the follow-up would replace the conditional bit-27 write rather than depend on this patch. [0] https://lore.kernel.org/r/20250818090217.2789521-4-o.rempel@pengutronix.de/ > -- > pw-bot: cr
Technical Details
Message-ID:
<CADvTj4oJ6HDR2k6qVgefUX-h0TGh2n+AO5gx_dcJFzzWML+2UQ@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367419-linux-kernel-netdev=dewy.ruReferences:
<20261115-submit-sun8i-emac-rx-checksum-v1-v1-1-f186d127b39f@gmail.com> <20261119144848.4ddd88cb@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367419-linux-kernel-netdev=dewy.ru
From: james.hilliard1@gmail.com (James Hilliard)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] net: stmmac: dwmac-sun8i: Honor the RX checksum
offload setting
Date: Thu, 19 Nov 2026 16:32:58 -0700
Organization: Usenet Network
Message-ID: <CADvTj4oJ6HDR2k6qVgefUX-h0TGh2n+AO5gx_dcJFzzWML+2UQ@mail.gmail.com>
References: <20261115-submit-sun8i-emac-rx-checksum-v1-v1-1-f186d127b39f@gmail.com>
<20261119144848.4ddd88cb@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="3010432"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:h5XfokFjqxkT3ZspEXPf6t0yFUU= sha256:cWkLrgNYbcD/5Kr6H9zeM565GJF0V6inz/cdQGK2xlw=
sha1:wKVjYuz49KWQe92IzBSjhIGr9ck= sha256:vEJD4JTPQ+7umbotJu9/+7jxeuvAeuvcBFguDhOUKpg=
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 C2F32115802; Fri, 20 Nov 2026 02:33:39 +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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, 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 (2048-bit key)
header.d=gmail.com
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 ZmI_f4RgqCl9;
Fri, 20 Nov 2026 02:33:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-367419-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 07CCF1157AA; Fri, 20 Nov 2026 02:33:26 +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 3D03D806BB; Thu, 19 Nov 2026 23:33:22 +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=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1795131198;
b=CjamAU/CTJCa4kBDwEHgtNzs0iveiWhgXHflSZe0PPZSkuzu6IShPo8zf0ZspXv3djAV
Gfsydp5K4BtGfndNeFt6W3FNbKLPXSP4abNddowA/3cXuTeOBR1Moc9mnpVR+5S6Ok5A5
epd108lh+NV41JqVudB5wolbdtyRIjarNwzPhHjganau8rwaOrVaM6/I0GFIiv/AN30oV
M6obwCbHFJjMM7NJ2GTUlqTcTX81H16Gt8g93hKTF5P5RZ3MF+1uxGBocizJkUWn8svm/
r/LDH9TcQJPgsmUGl5mwk91FLRG9fGMwWJy19SSwClDpcjtGYKMuWZRpyDWgSQx3fNA==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795131198;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:References:
In-Reply-To:From:Date:X-Gm-Features:Message-ID:Subject:To:Cc:
Content-Type:Content-Transfer-Encoding;
bh=db1dSJIcWvwP9jZk7KvLgI0rZAQDCeyNT1LeRTG4P5c=;
b=zFK72anSFufWLQLi1CLIJl/RaVPGonFRvKJb2thdmezSltnyGwybVpilDeU8Ehjd4vt5
KQPHyz43aIinvFpKS1vwwHiVlaOYJ/xLoXjaujZtFJu090+fpUfEJpbD9bbB9VEzIYoUI
0dXXAvhEMohqXysCwoKPsiG+yika9yaf4JgDTXiEJ5OLa5BYlVgYXkioHDW/0CeKFa7Jm
DC+/iHT6nMfoIwjlaxm+HZSRaTdZZy0j4piRvVvqomxcrpyGpu67xnpiqNJLm3dTDNPnu
hgtWMVHCzYzA3Z/DsAzfY0A239D3+5kKzrwxcqzFhaPrsV8q+sFjesZoSPHGTTkX7wA==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=sH7hxsVd;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
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 ECC50606A320;
Thu, 19 Nov 2026 23:33:17 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=sH7hxsVd
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.217.48
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1795131192;
b=1To5K6N4wR/F6S1AyiqJRcA5ONQGVnym2N8/GJcva58UtNZENZ/txponFBjeND/Fm8rX
eMjNfLaVitSGrJm1DJLCIi/SuWu+PNJGhT3rcppw6s/CG0V8aeYUBasW02o2+NmgVH9RN
EdwZIJDpgjatq74jF9xt0St/MKkF7Hb647P9NyTbOQv2zoCvS80HCYTtjA6PXP1U506l8
NakFI8Bhux4iRntcnKvxMSwEXHXasWoVA0MGWh9Fxa/9W6b1LlbZ5UA/NR0e2R7PTbtay
HFO7WDT5PXkv9gNYO2AX+rVPvr85Zq7Kt8Id6Nc7Jzle2013yuGNDHacpFrjkpv9lvQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795131192;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:MIME-Version:References:
In-Reply-To:From:Date:X-Gm-Features:Message-ID:Subject:To:Cc:
Content-Type:Content-Transfer-Encoding;
bh=db1dSJIcWvwP9jZk7KvLgI0rZAQDCeyNT1LeRTG4P5c=;
b=d1CmZ3KO0ox0ne+R/DNC45ofgQ0zD2d7kxsLWOCCWLaG0tdjN8dAQZPw3zSBN2rMQuz5
eIKLUKctx3TdvdOejMSVZR+NBA2JVT43MfZhrc4iUj69yx3A0Gl2J95Lfw6JbsRG1HFZz
iQ4A0PgQsP3ftwvPVYK8HLdrCkiYXlgJj7aRNlwWEjqrQfyV9DcAi+Xk9t3OlhGjNEshq
3r85l23YQ6tPN8XONkFHkKi4ncF2hCJQGfsW8hbfeKYbQZeBHDQdfkmROQlqjqOQZsWVE
3yRvADjmfxg2+n581n6OHk6ZN3X7bAyjYH6QA3AOxaADqtW2NAEh+pT/ce928h5o9nA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=sH7hxsVd;
arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.217.48
X-Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48])
(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 B9EA9606A326
for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 23:33:11 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B9EA9606A326
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-vs1-f48.google.com with SMTP id ada2fe7eead31-7d2db6408cfso221494137.1
for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 15:33:11 -0800 (PST)
X-ARC-Seal: i=1; a=rsa-sha256; t=1795131191; cv=none;
d=google.com; s=arc-20260327;
b=d3K3AmHQqNzuB5GJCBX+H4PCtG0iOW8djd4DEqdGO5L9EHutTsoDzaYip69gmdrHz9
7G1N89l7UnnFLkxZhYxrc5S0p5RLHz03Jy+X5qfnSM88e64weohQpQYYijSIhXrnxngz
DEFdBjI0qzJo/UteNemPBTN0ovGqYlT71eG67Fy1bAqMRjfXm7pVnIgupNntAaXbK3FQ
g+gqJk/lM3obk+R+SKBPXYeSgy+reijUlX1MJFwXvpUb9nWaGmJ26HgpwzkMSJQAb4BG
P60oO7OK8o4Tuo6MvXgZclj4eJ0/ckN/7cEE0oYNawbNarqH/bLK9h7D3WQYZPNjiIdh
sxhQ==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:dkim-signature;
bh=db1dSJIcWvwP9jZk7KvLgI0rZAQDCeyNT1LeRTG4P5c=;
fh=Jnru1Gb72DcfmvZx2VqzsDEtr2uCZuWCx6FFwiya73M=;
b=BpRnWLoiuzR7EBFoZcOay/GutpCybiC9OEc5I6aybq2nvFGduo4wo49StpmCuXeoY1
x2fUPUys1xQjxyP8Y41ji2vIrDzf4ZBhvQg1HAVWzlDiS8NE3VkTfnC4fnLKoD7HUBpn
8BtDa7EutvVZ6sYCF8Kc2swMy9UsWI+C53aN+8rczF1A/mKaSMh824zYUvbmGyVmWCMJ
vdpd97H68Mbao16uP3TBut8dQeHKdJmDtrPAcgOFR27U3oBn/pTN4wD1zJtuu6Tjv/IH
4lcC7/Nx3oNzhPioyuDL6JLm5OxqPQPVXbjbP4JrSz9B+HBkHH9Z9GwcwHlRKfbbH+Ug
AJwA==;
darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1795131190; x=1795735990; darn=vger.kernel.org;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=db1dSJIcWvwP9jZk7KvLgI0rZAQDCeyNT1LeRTG4P5c=;
b=sH7hxsVdU+p5G0+yBR4jmIxn0S8FWq9utTZC00fgEn64p6y7WBK4Kf2tUz56PpFo6s
zr+hv7ZSfXSEvA5FGsTOcNHxLVcMylqjCuMDAU7aK6reHp1LUgxkVLxorED0bLTnwpTl
uaxi5NT+HO5II2e+tNG0T6aaN9/sKItGAPMmnNAuPFiw9leSxrRSTilq+65VJvUn0ygD
KJpZisCP+HT49RpXr4THvlGJEyfa0OOUipAO48JxZbdDr4Ai88DubgiikU+WlhG8Q1DK
g1S/y6UXjeikGHyrPU7+DmNg4f/qFmKF1vpLhPtlPl6K7f1GyI30GSBRomM/ZGU977SX
iciQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795131190; x=1795735990;
h=content-transfer-encoding:content-type:cc:to:subject:message-id
:date:from:in-reply-to:references:mime-version:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=db1dSJIcWvwP9jZk7KvLgI0rZAQDCeyNT1LeRTG4P5c=;
b=gwFASbaD0bQDdLEOE1A3fPUh+jbSejwLujN8czZ1DJb1Fs7QHPksjT0dDVrniuTG/V
KXTw+d5BKoIFYAXGxo6SAoe8tFr4DJCP9HjIdvBLD1E3yu5Fh3RYy+tMicM2Hf+FHYSd
v+6E9LS1+sbYcg3TeA/iD7O84WUfxEdNGwYB9k9s8AEUExvd0KNLlye5658LSdRMG15P
sdLQGiHnkMBWVd1xykiinbOC+xIy+Nj1EGJU14xgZIdkaYkHLySrkJk2bDctZVtRkmw0
piIxPjKsW9+hyyLLWaJAaGZhrbD42UjXqPN9a0wKQXfosBl1E2p09MjLUsM8xfip0eta
fa5A==
X-Gm-Message-State: APuU4Z9eSlgSNQ5PBjVTA1z/MlAnR6EtB7r5y/fx0yBrMccQ16UQ5DYT
/Gzevs8RB66QxtFq9RGTIEzTqr/UKc+2UFUs6EoA+jgupgOwVCEY7rz+q83xYa+Fg295tO8uy5k
snI7bKgK0f/OSR0PGX7uIRhhAF5LkBuI=
X-Gm-Gg: AYBFou26hrt34rSC41KPHK1Y/AVfMc7EY17lDvuUgrqWpiyejTe7FkwrY0d2KfUwMnp
0gJP7Ovk4rmzCxzn7jX6SeCVRMGdeCJnGx5wkEM6TgX/WXeJXWg/WtmKufHpMKC2WfV+14dXten
BUw5+aec64Z3GsZSE0j5mPUdcdTG/dbhq6cSZsn5l0+BtKek1KczS7p24lW9gs/Ud1vOwkwoopg
8RoDqtpV6Nl/w822Nfo21vrlBS5LhKoqNtpfV77khTrpLYlL9m+2/wHfeFNbx1z4U/FBDDpHFcd
quMBu1wF352P5k+DlJBxT+IVbxH1G+VCiwDx9nEa7nJRXF6Oeh/5Dz7ZbCTNqXL53nQDpNVReq9
AJvjU8ckLIAbXG9kKmsX5brq+NrwLBwUvnidXDBYFaecxOmZq6wN7L6hs/E4wnlg9423nSR8kRt
fI9r4p6YKuFQZkdTuOGI2xUrlT/FRPHDAESAkIPmj1KQzgfgu5H23VLCmOCYt3uKNlQkX8GwKzP
tKELh/dibBxX4ee86vGj8QhzSEfYg==
X-Received: by 2002:a05:6102:162c:b0:7d2:b199:6710 with SMTP id
ada2fe7eead31-7d7394619edmr563227137.15.1795131190654; Thu, 19 Nov 2026
15:33:10 -0800 (PST)
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-In-Reply-To: <20261119144848.4ddd88cb@kernel.org>
X-Gm-Features: Aa3M54pl4hlXRMcwBzZFHc9YCWzUYN6am3kufSQboJBVsJ7s6nPiZ-HbdhxnAag
X-Cc: netdev@vger.kernel.org, Maxime Chevallier <maxime.chevallier@bootlin.com>,
Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>,
Chen-Yu Tsai <wens@kernel.org>, Jernej Skrabec <jernej.skrabec@gmail.com>,
Samuel Holland <samuel@sholland.org>, LABBE Corentin <clabbe.montjoie@gmail.com>,
linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev,
linux-kernel@vger.kernel.org