summaryrefslogtreecommitdiff
path: root/net/sctp
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2009-09-04 18:20:59 -0400
committerVlad Yasevich <vladislav.yasevich@hp.com>2009-09-04 18:20:59 -0400
commitb29e7907288554db9c987c36facfd0304ee8ff5a (patch)
tree5a20e7c0e59cfc986b20b915f5bd624850d56619 /net/sctp
parentd4d6fb5787a6ef6e1dab731d617ebda6be73d561 (diff)
sctp: Nagle delay should be based on path mtu
The decision to delay due to Nagle should be based on the path mtu and future packet size. We currently incorrectly base it on 'frag_point' which is the SCTP DATA segment size, and also we do not count DATA chunk header overhead in the computation. This actuall allows situations where a user can set low 'frag_point', and then send small messages without delay. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/output.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sctp/output.c b/net/sctp/output.c
index e25e2e20b63d..d0b84f6eba4d 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -697,13 +697,14 @@ static sctp_xmit_t sctp_packet_can_append_data(struct sctp_packet *packet,
*/
if (!sctp_sk(asoc->base.sk)->nodelay && sctp_packet_empty(packet) &&
inflight && sctp_state(asoc, ESTABLISHED)) {
- unsigned len = datasize + q->out_qlen;
+ unsigned max = transport->pathmtu - packet->overhead;
+ unsigned len = chunk->skb->len + q->out_qlen;
/* Check whether this chunk and all the rest of pending
* data will fit or delay in hopes of bundling a full
* sized packet.
*/
- if (len < asoc->frag_point) {
+ if (len < max) {
retval = SCTP_XMIT_NAGLE_DELAY;
goto finish;
}