aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/ulpqueue.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2017-05-31 04:36:31 -0400
committerDavid S. Miller <davem@davemloft.net>2017-06-02 13:56:26 -0400
commitcee360ab4dd66fc1de33a5fa1cb418fa21c27ce3 (patch)
treedb9b8575e7392b314e94a946590b71bb5c856e64 /net/sctp/ulpqueue.c
parent6e7da286e3513ac1e107ef8dffa5f254029d68e7 (diff)
sctp: define the member stream as an object instead of pointer in asoc
As Marcelo's suggestion, stream is a fixed size member of asoc and would not grow with more streams. To avoid an allocation for it, this patch is to define it as an object instead of pointer and update the places using it, also create sctp_stream_update() called in sctp_assoc_update() to migrate the stream info from one stream to another. Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/ulpqueue.c')
-rw-r--r--net/sctp/ulpqueue.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index aa3624d50278..25f7e4140566 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -764,7 +764,7 @@ static void sctp_ulpq_retrieve_ordered(struct sctp_ulpq *ulpq,
764 __u16 sid, csid, cssn; 764 __u16 sid, csid, cssn;
765 765
766 sid = event->stream; 766 sid = event->stream;
767 stream = ulpq->asoc->stream; 767 stream = &ulpq->asoc->stream;
768 768
769 event_list = (struct sk_buff_head *) sctp_event2skb(event)->prev; 769 event_list = (struct sk_buff_head *) sctp_event2skb(event)->prev;
770 770
@@ -858,7 +858,7 @@ static struct sctp_ulpevent *sctp_ulpq_order(struct sctp_ulpq *ulpq,
858 /* Note: The stream ID must be verified before this routine. */ 858 /* Note: The stream ID must be verified before this routine. */
859 sid = event->stream; 859 sid = event->stream;
860 ssn = event->ssn; 860 ssn = event->ssn;
861 stream = ulpq->asoc->stream; 861 stream = &ulpq->asoc->stream;
862 862
863 /* Is this the expected SSN for this stream ID? */ 863 /* Is this the expected SSN for this stream ID? */
864 if (ssn != sctp_ssn_peek(stream, in, sid)) { 864 if (ssn != sctp_ssn_peek(stream, in, sid)) {
@@ -893,7 +893,7 @@ static void sctp_ulpq_reap_ordered(struct sctp_ulpq *ulpq, __u16 sid)
893 struct sk_buff_head *lobby = &ulpq->lobby; 893 struct sk_buff_head *lobby = &ulpq->lobby;
894 __u16 csid, cssn; 894 __u16 csid, cssn;
895 895
896 stream = ulpq->asoc->stream; 896 stream = &ulpq->asoc->stream;
897 897
898 /* We are holding the chunks by stream, by SSN. */ 898 /* We are holding the chunks by stream, by SSN. */
899 skb_queue_head_init(&temp); 899 skb_queue_head_init(&temp);
@@ -958,7 +958,7 @@ void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn)
958 struct sctp_stream *stream; 958 struct sctp_stream *stream;
959 959
960 /* Note: The stream ID must be verified before this routine. */ 960 /* Note: The stream ID must be verified before this routine. */
961 stream = ulpq->asoc->stream; 961 stream = &ulpq->asoc->stream;
962 962
963 /* Is this an old SSN? If so ignore. */ 963 /* Is this an old SSN? If so ignore. */
964 if (SSN_lt(ssn, sctp_ssn_peek(stream, in, sid))) 964 if (SSN_lt(ssn, sctp_ssn_peek(stream, in, sid)))