outqueue.c (c74a7469f97c0f40b46e82ee979f9fb1bb6e847c) | outqueue.c (05364ca03cfd419caecb292fede20eb39667eaae) |
---|---|
1/* SCTP kernel implementation 2 * (C) Copyright IBM Corp. 2001, 2004 3 * Copyright (c) 1999-2000 Cisco, Inc. 4 * Copyright (c) 1999-2001 Motorola, Inc. 5 * Copyright (c) 2001-2003 Intel Corp. 6 * 7 * This file is part of the SCTP kernel implementation 8 * --- 66 unchanged lines hidden (view full) --- 75{ 76 struct sctp_stream_out_ext *oute; 77 __u16 stream; 78 79 list_add(&ch->list, &q->out_chunk_list); 80 q->out_qlen += ch->skb->len; 81 82 stream = sctp_chunk_stream_no(ch); | 1/* SCTP kernel implementation 2 * (C) Copyright IBM Corp. 2001, 2004 3 * Copyright (c) 1999-2000 Cisco, Inc. 4 * Copyright (c) 1999-2001 Motorola, Inc. 5 * Copyright (c) 2001-2003 Intel Corp. 6 * 7 * This file is part of the SCTP kernel implementation 8 * --- 66 unchanged lines hidden (view full) --- 75{ 76 struct sctp_stream_out_ext *oute; 77 __u16 stream; 78 79 list_add(&ch->list, &q->out_chunk_list); 80 q->out_qlen += ch->skb->len; 81 82 stream = sctp_chunk_stream_no(ch); |
83 oute = q->asoc->stream.out[stream].ext; | 83 oute = SCTP_SO(&q->asoc->stream, stream)->ext; |
84 list_add(&ch->stream_list, &oute->outq); 85} 86 87/* Take data from the front of the queue. */ 88static inline struct sctp_chunk *sctp_outq_dequeue_data(struct sctp_outq *q) 89{ 90 return q->sched->dequeue(q); 91} --- 4 unchanged lines hidden (view full) --- 96{ 97 struct sctp_stream_out_ext *oute; 98 __u16 stream; 99 100 list_add_tail(&ch->list, &q->out_chunk_list); 101 q->out_qlen += ch->skb->len; 102 103 stream = sctp_chunk_stream_no(ch); | 84 list_add(&ch->stream_list, &oute->outq); 85} 86 87/* Take data from the front of the queue. */ 88static inline struct sctp_chunk *sctp_outq_dequeue_data(struct sctp_outq *q) 89{ 90 return q->sched->dequeue(q); 91} --- 4 unchanged lines hidden (view full) --- 96{ 97 struct sctp_stream_out_ext *oute; 98 __u16 stream; 99 100 list_add_tail(&ch->list, &q->out_chunk_list); 101 q->out_qlen += ch->skb->len; 102 103 stream = sctp_chunk_stream_no(ch); |
104 oute = q->asoc->stream.out[stream].ext; | 104 oute = SCTP_SO(&q->asoc->stream, stream)->ext; |
105 list_add_tail(&ch->stream_list, &oute->outq); 106} 107 108/* 109 * SFR-CACC algorithm: 110 * D) If count_of_newacks is greater than or equal to 2 111 * and t was not sent to the current primary then the 112 * sender MUST NOT increment missing report count for t. --- 254 unchanged lines hidden (view full) --- 367 chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive)) 368 continue; 369 370 chk->msg->abandoned = 1; 371 list_del_init(&chk->transmitted_list); 372 sctp_insert_list(&asoc->outqueue.abandoned, 373 &chk->transmitted_list); 374 | 105 list_add_tail(&ch->stream_list, &oute->outq); 106} 107 108/* 109 * SFR-CACC algorithm: 110 * D) If count_of_newacks is greater than or equal to 2 111 * and t was not sent to the current primary then the 112 * sender MUST NOT increment missing report count for t. --- 254 unchanged lines hidden (view full) --- 367 chk->sinfo.sinfo_timetolive <= sinfo->sinfo_timetolive)) 368 continue; 369 370 chk->msg->abandoned = 1; 371 list_del_init(&chk->transmitted_list); 372 sctp_insert_list(&asoc->outqueue.abandoned, 373 &chk->transmitted_list); 374 |
375 streamout = &asoc->stream.out[chk->sinfo.sinfo_stream]; | 375 streamout = SCTP_SO(&asoc->stream, chk->sinfo.sinfo_stream); |
376 asoc->sent_cnt_removable--; 377 asoc->abandoned_sent[SCTP_PR_INDEX(PRIO)]++; 378 streamout->ext->abandoned_sent[SCTP_PR_INDEX(PRIO)]++; 379 380 if (queue != &asoc->outqueue.retransmit && 381 !chk->tsn_gap_acked) { 382 if (chk->transport) 383 chk->transport->flight_size -= --- 27 unchanged lines hidden (view full) --- 411 continue; 412 413 chk->msg->abandoned = 1; 414 sctp_sched_dequeue_common(q, chk); 415 asoc->sent_cnt_removable--; 416 asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++; 417 if (chk->sinfo.sinfo_stream < asoc->stream.outcnt) { 418 struct sctp_stream_out *streamout = | 376 asoc->sent_cnt_removable--; 377 asoc->abandoned_sent[SCTP_PR_INDEX(PRIO)]++; 378 streamout->ext->abandoned_sent[SCTP_PR_INDEX(PRIO)]++; 379 380 if (queue != &asoc->outqueue.retransmit && 381 !chk->tsn_gap_acked) { 382 if (chk->transport) 383 chk->transport->flight_size -= --- 27 unchanged lines hidden (view full) --- 411 continue; 412 413 chk->msg->abandoned = 1; 414 sctp_sched_dequeue_common(q, chk); 415 asoc->sent_cnt_removable--; 416 asoc->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++; 417 if (chk->sinfo.sinfo_stream < asoc->stream.outcnt) { 418 struct sctp_stream_out *streamout = |
419 &asoc->stream.out[chk->sinfo.sinfo_stream]; | 419 SCTP_SO(&asoc->stream, chk->sinfo.sinfo_stream); |
420 421 streamout->ext->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++; 422 } 423 424 msg_len -= SCTP_DATA_SNDSIZE(chk) + 425 sizeof(struct sk_buff) + 426 sizeof(struct sctp_chunk); 427 sctp_chunk_free(chk); --- 649 unchanged lines hidden (view full) --- 1077 * to the currently queued data. 1078 */ 1079 if (ctx->transport) 1080 sctp_transport_burst_limited(ctx->transport); 1081 1082 /* Finally, transmit new packets. */ 1083 while ((chunk = sctp_outq_dequeue_data(ctx->q)) != NULL) { 1084 __u32 sid = ntohs(chunk->subh.data_hdr->stream); | 420 421 streamout->ext->abandoned_unsent[SCTP_PR_INDEX(PRIO)]++; 422 } 423 424 msg_len -= SCTP_DATA_SNDSIZE(chk) + 425 sizeof(struct sk_buff) + 426 sizeof(struct sctp_chunk); 427 sctp_chunk_free(chk); --- 649 unchanged lines hidden (view full) --- 1077 * to the currently queued data. 1078 */ 1079 if (ctx->transport) 1080 sctp_transport_burst_limited(ctx->transport); 1081 1082 /* Finally, transmit new packets. */ 1083 while ((chunk = sctp_outq_dequeue_data(ctx->q)) != NULL) { 1084 __u32 sid = ntohs(chunk->subh.data_hdr->stream); |
1085 __u8 stream_state = SCTP_SO(&ctx->asoc->stream, sid)->state; |
|
1085 1086 /* Has this chunk expired? */ 1087 if (sctp_chunk_abandoned(chunk)) { 1088 sctp_sched_dequeue_done(ctx->q, chunk); 1089 sctp_chunk_fail(chunk, 0); 1090 sctp_chunk_free(chunk); 1091 continue; 1092 } 1093 | 1086 1087 /* Has this chunk expired? */ 1088 if (sctp_chunk_abandoned(chunk)) { 1089 sctp_sched_dequeue_done(ctx->q, chunk); 1090 sctp_chunk_fail(chunk, 0); 1091 sctp_chunk_free(chunk); 1092 continue; 1093 } 1094 |
1094 if (ctx->asoc->stream.out[sid].state == SCTP_STREAM_CLOSED) { | 1095 if (stream_state == SCTP_STREAM_CLOSED) { |
1095 sctp_outq_head_data(ctx->q, chunk); 1096 break; 1097 } 1098 1099 sctp_outq_select_transport(ctx, chunk); 1100 1101 pr_debug("%s: outq:%p, chunk:%p[%s], tx-tsn:0x%x skb->head:%p skb->users:%d\n", 1102 __func__, ctx->q, chunk, chunk && chunk->chunk_hdr ? --- 805 unchanged lines hidden --- | 1096 sctp_outq_head_data(ctx->q, chunk); 1097 break; 1098 } 1099 1100 sctp_outq_select_transport(ctx, chunk); 1101 1102 pr_debug("%s: outq:%p, chunk:%p[%s], tx-tsn:0x%x skb->head:%p skb->users:%d\n", 1103 __func__, ctx->q, chunk, chunk && chunk->chunk_hdr ? --- 805 unchanged lines hidden --- |