diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2009-08-10 13:51:03 -0400 |
---|---|---|
committer | Vlad Yasevich <vladislav.yasevich@hp.com> | 2009-09-04 18:20:57 -0400 |
commit | 9c5c62be2f794c7cee533d856f9f34c3cf21ff1b (patch) | |
tree | e81bcc703cedf4e667b91504b5cf9e8e01ffb6a5 /net/sctp/chunk.c | |
parent | 5d7ff261ef497c62f54c39effc259910a28b313d (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/chunk.c')
-rw-r--r-- | net/sctp/chunk.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c index 7acaf15679b6..645577ddc33e 100644 --- a/net/sctp/chunk.c +++ b/net/sctp/chunk.c | |||
@@ -73,6 +73,19 @@ SCTP_STATIC struct sctp_datamsg *sctp_datamsg_new(gfp_t gfp) | |||
73 | return msg; | 73 | return msg; |
74 | } | 74 | } |
75 | 75 | ||
76 | void sctp_datamsg_free(struct sctp_datamsg *msg) | ||
77 | { | ||
78 | struct sctp_chunk *chunk; | ||
79 | |||
80 | /* This doesn't have to be a _safe vairant because | ||
81 | * sctp_chunk_free() only drops the refs. | ||
82 | */ | ||
83 | list_for_each_entry(chunk, &msg->chunks, frag_list) | ||
84 | sctp_chunk_free(chunk); | ||
85 | |||
86 | sctp_datamsg_put(msg); | ||
87 | } | ||
88 | |||
76 | /* Final destructruction of datamsg memory. */ | 89 | /* Final destructruction of datamsg memory. */ |
77 | static void sctp_datamsg_destroy(struct sctp_datamsg *msg) | 90 | static void sctp_datamsg_destroy(struct sctp_datamsg *msg) |
78 | { | 91 | { |