Commit 52849bc
net: mscc: ocelot: avoid overflowing the PTP timestamp FIFO
PTP packets with 2-step TX timestamp requests are matched to packets
based on the egress port number and a 6-bit timestamp identifier.
All PTP timestamps are held in a common FIFO that is 128 entry deep.
This patch ensures that back-to-back timestamping requests cannot exceed
the hardware FIFO capacity. If that happens, simply send the packets
without requesting a TX timestamp to be taken (in the case of felix,
since the DSA API has a void return code in ds->ops->port_txtstamp) or
drop them (in the case of ocelot).
I've moved the ts_id_lock from a per-port basis to a per-switch basis,
because we need separate accounting for both numbers of PTP frames in
flight. And since we need locking to inc/dec the per-switch counter,
that also offers protection for the per-port counter and hence there is
no reason to have a per-port counter anymore.
Fixes: 4e3b046 ("net: mscc: PTP Hardware Clock (PHC) support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent c57fe00 commit 52849bc
File tree
4 files changed
+40
-9
lines changed- drivers/net
- dsa/ocelot
- ethernet/mscc
- include/soc/mscc
4 files changed
+40
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1291 | 1291 | | |
1292 | 1292 | | |
1293 | 1293 | | |
1294 | | - | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
1295 | 1298 | | |
| 1299 | + | |
1296 | 1300 | | |
1297 | 1301 | | |
1298 | 1302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
572 | | - | |
573 | | - | |
| 572 | + | |
| 573 | + | |
574 | 574 | | |
575 | 575 | | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
576 | 579 | | |
577 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
578 | 585 | | |
579 | 586 | | |
580 | 587 | | |
581 | 588 | | |
| 589 | + | |
582 | 590 | | |
583 | 591 | | |
584 | 592 | | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
585 | 597 | | |
586 | 598 | | |
587 | | - | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
588 | 602 | | |
589 | 603 | | |
590 | 604 | | |
| |||
633 | 647 | | |
634 | 648 | | |
635 | 649 | | |
| 650 | + | |
636 | 651 | | |
637 | 652 | | |
638 | 653 | | |
| |||
650 | 665 | | |
651 | 666 | | |
652 | 667 | | |
653 | | - | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
654 | 672 | | |
655 | 673 | | |
656 | 674 | | |
| |||
709 | 727 | | |
710 | 728 | | |
711 | 729 | | |
712 | | - | |
713 | 730 | | |
714 | 731 | | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
715 | 738 | | |
716 | 739 | | |
717 | 740 | | |
| |||
1950 | 1973 | | |
1951 | 1974 | | |
1952 | 1975 | | |
1953 | | - | |
1954 | 1976 | | |
1955 | 1977 | | |
1956 | 1978 | | |
| |||
2083 | 2105 | | |
2084 | 2106 | | |
2085 | 2107 | | |
| 2108 | + | |
2086 | 2109 | | |
2087 | 2110 | | |
2088 | 2111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
603 | 603 | | |
604 | 604 | | |
605 | 605 | | |
| 606 | + | |
606 | 607 | | |
607 | 608 | | |
608 | 609 | | |
609 | | - | |
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| |||
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
683 | 686 | | |
684 | 687 | | |
685 | 688 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
0 commit comments