Commit 57a92d14 authored by Horatiu Vultur's avatar Horatiu Vultur Committed by Paolo Abeni
Browse files

net: phy: mscc: Stop clearing the the UDPv4 checksum for L2 frames



We have noticed that when PHY timestamping is enabled, L2 frames seems
to be modified by changing two 2 bytes with a value of 0. The place were
these 2 bytes seems to be random(or I couldn't find a pattern).  In most
of the cases the userspace can ignore these frames but if for example
those 2 bytes are in the correction field there is nothing to do.  This
seems to happen when configuring the HW for IPv4 even that the flow is
not enabled.
These 2 bytes correspond to the UDPv4 checksum and once we don't enable
clearing the checksum when using L2 frames then the frame doesn't seem
to be changed anymore.

Fixes: 7d272e63 ("net: phy: mscc: timestamping and PHC support")
Signed-off-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
Link: https://patch.msgid.link/20250523082716.2935895-1-horatiu.vultur@microchip.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 0bdc924b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -946,7 +946,9 @@ static int vsc85xx_ip1_conf(struct phy_device *phydev, enum ts_blk blk,
	/* UDP checksum offset in IPv4 packet
	 * according to: https://tools.ietf.org/html/rfc768
	 */
	val |= IP1_NXT_PROT_UDP_CHKSUM_OFF(26) | IP1_NXT_PROT_UDP_CHKSUM_CLEAR;
	val |= IP1_NXT_PROT_UDP_CHKSUM_OFF(26);
	if (enable)
		val |= IP1_NXT_PROT_UDP_CHKSUM_CLEAR;
	vsc85xx_ts_write_csr(phydev, blk, MSCC_ANA_IP1_NXT_PROT_UDP_CHKSUM,
			     val);