]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net: ethernet: ti: cpts: fix tx timestamping timeout
authorGrygorii Strashko <grygorii.strashko@ti.com>
Fri, 28 Jul 2017 22:30:04 +0000 (17:30 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Aug 2017 22:22:55 +0000 (15:22 -0700)
commit0d5f54fec0a18eea5e4ac005646fd2bc2118636c
tree6d4a6071695f878692f4cb2db76ff4de8cfc8da1
parent999f129289ab1599e7cdc08804a9b5ec4e1418f4
net: ethernet: ti: cpts: fix tx timestamping timeout

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: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpts.c
drivers/net/ethernet/ti/cpts.h