Skip to content

Commit b29e790

Browse files
author
Vlad Yasevich
committed
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>
1 parent d4d6fb5 commit b29e790

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎net/sctp/output.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,13 +697,14 @@ static sctp_xmit_t sctp_packet_can_append_data(struct sctp_packet *packet,
697697
*/
698698
if (!sctp_sk(asoc->base.sk)->nodelay && sctp_packet_empty(packet) &&
699699
inflight && sctp_state(asoc, ESTABLISHED)) {
700-
unsigned len = datasize + q->out_qlen;
700+
unsigned max = transport->pathmtu - packet->overhead;
701+
unsigned len = chunk->skb->len + q->out_qlen;
701702

702703
/* Check whether this chunk and all the rest of pending
703704
* data will fit or delay in hopes of bundling a full
704705
* sized packet.
705706
*/
706-
if (len < asoc->frag_point) {
707+
if (len < max) {
707708
retval = SCTP_XMIT_NAGLE_DELAY;
708709
goto finish;
709710
}

0 commit comments

Comments
 (0)