[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140717181222.GB23623@localhost.localdomain>
Date: Thu, 17 Jul 2014 20:12:22 +0200
From: Richard Cochran <richardcochran@...il.com>
To: Stefan Sørensen
<stefan.sorensen@...ctralink.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] dp83640: Fix receive timestamp race condition
On Thu, Jul 17, 2014 at 03:17:59PM +0200, Stefan Sørensen wrote:
> When timestamping received packets, rx_timestamp_work may be scheduled before
> the timestamps is received from the hardware resulting in the packet beeing
> delivered without the timestamp.
>
> This is fixed by changing the receive timestamp path: On receiving a packet
> that need timestamping, it is added to a queue. When a timestamp arrives, the
> queue is traversed and if a matching packet is found, it is deliverd with the
> timestamp. In case the hardware drops a timestamp, a workqueue regularly
> checks the queue for old packets and delivers them without a timestamp.
And what happens when the timestamp arrives *before* the PTP packet?
The original code was desgined to handle this possibility. Although it
makes logical sense for the PHY to deliver the status frame after the
regular frame, there is nothing in the documentation that confirms
this behavior, and hardware engineering decisions are not always
logical. If some newer silicon revision were to buffer the incoming
packet, waiting for the time stamp logic, then the driver should still
work.
Thanks,
Richard
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists