WSL2-Linux-Kernel/drivers/net
Vladimir Oltean c26a2c2ddc gianfar: Fix TX timestamping with a stacked DSA driver
The driver wrongly assumes that it is the only entity that can set the
SKBTX_IN_PROGRESS bit of the current skb. Therefore, in the
gfar_clean_tx_ring function, where the TX timestamp is collected if
necessary, the aforementioned bit is used to discriminate whether or not
the TX timestamp should be delivered to the socket's error queue.

But a stacked driver such as a DSA switch can also set the
SKBTX_IN_PROGRESS bit, which is actually exactly what it should do in
order to denote that the hardware timestamping process is undergoing.

Therefore, gianfar would misinterpret the "in progress" bit as being its
own, and deliver a second skb clone in the socket's error queue,
completely throwing off a PTP process which is not expecting to receive
it, _even though_ TX timestamping is not enabled for gianfar.

There have been discussions [0] as to whether non-MAC drivers need or
not to set SKBTX_IN_PROGRESS at all (whose purpose is to avoid sending 2
timestamps, a sw and a hw one, to applications which only expect one).
But as of this patch, there are at least 2 PTP drivers that would break
in conjunction with gianfar: the sja1105 DSA switch and the felix
switch, by way of its ocelot core driver.

So regardless of that conclusion, fix the gianfar driver to not do stuff
based on flags set by others and not intended for it.

[0]: https://www.spinics.net/lists/netdev/msg619699.html

Fixes: f0ee7acfcd ("gianfar: Add hardware TX timestamping support")
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-12-28 11:43:40 -08:00
..
appletalk netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
arcnet netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
bonding bonding: rename AD_STATE_* to LACP_STATE_* 2019-12-26 13:09:37 -08:00
caif net: caif: replace BUG_ON with recovery code 2019-12-16 16:29:05 -08:00
can can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices 2019-12-08 12:22:01 +01:00
dsa mv88e6xxx: Add serdes Rx statistics 2019-12-27 16:34:15 -08:00
ethernet gianfar: Fix TX timestamping with a stacked DSA driver 2019-12-28 11:43:40 -08:00
fddi
fjes Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 15:15:05 -08:00
hamradio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 15:15:05 -08:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 09:54:33 -08:00
ieee802154 drivers: net: Fix Kconfig indentation, continued 2019-11-21 11:54:09 -08:00
ipvlan
netdevsim ipv6: Remove old route notifications and convert listeners 2019-12-24 22:37:30 -08:00
phy net: phy: realtek: add support for configuring the RX delay on RTL8211F 2019-12-26 13:22:17 -08:00
plip
ppp ppp: Remove redundant BUG_ON() check in ppp_pernet 2019-12-27 16:30:52 -08:00
slip netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
team
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 15:15:05 -08:00
vmxnet3 netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
wan net/wan/fsl_ucc_hdlc: remove set but not used variables 'ut_info' and 'ret' 2019-12-28 11:34:02 -08:00
wimax netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
wireguard wireguard: allowedips: use kfree_rcu() instead of call_rcu() 2019-12-16 19:22:22 -08:00
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2019-12-22 15:15:05 -08:00
xen-netback xen-netback: support dynamic unbind/bind 2019-12-26 15:16:26 -08:00
Kconfig wireguard: Kconfig: select parent dependency for crypto 2019-12-16 19:22:22 -08:00
LICENSE.SRC
Makefile net: WireGuard secure network tunnel 2019-12-08 17:48:42 -08:00
Space.c
dummy.c
eql.c
geneve.c treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
gtp.c gtp: avoid zero size hashtable 2019-12-14 17:15:24 -08:00
ifb.c
loopback.c
macsec.c
macvlan.c net: macvlan: Use the PHY time stamping interface. 2019-12-25 19:51:33 -08:00
macvtap.c
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c tun: fix data-race in gro_normal_list() 2019-11-15 12:46:49 -08:00
veth.c
virtio_net.c bpf: Convert bpf_prog refcnt to atomic64_t 2019-11-18 11:41:59 +01:00
vrf.c
vsockmon.c
vxlan.c treewide: Use sizeof_field() macro 2019-12-09 10:36:44 -08:00
xen-netfront.c