MT-149497: net: fec: add imx8mm devinfo with UDP checksum quirk#42
Open
Overdr0ne wants to merge 1 commit into
Open
MT-149497: net: fec: add imx8mm devinfo with UDP checksum quirk#42Overdr0ne wants to merge 1 commit into
Overdr0ne wants to merge 1 commit into
Conversation
The imx8mm FEC hardware RX checksum offload engine incorrectly marks certain UDP packets as checksum-valid, causing them to be silently dropped by the kernel UDP stack. Add a dedicated fsl,imx8mm-fec compatible string, which previously fell through to fsl,imx8mq-fec, and a new FEC_QUIRK_ERR_UDP_CSUM quirk. When the quirk is set, downgrade CHECKSUM_UNNECESSARY to CHECKSUM_NONE for UDP packets only after the HW reports no error, forcing the kernel UDP stack to re-validate the checksum in software. TCP checksum offload is unaffected.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds i.MX8MM FEC support and introduces a quirk/workaround for a hardware RX checksum offload issue affecting UDP.
Changes:
- Add i.MX8MM-specific
fec_devinfoand register it via platform IDs + DT compatible match. - Introduce a new quirk bit (
FEC_QUIRK_ERR_UDP_CSUM) for the i.MX8MM UDP RX checksum validation issue. - Adjust RX checksum handling to force software validation for UDP when the quirk is enabled.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| drivers/net/ethernet/freescale/fec_main.c | Registers imx8mm variant and changes RX checksum behavior under a new quirk. |
| drivers/net/ethernet/freescale/fec.h | Defines a new quirk flag to gate the UDP checksum workaround. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1806
to
+1815
| /* i.MX8MM FEC HW checksum offload incorrectly | ||
| * validates certain UDP packets (FEC_QUIRK_ERR_UDP_CSUM). | ||
| * Force software re-validation for UDP only. | ||
| */ | ||
| if (fep->quirks & FEC_QUIRK_ERR_UDP_CSUM) { | ||
| struct iphdr *iph = (struct iphdr *)skb_network_header(skb); | ||
|
|
||
| if (iph && iph->protocol == IPPROTO_UDP) | ||
| skb->ip_summed = CHECKSUM_NONE; | ||
| } |
Comment on lines
+517
to
+521
| /* i.MX8MM FEC hardware RX checksum offload incorrectly validates certain UDP | ||
| * packets, causing them to be silently dropped by the kernel UDP stack. | ||
| * Force software re-validation for UDP by downgrading CHECKSUM_UNNECESSARY. | ||
| */ | ||
| #define FEC_QUIRK_ERR_UDP_CSUM BIT(25) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MT-149497
So I basically just had Claude implement the Option B fix here. I've only really done a build test so far.
The imx8mm FEC hardware RX checksum offload engine incorrectly marks certain UDP packets as checksum-valid, causing them to be silently dropped by the kernel UDP stack.
Add a dedicated fsl,imx8mm-fec compatible string, which previously fell through to fsl,imx8mq-fec, and a new FEC_QUIRK_ERR_UDP_CSUM quirk. When the quirk is set, downgrade CHECKSUM_UNNECESSARY to CHECKSUM_NONE for UDP packets only after the HW reports no error, forcing the kernel UDP stack to re-validate the checksum in software. TCP checksum offload is unaffected.
dev QA: @AmeNote-Michael