aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/outqueue.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2017-04-01 05:07:46 -0400
committerDavid S. Miller <davem@davemloft.net>2017-04-03 17:52:35 -0400
commitd229d48d183fbc1391908decc7d2bcf09ca2f38f (patch)
tree36804c2c5ec00fd7d3bc3653abba3b2f3b756a84 /net/sctp/outqueue.c
parentcdccf74b9501207b9d299afe2825a311d461a318 (diff)
sctp: add SCTP_PR_STREAM_STATUS sockopt for prsctp
Before when implementing sctp prsctp, SCTP_PR_STREAM_STATUS wasn't added, as it needs to save abandoned_(un)sent for every stream. After sctp stream reconf is added in sctp, assoc has structure sctp_stream_out to save per stream info. This patch is to add SCTP_PR_STREAM_STATUS by putting the prsctp per stream statistics into sctp_stream_out. v1->v2: fix an indent issue. Signed-off-by: Xin Long <lucien.xin@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/outqueue.c')
-rw-r--r--net/sctp/outqueue.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index 025ccff67072..3f78d7f06e14 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -353,6 +353,8 @@ static int sctp_prsctp_prune_sent(struct sctp_association *asoc,
353 struct sctp_chunk *chk, *temp; 353 struct sctp_chunk *chk, *temp;
354 354
355 list_for_each_entry_safe(chk, temp, queue, transmitted_list) { 355 list_for_each_entry_safe(chk, temp, queue, transmitted_list) {
356 struct sctp_stream_out *streamout;
357
356 if (!SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) || 358 if (!SCTP_PR_PRIO_ENABLED(chk->sinfo.sinfo_flags) ||
357 chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive) 359 chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive)
358 continue; 360 continue;
@@ -361,8 +363,10 @@ static int sctp_prsctp_prune_sent(struct sctp_association *asoc,
361 sctp_insert_list(&asoc->outqueue.abandoned, 363 sctp_insert_list(&asoc->outqueue.abandoned,
362 &chk->transmitted_list); 364 &chk->transmitted_list);
363 365
366 streamout = &asoc->stream->out[chk->sinfo.sinfo_stream];
364 asoc->sent_cnt_removable--; 367 asoc->sent_cnt_removable--;
365 asoc->abandoned_sent[SCTP_PR_INDEX(PRIO)]++; 368 asoc->abandoned_sent[SCTP_PR_INDEX(PRIO)]++;
369 streamout->abandoned_sent[SCTP_PR_INDEX(PRIO)]++;
366 370
367 if (!chk->tsn_gap_acked) { 371 if (!chk->tsn_gap_acked) {
368 if (chk->transport) 372 if (chk->transport)
@@ -396,6 +400,12 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
396 q->out_qlen -= chk->skb->len; 400 q->out_qlen -= chk->skb->len;
397 asoc->sent_cnt_removable--; 401 asoc->sent_cnt_removable--;
398 asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++; 402 asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
403 if (chk->sinfo.sinfo_stream < asoc->stream->outcnt) {
404 struct sctp_stream_out *streamout =
405 &asoc->stream->out[chk->sinfo.sinfo_stream];
406
407 streamout->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
408 }
399 409
400 msg_len -= SCTP_DATA_SNDSIZE(chk) + 410 msg_len -= SCTP_DATA_SNDSIZE(chk) +
401 sizeof(struct sk_buff) + 411 sizeof(struct sk_buff) +