diff options
-rw-r--r-- | include/net/sctp/structs.h | 2 | ||||
-rw-r--r-- | net/sctp/chunk.c | 2 | ||||
-rw-r--r-- | net/sctp/output.c | 4 |
3 files changed, 6 insertions, 2 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index b1bd2689bb70..df4c6321996d 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -628,7 +628,7 @@ struct sctp_datamsg { | |||
628 | /* Chunks waiting to be submitted to lower layer. */ | 628 | /* Chunks waiting to be submitted to lower layer. */ |
629 | struct list_head chunks; | 629 | struct list_head chunks; |
630 | /* Chunks that have been transmitted. */ | 630 | /* Chunks that have been transmitted. */ |
631 | struct list_head track; | 631 | size_t msg_size; |
632 | /* Reference counting. */ | 632 | /* Reference counting. */ |
633 | atomic_t refcnt; | 633 | atomic_t refcnt; |
634 | /* When is this message no longer interesting to the peer? */ | 634 | /* When is this message no longer interesting to the peer? */ |
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c index 645577ddc33e..acf7c4d128f7 100644 --- a/net/sctp/chunk.c +++ b/net/sctp/chunk.c | |||
@@ -59,6 +59,7 @@ static void sctp_datamsg_init(struct sctp_datamsg *msg) | |||
59 | msg->can_abandon = 0; | 59 | msg->can_abandon = 0; |
60 | msg->expires_at = 0; | 60 | msg->expires_at = 0; |
61 | INIT_LIST_HEAD(&msg->chunks); | 61 | INIT_LIST_HEAD(&msg->chunks); |
62 | msg->msg_size = 0; | ||
62 | } | 63 | } |
63 | 64 | ||
64 | /* Allocate and initialize datamsg. */ | 65 | /* Allocate and initialize datamsg. */ |
@@ -155,6 +156,7 @@ static void sctp_datamsg_assign(struct sctp_datamsg *msg, struct sctp_chunk *chu | |||
155 | { | 156 | { |
156 | sctp_datamsg_hold(msg); | 157 | sctp_datamsg_hold(msg); |
157 | chunk->msg = msg; | 158 | chunk->msg = msg; |
159 | msg->msg_size += chunk->skb->len; | ||
158 | } | 160 | } |
159 | 161 | ||
160 | 162 | ||
diff --git a/net/sctp/output.c b/net/sctp/output.c index d0b84f6eba4d..b801bc9fb639 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -703,8 +703,10 @@ static sctp_xmit_t sctp_packet_can_append_data(struct sctp_packet *packet, | |||
703 | /* Check whether this chunk and all the rest of pending | 703 | /* Check whether this chunk and all the rest of pending |
704 | * data will fit or delay in hopes of bundling a full | 704 | * data will fit or delay in hopes of bundling a full |
705 | * sized packet. | 705 | * sized packet. |
706 | * Don't delay large message writes that may have been | ||
707 | * fragmeneted into small peices. | ||
706 | */ | 708 | */ |
707 | if (len < max) { | 709 | if ((len < max) && (chunk->msg->msg_size < max)) { |
708 | retval = SCTP_XMIT_NAGLE_DELAY; | 710 | retval = SCTP_XMIT_NAGLE_DELAY; |
709 | goto finish; | 711 | goto finish; |
710 | } | 712 | } |