]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net: mscc: ocelot: deny TX timestamping of non-PTP packets
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 12 Oct 2021 11:40:38 +0000 (14:40 +0300)
committerJakub Kicinski <kuba@kernel.org>
Wed, 13 Oct 2021 00:35:18 +0000 (17:35 -0700)
commitfba01283d85a09e0e2ef552c6e764b903111d90a
tree4101cb8459d124789cf26645f849caf7f8782d95
parent9fde506e0c53b8309f69b18b4b8144c544b4b3b1
net: mscc: ocelot: deny TX timestamping of non-PTP packets

It appears that Ocelot switches cannot timestamp non-PTP frames,
I tested this using the isochron program at:
https://github.com/vladimiroltean/tsn-scripts

with the result that the driver increments the ocelot_port->ts_id
counter as expected, puts it in the REW_OP, but the hardware seems to
not timestamp these packets at all, since no IRQ is emitted.

Therefore check whether we are sending PTP frames, and refuse to
populate REW_OP otherwise.

Fixes: 4e3b0468e6d7 ("net: mscc: PTP Hardware Clock (PHC) support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot.c