Commit eb44128
committed
Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says:
====================
igc: TX timestamping fixes
This is the fixes part of the series intended to add support for using
the 4 timestamp registers present in i225/i226.
Moving the timestamp handling to be inline with the interrupt handling
has the advantage of improving the TX timestamping retrieval latency,
here are some numbers using ntpperf:
Before:
$ sudo ./ntpperf -i enp3s0 -m 10:22:22:22:22:21 -d 192.168.1.3 -s 172.18.0.0/16 -I -H -o -37
| responses | TX timestamp offset (ns)
rate clients | lost invalid basic xleave | min mean max stddev
1000 100 0.00% 0.00% 0.00% 100.00% -56 +9 +52 19
1500 150 0.00% 0.00% 0.00% 100.00% -40 +30 +75 22
2250 225 0.00% 0.00% 0.00% 100.00% -11 +29 +72 15
3375 337 0.00% 0.00% 0.00% 100.00% -18 +40 +88 22
5062 506 0.00% 0.00% 0.00% 100.00% -19 +23 +77 15
7593 759 0.00% 0.00% 0.00% 100.00% +7 +47 +5168 43
11389 1138 0.00% 0.00% 0.00% 100.00% -11 +41 +5240 39
17083 1708 0.00% 0.00% 0.00% 100.00% +19 +60 +5288 50
25624 2562 0.00% 0.00% 0.00% 100.00% +1 +56 +5368 58
38436 3843 0.00% 0.00% 0.00% 100.00% -84 +12 +8847 66
57654 5765 0.00% 0.00% 100.00% 0.00%
86481 8648 0.00% 0.00% 100.00% 0.00%
129721 12972 0.00% 0.00% 100.00% 0.00%
194581 16384 0.00% 0.00% 100.00% 0.00%
291871 16384 27.35% 0.00% 72.65% 0.00%
437806 16384 50.05% 0.00% 49.95% 0.00%
After:
$ sudo ./ntpperf -i enp3s0 -m 10:22:22:22:22:21 -d 192.168.1.3 -s 172.18.0.0/16 -I -H -o -37
| responses | TX timestamp offset (ns)
rate clients | lost invalid basic xleave | min mean max stddev
1000 100 0.00% 0.00% 0.00% 100.00% -44 +0 +61 19
1500 150 0.00% 0.00% 0.00% 100.00% -6 +39 +81 16
2250 225 0.00% 0.00% 0.00% 100.00% -22 +25 +69 15
3375 337 0.00% 0.00% 0.00% 100.00% -28 +15 +56 14
5062 506 0.00% 0.00% 0.00% 100.00% +7 +78 +143 27
7593 759 0.00% 0.00% 0.00% 100.00% -54 +24 +144 47
11389 1138 0.00% 0.00% 0.00% 100.00% -90 -33 +28 21
17083 1708 0.00% 0.00% 0.00% 100.00% -50 -2 +35 14
25624 2562 0.00% 0.00% 0.00% 100.00% -62 +7 +66 23
38436 3843 0.00% 0.00% 0.00% 100.00% -33 +30 +5395 36
57654 5765 0.00% 0.00% 100.00% 0.00%
86481 8648 0.00% 0.00% 100.00% 0.00%
129721 12972 0.00% 0.00% 100.00% 0.00%
194581 16384 19.50% 0.00% 80.50% 0.00%
291871 16384 35.81% 0.00% 64.19% 0.00%
437806 16384 55.40% 0.00% 44.60% 0.00%
During this series, and to show that as is always the case, things are
never easy as they should be, a hardware issue was found, and it took
some time to find the workaround(s). The bug and workaround are better
explained in patch 4/4.
Note: the workaround has a simpler alternative, but it would involve
adding support for the other timestamp registers, and only using the
TXSTMP{H/L}_0 as a way to clear the interrupt. But I feel bad about
throwing this kind of resources away. Didn't test this extensively but
it should work.
Also, as Marc Kleine-Budde suggested, after some consensus is reached
on this series, most parts of it will be proposed for igb.
* '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
igc: Work around HW bug causing missing timestamps
igc: Retrieve TX timestamp during interrupt handling
igc: Check if hardware TX timestamping is enabled earlier
igc: Fix race condition in PTP tx code
====================
Link: https://lore.kernel.org/r/20230622165244.2202786-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>3 files changed
Lines changed: 117 additions & 47 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
232 | 235 | | |
233 | 236 | | |
234 | 237 | | |
| |||
401 | 404 | | |
402 | 405 | | |
403 | 406 | | |
404 | | - | |
405 | 407 | | |
406 | 408 | | |
407 | 409 | | |
| |||
578 | 580 | | |
579 | 581 | | |
580 | 582 | | |
| 583 | + | |
581 | 584 | | |
582 | 585 | | |
583 | 586 | | |
| |||
634 | 637 | | |
635 | 638 | | |
636 | 639 | | |
| 640 | + | |
637 | 641 | | |
638 | 642 | | |
639 | 643 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1585 | 1585 | | |
1586 | 1586 | | |
1587 | 1587 | | |
1588 | | - | |
| 1588 | + | |
| 1589 | + | |
1589 | 1590 | | |
1590 | 1591 | | |
1591 | 1592 | | |
1592 | 1593 | | |
1593 | | - | |
1594 | | - | |
1595 | | - | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
1596 | 1598 | | |
1597 | 1599 | | |
1598 | 1600 | | |
| |||
1601 | 1603 | | |
1602 | 1604 | | |
1603 | 1605 | | |
| 1606 | + | |
| 1607 | + | |
1604 | 1608 | | |
1605 | 1609 | | |
1606 | 1610 | | |
| |||
5219 | 5223 | | |
5220 | 5224 | | |
5221 | 5225 | | |
5222 | | - | |
| 5226 | + | |
5223 | 5227 | | |
5224 | 5228 | | |
5225 | 5229 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
539 | 551 | | |
540 | 552 | | |
541 | 553 | | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
542 | 567 | | |
543 | 568 | | |
544 | 569 | | |
545 | 570 | | |
546 | 571 | | |
547 | 572 | | |
548 | 573 | | |
| 574 | + | |
549 | 575 | | |
550 | 576 | | |
551 | 577 | | |
552 | 578 | | |
553 | 579 | | |
554 | 580 | | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
555 | 591 | | |
556 | 592 | | |
557 | 593 | | |
| |||
603 | 639 | | |
604 | 640 | | |
605 | 641 | | |
| 642 | + | |
606 | 643 | | |
607 | 644 | | |
608 | 645 | | |
609 | 646 | | |
610 | 647 | | |
611 | 648 | | |
612 | 649 | | |
613 | | - | |
614 | 650 | | |
615 | 651 | | |
616 | 652 | | |
617 | 653 | | |
618 | 654 | | |
619 | 655 | | |
620 | 656 | | |
621 | | - | |
622 | | - | |
| 657 | + | |
623 | 658 | | |
624 | | - | |
625 | | - | |
| 659 | + | |
626 | 660 | | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
635 | 671 | | |
636 | 672 | | |
637 | 673 | | |
| |||
641 | 677 | | |
642 | 678 | | |
643 | 679 | | |
| 680 | + | |
| 681 | + | |
644 | 682 | | |
645 | 683 | | |
646 | 684 | | |
647 | 685 | | |
648 | 686 | | |
649 | 687 | | |
| 688 | + | |
650 | 689 | | |
651 | 690 | | |
652 | 691 | | |
653 | 692 | | |
654 | 693 | | |
655 | 694 | | |
656 | | - | |
657 | | - | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
658 | 731 | | |
659 | 732 | | |
660 | 733 | | |
| |||
676 | 749 | | |
677 | 750 | | |
678 | 751 | | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | 752 | | |
685 | | - | |
686 | 753 | | |
687 | 754 | | |
688 | 755 | | |
689 | 756 | | |
690 | 757 | | |
691 | 758 | | |
692 | 759 | | |
693 | | - | |
694 | | - | |
| 760 | + | |
| 761 | + | |
695 | 762 | | |
696 | | - | |
697 | | - | |
| 763 | + | |
| 764 | + | |
698 | 765 | | |
699 | | - | |
| 766 | + | |
700 | 767 | | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
| 768 | + | |
705 | 769 | | |
706 | | - | |
707 | | - | |
| 770 | + | |
708 | 771 | | |
709 | | - | |
710 | | - | |
711 | | - | |
| 772 | + | |
| 773 | + | |
712 | 774 | | |
713 | 775 | | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
714 | 779 | | |
715 | 780 | | |
716 | 781 | | |
| |||
959 | 1024 | | |
960 | 1025 | | |
961 | 1026 | | |
| 1027 | + | |
962 | 1028 | | |
963 | | - | |
964 | 1029 | | |
965 | 1030 | | |
966 | 1031 | | |
| |||
1020 | 1085 | | |
1021 | 1086 | | |
1022 | 1087 | | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
| 1088 | + | |
1027 | 1089 | | |
1028 | 1090 | | |
1029 | 1091 | | |
| |||
0 commit comments