Skip to contentSkip to conversation

tcp: Fix SOF_TIMESTAMPING_RX_HARDWARE to use the latest timestamp during TCP coalescing

PATCH In review Stephen Mallon 2 participants 2 messages Nov 20, 2018 – Nov 21, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: Fix SOF_TIMESTAMPING_RX_HARDWARE to use the latest timestamp during TCP coalescing

During tcp coalescing ensure that the skb hardware timestamp refers to the highest sequence number data.
Previously only the software timestamp was updated during coalescing.

---
 net/ipv4/tcp_input.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp_input.c +1 -0
index 2868ef28ce52..e695584bb33f 100644
@@ -4363,6 +4363,7 @@ static bool tcp_try_coalesce(struct sock *sk,
 	if (TCP_SKB_CB(from)->has_rxtstamp) {
 		TCP_SKB_CB(to)->has_rxtstamp = true;
 		to->tstamp = from->tstamp;
+		skb_hwtstamps(to)->hwtstamp = skb_hwtstamps(from)->hwtstamp;
 	}
 
 	return true;
Signature · 1 line
2.18.1
#1 lore raw
Quoted 15 lines · Stephen Mallon

During tcp coalescing ensure that the skb hardware timestamp refers to the highest sequence number data.
Previously only the software timestamp was updated during coalescing.

---
 net/ipv4/tcp_input.c | 1 +
 1 file changed, 1 insertion(+)
net/ipv4/tcp_input.c +0 -0
index 2868ef28ce52..e695584bb33f 100644

net/ipv4/tcp_input.c static bool tcp_try_coalesce(struct sock *sk, · line 4369

Quoted 7 lines
net/ipv4/tcp_input.c +1 -0
@@ -4363,6 +4363,7 @@ static bool tcp_try_coalesce(struct sock *sk,
 	if (TCP_SKB_CB(from)->has_rxtstamp) {
 		TCP_SKB_CB(to)->has_rxtstamp = true;
 		to->tstamp = from->tstamp;
+		skb_hwtstamps(to)->hwtstamp = skb_hwtstamps(from)->hwtstamp;
 	}
 
 	return true;

SGTM, thanks !