Commit be4e0ce1 authored by Xin Long's avatar Xin Long Committed by David S. Miller

sctp: implement start_pd for sctp_stream_interleave

start_pd is added as a member of sctp_stream_interleave, used to
do partial_delivery for data or idata when datalen >= asoc->rwnd
in sctp_eat_data. The codes have been done in last patches, but
they need to be extracted into start_pd, so that it could be used
for SCTP_CMD_PART_DELIVER cmd as well.
Signed-off-by: default avatarXin Long <lucien.xin@gmail.com>
Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 94014e8d
...@@ -45,6 +45,7 @@ struct sctp_stream_interleave { ...@@ -45,6 +45,7 @@ struct sctp_stream_interleave {
struct sctp_ulpevent *event); struct sctp_ulpevent *event);
void (*renege_events)(struct sctp_ulpq *ulpq, void (*renege_events)(struct sctp_ulpq *ulpq,
struct sctp_chunk *chunk, gfp_t gfp); struct sctp_chunk *chunk, gfp_t gfp);
void (*start_pd)(struct sctp_ulpq *ulpq, gfp_t gfp);
}; };
void sctp_stream_interleave_init(struct sctp_stream *stream); void sctp_stream_interleave_init(struct sctp_stream *stream);
......
...@@ -1731,7 +1731,7 @@ static int sctp_cmd_interpreter(enum sctp_event event_type, ...@@ -1731,7 +1731,7 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
break; break;
case SCTP_CMD_PART_DELIVER: case SCTP_CMD_PART_DELIVER:
sctp_ulpq_partial_delivery(&asoc->ulpq, GFP_ATOMIC); asoc->stream.si->start_pd(&asoc->ulpq, GFP_ATOMIC);
break; break;
case SCTP_CMD_RENEGE: case SCTP_CMD_RENEGE:
......
...@@ -661,6 +661,7 @@ static struct sctp_stream_interleave sctp_stream_interleave_0 = { ...@@ -661,6 +661,7 @@ static struct sctp_stream_interleave sctp_stream_interleave_0 = {
.ulpevent_data = sctp_ulpq_tail_data, .ulpevent_data = sctp_ulpq_tail_data,
.enqueue_event = sctp_ulpq_tail_event, .enqueue_event = sctp_ulpq_tail_event,
.renege_events = sctp_ulpq_renege, .renege_events = sctp_ulpq_renege,
.start_pd = sctp_ulpq_partial_delivery,
}; };
static struct sctp_stream_interleave sctp_stream_interleave_1 = { static struct sctp_stream_interleave sctp_stream_interleave_1 = {
...@@ -672,6 +673,7 @@ static struct sctp_stream_interleave sctp_stream_interleave_1 = { ...@@ -672,6 +673,7 @@ static struct sctp_stream_interleave sctp_stream_interleave_1 = {
.ulpevent_data = sctp_ulpevent_idata, .ulpevent_data = sctp_ulpevent_idata,
.enqueue_event = sctp_enqueue_event, .enqueue_event = sctp_enqueue_event,
.renege_events = sctp_renege_events, .renege_events = sctp_renege_events,
.start_pd = sctp_intl_start_pd,
}; };
void sctp_stream_interleave_init(struct sctp_stream *stream) void sctp_stream_interleave_init(struct sctp_stream *stream)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment