ipv4: Fix updating SOF_TIMESTAMPING_OPT_ID when SKBTX_HW_TSTAMP is enabled
Subsystems (3)
PATCH 1/1 ipv4: Fix updating SOF_TIMESTAMPING_OPT_ID when SKBTX_HW_TSTAMP is enabled
Ensure that the unique timestamp identifier is incremented for skb hardware timestamps, not just software timestamps.
--- net/ipv4/ip_output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/ip_output.c +1 -1
@@ -891,7 +891,7 @@ static int __ip_append_data(struct sock *sk, mtu = cork->gso_size ?IP_MAX_MTU : cork->fragsize; paged = !!cork->gso_size; -if (cork->tx_flags &SKBTX_ANY_SW_TSTAMP && +if (cork->tx_flags &SKBTX_ANY_TSTAMP && sk->sk_tsflags &SOF_TIMESTAMPING_OPT_ID ) tskey = sk->sk_tskey++;
Signature · 1 line
2.18.1
Quoted 2 lines · Stephen Mallon
Ensure that the unique timestamp identifier is incremented for skb hardware timestamps, not just software timestamps.
Thanks for fixing this. It has been at the back of my mind for a long time, but since I don't use this feature... oh well.
This patch would be a candidate for stable kernels. Can you please add a Fixes: tag?
Thanks,
Richard
Quoted 10 lines · Richard Cochran
Quoted 2 lines · Stephen Mallon
Ensure that the unique timestamp identifier is incremented for skb hardware timestamps, not just software timestamps.
Thanks for fixing this. It has been at the back of my mind for a long time, but since I don't use this feature... oh well.
This patch would be a candidate for stable kernels. Can you please add a Fixes: tag?
It is debatable whether this is a fix or a new feature. It extends SOF_TIMESTAMPING_OPT_ID to hardware timestamps. I don't think this would be a stable candidate.
More importantly, note that __ip6_append_data has similar logic. For consistency the two should be updated at the same time.
Quoted 3 lines · Willem de Bruijn
It is debatable whether this is a fix or a new feature. It extends
SOF_TIMESTAMPING_OPT_IDto hardware timestamps. I don't think this would be a stable candidate.
Was the original series advertised as SW timestamping only?
If so, I missed that at the time. After seeing it not work, I meant to fix it, but never got around to it. So to me this is a known issue.
Quoted 2 lines
More importantly, note that
__ip6_append_datahas similar logic. For consistency the two should be updated at the same time.
+1
Thanks,
Richard
Quoted 7 lines · Richard Cochran
Quoted 3 lines · Willem de Bruijn
It is debatable whether this is a fix or a new feature. It extends
SOF_TIMESTAMPING_OPT_IDto hardware timestamps. I don't think this would be a stable candidate.Was the original series advertised as SW timestamping only?
I did not intend to cover hardware timestamps at the time.
Quoted 3 lines
If so, I missed that at the time. After seeing it not work, I meant to fix it, but never got around to it. So to me this is a known issue.
Understood. I certainly understand that view. I never use hw timestamps, so it is a bit of a blind spot for me. If this is a safe and predictable change, I don't care strongly about net vs net-next. I don't think it meets the bar for stable, but that is not my call.
Quoted 7 lines
Quoted 2 lines
More importantly, note that
__ip6_append_datahas similar logic. For consistency the two should be updated at the same time.+1
Thanks,
Richard
Quoted 12 lines · Willem de Bruijn
Quoted 7 lines · Richard Cochran
Quoted 3 lines · Willem de Bruijn
It is debatable whether this is a fix or a new feature. It extends
SOF_TIMESTAMPING_OPT_IDto hardware timestamps. I don't think this would be a stable candidate.Was the original series advertised as SW timestamping only?
I did not intend to cover hardware timestamps at the time.
Quoted 8 lines
Quoted 3 lines
If so, I missed that at the time. After seeing it not work, I meant to fix it, but never got around to it. So to me this is a known issue.
Understood. I certainly understand that view. I never use hw timestamps, so it is a bit of a blind spot for me. If this is a safe and predictable change, I don't care strongly about net vs net-next. I don't think it meets the bar for stable, but that is not my call.
I've found that SOF_TIMESTAMPING_OPT_ID already works with hardware timestamps for TCP just not datagram sockets and so I though this was a fix.
Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
More importantly, note that
__ip6_append_datahas similar logic. For consistency the two should be updated at the same time.+1
Thanks,
Richard
Thanks for the feedback, I'll update with __ip6_append_data.
Quoted 3 lines · Stephen Mallon
I've found that
SOF_TIMESTAMPING_OPT_IDalready works with hardware timestamps for TCP just not datagram sockets and so I though this was a fix.
Right, so if HW time stamping worked for TCP but not for UDP, then I would call it a regression to be fixed in stable.
Thanks,
Richard