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 /include/net/sctp | |
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 'include/net/sctp')
-rw-r--r-- | include/net/sctp/command.h | 3 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 3b966802e05d..8be5135ff7aa 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -106,6 +106,7 @@ typedef enum { | |||
106 | SCTP_CMD_ASSOC_SHKEY, /* generate the association shared keys */ | 106 | SCTP_CMD_ASSOC_SHKEY, /* generate the association shared keys */ |
107 | SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */ | 107 | SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */ |
108 | SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ | 108 | SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ |
109 | SCTP_CMD_SEND_MSG, /* Send the whole use message */ | ||
109 | SCTP_CMD_LAST | 110 | SCTP_CMD_LAST |
110 | } sctp_verb_t; | 111 | } sctp_verb_t; |
111 | 112 | ||
@@ -139,6 +140,7 @@ typedef union { | |||
139 | struct sctp_ulpevent *ulpevent; | 140 | struct sctp_ulpevent *ulpevent; |
140 | struct sctp_packet *packet; | 141 | struct sctp_packet *packet; |
141 | sctp_sackhdr_t *sackh; | 142 | sctp_sackhdr_t *sackh; |
143 | struct sctp_datamsg *msg; | ||
142 | } sctp_arg_t; | 144 | } sctp_arg_t; |
143 | 145 | ||
144 | /* We are simulating ML type constructors here. | 146 | /* We are simulating ML type constructors here. |
@@ -188,6 +190,7 @@ SCTP_ARG_CONSTRUCTOR(PEER_INIT, sctp_init_chunk_t *, init) | |||
188 | SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent) | 190 | SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent) |
189 | SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet) | 191 | SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet) |
190 | SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) | 192 | SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) |
193 | SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg) | ||
191 | 194 | ||
192 | typedef struct { | 195 | typedef struct { |
193 | sctp_arg_t obj; | 196 | sctp_arg_t obj; |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index edfcacf3250e..97024faaa08f 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -643,6 +643,7 @@ struct sctp_datamsg { | |||
643 | struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, | 643 | struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, |
644 | struct sctp_sndrcvinfo *, | 644 | struct sctp_sndrcvinfo *, |
645 | struct msghdr *, int len); | 645 | struct msghdr *, int len); |
646 | void sctp_datamsg_free(struct sctp_datamsg *); | ||
646 | void sctp_datamsg_put(struct sctp_datamsg *); | 647 | void sctp_datamsg_put(struct sctp_datamsg *); |
647 | void sctp_chunk_fail(struct sctp_chunk *, int error); | 648 | void sctp_chunk_fail(struct sctp_chunk *, int error); |
648 | int sctp_chunk_abandoned(struct sctp_chunk *); | 649 | int sctp_chunk_abandoned(struct sctp_chunk *); |