Skip to contentSkip to conversation

tcp: fix comment for tp->highest_sack

PATCH Applied Neal Cardwell 4 participants 4 messages Feb 27, 2012 – Feb 28, 2012

Subsystems (3)
lore
Share & tools
lore

Neal Cardwell

author maintainer
#0 lore raw

PATCH 1/1 tcp: fix comment for tp->highest_sack

There was an off-by-one error in the comments describing the highest_sack field in struct tcp_sock. The comments previously claimed that it was the "start sequence of the highest skb with SACKed bit". This commit fixes the comments to note that it is the "start sequence of the skb just *after* the highest skb with SACKed bit".

---
 include/linux/tcp.h |    3 ++-
 include/net/tcp.h   |    5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)
include/linux/tcp.h +2 -1
index 46a85c9..3c7ffdb 100644
@@ -412,7 +412,8 @@ struct tcp_sock {
 
 	struct tcp_sack_block recv_sack_cache[4];
 
-	struct sk_buff *highest_sack;   /* highest skb with SACK received
+	struct sk_buff *highest_sack;   /* skb just after the highest
+					 * skb with SACKed bit set
 					 * (validity guaranteed only if
 					 * sacked_out > 0)
 					 */
include/net/tcp.h +3 -2
index 42c29bf..2d80c29 100644
@@ -1364,8 +1364,9 @@ static inline void tcp_push_pending_frames(struct sock *sk)
 	}
 }
 
-/* Start sequence of the highest skb with SACKed bit, valid only if
- * sacked > 0 or when the caller has ensured validity by itself.
+/* Start sequence of the skb just after the highest skb with SACKed
+ * bit, valid only if sacked_out > 0 or when the caller has ensured
+ * validity by itself.
  */
 static inline u32 tcp_highest_sack_seq(struct tcp_sock *tp)
 {
Signature · 1 line
1.7.7.3
maintainer Applied
#1 lore raw

From: Neal Cardwell <[email protected]>
Date: Mon, 27 Feb 2012 17:51:10 -0500

Quoted 7 lines

There was an off-by-one error in the comments describing the highest_sack field in struct tcp_sock. The comments previously claimed that it was the "start sequence of the highest skb with SACKed bit". This commit fixes the comments to note that it is the "start sequence of the skb just *after* the highest skb with SACKed bit".

Applied, thanks Neal.

Acked-by on v1 1/1
#2 lore raw
In reply to Neal Cardwell
Quoted 32 lines · Neal Cardwell

There was an off-by-one error in the comments describing the highest_sack field in struct tcp_sock. The comments previously claimed that it was the "start sequence of the highest skb with SACKed bit". This commit fixes the comments to note that it is the "start sequence of the skb just *after* the highest skb with SACKed bit".

---
 include/linux/tcp.h |    3 ++-
 include/net/tcp.h   |    5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)
include/linux/tcp.h +2 -1
index 46a85c9..3c7ffdb 100644
@@ -412,7 +412,8 @@ struct tcp_sock {
 
 	struct tcp_sack_block recv_sack_cache[4];
 
-	struct sk_buff *highest_sack;   /* highest skb with SACK received
+	struct sk_buff *highest_sack;   /* skb just after the highest
+					 * skb with SACKed bit set
 					 * (validity guaranteed only if
 					 * sacked_out > 0)
 					 */
include/net/tcp.h +0 -0
index 42c29bf..2d80c29 100644
@@ -1364,8 +1364,9 @@ static inline void tcp_push_pending_frames(struct sock *sk)
 	}

include/net/tcp.h static inline void tcp_push_pending_frames(struct sock *sk) · line 1372

Quoted 10 lines
include/net/tcp.h +3 -2
 }
 
-/* Start sequence of the highest skb with SACKed bit, valid only if
- * sacked > 0 or when the caller has ensured validity by itself.
+/* Start sequence of the skb just after the highest skb with SACKed
+ * bit, valid only if sacked_out > 0 or when the caller has ensured
+ * validity by itself.
  */
 static inline u32 tcp_highest_sack_seq(struct tcp_sock *tp)
 {

Right, commenting code in the first place is evil as we see. ...I remember changing this at some point, perhaps already before the submission but never managed to detect the errors in those non-compile tested comments. :-)

Signature · 1 line
 i.
Acked-by on v1 1/1
#3 lore raw
In reply to Neal Cardwell
Quoted 43 lines · Neal Cardwell

There was an off-by-one error in the comments describing the highest_sack field in struct tcp_sock. The comments previously claimed that it was the "start sequence of the highest skb with SACKed bit". This commit fixes the comments to note that it is the "start sequence of the skb just *after* the highest skb with SACKed bit".

---
 include/linux/tcp.h |    3 ++-
 include/net/tcp.h   |    5 +++--

 2 files changed, 5 insertions(+), 3 deletions(-)
include/linux/tcp.h +2 -1
index 46a85c9..3c7ffdb 100644
@@ -412,7 +412,8 @@ struct tcp_sock {
 
        struct tcp_sack_block recv_sack_cache[4];
 
-       struct sk_buff *highest_sack;   /* highest skb with SACK received
+       struct sk_buff *highest_sack;   /* skb just after the highest
+                                        * skb with SACKed bit set
                                         * (validity guaranteed only if
                                         * sacked_out > 0)
                                         */
include/net/tcp.h +3 -3
index 42c29bf..2d80c29 100644
@@ -1364,8 +1364,9 @@ static inline void tcp_push_pending_frames(struct sock *sk)
        }
  }
 
-/* Start sequence of the highest skb with SACKed bit, valid only if
- * sacked > 0 or when the caller has ensured validity by itself.
+/* Start sequence of the skb just after the highest skb with SACKed
+ * bit, valid only if sacked_out > 0 or when the caller has ensured
+ * validity by itself.
  */
  static inline u32 tcp_highest_sack_seq(struct tcp_sock *tp)
  {
--
Quoted 2 lines

1.7.7.3

AFAICT, highest_sack_* in Linux are essentially SND.FACK? if so it would be nice to add that in the comment too.