Commit cb95ea32 authored by Vlad Yasevich's avatar Vlad Yasevich
Browse files

sctp: Don't do NAGLE delay on large writes that were fragmented small

SCTP will delay the last part of a large write due to NAGLE, if that
part is smaller then MTU.  Since we are doing large writes, we might
as well send the last portion now instead of waiting untill the next
large write happens.  The small portion will be sent as is regardless,
so it's better to not delay it.

This is a result of much discussions with Wei Yongjun <>
and Doug Graham <>.  Many thanks go out to them.
Signed-off-by: default avatarVlad Yasevich <>
parent b29e7907
......@@ -628,7 +628,7 @@ struct sctp_datamsg {
/* Chunks waiting to be submitted to lower layer. */
struct list_head chunks;
/* Chunks that have been transmitted. */
struct list_head track;
size_t msg_size;
/* Reference counting. */
atomic_t refcnt;
/* When is this message no longer interesting to the peer? */
......@@ -59,6 +59,7 @@ static void sctp_datamsg_init(struct sctp_datamsg *msg)
msg->can_abandon = 0;
msg->expires_at = 0;
msg->msg_size = 0;
/* Allocate and initialize datamsg. */
......@@ -155,6 +156,7 @@ static void sctp_datamsg_assign(struct sctp_datamsg *msg, struct sctp_chunk *chu
chunk->msg = msg;
msg->msg_size += chunk->skb->len;
......@@ -703,8 +703,10 @@ 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.
* Don't delay large message writes that may have been
* fragmeneted into small peices.
if (len < max) {
if ((len < max) && (chunk->msg->msg_size < max)) {
goto finish;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment