]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sctp: remove the unnecessary sinfo_stream check in sctp_prsctp_prune_unsent
authorXin Long <lucien.xin@gmail.com>
Fri, 4 Nov 2022 21:45:15 +0000 (17:45 -0400)
committerJakub Kicinski <kuba@kernel.org>
Tue, 8 Nov 2022 03:59:01 +0000 (19:59 -0800)
Since commit d5f9a5945926 ("sctp: introduce stream scheduler foundations"),
sctp_stream_outq_migrate() has been called in sctp_stream_init/update to
removes those chunks to streams higher than the new max. There is no longer
need to do such check in sctp_prsctp_prune_unsent().

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/sctp/outqueue.c

index e213aaf45d67c61edbd22abc8be6cd4a197a9ed8..c99fe3dc19bc6943bbae85d1181823e11cc202ba 100644 (file)
@@ -384,6 +384,7 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
 {
        struct sctp_outq *q = &asoc->outqueue;
        struct sctp_chunk *chk, *temp;
+       struct sctp_stream_out *sout;
 
        q->sched->unsched_all(&asoc->stream);
 
@@ -398,12 +399,9 @@ static int sctp_prsctp_prune_unsent(struct sctp_association *asoc,
                sctp_sched_dequeue_common(q, chk);
                asoc->sent_cnt_removable--;
                asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
-               if (chk->sinfo.sinfo_stream < asoc->stream.outcnt) {
-                       struct sctp_stream_out *streamout =
-                               SCTP_SO(&asoc->stream, chk->sinfo.sinfo_stream);
 
-                       streamout->ext->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
-               }
+               sout = SCTP_SO(&asoc->stream, chk->sinfo.sinfo_stream);
+               sout->ext->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++;
 
                msg_len -= chk->skb->truesize + sizeof(struct sctp_chunk);
                sctp_chunk_free(chk);