Commit b3ca9ee
tsnep: fix timestamping with a stacked DSA driver
This driver is susceptible to a form of the bug explained in commit
c26a2c2 ("gianfar: Fix TX timestamping with a stacked DSA driver")
and in Documentation/networking/timestamping.rst section "Other caveats
for MAC drivers", specifically it timestamps any skb which has
SKBTX_HW_TSTAMP, and does not consider if timestamping has been enabled
in adapter->hwtstamp_config.tx_type.
Evaluate the proper TX timestamping condition only once on the TX
path (in tsnep_xmit_frame_ring()) and store the result in an additional
TX entry flag. Evaluate the new TX entry flag in the TX confirmation path
(in tsnep_tx_poll()).
This way SKBTX_IN_PROGRESS is set by the driver as required, but never
evaluated. SKBTX_IN_PROGRESS shall not be evaluated as it can be set
by a stacked DSA driver and evaluating it would lead to unwanted
timestamps.
Fixes: 403f69b ("tsnep: Add TSN endpoint Ethernet MAC driver")
Suggested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20250514195657.25874-1-gerhard@engleder-embedded.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 491deb9 commit b3ca9ee
1 file changed
+19
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
386 | 388 | | |
387 | 389 | | |
388 | 390 | | |
389 | | - | |
390 | | - | |
| 391 | + | |
391 | 392 | | |
392 | 393 | | |
393 | 394 | | |
| |||
479 | 480 | | |
480 | 481 | | |
481 | 482 | | |
482 | | - | |
| 483 | + | |
| 484 | + | |
483 | 485 | | |
484 | 486 | | |
485 | 487 | | |
| |||
505 | 507 | | |
506 | 508 | | |
507 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
508 | 513 | | |
509 | 514 | | |
510 | 515 | | |
| |||
558 | 563 | | |
559 | 564 | | |
560 | 565 | | |
561 | | - | |
562 | 566 | | |
| 567 | + | |
| 568 | + | |
563 | 569 | | |
564 | | - | |
565 | 570 | | |
| 571 | + | |
566 | 572 | | |
567 | 573 | | |
568 | 574 | | |
| |||
579 | 585 | | |
580 | 586 | | |
581 | 587 | | |
582 | | - | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
583 | 595 | | |
584 | 596 | | |
585 | 597 | | |
| |||
591 | 603 | | |
592 | 604 | | |
593 | 605 | | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | 606 | | |
598 | 607 | | |
599 | 608 | | |
| |||
844 | 853 | | |
845 | 854 | | |
846 | 855 | | |
847 | | - | |
848 | | - | |
| 856 | + | |
849 | 857 | | |
850 | 858 | | |
851 | 859 | | |
| |||
0 commit comments