• Grygorii Strashko's avatar
    net: ethernet: ti: cpts: fix tx timestamping timeout · 0d5f54fe
    Grygorii Strashko authored
    With the low speed Ethernet connection CPDMA notification about packet
    processing can be received before CPTS TX timestamp event, which is set
    when packet actually left CPSW while cpdma notification is sent when packet
    pushed in CPSW fifo.  As result, when connection is slow and CPU is fast
    enough TX timestamping is not working properly.
    
    Fix it, by introducing TX SKB queue to store PTP SKBs for which Ethernet
    Transmit Event hasn't been received yet and then re-check this queue
    with new Ethernet Transmit Events by scheduling CPTS overflow
    work more often (every 1 jiffies) until TX SKB queue is not empty.
    
    Side effect of this change is:
     - User space tools require to take into account possible delay in TX
    timestamp processing (for example ptp4l works with tx_timestamp_timeout=400
    under net traffic and tx_timestamp_timeout=25 in idle).
    Signed-off-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0d5f54fe
cpts.h 6.31 KB