Re: [PATCH net-next 3/3] docs: networking: timestamping: add a set of frequently asked questions

From
Richard Cochran <richardcochran@gmail.com>
Date
2020-07-21 00:15:24
Also in
linux-doc
Reply to
Vladimir Oltean, 2020-07-20
On Tue, Jul 21, 2020 at 12:05:18AM +0300, Vladimir Oltean wrote:
Yes, the problematic cases have to do with stacked PHCs (DSA, PHY). The
pattern is that:
- DSA sets SKBTX_IN_PROGRESS
Nit: DSA should _not_ set this bit (but a PHY/MII device should).
quoted hunk ↗ jump to hunk
- calls dev_queue_xmit towards the MAC driver
- MAC driver sees SKBTX_IN_PROGRESS, thinks it's the one who set it
- MAC driver delivers TX timestamp
- DSA ends poll or receives TX interrupt, collects its timestamp, and
  delivers a second TX timestamp
So it's very far from obvious that setting this flag is 'the prevailing
convention'. For a MAC driver, that might well be, but for DSA/PHY,
there seem to be risks associated with doing that, and driver writers
should know what they're signing up for.
The flag only exists to prevent the stack from delivering SW time
stamps when HW time stamps are active.  If an interface doesn't
provide SW time stamps (like DSA interfaces), then there is no need to
set the flag.

For MAC and PHY/MII time stamping, they must co-operate, meaning that
the MAC driver must be prepared to deal with the fact that the PHY/MII
might set this flag.  Many MAC drivers don't do this correctly, but
there are very few PHY/MII actually in use, and so very few authors of
MAC drivers have paid attention to this.

Thanks,
Richard
Thread (19 messages) 19 messages, 3 authors, last reply 2020-07-25
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help