linux/drivers/net/ethernet/mscc
Vladimir Oltean 52849bcf00 net: mscc: ocelot: avoid overflowing the PTP timestamp FIFO
PTP packets with 2-step TX timestamp requests are matched to packets
based on the egress port number and a 6-bit timestamp identifier.
All PTP timestamps are held in a common FIFO that is 128 entry deep.

This patch ensures that back-to-back timestamping requests cannot exceed
the hardware FIFO capacity. If that happens, simply send the packets
without requesting a TX timestamp to be taken (in the case of felix,
since the DSA API has a void return code in ds->ops->port_txtstamp) or
drop them (in the case of ocelot).

I've moved the ts_id_lock from a per-port basis to a per-switch basis,
because we need separate accounting for both numbers of PTP frames in
flight. And since we need locking to inc/dec the per-switch counter,
that also offers protection for the per-port counter and hence there is
no reason to have a per-port counter anymore.

Fixes: 4e3b0468e6 ("net: mscc: PTP Hardware Clock (PHC) support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-10-12 17:35:17 -07:00
..
Kconfig net: mscc: ocelot: convert to phylink 2021-08-16 11:19:34 +01:00
Makefile
ocelot.c net: mscc: ocelot: avoid overflowing the PTP timestamp FIFO 2021-10-12 17:35:17 -07:00
ocelot.h net: mscc: ocelot: convert to phylink 2021-08-16 11:19:34 +01:00
ocelot_devlink.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
ocelot_flower.c
ocelot_io.c net: mscc: Fix non-GPL export of regmap APIs 2021-08-12 09:44:31 +01:00
ocelot_mrp.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
ocelot_net.c net: mscc: ocelot: Fix dumplicated argument in ocelot 2021-10-12 11:21:55 +01:00
ocelot_police.c
ocelot_police.h
ocelot_ptp.c
ocelot_qs.h
ocelot_rew.h
ocelot_vcap.c net: mscc: ocelot: fix VCAP filters remaining active after being deleted 2021-10-01 15:13:20 -07:00
ocelot_vcap.h
ocelot_vsc7514.c net: mscc: ocelot: allow probing to continue with ports that fail to register 2021-08-20 14:36:42 +01:00