Commit 7822dd4
igc: Fix HW RX timestamp when passed by ZC XDP
Fixes HW RX timestamp in the following scenario:
- AF_PACKET socket with enabled HW RX timestamps is created
- AF_XDP socket with enabled zero copy is created
- frame is forwarded to the BPF program, where the timestamp should
still be readable (extracted by igc_xdp_rx_timestamp(), kfunc
behind bpf_xdp_metadata_rx_timestamp())
- the frame got XDP_PASS from BPF program, redirecting to the stack
- AF_PACKET socket receives the frame with HW RX timestamp
Moves the skb timestamp setting from igc_dispatch_skb_zc() to
igc_construct_skb_zc() so that igc_construct_skb_zc() is similar to
igc_construct_skb().
This issue can also be reproduced by running:
# tools/testing/selftests/bpf/xdp_hw_metadata enp1s0
When a frame with the wrong port 9092 (instead of 9091) is used:
# echo -n xdp | nc -u -q1 192.168.10.9 9092
then the RX timestamp is missing and xdp_hw_metadata prints:
skb hwtstamp is not found!
With this fix or when copy mode is used:
# tools/testing/selftests/bpf/xdp_hw_metadata -c enp1s0
then RX timestamp is found and xdp_hw_metadata prints:
found skb hwtstamp = 1736509937.852786132
Fixes: 069b142 ("igc: Add support for PTP .getcyclesx64()")
Signed-off-by: Zdenek Bouska <zdenek.bouska@siemens.com>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Florian Bezdeka <florian.bezdeka@siemens.com>
Reviewed-by: Song Yoong Siang <yoong.siang.song@intel.com>
Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>1 parent 61fb097 commit 7822dd4
1 file changed
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2701 | 2701 | | |
2702 | 2702 | | |
2703 | 2703 | | |
2704 | | - | |
| 2704 | + | |
2705 | 2705 | | |
| 2706 | + | |
2706 | 2707 | | |
2707 | 2708 | | |
2708 | 2709 | | |
| |||
2721 | 2722 | | |
2722 | 2723 | | |
2723 | 2724 | | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
2724 | 2730 | | |
2725 | 2731 | | |
2726 | 2732 | | |
2727 | 2733 | | |
2728 | 2734 | | |
2729 | | - | |
2730 | | - | |
| 2735 | + | |
2731 | 2736 | | |
2732 | 2737 | | |
2733 | 2738 | | |
2734 | 2739 | | |
2735 | | - | |
| 2740 | + | |
2736 | 2741 | | |
2737 | 2742 | | |
2738 | 2743 | | |
2739 | 2744 | | |
2740 | 2745 | | |
2741 | 2746 | | |
2742 | | - | |
2743 | | - | |
2744 | | - | |
2745 | 2747 | | |
2746 | 2748 | | |
2747 | 2749 | | |
| |||
2777 | 2779 | | |
2778 | 2780 | | |
2779 | 2781 | | |
2780 | | - | |
2781 | 2782 | | |
2782 | 2783 | | |
2783 | 2784 | | |
| |||
2807 | 2808 | | |
2808 | 2809 | | |
2809 | 2810 | | |
| 2811 | + | |
| 2812 | + | |
2810 | 2813 | | |
2811 | 2814 | | |
2812 | 2815 | | |
| |||
2815 | 2818 | | |
2816 | 2819 | | |
2817 | 2820 | | |
2818 | | - | |
| 2821 | + | |
2819 | 2822 | | |
2820 | 2823 | | |
2821 | 2824 | | |
| |||
0 commit comments