aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp
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 /include/net/sctp
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 'include/net/sctp')
-rw-r--r--include/net/sctp/command.h3
-rw-r--r--include/net/sctp/structs.h1
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)
188SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent) 190SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent)
189SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet) 191SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet)
190SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) 192SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh)
193SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg)
191 194
192typedef struct { 195typedef 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 {
643struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, 643struct 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);
646void sctp_datamsg_free(struct sctp_datamsg *);
646void sctp_datamsg_put(struct sctp_datamsg *); 647void sctp_datamsg_put(struct sctp_datamsg *);
647void sctp_chunk_fail(struct sctp_chunk *, int error); 648void sctp_chunk_fail(struct sctp_chunk *, int error);
648int sctp_chunk_abandoned(struct sctp_chunk *); 649int sctp_chunk_abandoned(struct sctp_chunk *);