[PATCH net v5] net: stmmac: Prevent DSA tags from breaking COE

Romain Gantois romain.gantois at bootlin.com
Tue Jan 16 08:18:30 PST 2024


On Tue, 16 Jan 2024, Jakub Kicinski wrote:

> Hm, the comment in enh_desc_coe_rdes0() says:
> 
> 	/* bits 5 7 0 | Frame status
> 	 * ----------------------------------------------------------
> 	 *      0 0 0 | IEEE 802.3 Type frame (length < 1536 octects)
> 	 *      1 0 0 | IPv4/6 No CSUM errorS.
> 	 *      1 0 1 | IPv4/6 CSUM PAYLOAD error
> 	 *      1 1 0 | IPv4/6 CSUM IP HR error
> 	 *      1 1 1 | IPv4/6 IP PAYLOAD AND HEADER errorS
> 	 *      0 0 1 | IPv4/6 unsupported IP PAYLOAD
> 	 *      0 1 1 | COE bypassed.. no IPv4/6 frame
> 	 *      0 1 0 | Reserved.
> 	 */
> 
> which makes it sound like bit 5 will not be set for a Ethernet II frame
> with unsupported IP payload, or not an IP frame. Does the bit mean other
> things in different descriptor formats?

The description of this bit in my datasheet is:

```
b5 FT Frame Type
When set, this bit indicates that the Receive Frame is an Ethernet-type frame 
(the Length/Type field is greater than or equal to 1,536). When this bit is 
reset, it indicates that the received frame is an IEEE 802.3 frame. This bit is 
not valid for Runt frames less than 14 bytes
```

There is no mention of a more subtle check to detect non-IP Ethernet II frames. 
I ran some tests on my hardware and EDSA-tagged packets consistently come in 
with status 0b100, so the MAC sets the frame type bit even for frames that don't 
have an IP ethertype.

Best Regards,

-- 
Romain Gantois, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the linux-arm-kernel mailing list