summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_output.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2010-08-14 21:41:33 +0000
committerandre <andre@FreeBSD.org>2010-08-14 21:41:33 +0000
commitae1f5ecd8ef9d870c90b9d061d3ce225aa0becd0 (patch)
tree5f8afa59bfbdcb374348c7db8224e6fa0912446a /sys/netinet/tcp_output.c
parent75f1786a8e657d2c23cf9dd31e39ab952b6cf4dc (diff)
downloadFreeBSD-src-ae1f5ecd8ef9d870c90b9d061d3ce225aa0becd0.zip
FreeBSD-src-ae1f5ecd8ef9d870c90b9d061d3ce225aa0becd0.tar.gz
When using TSO and sending more than TCP_MAXWIN sendalot is set
and we loop back to 'again'. If the remainder is less or equal to one full segment, the TSO flag was not cleared even though it isn't necessary anymore. Enabling the TSO flag on a segment that doesn't require any offloaded segmentation by the NIC may cause confusion in the driver or hardware. Reset the internal tso flag in tcp_output() on every iteration of sendalot. PR: kern/132832 Submitted by: Renaud Lienhart <renaud-at-vmware com> MFC after: 1 week
Diffstat (limited to 'sys/netinet/tcp_output.c')
-rw-r--r--sys/netinet/tcp_output.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 50973c4..4327c7e 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -153,7 +153,7 @@ tcp_output(struct tcpcb *tp)
int idle, sendalot;
int sack_rxmit, sack_bytes_rxmt;
struct sackhole *p;
- int tso = 0;
+ int tso;
struct tcpopt to;
#if 0
int maxburst = TCP_MAXBURST;
@@ -211,6 +211,7 @@ again:
SEQ_LT(tp->snd_nxt, tp->snd_max))
tcp_sack_adjust(tp);
sendalot = 0;
+ tso = 0;
off = tp->snd_nxt - tp->snd_una;
sendwin = min(tp->snd_wnd, tp->snd_cwnd);
sendwin = min(sendwin, tp->snd_bwnd);
@@ -490,9 +491,9 @@ after_sack_rexmit:
} else {
len = tp->t_maxseg;
sendalot = 1;
- tso = 0;
}
}
+
if (sack_rxmit) {
if (SEQ_LT(p->rxmit + len, tp->snd_una + so->so_snd.sb_cc))
flags &= ~TH_FIN;
@@ -1051,6 +1052,8 @@ send:
* XXX: Fixme: This is currently not the case for IPv6.
*/
if (tso) {
+ KASSERT(len > tp->t_maxopd - optlen,
+ ("%s: len <= tso_segsz", __func__));
m->m_pkthdr.csum_flags |= CSUM_TSO;
m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen;
}
OpenPOWER on IntegriCloud