| Message ID | 20261115-submit-sun8i-emac-rx-checksum-v1-v1-1-f186d127b39f@gmail.com (mailing list archive) |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-sunxi+bounces-27716-sunxi=pue.re@lists.linux.dev>
X-Original-To: noreply@patchwork.local
Delivered-To: noreply@patchwork.local
Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mxe881.netcup.net (Postfix) with ESMTPS id D685C1C27FD
for <noreply@patchwork.local>; Mon, 16 Nov 2026 01:58:37 +0100 (CET)
Authentication-Results: mxe881;
dkim=pass header.d=gmail.com;
spf=pass (sender IP is 172.234.253.10)
smtp.mailfrom=linux-sunxi+bounces-27716-noreply=patchwork.local@lists.linux.dev
smtp.helo=sea.lore.kernel.org
Received-SPF: pass (mxe881: domain of lists.linux.dev designates
172.234.253.10 as permitted sender) client-ip=172.234.253.10;
envelope-from=linux-sunxi+bounces-27716-noreply=patchwork.local@lists.linux.dev;
helo=sea.lore.kernel.org;
Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org
[100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 4DB052FA12
for <noreply@patchwork.local>; Mon, 16 Nov 2026 00:58:35 +0000 (UTC)
Authentication-Results: smtp.subspace.kernel.org;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1794790714;
b=EYh+Jlg0RibA4OgLcxtwUdRLmiANFJ6mgB1hlwbw+3di/F+lKm4HwOn4dKbiW+Xu1wZW
TjHeF1J8axp/XHXjcNk5e8vhdthXkP1VXQHtyFJiXjwPKKv2E1vt7xRGX4fEna79JHlLs
XGHpK9UqjeSZ5NtflO2villcIY8iSoMx/pR+C+fQ8eHT5fXxtzTUGR7orvebclIpNEfyH
+hN9r6sJIQHAMGvIoMd7awTXDmeQoXAaXQEhFxhCS4UiB0ygcToXipd1GLQiLn6TbG37+
7DXKxEd/DyaF4psUtkgNoKSYROEhIgrDQwIvDhPz6TqoB8Ls/hZj8A9kwVPfKEpD29Q==
ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794790714;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id:
List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding:
Message-Id:X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer;
bh=lmDeE0t9mdZmydmmEQ++6Bol6tB283nojcABTDXVogk=;
b=5tNTgRoYcGDKi8/zCVHpBMycXmof8L21FFYEmYGqVWSpea3BwegVY2nWhGiW/5yRM9wh
UzSQije4j7aPwInOR2D1lonXPG78EePjAouaiuoAC0ieqbFmUEuI4cdRGA+6Vck4+Rh3y
RHrsxFjMnyU/qKQjDBKtLW41wHxSejtKmu3ivNFRwTRgSWCiRxu2DZ0TI8lhWFkR/za6f
QRu7kk1O9XdMy8nGY2HzsKZWRg73gkdqgNAAzu/WYFz5B3aEpip7+uYI+U3DkrIb3GT2v
fuwuDpNZm8IbSx6ASE90CcRWzsdXGNeibABbvjbeTujb1A/Mi37NWbHTx1ktCF4VOgg==
ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256
header.s=20260707 header.b=U9U2NDLt;
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
Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 8BAD7606A332;
Mon, 16 Nov 2026 00:58:34 +0000 (UTC)
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=U9U2NDLt
X-Original-To: linux-sunxi@lists.linux.dev
Authentication-Results: smtp.subspace.kernel.org;
arc=none smtp.remote-ip=209.85.210.54
ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794790714;
b=mfA3Ff6RhJc/NbYK10H23LAt05CU9Ex1z9loEFrs2T/8pM/0TQW+A/3Dv7JgTuEodY9k
UTrLFhkBOlJqRNgfh/ogTqAYO2IswcX2ra1RdxaHLb7p61xZC3pAygQMN/+WlzAnb3BdS
24N4YnrEVEy2rnCsxcM4gC+W0oeup8vX/5Q+Fewb76VhqfuRMg7mJXJB7XN28QsUk4Tgg
OXjwIItl9J93zE4nMmdxpb4PMYQDmEkjIzQQx/kw9//klKnFddK+Yx1/LWjouJODbM4ZB
5yPIsfONrT6u4ekxgz87kgdCQIyxKcbdDL3mvmYW4TmDktkGH180e7PZwHVMr6mGJ8g==
ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794790714;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:
Message-Id:X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer;
bh=lmDeE0t9mdZmydmmEQ++6Bol6tB283nojcABTDXVogk=;
b=ldoyOOr6/rmVuhexSMrwmll2eMnmHDRdWE7LZDM9kRBY36ahoneeWOVBF66e5cXg9bSt
e5En1JpqxtR20FL9jvezRwPgGztKcQ79AQkBhUM/A1XfzPQlyMb700e+MVaDFP/fEAJpr
+s83MsjqiNbdzH+fq8vL8Log4icgJlF74nlb4D4CHhRtrMwHvER6uNQEex16qs7Lo4tDx
EbfWxZ46/c55O0wuPRgTbqO3qsXJwqHh1EDOPymVzdGoC5BddCrZHAaYCAJQZr1tedD46
bZhFN6admyh6E5FoGqm6wKVO0Q+apkddoYJ7Z+QtZxDCpO8m7uURX7Ra1fhuU5WDcYw==
ARC-Authentication-Results: i=1; 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=U9U2NDLt;
arc=none smtp.remote-ip=209.85.210.54
Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com
[209.85.210.54])
(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 177B7606A32F
for <linux-sunxi@lists.linux.dev>; Mon, 16 Nov 2026 00:58:33 +0000 (UTC)
DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 177B7606A32F
Authentication-Results: smtp.subspace.kernel.org;
dmarc=pass (p=none dis=none) header.from=gmail.com
Authentication-Results: smtp.subspace.kernel.org;
spf=pass smtp.mailfrom=gmail.com
Received: by mail-ot1-f54.google.com with SMTP id
46e09a7af769-845788309b4so1863616a34.1
for <linux-sunxi@lists.linux.dev>;
Sun, 15 Nov 2026 16:58:33 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1794790713; x=1795395513;
darn=lists.linux.dev;
h=cc:to:message-id:content-transfer-encoding:content-type
:mime-version:subject:date:from:from:to:cc:subject:date:message-id
:reply-to:content-type;
bh=lmDeE0t9mdZmydmmEQ++6Bol6tB283nojcABTDXVogk=;
b=U9U2NDLtnhNmdtLJAvZi4OqBnpYWP1FaxTiKOvN+gwLGc1uCRJl47AZdNbhSh0bglo
nuGIsX9XabecUlxjJj/RxxFx8RLbCSey5cZz6vrKnlmIKBaBFCseV64OZEZ9o1PU1D42
X9acJVSfdrJCZXFSy+bh3HEH/rlwvck+0MdCF9Qm4DEwyd6CtSA87kxRM/UU1g7q6s0n
Q+mUSmdgSjk/N+RBVe8timR8sjF2CqtjlCiYsLlbIxrw6io1tWsFZCmwJDuIx/icmBUB
Z/GU7V28yhZAaYXjuYXihm6JQ+50PUaNDo7dNkQGXKwP0dgMQOpdLJ03+BV4k0fgFBVc
dvpA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794790713; x=1795395513;
h=cc:to:message-id:content-transfer-encoding:content-type
:mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to
:cc:subject:date:message-id:reply-to:content-type;
bh=lmDeE0t9mdZmydmmEQ++6Bol6tB283nojcABTDXVogk=;
b=LePS/MXX+/V/QswgpJPyXcSBRxktxtLnlDMA+G+OM9e1UsCibxL1mb1QHIqfDGuRq4
auG3ewYT/5DP6kG2fcC/5k1pqTNp8XwjWoGz+DUwAHYvuJ8liKTGRqnsMtnQaqgyTayj
45nfkXIHINUewa0iCZp1igYgxAi29NZsc6Ym0i18qRJilmXZ1xKn0L6sWRIrI/i+F9LK
mQdQfa9X596jtefGDPTjMhYgD2Au6xR816zoMnZCFYJ1SPckPg3xwL1SIM5zfalS/CZ3
FhEuN1geElvxfnDjGBrG+BD/Z5y9F20+yomPRm/RqNt2pDCzsTdJNMM3LjoLV+pzG7dc
lCnA==
X-Forwarded-Encrypted: i=1;
AL+hErEpN2fuu93OOFsbJkKz/V7lFUwq8K561QPxx3ycDU+jqLIlUMHHoa4zRMfUNqm9TT3cY2TyznxDF4y3rg==@lists.linux.dev
X-Gm-Message-State: APuU4Z/E0GFAJQqd8tvyCCteaR9CDUDbFdVM5AUWoAs+cUfVHX23wrUn
b+4ZA1qD2qbQimKnEd6tVRAezZuZrzl7nLg4xMQSlGoBWjRBjBmj4/v/msL/5w==
X-Gm-Gg: AYBFou0eTjIVeyIW2Mdzot2QWomoelt5XfVqSXVwmGL+tVC3aGuR7ihuY17cNdmIzBE
6pEuzb2D8W/qDo7BgBE4/3f6UDZ+LlQ0cFH2BOF39G+ySv14UCDhEid01xrAGp3tpsLvxzJKw+N
J5KkzWGIcpgIvaGMNAM+mlULtYcvQZVnFv6ieA06pYZwohUDuznMyljFyJx2Sxx3F6OMeFbaRAV
UACJbsfRPX/qBWtw2db1qJIQSiiqzZ/nc+hRJLiI3kPpDDC2zZ3sHPlajqhF+CehJ4KSwrO6mHc
WFUSLu6wlRXqauSUgxglM9XOGjR+9zV/p9hnojSyoy8/Es1N26xY4+Adj0hRW+nYH/Bbhlrg1Bl
2uuhSP84HvgpajyVc+zb+FStyhcpJedr/ZqiwXhTRchzASDFRgGHJeaE2HOT9gnMOjUuHJ6Xz62
uesH21uxUC7x/IOxsVXNuH4PnHxdJFx/hD7kJ5TZkbNsI0OZBM9jizMLKnzDRn3uNgst5j3GCTy
U/zizHJVTTs2CxTXmo8KskIm1wpkahQi3neP26sP2DPUieDRuviT+8Y90ZDE8CcjuoUJuRUZ7lS
70VoxlODYkpJm0jfS1Upa8B5F5ViO/quubcX5tW6Nv/5pyP4uO1WtWC5XlAiFnhhcPB9HYBVdWG
0xveMl+TarTKYBQa4owBf/tDo2ONoDKzYjXd/GWr7B3hEjkNFHzwP36ly54GsLAwH+QPtUtUbiu
N/AxeAh3etVuT9A/N2pjrCQLO0fURtfafTiL59Ku8J7kIKLFhbNzc=
X-Received: by 2002:a05:6830:43ac:b0:862:af88:e9bc with SMTP id
46e09a7af769-862af891402mr4387234a34.7.1794790712901;
Sun, 15 Nov 2026 16:58:32 -0800 (PST)
Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49])
by smtp.gmail.com with ESMTPSA id
46e09a7af769-86287f0e0fcsm9545673a34.2.2026.11.15.16.58.31
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 15 Nov 2026 16:58:32 -0800 (PST)
From: James Hilliard <james.hilliard1@gmail.com>
Date: Sun, 15 Nov 2026 17:58:26 -0700
Subject: [PATCH net] net: stmmac: dwmac-sun8i: Honor the RX checksum
offload setting
X-Mailing-List: linux-sunxi@lists.linux.dev
List-Id: <linux-sunxi.lists.linux.dev>
List-Post: <mailto:linux-sunxi@lists.linux.dev>
List-Help: <mailto:linux-sunxi+help@lists.linux.dev>
List-Subscribe: <mailto:linux-sunxi+subscribe@lists.linux.dev>
List-Unsubscribe: <mailto:linux-sunxi+unsubscribe@lists.linux.dev>
List-Owner: <mailto:linux-sunxi+owner@lists.linux.dev>
Precedence: list
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id:
<20261115-submit-sun8i-emac-rx-checksum-v1-v1-1-f186d127b39f@gmail.com>
X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yWNQQrCMBBFr1Jm7UCmkla8irhIx6kdJVEyaSmU3
t2oq8/7i/c2MMkqBudmgyyLmr5SBTo0wFNId0G9VYbWtR0RebR5iFrqpJOixMCYV+RJ+GlzxIW
QR9/50B/Z9Q6q5p1l1PWXuECSAtf/WUUP4fKVw75/ALUwtB6JAAAA
X-Change-ID: 20261115-submit-sun8i-emac-rx-checksum-v1-cf565a73c070
To: 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>,
Jakub Kicinski <kuba@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>
Cc: linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev,
linux-kernel@vger.kernel.org, James Hilliard <james.hilliard1@gmail.com>
X-Mailer: b4 0.15.2
X-Rspamd-Server: rspamd-worker-8404
X-Spamd-Result: default: False [4.31 / 15.00];
RBL_SENDERSCORE(2.00)[172.234.253.10:from];
SUSPICIOUS_RECIPS(1.50)[];
DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed),
No valid DKIM,none];
MAILLIST(-0.18)[generic];
MIME_GOOD(-0.10)[text/plain];
BAD_REP_POLICIES(0.10)[];
HAS_LIST_UNSUB(-0.01)[];
FROM_HAS_DN(0.00)[];
DBL_BLOCKED_OPENRESOLVER(0.00)[sea.lore.kernel.org:helo,sea.lore.kernel.org:rdns];
RCVD_COUNT_FIVE(0.00)[6];
FORGED_RECIPIENTS_MAILLIST(0.00)[];
TAGGED_RCPT(0.00)[netdev];
FORGED_SENDER_MAILLIST(0.00)[];
RCPT_COUNT_TWELVE(0.00)[17];
FREEMAIL_CC(0.00)[lists.infradead.org,lists.linux.dev,vger.kernel.org,gmail.com];
FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev];
ASN(0.00)[asn:63949, ipnet:172.234.224.0/19, country:SG];
MID_RHS_MATCH_FROM(0.00)[];
TO_DN_SOME(0.00)[];
FREEMAIL_FROM(0.00)[gmail.com];
RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received];
RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.234.253.10:from];
TAGGED_FROM(0.00)[bounces-27716-noreply=patchwork.local];
R_SPF_ALLOW(0.00)[+ip4:172.234.253.10];
RECEIVED_SPAMHAUS_PBL(0.00)[174.29.1.49:received];
ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2];
FREEMAIL_TO(0.00)[vger.kernel.org,bootlin.com,lunn.ch,davemloft.net,kernel.org,redhat.com,gmail.com,foss.st.com,sholland.org];
RCVD_TLS_LAST(0.00)[];
MIME_TRACE(0.00)[0:+];
RCVD_VIA_SMTP_AUTH(0.00)[]
X-Rspamd-Queue-Id: D685C1C27FD
X-MORS-Enabled: yes
X-MORS-DOMAIN: patchwork.local
X-MORS-HOSTING: hosting172546
X-MORS-USER: hosting172546
X-getmail-retrieved-from-mailbox: INBOX
|
| Series |
[net] net: stmmac: dwmac-sun8i: Honor the RX checksum offload setting
|
|
Commit Message
James Hilliard
Nov. 16, 2026, 12:58 a.m. UTC
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.
Set or clear EMAC_RX_DO_CRC according to hw->rx_csum so that disabling
offload leaves checksum validation to the network stack. Preserve the
callback's existing success return value.
Fixes: 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
base-commit: aa40afa831ebfe45e40a23721711059f2ac584d4
change-id: 20261115-submit-sun8i-emac-rx-checksum-v1-cf565a73c070
Best regards,
--
James Hilliard <james.hilliard1@gmail.com>
Comments
Hi! This is an automated message. This series looks like a fix, but its commit messages seem to be missing some information: - How the issue was discovered, e.g. hit in production, hit during development, syzbot report, manual code inspection, LLM or static analysis tool scan. - Whether the issue was actually triggered, or is only theoretical (e.g. found by LLM and not proven at runtime). If it was triggered please include the symptoms, like the stack trace or kernel messages. - What hardware the change was tested on. For driver fixes please mention the device (and if relevant firmware version) used for testing, or say that the change was not tested on real hardware. Please do not repost the series just to address the above. Instead, reply to this email with the missing information, so that reviewers can take it into account. *IMPORTANT*: If you do repost (for other reasons) - please include the relevant info in the cover letter or commit messages.
On Sun, Nov 15, 2026 at 6:03 PM <netdev-bot+sinfo@kernel.org> wrote: > > Hi! > > This is an automated message. This series looks like a fix, but its > commit messages seem to be missing some information: > > - How the issue was discovered, e.g. hit in production, hit during > development, syzbot report, manual code inspection, LLM or static > analysis tool scan. This was found while investigating RX checksum offload behavior on H616 and reviewing the shared setup and feature-filtering paths. > > - Whether the issue was actually triggered, or is only theoretical > (e.g. found by LLM and not proven at runtime). If it was triggered > please include the symptoms, like the stack trace or kernel messages. The capability loss was reproduced in a source-extracted test using the actual GMAC, GMAC4 and XGMAC checksum callbacks with mocked MMIO and the relevant setup and feature-filtering logic. With the original code, disabling offload and following the reopen path clears plat->rx_coe. The feature filter then prevents offload from being enabled again. With the patch, the saved capability survives that sequence. A requested enable that fails hardware readback still clears the capability. > > - What hardware the change was tested on. For driver fixes please > mention the device (and if relevant firmware version) used for > testing, or say that the change was not tested on real hardware. Tested on an Allwinner H616 board with an AC200 PHY. > > Please do not repost the series just to address the above. Instead, > reply to this email with the missing information, so that reviewers > can take it into account. > > *IMPORTANT*: If you do repost (for other reasons) - please include > the relevant info in the cover letter or commit messages. > -- > The evaluation is done by an LLM so it may be wrong, if you think > that is the case please reply and explain.
On Sun, Nov 15, 2026 at 7:19 PM James Hilliard <james.hilliard1@gmail.com> wrote: > > On Sun, Nov 15, 2026 at 6:03 PM <netdev-bot+sinfo@kernel.org> wrote: > > > > Hi! > > > > This is an automated message. This series looks like a fix, but its > > commit messages seem to be missing some information: > > > > - How the issue was discovered, e.g. hit in production, hit during > > development, syzbot report, manual code inspection, LLM or static > > analysis tool scan. > > This was found while investigating RX checksum offload behavior on > H616 and reviewing the shared setup and feature-filtering paths. > > > > > - Whether the issue was actually triggered, or is only theoretical > > (e.g. found by LLM and not proven at runtime). If it was triggered > > please include the symptoms, like the stack trace or kernel messages. > > The capability loss was reproduced in a source-extracted test using the > actual GMAC, GMAC4 and XGMAC checksum callbacks with mocked MMIO and the > relevant setup and feature-filtering logic. I mixed up the two threads. That explanation belongs to the separate checksum-capability fix [0]. For this sun8i patch, the issue was found and reproduced during MAC/PHY receive testing on an Allwinner H616 board with an AC200 PHY. Even after ethtool reported RX checksumming disabled, EMAC_RX_DO_CRC remained set and the hardware kept dropping packets with invalid IP or transport checksums before they reached an RX descriptor. With the fix, disabling offload cleared that bit. In steady-state tests, those packets then reached the host and were rejected by software checksum validation. Valid traffic continued to work, and Ethernet FCS rejection remained active. [0] https://lore.kernel.org/r/20261115-submit-stmmac-rx-checksum-capability-v1-v1-1-ea26fa3689be@gmail.com/ > > With the original code, disabling offload and following the reopen path > clears plat->rx_coe. The feature filter then prevents offload from being > enabled again. With the patch, the saved capability survives that > sequence. A requested enable that fails hardware readback still clears > the capability. > > > > > - What hardware the change was tested on. For driver fixes please > > mention the device (and if relevant firmware version) used for > > testing, or say that the change was not tested on real hardware. > > Tested on an Allwinner H616 board with an AC200 PHY. > > > > > Please do not repost the series just to address the above. Instead, > > reply to this email with the missing information, so that reviewers > > can take it into account. > > > > *IMPORTANT*: If you do repost (for other reasons) - please include > > the relevant info in the cover letter or commit messages. > > -- > > The evaluation is done by an LLM so it may be wrong, if you think > > that is the case please reply and explain.
Hi, On 11/16/26 01:58, 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. > > Set or clear EMAC_RX_DO_CRC according to hw->rx_csum so that disabling > offload leaves checksum validation to the network stack. Preserve the > callback's existing success return value. > > Fixes: 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i") > Signed-off-by: James Hilliard <james.hilliard1@gmail.com> Nice and simple, I tested that on an orangepi zero, with an allwinner H2+, and I can indeed see the difference as bad chksum packets are dropped on that core. Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Maxime
> Hi, > > On 11/16/26 01:58, 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. > > > > Set or clear EMAC_RX_DO_CRC according to hw->rx_csum so that disabling > > offload leaves checksum validation to the network stack. Preserve the > > callback's existing success return value. > > > > Fixes: 9f93ac8d4085 ("net-next: stmmac: Add dwmac-sun8i") > > Signed-off-by: James Hilliard <james.hilliard1@gmail.com> > > Nice and simple, I tested that on an orangepi zero, with an allwinner > H2+, and I can indeed see the difference as bad chksum packets are > dropped on that core. > > Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> > Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Reviewed-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com> > > Maxime > >
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 1 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] Clearing EMAC_RX_DO_CRC (EMAC_RX_CTL0 bit 27) whenever NETIF_F_RXCSUM is off may also turn off the MAC's Ethernet FCS… - [Low] When RX checksum offload is turned back on, frames the sun8i MAC received while EMAC_RX_DO_CRC was clear can be marked… -- net: stmmac: dwmac-sun8i: Honor the RX checksum offload setting Before this patch, sun8i_dwmac_rx_ipc_enable() always set EMAC_RX_DO_CRC. With the patch, it sets or clears the bit based on hw->rx_csum, so that turning off RX checksum offload through ethtool also turns off the hardware checksum engine. > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c > index 2ece7ba9dd73b..98cc7503bddeb 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c > @@ -705,7 +705,10 @@ static int sun8i_dwmac_rx_ipc_enable(struct mac_device_info *hw) > u32 v; > > v = readl(ioaddr + EMAC_RX_CTL0); > - v |= EMAC_RX_DO_CRC; > + if (hw->rx_csum) > + v |= EMAC_RX_DO_CRC; > + else > + v &= ~EMAC_RX_DO_CRC; [Severity: Medium] Does clearing bit 27 of EMAC_RX_CTL0 also turn off the MAC's Ethernet FCS check, and not only the IP/L4 checksum engine? The bit is named after the CRC: #define EMAC_RX_DO_CRC BIT(27) The probe code says the hardware features were "copied from Allwinner drivers". That code sets this bit with the comment "Enable CRC & IPv4 Header Checksum". The Allwinner manuals describe CHECK_CRC as "Calculate CRC and check the IPv4 Header Checksum". On this path, sun8i does not have the hardware strip the FCS. stmmac_rx() removes it in software without checking it: /* ACS is disabled; strip manually. */ if (likely(!(status & rx_not_ls))) len -= ETH_FCS_LEN; The only FCS check left is the hardware RDES0_CRC_ERROR bit, which ndesc_get_rx_status() turns into discard_frame. Suppose bit 27 does control CRC calculation. After "ethtool -K ethX rx off", the path is stmmac_set_features() -> hw->rx_csum = 0 -> sun8i_dwmac_rx_ipc_enable(). Frames with a corrupted FCS would then no longer set RDES0_CRC_ERROR. They would reach the stack as good frames, with the FCS silently stripped. That behaves like NETIF_F_RXALL rather than "RX checksum offload off". Is there a datasheet reference or a bad-FCS test showing that bit 27 gates only the L3/L4 checksum? If the hardware ties the two checks together, a different approach may be needed. For example, keep bit 27 set and, when rx_csum is 0, stop discarding frames whose only error is the IP or payload checksum. [Severity: Low] Can frames that arrive while EMAC_RX_DO_CRC is clear be marked as checksum-verified once RX checksum offload is turned back on? When "ethtool -K ethX rx on" runs, stmmac_set_features() publishes the software flag before the MMIO write that re-enables the engine: stmmac_set_features() { ... if (features & NETIF_F_RXCSUM) priv->hw->rx_csum = priv->plat->rx_coe; else priv->hw->rx_csum = 0; ... stmmac_rx_ipc(priv, priv->hw); ... } NAPI is not disabled, RX DMA is not stopped and the ring is not drained. Meanwhile, stmmac_rx() may run on another CPU and read the flag directly: int coe = priv->hw->rx_csum; ... if (unlikely(!coe) || !stmmac_has_ip_ethertype(skb) || (status & csum_none)) skb_checksum_none_assert(skb); else skb->ip_summed = CHECKSUM_UNNECESSARY; sun8i uses normal descriptors. ndesc_get_rx_status() never returns csum_none, so nothing in the descriptor says whether the hardware actually checked a given frame. Any unchecked frame still in the RX ring would then be passed up as CHECKSUM_UNNECESSARY. That covers frames received before the writel() in sun8i_dwmac_rx_ipc_enable() and frames received just after it. Before this patch, the bit was never cleared, so this state could not happen on sun8i. Swapping the two writes would narrow the window, but it would not cover frames already in the ring. Would RX need to be quiesced or drained across this transition? > writel(v, ioaddr + EMAC_RX_CTL0); > > return 1;
On Tue, Nov 17, 2026 at 9:00 PM <netdev-bot+sashiko@kernel.org> wrote: > > Thank you for your contribution! Sashiko AI review found 2 potential > issue(s) to consider. > > Critical: 0 · High: 0 · Medium: 1 · Low: 1 > > If you believe none of the issues are legitimate, please reply to each > issue of Medium severity or higher and explain why the AI is wrong. > If any of them are legitimate and you plan to respin, please let patchwork > know by including "pw-bot: cr" as a separate line at the end of your reply > (one such reply per series is enough). > > - [Medium] Clearing EMAC_RX_DO_CRC (EMAC_RX_CTL0 bit 27) whenever > NETIF_F_RXCSUM is off may also turn off the MAC's Ethernet FCS… > - [Low] When RX checksum offload is turned back on, frames the sun8i MAC > received while EMAC_RX_DO_CRC was clear can be marked… > > -- > > net: stmmac: dwmac-sun8i: Honor the RX checksum offload setting > > Before this patch, sun8i_dwmac_rx_ipc_enable() always set > EMAC_RX_DO_CRC. With the patch, it sets or clears the bit based on > hw->rx_csum, so that turning off RX checksum offload through ethtool > also turns off the hardware checksum engine. > > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c > > index 2ece7ba9dd73b..98cc7503bddeb 100644 > > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c > > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c > > @@ -705,7 +705,10 @@ static int sun8i_dwmac_rx_ipc_enable(struct mac_device_info *hw) > > u32 v; > > > > v = readl(ioaddr + EMAC_RX_CTL0); > > - v |= EMAC_RX_DO_CRC; > > + if (hw->rx_csum) > > + v |= EMAC_RX_DO_CRC; > > + else > > + v &= ~EMAC_RX_DO_CRC; > > [Severity: Medium] > Does clearing bit 27 of EMAC_RX_CTL0 also turn off the MAC's Ethernet > FCS check, and not only the IP/L4 checksum engine? It doesn't on H616. I sent 100 frames with a deliberately incorrect FCS in each setting and checked that bit 27 changed. With normal filtering, none produced an RX descriptor. With error forwarding enabled, all 100 produced descriptors with RDES0_CRC_ERROR set in both settings, and the driver discarded them. All 100 good-FCS controls were received in both settings. > > The bit is named after the CRC: > > #define EMAC_RX_DO_CRC BIT(27) > > The probe code says the hardware features were "copied from Allwinner > drivers". That code sets this bit with the comment "Enable CRC & IPv4 > Header Checksum". The Allwinner manuals describe CHECK_CRC as "Calculate > CRC and check the IPv4 Header Checksum". > > On this path, sun8i does not have the hardware strip the FCS. > stmmac_rx() removes it in software without checking it: > > /* ACS is disabled; strip manually. */ > if (likely(!(status & rx_not_ls))) > len -= ETH_FCS_LEN; > > The only FCS check left is the hardware RDES0_CRC_ERROR bit, which > ndesc_get_rx_status() turns into discard_frame. > > Suppose bit 27 does control CRC calculation. After "ethtool -K ethX rx > off", the path is stmmac_set_features() -> hw->rx_csum = 0 -> > sun8i_dwmac_rx_ipc_enable(). Frames with a corrupted FCS would then no > longer set RDES0_CRC_ERROR. They would reach the stack as good frames, > with the FCS silently stripped. That behaves like NETIF_F_RXALL rather > than "RX checksum offload off". > > Is there a datasheet reference or a bad-FCS test showing that bit 27 > gates only the L3/L4 checksum? If the hardware ties the two checks > together, a different approach may be needed. For example, keep bit 27 > set and, when rx_csum is 0, stop discarding frames whose only error is > the IP or payload checksum. > > [Severity: Low] > Can frames that arrive while EMAC_RX_DO_CRC is clear be marked as > checksum-verified once RX checksum offload is turned back on? Yes. In a separate test, frames with bad UDP checksums were already in the RX ring when offload was turned back on. When NAPI processed them, invalid datagrams reached the UDP socket in both the IPv4 and IPv6 tests. The driver used the new offload setting for descriptors filled under the old one. Changing the order of the register and software flag updates would not fix that case. > > When "ethtool -K ethX rx on" runs, stmmac_set_features() publishes the > software flag before the MMIO write that re-enables the engine: > > stmmac_set_features() { > ... > if (features & NETIF_F_RXCSUM) > priv->hw->rx_csum = priv->plat->rx_coe; > else > priv->hw->rx_csum = 0; > ... > stmmac_rx_ipc(priv, priv->hw); > ... > } > > NAPI is not disabled, RX DMA is not stopped and the ring is not drained. > Meanwhile, stmmac_rx() may run on another CPU and read the flag > directly: > > int coe = priv->hw->rx_csum; > ... > if (unlikely(!coe) || !stmmac_has_ip_ethertype(skb) || > (status & csum_none)) > skb_checksum_none_assert(skb); > else > skb->ip_summed = CHECKSUM_UNNECESSARY; > > sun8i uses normal descriptors. ndesc_get_rx_status() never returns > csum_none, so nothing in the descriptor says whether the hardware > actually checked a given frame. > > Any unchecked frame still in the RX ring would then be passed up as > CHECKSUM_UNNECESSARY. That covers frames received before the writel() > in sun8i_dwmac_rx_ipc_enable() and frames received just after it. > Before this patch, the bit was never cleared, so this state could not > happen on sun8i. > > Swapping the two writes would narrow the window, but it would not cover > frames already in the ring. Would RX need to be quiesced or drained > across this transition? > > > writel(v, ioaddr + EMAC_RX_CTL0); > > > > return 1; > > -- > Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261115-submit-sun8i-emac-rx-checksum-v1-v1-1-f186d127b39f%40gmail.com
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. (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) 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.
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
On Thu, 19 Nov 2026 16:32:58 -0700 James Hilliard wrote: > 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. I'm not very clear on the changes needed to get to "bad L4 csum packets still reach the stack" / correct behavior. Would you be willing to sketch the full series out already, and then we decide what gets applied where? What I would like to avoid is us applying this fix to net (which seems legitimate on the surface), but then following up with another fix which unconditionally clears EMAC_RX_DO_CRC since AFAIU we need to clear it for the correct behavior.
On Thu, Nov 19, 2026 at 5:11 PM Jakub Kicinski <kuba@kernel.org> wrote: > > On Thu, 19 Nov 2026 16:32:58 -0700 James Hilliard wrote: > > 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. > > I'm not very clear on the changes needed to get to "bad L4 csum packets > still reach the stack" / correct behavior. Would you be willing to > sketch the full series out already, and then we decide what gets > applied where? I posted the two-patch series [0]. The first patch fixes RX checksum handling in both ethtool modes. The second adds rx-all support. > What I would like to avoid is us applying this fix to net (which > seems legitimate on the surface), but then following up with another > fix which unconditionally clears EMAC_RX_DO_CRC since AFAIU we > need to clear it for the correct behavior. We don't need to clear EMAC_RX_DO_CRC. On H616 I verified that setting RX_ERR_FRM lets packets with a bad UDP checksum reach DMA while EMAC_RX_DO_CRC is still set. The descriptor flags the checksum error, so the driver can pass the packet up as CHECKSUM_NONE while still dropping frames with a bad FCS by default. The new series keeps EMAC_RX_DO_CRC set in both modes. It replaces the conditional write in this patch, so there's no need to apply this patch to net first. [0] https://lore.kernel.org/r/20261120-submit-sun8i-rx-features-v1-v1-0-5058fecba6b3@gmail.com/
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 2ece7ba9dd73..98cc7503bdde 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -705,7 +705,10 @@ static int sun8i_dwmac_rx_ipc_enable(struct mac_device_info *hw) u32 v; v = readl(ioaddr + EMAC_RX_CTL0); - v |= EMAC_RX_DO_CRC; + if (hw->rx_csum) + v |= EMAC_RX_DO_CRC; + else + v &= ~EMAC_RX_DO_CRC; writel(v, ioaddr + EMAC_RX_CTL0); return 1;