aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2016-01-07 00:14:42 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2016-01-07 00:14:42 +0000
commit0c39d38d215df8423974f87134838fafc0170552 (patch)
tree3e84c070bf3f77cacff7c73e3720b9e5294f53f2 /sys/dev
parentb46e917554ee224fb1035c66bf4f7bbfccb3a922 (diff)
downloadsrc-0c39d38d215df8423974f87134838fafc0170552.tar.gz
src-0c39d38d215df8423974f87134838fafc0170552.zip
Historically we have two fields in tcpcb to describe sender MSS: t_maxopd,
and t_maxseg. This dualism emerged with T/TCP, but was not properly cleaned up after T/TCP removal. After all permutations over the years the result is that t_maxopd stores a minimum of peer offered MSS and MTU reduced by minimum protocol header. And t_maxseg stores (t_maxopd - TCPOLEN_TSTAMP_APPA) if timestamps are in action, or is equal to t_maxopd otherwise. That's a very rough estimate of MSS reduced by options length. Throughout the code it was used in places, where preciseness was not important, like cwnd or ssthresh calculations. With this change: - t_maxopd goes away. - t_maxseg now stores MSS not adjusted by options. - new function tcp_maxseg() is provided, that calculates MSS reduced by options length. The functions gives a better estimate, since it takes into account SACK state as well. Reviewed by: jtl Differential Revision: https://reviews.freebsd.org/D3593
Notes
Notes: svn path=/head/; revision=293284
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c3
-rw-r--r--sys/dev/cxgbe/tom/t4_cpl_io.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c b/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
index 985306c3c6e8..d896020abf39 100644
--- a/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
+++ b/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
@@ -1536,14 +1536,13 @@ assign_rxopt(struct tcpcb *tp, uint16_t tcpopt)
struct toepcb *toep = tp->t_toe;
struct adapter *sc = toep->tp_tod->tod_softc;
- tp->t_maxseg = tp->t_maxopd = sc->params.mtus[G_TCPOPT_MSS(tcpopt)] - 40;
+ tp->t_maxseg = sc->params.mtus[G_TCPOPT_MSS(tcpopt)] - 40;
if (G_TCPOPT_TSTAMP(tcpopt)) {
tp->t_flags |= TF_RCVD_TSTMP;
tp->t_flags |= TF_REQ_TSTMP; /* forcibly set */
tp->ts_recent = 0; /* XXX */
tp->ts_recent_age = tcp_ts_getticks();
- tp->t_maxseg -= TCPOLEN_TSTAMP_APPA;
}
if (G_TCPOPT_SACK(tcpopt))
diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c
index d58592e85b49..f18f115c3202 100644
--- a/sys/dev/cxgbe/tom/t4_cpl_io.c
+++ b/sys/dev/cxgbe/tom/t4_cpl_io.c
@@ -221,7 +221,7 @@ assign_rxopt(struct tcpcb *tp, unsigned int opt)
n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr);
else
n = sizeof(struct ip) + sizeof(struct tcphdr);
- tp->t_maxseg = tp->t_maxopd = sc->params.mtus[G_TCPOPT_MSS(opt)] - n;
+ tp->t_maxseg = sc->params.mtus[G_TCPOPT_MSS(opt)] - n;
CTR4(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u)", __func__, toep->tid,
G_TCPOPT_MSS(opt), sc->params.mtus[G_TCPOPT_MSS(opt)]);
@@ -230,7 +230,6 @@ assign_rxopt(struct tcpcb *tp, unsigned int opt)
tp->t_flags |= TF_RCVD_TSTMP; /* timestamps ok */
tp->ts_recent = 0; /* hmmm */
tp->ts_recent_age = tcp_ts_getticks();
- tp->t_maxseg -= TCPOLEN_TSTAMP_APPA;
}
if (G_TCPOPT_SACK(opt))