svn commit: r203781 - projects/tcp_cc_head/sys/netinet
Lawrence Stewart
lstewart at FreeBSD.org
Thu Feb 11 15:36:39 UTC 2010
Author: lstewart
Date: Thu Feb 11 15:36:39 2010
New Revision: 203781
URL: http://svn.freebsd.org/changeset/base/203781
Log:
- The ertt helper actually needs an input and output path hook point to work
correctly, so update accordingly.
- In order to do enhanced timing correctly, need to track the most recently
SACKed sequence number, by adding a new member to sackhint.
- Expand the context data passed to the helper hooks as required by the ertt
helper.
Modified:
projects/tcp_cc_head/sys/netinet/tcp_input.c
projects/tcp_cc_head/sys/netinet/tcp_output.c
projects/tcp_cc_head/sys/netinet/tcp_sack.c
projects/tcp_cc_head/sys/netinet/tcp_subr.c
Modified: projects/tcp_cc_head/sys/netinet/tcp_input.c
==============================================================================
--- projects/tcp_cc_head/sys/netinet/tcp_input.c Thu Feb 11 15:34:54 2010 (r203780)
+++ projects/tcp_cc_head/sys/netinet/tcp_input.c Thu Feb 11 15:36:39 2010 (r203781)
@@ -2119,14 +2119,20 @@ tcp_do_segment(struct mbuf *m, struct tc
TCPSTAT_INC(tcps_rcvacktoomuch);
goto dropafterack;
}
+ hhook_data.new_sacked_bytes = 0;
if ((tp->t_flags & TF_SACK_PERMIT) &&
((to.to_flags & TOF_SACK) ||
- !TAILQ_EMPTY(&tp->snd_holes)))
+ !TAILQ_EMPTY(&tp->snd_holes))) {
tcp_sack_doack(tp, &to, th->th_ack);
+ /* XXXDH: should only be one if a productive SACK */
+ hhook_data.new_sacked_bytes = 1;
+ }
- hhook_data.curack = th->th_ack;
- run_hhooks(HHOOK_TYPE_TCP, HHOOK_TCP_ESTABLISHED, &hhook_data,
- tp->dblocks, tp->n_dblocks);
+ hhook_data.tp = tp;
+ hhook_data.th = th;
+ hhook_data.to = &to;
+ run_hhooks(HHOOK_TYPE_TCP, HHOOK_TCP_ESTABLISHED_IN, &hhook_data,
+ tp->dblocks, tp->n_dblocks);
if (SEQ_LEQ(th->th_ack, tp->snd_una)) {
if (tlen == 0 && tiwin == tp->snd_wnd) {
Modified: projects/tcp_cc_head/sys/netinet/tcp_output.c
==============================================================================
--- projects/tcp_cc_head/sys/netinet/tcp_output.c Thu Feb 11 15:34:54 2010 (r203780)
+++ projects/tcp_cc_head/sys/netinet/tcp_output.c Thu Feb 11 15:36:39 2010 (r203781)
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include <net/vnet.h>
#include <netinet/cc.h>
+#include <netinet/hhooks.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
@@ -161,6 +162,7 @@ tcp_output(struct tcpcb *tp)
struct sackhole *p;
int tso = 0;
struct tcpopt to;
+ struct tcp_hhook_data hhook_data;
#if 0
int maxburst = TCP_MAXBURST;
#endif
@@ -1112,6 +1114,15 @@ timer:
tp->snd_max = tp->snd_nxt + len;
}
+ hhook_data.th = th;
+ hhook_data.tp = tp;
+ hhook_data.to = &to;
+ hhook_data.len = len;
+ hhook_data.tso = tso;
+ run_hhooks(HHOOK_TYPE_TCP, HHOOK_TCP_ESTABLISHED_OUT, &hhook_data,
+ tp->dblocks, tp->n_dblocks);
+
+
#ifdef TCPDEBUG
/*
* Trace.
Modified: projects/tcp_cc_head/sys/netinet/tcp_sack.c
==============================================================================
--- projects/tcp_cc_head/sys/netinet/tcp_sack.c Thu Feb 11 15:34:54 2010 (r203780)
+++ projects/tcp_cc_head/sys/netinet/tcp_sack.c Thu Feb 11 15:36:39 2010 (r203781)
@@ -426,6 +426,7 @@ tcp_sack_doack(struct tcpcb *tp, struct
* are received.
*/
sblkp = &sack_blocks[num_sack_blks - 1]; /* Last SACK block */
+ tp->sackhint.last_sack_ack = sblkp->end;
if (SEQ_LT(tp->snd_fack, sblkp->start)) {
/*
* The highest SACK block is beyond fack. Append new SACK
Modified: projects/tcp_cc_head/sys/netinet/tcp_subr.c
==============================================================================
--- projects/tcp_cc_head/sys/netinet/tcp_subr.c Thu Feb 11 15:34:54 2010 (r203780)
+++ projects/tcp_cc_head/sys/netinet/tcp_subr.c Thu Feb 11 15:36:39 2010 (r203781)
@@ -378,7 +378,10 @@ tcp_init(void)
V_tcp_inflight_rttthresh = TCPTV_INFLIGHT_RTTTHRESH;
- if (register_hhook_head(HHOOK_TYPE_TCP, HHOOK_TCP_ESTABLISHED,
+ if (register_hhook_head(HHOOK_TYPE_TCP, HHOOK_TCP_ESTABLISHED_IN,
+ HHOOK_NOWAIT) != 0)
+ printf("%s: WARNING: unable to register helper hook\n", __func__);
+ if (register_hhook_head(HHOOK_TYPE_TCP, HHOOK_TCP_ESTABLISHED_OUT,
HHOOK_NOWAIT) != 0)
printf("%s: WARNING: unable to register helper hook\n", __func__);
More information about the svn-src-projects
mailing list