Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jul 2009 18:25:51 +0000 (UTC)
From:      Lawrence Stewart <lstewart@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r195826 - projects/tcp_ffcaia2008_8.x/sys/netinet
Message-ID:  <200907221825.n6MIPpGT048740@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: lstewart
Date: Wed Jul 22 18:25:51 2009
New Revision: 195826
URL: http://svn.freebsd.org/changeset/base/195826

Log:
  Fold struct sackhint into struct tcpcb. Having the details in a separate struct
  provided no real benefit, and we now have a simplified ABI with respect to
  struct tcpcb.
  
  Sponsored by:	FreeBSD Foundation

Modified:
  projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_input.c
  projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_output.c
  projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_sack.c
  projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_usrreq.c
  projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_var.h

Modified: projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_input.c
==============================================================================
--- projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_input.c	Wed Jul 22 18:10:44 2009	(r195825)
+++ projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_input.c	Wed Jul 22 18:25:51 2009	(r195826)
@@ -2078,7 +2078,7 @@ tcp_do_segment(struct mbuf *m, struct tc
 						 * worth of data in flight.
 						 */
 						awnd = (tp->snd_nxt - tp->snd_fack) +
-							tp->sackhint.sack_bytes_rexmit;
+							tp->sack_bytes_rexmit;
 						if (awnd < tp->snd_ssthresh) {
 							tp->snd_cwnd += tp->t_maxseg;
 							if (tp->snd_cwnd > tp->snd_ssthresh)

Modified: projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_output.c
==============================================================================
--- projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_output.c	Wed Jul 22 18:10:44 2009	(r195825)
+++ projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_output.c	Wed Jul 22 18:25:51 2009	(r195826)
@@ -953,7 +953,7 @@ send:
 	} else {
 		th->th_seq = htonl(p->rxmit);
 		p->rxmit += len;
-		tp->sackhint.sack_bytes_rexmit += len;
+		tp->sack_bytes_rexmit += len;
 	}
 	th->th_ack = htonl(tp->rcv_nxt);
 	if (optlen) {
@@ -1209,9 +1209,9 @@ timer:
 		    (error != EPERM)) {
 			if (sack_rxmit) {
 				p->rxmit -= len;
-				tp->sackhint.sack_bytes_rexmit -= len;
-				KASSERT(tp->sackhint.sack_bytes_rexmit >= 0,
-				    ("sackhint bytes rtx >= 0"));
+				tp->sack_bytes_rexmit -= len;
+				KASSERT(tp->sack_bytes_rexmit >= 0,
+				    ("sack bytes rtx >= 0"));
 			} else
 				tp->snd_nxt -= len;
 		}

Modified: projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_sack.c
==============================================================================
--- projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_sack.c	Wed Jul 22 18:10:44 2009	(r195825)
+++ projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_sack.c	Wed Jul 22 18:25:51 2009	(r195826)
@@ -317,8 +317,8 @@ tcp_sackhole_insert(struct tcpcb *tp, tc
 		TAILQ_INSERT_TAIL(&tp->snd_holes, hole, scblink);
 
 	/* Update SACK hint. */
-	if (tp->sackhint.nexthole == NULL)
-		tp->sackhint.nexthole = hole;
+	if (tp->sack_nexthole == NULL)
+		tp->sack_nexthole = hole;
 
 	return hole;
 }
@@ -331,8 +331,8 @@ tcp_sackhole_remove(struct tcpcb *tp, st
 {
 
 	/* Update SACK hint. */
-	if (tp->sackhint.nexthole == hole)
-		tp->sackhint.nexthole = TAILQ_NEXT(hole, scblink);
+	if (tp->sack_nexthole == hole)
+		tp->sack_nexthole = TAILQ_NEXT(hole, scblink);
 
 	/* Remove this SACK hole. */
 	TAILQ_REMOVE(&tp->snd_holes, hole, scblink);
@@ -482,9 +482,9 @@ tcp_sack_doack(struct tcpcb *tp, struct 
 			cur = TAILQ_PREV(cur, sackhole_head, scblink);
 			continue;
 		}
-		tp->sackhint.sack_bytes_rexmit -= (cur->rxmit - cur->start);
-		KASSERT(tp->sackhint.sack_bytes_rexmit >= 0,
-		    ("sackhint bytes rtx >= 0"));
+		tp->sack_bytes_rexmit -= (cur->rxmit - cur->start);
+		KASSERT(tp->sack_bytes_rexmit >= 0,
+		    ("sack bytes rtx >= 0"));
 		if (SEQ_LEQ(sblkp->start, cur->start)) {
 			/* Data acks at least the beginning of hole. */
 			if (SEQ_GEQ(sblkp->end, cur->end)) {
@@ -519,7 +519,7 @@ tcp_sack_doack(struct tcpcb *tp, struct 
 				if (temp != NULL) {
 					if (SEQ_GT(cur->rxmit, temp->rxmit)) {
 						temp->rxmit = cur->rxmit;
-						tp->sackhint.sack_bytes_rexmit
+						tp->sack_bytes_rexmit
 						    += (temp->rxmit
 						    - temp->start);
 					}
@@ -529,7 +529,7 @@ tcp_sack_doack(struct tcpcb *tp, struct 
 				}
 			}
 		}
-		tp->sackhint.sack_bytes_rexmit += (cur->rxmit - cur->start);
+		tp->sack_bytes_rexmit += (cur->rxmit - cur->start);
 		/*
 		 * Testing sblkp->start against cur->start tells us whether
 		 * we're done with the sack block or the sack hole.
@@ -553,11 +553,11 @@ tcp_free_sackholes(struct tcpcb *tp)
 	INP_WLOCK_ASSERT(tp->t_inpcb);
 	while ((q = TAILQ_FIRST(&tp->snd_holes)) != NULL)
 		tcp_sackhole_remove(tp, q);
-	tp->sackhint.sack_bytes_rexmit = 0;
+	tp->sack_bytes_rexmit = 0;
 
 	KASSERT(tp->snd_numholes == 0, ("tp->snd_numholes == 0"));
-	KASSERT(tp->sackhint.nexthole == NULL,
-		("tp->sackhint.nexthole == NULL"));
+	KASSERT(tp->sack_nexthole == NULL,
+		("tp->sack_nexthole == NULL"));
 }
 
 /*
@@ -579,7 +579,7 @@ tcp_sack_partialack(struct tcpcb *tp, st
 	/* Send one or 2 segments based on how much new data was acked. */
 	if (((th->th_ack - tp->snd_una) / tp->t_maxseg) > 2)
 		num_segs = 2;
-	tp->snd_cwnd = (tp->sackhint.sack_bytes_rexmit +
+	tp->snd_cwnd = (tp->sack_bytes_rexmit +
 	    (tp->snd_nxt - tp->sack_newdata) + num_segs * tp->t_maxseg);
 	if (tp->snd_cwnd > tp->snd_ssthresh)
 		tp->snd_cwnd = tp->snd_ssthresh;
@@ -636,13 +636,13 @@ tcp_sack_output(struct tcpcb *tp, int *s
 	struct sackhole *hole = NULL;
 
 	INP_WLOCK_ASSERT(tp->t_inpcb);
-	*sack_bytes_rexmt = tp->sackhint.sack_bytes_rexmit;
-	hole = tp->sackhint.nexthole;
+	*sack_bytes_rexmt = tp->sack_bytes_rexmit;
+	hole = tp->sack_nexthole;
 	if (hole == NULL || SEQ_LT(hole->rxmit, hole->end))
 		goto out;
 	while ((hole = TAILQ_NEXT(hole, scblink)) != NULL) {
 		if (SEQ_LT(hole->rxmit, hole->end)) {
-			tp->sackhint.nexthole = hole;
+			tp->sack_nexthole = hole;
 			break;
 		}
 	}

Modified: projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_usrreq.c
==============================================================================
--- projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_usrreq.c	Wed Jul 22 18:10:44 2009	(r195825)
+++ projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_usrreq.c	Wed Jul 22 18:25:51 2009	(r195826)
@@ -1853,7 +1853,7 @@ db_print_tcpcb(struct tcpcb *tp, const c
 	db_printf("snd_fack: 0x%08x   rcv_numsacks: %d   sack_newdata: "
 	    "0x%08x\n", tp->snd_fack, tp->rcv_numsacks, tp->sack_newdata);
 
-	/* Skip sackblks, sackhint. */
+	/* Skip sackblks. */
 
 	db_print_indent(indent);
 	db_printf("t_rttlow: %d   rfbuf_ts: %u   rfbuf_cnt: %d\n",

Modified: projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_var.h
==============================================================================
--- projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_var.h	Wed Jul 22 18:10:44 2009	(r195825)
+++ projects/tcp_ffcaia2008_8.x/sys/netinet/tcp_var.h	Wed Jul 22 18:25:51 2009	(r195826)
@@ -71,14 +71,6 @@ struct sackhole {
 	TAILQ_ENTRY(sackhole) scblink;	/* scoreboard linkage */
 };
 
-struct sackhint {
-	struct sackhole	*nexthole;
-	int		sack_bytes_rexmit;
-
-	int		ispare;		/* explicit pad for 64bit alignment */
-	uint64_t	_pad[2];	/* 1 sacked_bytes, 1 TBD */
-};
-
 struct tcptemp {
 	u_char	tt_ipgen[40]; /* the size must be of max ip header, now IPv6 */
 	struct	tcphdr tt_t;
@@ -192,7 +184,8 @@ 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 */
+	struct sackhole	*sack_nexthole;	/* next hole to rexmt */
+	int	sack_bytes_rexmit;	/* # bytes rexmt this RTT */
 	int	t_rttlow;		/* smallest observerved RTT */
 	u_int32_t	rfbuf_ts;	/* recv buffer autoscaling timestamp */
 	int	rfbuf_cnt;		/* recv buffer autoscaling byte count */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907221825.n6MIPpGT048740>