Remove 2 (SACK) fields from the tcpcb. These are only used by a
function that is called from tcp_input(), so they oughta be passed on the stack instead of stuck in the tcpcb. Submitted by: Mohan Srinivasan
This commit is contained in:
parent
348c9a5668
commit
7643c37cf2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=142031
@ -2295,11 +2295,8 @@ tcp_input(m, off0)
|
||||
thflags = tcp_reass(tp, th, &tlen, m);
|
||||
tp->t_flags |= TF_ACKNOW;
|
||||
}
|
||||
if (tp->sack_enable) {
|
||||
tp->rcv_laststart = th->th_seq; /* last recv'd segment*/
|
||||
tp->rcv_lastend = th->th_seq + tlen;
|
||||
tcp_update_sack_list(tp);
|
||||
}
|
||||
if (tp->sack_enable)
|
||||
tcp_update_sack_list(tp, th->th_seq, th->th_seq + tlen);
|
||||
/*
|
||||
* Note the amount of data that peer has sent into
|
||||
* our window, in order to estimate the sender's
|
||||
|
@ -2295,11 +2295,8 @@ tcp_input(m, off0)
|
||||
thflags = tcp_reass(tp, th, &tlen, m);
|
||||
tp->t_flags |= TF_ACKNOW;
|
||||
}
|
||||
if (tp->sack_enable) {
|
||||
tp->rcv_laststart = th->th_seq; /* last recv'd segment*/
|
||||
tp->rcv_lastend = th->th_seq + tlen;
|
||||
tcp_update_sack_list(tp);
|
||||
}
|
||||
if (tp->sack_enable)
|
||||
tcp_update_sack_list(tp, th->th_seq, th->th_seq + tlen);
|
||||
/*
|
||||
* Note the amount of data that peer has sent into
|
||||
* our window, in order to estimate the sender's
|
||||
|
@ -175,8 +175,9 @@ TUNABLE_INT("net.inet.tcp.sack.enable", &tcp_do_sack);
|
||||
* prediction mode), and it updates the ordered list of sacks.
|
||||
*/
|
||||
void
|
||||
tcp_update_sack_list(tp)
|
||||
tcp_update_sack_list(tp, rcv_laststart, rcv_lastend)
|
||||
struct tcpcb *tp;
|
||||
tcp_seq rcv_laststart, rcv_lastend;
|
||||
{
|
||||
/*
|
||||
* First reported block MUST be the most recent one. Subsequent
|
||||
@ -206,10 +207,10 @@ tcp_update_sack_list(tp)
|
||||
tp->rcv_numsacks -= count;
|
||||
if (tp->rcv_numsacks == 0) { /* no sack blocks currently (fast path) */
|
||||
tcp_clean_sackreport(tp);
|
||||
if (SEQ_LT(tp->rcv_nxt, tp->rcv_laststart)) {
|
||||
if (SEQ_LT(tp->rcv_nxt, rcv_laststart)) {
|
||||
/* ==> need first sack block */
|
||||
tp->sackblks[0].start = tp->rcv_laststart;
|
||||
tp->sackblks[0].end = tp->rcv_lastend;
|
||||
tp->sackblks[0].start = rcv_laststart;
|
||||
tp->sackblks[0].end = rcv_lastend;
|
||||
tp->rcv_numsacks = 1;
|
||||
}
|
||||
return;
|
||||
@ -217,14 +218,14 @@ tcp_update_sack_list(tp)
|
||||
/* Otherwise, sack blocks are already present. */
|
||||
for (i = 0; i < tp->rcv_numsacks; i++)
|
||||
tp->sackblks[i] = temp[i]; /* first copy back sack list */
|
||||
if (SEQ_GEQ(tp->rcv_nxt, tp->rcv_lastend))
|
||||
if (SEQ_GEQ(tp->rcv_nxt, rcv_lastend))
|
||||
return; /* sack list remains unchanged */
|
||||
/*
|
||||
* From here, segment just received should be (part of) the 1st sack.
|
||||
* Go through list, possibly coalescing sack block entries.
|
||||
*/
|
||||
firstsack.start = tp->rcv_laststart;
|
||||
firstsack.end = tp->rcv_lastend;
|
||||
firstsack.start = rcv_laststart;
|
||||
firstsack.end = rcv_lastend;
|
||||
for (i = 0; i < tp->rcv_numsacks; i++) {
|
||||
sack = tp->sackblks[i];
|
||||
if (SEQ_LT(sack.end, firstsack.start) ||
|
||||
|
@ -187,8 +187,6 @@ struct tcpcb {
|
||||
int sack_enable; /* enable SACK for this connection */
|
||||
int snd_numholes; /* number of holes seen by sender */
|
||||
struct sackhole *snd_holes; /* linked list of holes (sorted) */
|
||||
tcp_seq rcv_laststart; /* start of last segment recd. */
|
||||
tcp_seq rcv_lastend; /* end of ... */
|
||||
tcp_seq rcv_lastsack; /* last seq number(+1) sack'd by rcv'r*/
|
||||
int rcv_numsacks; /* # distinct sack blks present */
|
||||
struct sackblk sackblks[MAX_SACK_BLKS]; /* seq nos. of sack blocks */
|
||||
@ -575,7 +573,7 @@ extern u_long tcp_recvspace;
|
||||
tcp_seq tcp_new_isn(struct tcpcb *);
|
||||
|
||||
int tcp_sack_option(struct tcpcb *,struct tcphdr *,u_char *,int);
|
||||
void tcp_update_sack_list(struct tcpcb *tp);
|
||||
void tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_laststart, tcp_seq rcv_lastend);
|
||||
void tcp_del_sackholes(struct tcpcb *, struct tcphdr *);
|
||||
void tcp_clean_sackreport(struct tcpcb *tp);
|
||||
void tcp_sack_adjust(struct tcpcb *tp);
|
||||
|
Loading…
Reference in New Issue
Block a user