Skip to content

Commit 57c0a80

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 e3ae44a commit 57c0a80

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

kernel-module/nft_rtpengine.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5024,6 +5024,14 @@ static int send_proxy_packet4(struct sk_buff *skb, const struct re_address *src,
50245024
* throttle code path which can tail-call into TC_ACT_SHOT when the
50255025
* aggregate slot is uninitialised. */
50265026
skb->queue_mapping = 0;
5027+
/* Zero skb->tstamp: skb_copy_expand() preserves the receive timestamp
5028+
* (a REALTIME ktime ~1.77e18 ns, i.e. Unix epoch). The fq qdisc
5029+
* compares skb->tstamp against the monotonic clock (seconds since boot)
5030+
* without checking tstamp_type; a REALTIME timestamp is billions of
5031+
* nanoseconds ahead of monotonic_now and exceeds the 2-second horizon,
5032+
* causing fq_packet_beyond_horizon() to silently drop every packet.
5033+
* Clearing tstamp tells fq to transmit immediately. */
5034+
skb->tstamp = 0;
50275035
ip_local_out(net, skb->sk, skb);
50285036

50295037
return 0;
@@ -5114,9 +5122,10 @@ static int send_proxy_packet6(struct sk_buff *skb, const struct re_address *src,
51145122
skb->ip_summed = CHECKSUM_COMPLETE;
51155123
}
51165124

5117-
/* Same reasoning as send_proxy_packet4: zero queue_mapping before
5118-
* handing the packet to the egress TC BPF program. */
5125+
/* Same reasoning as send_proxy_packet4: clear the inherited REALTIME
5126+
* receive timestamp to prevent fq horizon drops. */
51195127
skb->queue_mapping = 0;
5128+
skb->tstamp = 0;
51205129
ip6_local_out(net, skb->sk, skb);
51215130

51225131
return 0;

0 commit comments

Comments
 (0)