diff options
author | Robert Hancock <robert.hancock@calian.com> | 2023-01-17 00:41:33 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-01-18 17:25:18 +0300 |
commit | 7b90f5a665acd46efbbfa677a3a3a18d01ad6487 (patch) | |
tree | 2ca09fa9bf72f783847eb063cf11af718488c93a /drivers/net/virtio_net.c | |
parent | 3e134696215f45740ef0ccd0fd67f409cb5009cc (diff) | |
download | linux-7b90f5a665acd46efbbfa677a3a3a18d01ad6487.tar.xz |
net: macb: fix PTP TX timestamp failure due to packet padding
PTP TX timestamp handling was observed to be broken with this driver
when using the raw Layer 2 PTP encapsulation. ptp4l was not receiving
the expected TX timestamp after transmitting a packet, causing it to
enter a failure state.
The problem appears to be due to the way that the driver pads packets
which are smaller than the Ethernet minimum of 60 bytes. If headroom
space was available in the SKB, this caused the driver to move the data
back to utilize it. However, this appears to cause other data references
in the SKB to become inconsistent. In particular, this caused the
ptp_one_step_sync function to later (in the TX completion path) falsely
detect the packet as a one-step SYNC packet, even when it was not, which
caused the TX timestamp to not be processed when it should be.
Using the headroom for this purpose seems like an unnecessary complexity
as this is not a hot path in the driver, and in most cases it appears
that there is sufficient tailroom to not require using the headroom
anyway. Remove this usage of headroom to prevent this inconsistency from
occurring and causing other problems.
Fixes: 653e92a9175e ("net: macb: add support for padding and fcs computation")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Claudiu Beznea <claudiu.beznea@microchip.com> # on SAMA7G5
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/virtio_net.c')
0 files changed, 0 insertions, 0 deletions