sctp: implement start_pd for sctp_stream_interleave
authorXin Long <lucien.xin@gmail.com>
Fri, 8 Dec 2017 13:04:07 +0000 (21:04 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Dec 2017 16:23:05 +0000 (11:23 -0500)
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: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/stream_interleave.h
net/sctp/sm_sideeffect.c
net/sctp/stream_interleave.c

index 16a71cb2b098e9549f259f735703ec5e7e80b73b..317d9b3a5299585dcd1456c2fed2b03e83b27ba8 100644 (file)
@@ -45,6 +45,7 @@ struct sctp_stream_interleave {
                                 struct sctp_ulpevent *event);
        void    (*renege_events)(struct sctp_ulpq *ulpq,
                                 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);
index 2bec17ad7fc91d9bb4ad39d25226d004ff50e176..36710549a4ca807b81c0424ff91940ff6767f486 100644 (file)
@@ -1731,7 +1731,7 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
                        break;
 
                case SCTP_CMD_PART_DELIVER:
-                       sctp_ulpq_partial_delivery(&asoc->ulpq, GFP_ATOMIC);
+                       asoc->stream.si->start_pd(&asoc->ulpq, GFP_ATOMIC);
                        break;
 
                case SCTP_CMD_RENEGE:
index d62ad5c6209261ae64f8cd9760a6b33c548a6e14..4dce8d33c5ab790330774c26181a8cab326e6712 100644 (file)
@@ -661,6 +661,7 @@ static struct sctp_stream_interleave sctp_stream_interleave_0 = {
        .ulpevent_data          = sctp_ulpq_tail_data,
        .enqueue_event          = sctp_ulpq_tail_event,
        .renege_events          = sctp_ulpq_renege,
+       .start_pd               = sctp_ulpq_partial_delivery,
 };
 
 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,
        .enqueue_event          = sctp_enqueue_event,
        .renege_events          = sctp_renege_events,
+       .start_pd               = sctp_intl_start_pd,
 };
 
 void sctp_stream_interleave_init(struct sctp_stream *stream)