Skip to content
Snippets Groups Projects
Commit b32b81ce authored by Hangbin Liu's avatar Hangbin Liu
Browse files

net: fix SOF_TIMESTAMPING_BIND_PHC to work with multiple sockets

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2066451


Upstream Status: net.git commit 007747a9

commit 007747a9
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date:   Wed Jan 5 11:33:26 2022 +0100

    net: fix SOF_TIMESTAMPING_BIND_PHC to work with multiple sockets

    When multiple sockets using the SOF_TIMESTAMPING_BIND_PHC flag received
    a packet with a hardware timestamp (e.g. multiple PTP instances in
    different PTP domains using the UDPv4/v6 multicast or L2 transport),
    the timestamps received on some sockets were corrupted due to repeated
    conversion of the same timestamp (by the same or different vclocks).

    Fix ptp_convert_timestamp() to not modify the shared skb timestamp
    and return the converted timestamp as a ktime_t instead. If the
    conversion fails, return 0 to not confuse the application with
    timestamps corresponding to an unexpected PHC.

    Fixes: d7c08826 ("net: socket: support hardware timestamp conversion to PHC bound")
Signed-off-by: default avatarMiroslav Lichvar <mlichvar@redhat.com>
    Cc: Yangbo Lu <yangbo.lu@nxp.com>
    Cc: Richard Cochran <richardcochran@gmail.com>
Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>

Signed-off-by: default avatarHangbin Liu <haliu@redhat.com>
parent a274b6af
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment