Skip to content

Commit b219260

Browse files
grumvalskirfuchs
authored andcommitted
MT#55283 kernel-module: zero skb->tstamp before forwarding to fix fq horizon drop
Change-Id: Ie8f976373993b1ea07f568bbfa59d646dcbb3ae6 (cherry picked from commit 8aa1708)
1 parent 6e31a0a commit b219260

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

kernel-module/xt_RTPENGINE.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4953,6 +4953,14 @@ static int send_proxy_packet4(struct sk_buff *skb, struct re_address *src, struc
49534953
* throttle code path which can tail-call into TC_ACT_SHOT when the
49544954
* aggregate slot is uninitialised. */
49554955
skb->queue_mapping = 0;
4956+
/* Zero skb->tstamp: skb_copy_expand() preserves the receive timestamp
4957+
* (a REALTIME ktime ~1.77e18 ns, i.e. Unix epoch). The fq qdisc
4958+
* compares skb->tstamp against the monotonic clock (seconds since boot)
4959+
* without checking tstamp_type; a REALTIME timestamp is billions of
4960+
* nanoseconds ahead of monotonic_now and exceeds the 2-second horizon,
4961+
* causing fq_packet_beyond_horizon() to silently drop every packet.
4962+
* Clearing tstamp tells fq to transmit immediately. */
4963+
skb->tstamp = 0;
49564964
ip_local_out(net, skb->sk, skb);
49574965

49584966
return 0;
@@ -5048,9 +5056,10 @@ static int send_proxy_packet6(struct sk_buff *skb, struct re_address *src, struc
50485056
skb->ip_summed = CHECKSUM_COMPLETE;
50495057
}
50505058

5051-
/* Same reasoning as send_proxy_packet4: zero queue_mapping before
5052-
* handing the packet to the egress TC BPF program. */
5059+
/* Same reasoning as send_proxy_packet4: clear the inherited REALTIME
5060+
* receive timestamp to prevent fq horizon drops. */
50535061
skb->queue_mapping = 0;
5062+
skb->tstamp = 0;
50545063
ip6_local_out(net, skb->sk, skb);
50555064

50565065
return 0;

0 commit comments

Comments
 (0)