linux-stable/drivers/net/dsa
Vladimir Oltean 566b18c8b7 net: dsa: sja1105: implement TX timestamping for SJA1110
The TX timestamping procedure for SJA1105 is a bit unconventional
because the transmit procedure itself is unconventional.

Control packets (and therefore PTP as well) are transmitted to a
specific port in SJA1105 using "management routes" which must be written
over SPI to the switch. These are one-shot rules that match by
destination MAC address on traffic coming from the CPU port, and select
the precise destination port for that packet. So to transmit a packet
from NET_TX softirq context, we actually need to defer to a process
context so that we can perform that SPI write before we send the packet.
The DSA master dev_queue_xmit() runs in process context, and we poll
until the switch confirms it took the TX timestamp, then we annotate the
skb clone with that TX timestamp. This is why the sja1105 driver does
not need an skb queue for TX timestamping.

But the SJA1110 is a bit (not much!) more conventional, and you can
request 2-step TX timestamping through the DSA header, as well as give
the switch a cookie (timestamp ID) which it will give back to you when
it has the timestamp. So now we do need a queue for keeping the skb
clones until their TX timestamps become available.

The interesting part is that the metadata frames from SJA1105 haven't
disappeared completely. On SJA1105 they were used as follow-ups which
contained RX timestamps, but on SJA1110 they are actually TX completion
packets, which contain a variable (up to 32) array of timestamps.
Why an array? Because:
- not only is the TX timestamp on the egress port being communicated,
  but also the RX timestamp on the CPU port. Nice, but we don't care
  about that, so we ignore it.
- because a packet could be multicast to multiple egress ports, each
  port takes its own timestamp, and the TX completion packet contains
  the individual timestamps on each port.

This is unconventional because switches typically have a timestamping
FIFO and raise an interrupt, but this one doesn't. So the tagger needs
to detect and parse meta frames, and call into the main switch driver,
which pairs the timestamps with the skbs in the TX timestamping queue
which are waiting for one.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-06-11 12:45:38 -07:00
..
b53 net: dsa: b53: Do not force CPU to be always tagged 2021-06-09 13:49:20 -07:00
hirschmann net: dsa: hellcreek: Use is_zero_ether_addr() instead of memcmp() 2021-06-07 13:16:36 -07:00
microchip net: dsa: microchip: enable phy errata workaround on 9567 2021-05-24 14:27:18 -07:00
mv88e6xxx net: dsa: no longer clone skb in core driver 2021-04-27 14:10:15 -07:00
ocelot net: dsa: felix: set TX flow control according to the phylink_mac_link_up resolution 2021-06-08 16:35:14 -07:00
qca net: dsa: set configure_vlan_while_not_filtering to true by default 2021-01-15 17:29:40 -08:00
sja1105 net: dsa: sja1105: implement TX timestamping for SJA1110 2021-06-11 12:45:38 -07:00
xrs700x net: dsa: xrs700x: allow HSR/PRP supervision dupes for node_table 2021-06-04 14:49:28 -07:00
bcm_sf2.c net: dsa: bcm_sf2: Fix bcm_sf2_reg_rgmii_cntrl() call for non-RGMII port 2021-05-21 14:18:34 -07:00
bcm_sf2.h net: dsa: bcm_sf2: setup BCM4908 internal crossbar 2021-03-12 17:06:37 -08:00
bcm_sf2_cfp.c net: dsa: propagate extack to .port_vlan_add 2021-02-14 17:38:11 -08:00
bcm_sf2_regs.h net: dsa: bcm_sf2: fix BCM4908 RGMII reg(s) 2021-03-18 14:44:05 -07:00
dsa_loop.c net: dsa: propagate extack to .port_vlan_filtering 2021-02-14 17:38:12 -08:00
dsa_loop.h
dsa_loop_bdinfo.c
Kconfig dsa: simplify Kconfig symbols and dependencies 2021-03-22 12:15:37 -07:00
lan9303-core.c net: dsa: remove the transactional logic from MDB entries 2021-01-11 16:00:57 -08:00
lan9303.h
lan9303_i2c.c
lan9303_mdio.c
lantiq_gswip.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-04-09 20:48:35 -07:00
lantiq_pce.h
Makefile net: dsa: add Arrow SpeedChips XRS700x driver 2021-01-15 15:37:37 -08:00
mt7530.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-05-27 09:55:10 -07:00
mt7530.h net: dsa: mt7530: add interrupt support 2021-05-19 13:27:42 -07:00
mv88e6060.c
mv88e6060.h
qca8k.c net: dsa: qca8k: check the correct variable in qca8k_set_mac_eee() 2021-06-09 14:10:38 -07:00
qca8k.h net: dsa: qca8k: add support for internal phy and internal mdio 2021-05-14 15:30:22 -07:00
realtek-smi-core.c net: dsa: rtl8366rb: Roof MTU for switch 2020-10-10 11:25:05 -07:00
realtek-smi-core.h net: dsa: propagate extack to .port_vlan_filtering 2021-02-14 17:38:12 -08:00
rtl8366.c net: dsa: propagate extack to .port_vlan_filtering 2021-02-14 17:38:12 -08:00
rtl8366rb.c net: dsa: rtl8366rb: standardize init jam tables 2021-01-27 20:21:20 -08:00
vitesse-vsc73xx-core.c net: dsa: vsc73xx: make the MTU configurable 2020-03-27 16:07:25 -07:00
vitesse-vsc73xx-platform.c net: dsa: vitesse-vsc73xx: Convert to plain comments to avoid kerneldoc warnings 2020-07-05 15:49:03 -07:00
vitesse-vsc73xx-spi.c net: dsa: vitesse-vsc73xx: Convert to plain comments to avoid kerneldoc warnings 2020-07-05 15:49:03 -07:00
vitesse-vsc73xx.h