summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_var.h
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2005-05-11 21:37:42 +0000
committerps <ps@FreeBSD.org>2005-05-11 21:37:42 +0000
commit0ee231720168f91505019116179aa59a3f939618 (patch)
tree136eaa5e8df38eb44a216776b146e7f2be9d17d5 /sys/netinet/tcp_var.h
parentb2be2c6b08ec2d5c2b4b24ddd94f0f026c865ff9 (diff)
downloadFreeBSD-src-0ee231720168f91505019116179aa59a3f939618.zip
FreeBSD-src-0ee231720168f91505019116179aa59a3f939618.tar.gz
When looking for the next hole to retransmit from the scoreboard,
or to compute the total retransmitted bytes in this sack recovery episode, the scoreboard is traversed. While in sack recovery, this traversal occurs on every call to tcp_output(), every dupack and every partial ack. The scoreboard could potentially get quite large, making this traversal expensive. This change optimizes this by storing hints (for the next hole to retransmit and the total retransmitted bytes in this sack recovery episode) reducing the complexity to find these values from O(n) to constant time. The debug code that sanity checks the hints against the computed value will be removed eventually. Submitted by: Mohan Srinivasan, Noritoshi Demizu, Raja Mukerji.
Diffstat (limited to 'sys/netinet/tcp_var.h')
-rw-r--r--sys/netinet/tcp_var.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 84d7150..0d7485f 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -63,6 +63,11 @@ struct sackhole {
TAILQ_ENTRY(sackhole) scblink; /* scoreboard linkage */
};
+struct sackhint {
+ struct sackhole *nexthole;
+ int sack_bytes_rexmit;
+};
+
struct tcptemp {
u_char tt_ipgen[40]; /* the size must be of max ip header, now IPv6 */
struct tcphdr tt_t;
@@ -192,6 +197,7 @@ struct tcpcb {
struct sackblk sackblks[MAX_SACK_BLKS]; /* seq nos. of sack blocks */
tcp_seq sack_newdata; /* New data xmitted in this recovery
episode starts at this seq number */
+ struct sackhint sackhint; /* SACK scoreboard hint */
};
#define IN_FASTRECOVERY(tp) (tp->t_flags & TF_FASTRECOVERY)
@@ -577,7 +583,6 @@ void tcp_del_sackholes(struct tcpcb *, struct tcphdr *);
void tcp_clean_sackreport(struct tcpcb *tp);
void tcp_sack_adjust(struct tcpcb *tp);
struct sackhole *tcp_sack_output(struct tcpcb *tp, int *sack_bytes_rexmt);
-int tcp_sacked_bytes(struct tcpcb *tp, int *lost_not_rexmitted);
void tcp_sack_partialack(struct tcpcb *, struct tcphdr *);
void tcp_free_sackholes(struct tcpcb *tp);
int tcp_newreno(struct tcpcb *, struct tcphdr *);
OpenPOWER on IntegriCloud