aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/chunk.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/chunk.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/chunk.c')
-rw-r--r--net/sctp/chunk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
index 697721a7a3f1..81466f6442e8 100644
--- a/net/sctp/chunk.c
+++ b/net/sctp/chunk.c
@@ -307,7 +307,7 @@ int sctp_chunk_abandoned(struct sctp_chunk *chunk)
307 if (SCTP_PR_TTL_ENABLED(chunk->sinfo.sinfo_flags) && 307 if (SCTP_PR_TTL_ENABLED(chunk->sinfo.sinfo_flags) &&
308 time_after(jiffies, chunk->msg->expires_at)) { 308 time_after(jiffies, chunk->msg->expires_at)) {
309 struct sctp_stream_out *streamout = 309 struct sctp_stream_out *streamout =
310 &chunk->asoc->stream->out[chunk->sinfo.sinfo_stream]; 310 &chunk->asoc->stream.out[chunk->sinfo.sinfo_stream];
311 311
312 if (chunk->sent_count) { 312 if (chunk->sent_count) {
313 chunk->asoc->abandoned_sent[SCTP_PR_INDEX(TTL)]++; 313 chunk->asoc->abandoned_sent[SCTP_PR_INDEX(TTL)]++;
@@ -320,7 +320,7 @@ int sctp_chunk_abandoned(struct sctp_chunk *chunk)
320 } else if (SCTP_PR_RTX_ENABLED(chunk->sinfo.sinfo_flags) && 320 } else if (SCTP_PR_RTX_ENABLED(chunk->sinfo.sinfo_flags) &&
321 chunk->sent_count > chunk->sinfo.sinfo_timetolive) { 321 chunk->sent_count > chunk->sinfo.sinfo_timetolive) {
322 struct sctp_stream_out *streamout = 322 struct sctp_stream_out *streamout =
323 &chunk->asoc->stream->out[chunk->sinfo.sinfo_stream]; 323 &chunk->asoc->stream.out[chunk->sinfo.sinfo_stream];
324 324
325 chunk->asoc->abandoned_sent[SCTP_PR_INDEX(RTX)]++; 325 chunk->asoc->abandoned_sent[SCTP_PR_INDEX(RTX)]++;
326 streamout->abandoned_sent[SCTP_PR_INDEX(RTX)]++; 326 streamout->abandoned_sent[SCTP_PR_INDEX(RTX)]++;