aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2009-08-10 13:51:03 -0400
committerVlad Yasevich <vladislav.yasevich@hp.com>2009-09-04 18:20:57 -0400
commit9c5c62be2f794c7cee533d856f9f34c3cf21ff1b (patch)
treee81bcc703cedf4e667b91504b5cf9e8e01ffb6a5 /net/sctp/socket.c
parent5d7ff261ef497c62f54c39effc259910a28b313d (diff)
sctp: Send user messages to the lower layer as one
Currenlty, sctp breaks up user messages into fragments and sends each fragment to the lower layer by itself. This means that for each fragment we go all the way down the stack and back up. This also discourages bundling of multiple fragments when they can fit into a sigle packet (ex: due to user setting a low fragmentation threashold). We introduce a new command SCTP_CMD_SND_MSG and hand the whole message down state machine. The state machine and the side-effect parser will cork the queue, add all chunks from the message to the queue, and then un-cork the queue thus causing the chunks to get transmitted. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index a7e544e3f28a..95a5623d79a0 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1814,20 +1814,22 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1814 sctp_set_owner_w(chunk); 1814 sctp_set_owner_w(chunk);
1815 1815
1816 chunk->transport = chunk_tp; 1816 chunk->transport = chunk_tp;
1817
1818 /* Send it to the lower layers. Note: all chunks
1819 * must either fail or succeed. The lower layer
1820 * works that way today. Keep it that way or this
1821 * breaks.
1822 */
1823 err = sctp_primitive_SEND(asoc, chunk);
1824 /* Did the lower layer accept the chunk? */
1825 if (err)
1826 sctp_chunk_free(chunk);
1827 SCTP_DEBUG_PRINTK("We sent primitively.\n");
1828 } 1817 }
1829 1818
1830 sctp_datamsg_put(datamsg); 1819 /* Send it to the lower layers. Note: all chunks
1820 * must either fail or succeed. The lower layer
1821 * works that way today. Keep it that way or this
1822 * breaks.
1823 */
1824 err = sctp_primitive_SEND(asoc, datamsg);
1825 /* Did the lower layer accept the chunk? */
1826 if (err)
1827 sctp_datamsg_free(datamsg);
1828 else
1829 sctp_datamsg_put(datamsg);
1830
1831 SCTP_DEBUG_PRINTK("We sent primitively.\n");
1832
1831 if (err) 1833 if (err)
1832 goto out_free; 1834 goto out_free;
1833 else 1835 else