linux-stable/drivers/net/dsa/ocelot
Vladimir Oltean 2edcfcbb3c net: dsa: felix: don't drop PTP frames with tag_8021q when RX timestamping is disabled
The driver implements a workaround for the fact that it doesn't have an
IRQ source to tell it whether PTP frames are available through the
extraction registers, for those frames to be processed and passed
towards the network stack. That workaround is to configure the switch,
through felix_hwtstamp_set() -> felix_update_trapping_destinations(),
to create two copies of PTP packets: one sent over Ethernet to the DSA
master, and one to be consumed through the aforementioned CPU extraction
queue registers.

The reason why we want PTP packets to be consumed through the CPU
extraction registers in the first place is because we want to see their
hardware RX timestamp. With tag_8021q, that is only visible that way,
and it isn't visible with the copy of the packet that's transmitted over
Ethernet.

The problem with the workaround implementation is that it drops the
packet received over Ethernet, in expectation of its copy being present
in the CPU extraction registers. However, if felix_hwtstamp_set() hasn't
run (aka PTP RX timestamping is disabled), the driver will drop the
original PTP frame and there will be no copy of it in the CPU extraction
registers. So, the network stack will simply not see any PTP frame.

Look at the port's trapping configuration to see whether the driver has
previously enabled the CPU extraction registers. If it hasn't, just
don't RX timestamp the frame and let it be passed up the stack by DSA,
which is perfectly fine.

Fixes: 0a6f17c6ae ("net: dsa: tag_ocelot_8021q: add support for PTP timestamping")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2023-06-29 12:40:27 +02:00
..
felix.c net: dsa: felix: don't drop PTP frames with tag_8021q when RX timestamping is disabled 2023-06-29 12:40:27 +02:00
felix.h net: dsa: felix: allow serdes configuration for dsa ports 2023-03-20 09:08:48 +00:00
felix_vsc9959.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-15 22:19:41 -07:00
Kconfig net: dsa: ocelot: fix selecting MFD_OCELOT 2023-02-16 13:03:15 +01:00
Makefile net: dsa: ocelot: add external ocelot switch control 2023-01-30 21:07:21 -08:00
ocelot_ext.c net: dsa: ocelot: add support for external phys 2023-03-20 09:08:48 +00:00
seville_vsc9953.c net: dsa: ocelot: use lynx_pcs_create_mdiodev() 2023-05-29 21:46:53 -07:00