From: Marcelo Ricardo Leitner Date: Fri, 1 Apr 2016 17:05:48 +0000 (-0300) Subject: sctp: flush if we can't fit another DATA chunk X-Git-Tag: v4.9.8~2332^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e43569e6d3c71eb266641c6297ea54f7ac66954f;p=platform%2Fkernel%2Flinux-rpi3.git sctp: flush if we can't fit another DATA chunk There is no point on delaying the packet if we can't fit a single byte of data on it anymore. So lets just reduce the threshold by the amount that a data chunk with 4 bytes (rounding) would use. v2: based on the right tree Signed-off-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller --- diff --git a/net/sctp/output.c b/net/sctp/output.c index 9774535..9844fe5 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c @@ -705,7 +705,8 @@ static sctp_xmit_t sctp_packet_can_append_data(struct sctp_packet *packet, /* Check whether this chunk and all the rest of pending data will fit * or delay in hopes of bundling a full sized packet. */ - if (chunk->skb->len + q->out_qlen >= transport->pathmtu - packet->overhead) + if (chunk->skb->len + q->out_qlen > + transport->pathmtu - packet->overhead - sizeof(sctp_data_chunk_t) - 4) /* Enough data queued to fill a packet */ return SCTP_XMIT_OK;