Lines Matching full:chunk

79 /* Add data chunk to the end of the queue. */
210 struct sctp_chunk *chunk, *tmp; in __sctp_outq_teardown() local
216 chunk = list_entry(lchunk, struct sctp_chunk, in __sctp_outq_teardown()
219 sctp_chunk_fail(chunk, q->error); in __sctp_outq_teardown()
220 sctp_chunk_free(chunk); in __sctp_outq_teardown()
227 chunk = list_entry(lchunk, struct sctp_chunk, in __sctp_outq_teardown()
229 sctp_chunk_fail(chunk, q->error); in __sctp_outq_teardown()
230 sctp_chunk_free(chunk); in __sctp_outq_teardown()
236 chunk = list_entry(lchunk, struct sctp_chunk, in __sctp_outq_teardown()
238 sctp_chunk_fail(chunk, q->error); in __sctp_outq_teardown()
239 sctp_chunk_free(chunk); in __sctp_outq_teardown()
245 chunk = list_entry(lchunk, struct sctp_chunk, in __sctp_outq_teardown()
247 sctp_chunk_fail(chunk, q->error); in __sctp_outq_teardown()
248 sctp_chunk_free(chunk); in __sctp_outq_teardown()
252 while ((chunk = sctp_outq_dequeue_data(q)) != NULL) { in __sctp_outq_teardown()
253 sctp_sched_dequeue_done(q, chunk); in __sctp_outq_teardown()
256 sctp_chunk_fail(chunk, q->error); in __sctp_outq_teardown()
257 sctp_chunk_free(chunk); in __sctp_outq_teardown()
261 list_for_each_entry_safe(chunk, tmp, &q->control_chunk_list, list) { in __sctp_outq_teardown()
262 list_del_init(&chunk->list); in __sctp_outq_teardown()
263 sctp_chunk_free(chunk); in __sctp_outq_teardown()
280 /* Put a new chunk in an sctp_outq. */
281 void sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk, gfp_t gfp) in sctp_outq_tail() argument
285 pr_debug("%s: outq:%p, chunk:%p[%s]\n", __func__, q, chunk, in sctp_outq_tail()
286 chunk && chunk->chunk_hdr ? in sctp_outq_tail()
287 sctp_cname(SCTP_ST_CHUNK(chunk->chunk_hdr->type)) : in sctp_outq_tail()
288 "illegal chunk"); in sctp_outq_tail()
293 if (sctp_chunk_is_data(chunk)) { in sctp_outq_tail()
294 pr_debug("%s: outqueueing: outq:%p, chunk:%p[%s])\n", in sctp_outq_tail()
295 __func__, q, chunk, chunk && chunk->chunk_hdr ? in sctp_outq_tail()
296 sctp_cname(SCTP_ST_CHUNK(chunk->chunk_hdr->type)) : in sctp_outq_tail()
297 "illegal chunk"); in sctp_outq_tail()
299 sctp_outq_tail_data(q, chunk); in sctp_outq_tail()
300 if (chunk->asoc->peer.prsctp_capable && in sctp_outq_tail()
301 SCTP_PR_PRIO_ENABLED(chunk->sinfo.sinfo_flags)) in sctp_outq_tail()
302 chunk->asoc->sent_cnt_removable++; in sctp_outq_tail()
303 if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) in sctp_outq_tail()
308 list_add_tail(&chunk->list, &q->control_chunk_list); in sctp_outq_tail()
316 /* Insert a chunk into the sorted list based on the TSNs. The retransmit list
455 struct sctp_chunk *chunk; in sctp_retransmit_mark() local
459 chunk = list_entry(lchunk, struct sctp_chunk, in sctp_retransmit_mark()
462 /* If the chunk is abandoned, move it to abandoned list. */ in sctp_retransmit_mark()
463 if (sctp_chunk_abandoned(chunk)) { in sctp_retransmit_mark()
467 /* If this chunk has not been previousely acked, in sctp_retransmit_mark()
472 if (!chunk->tsn_gap_acked) { in sctp_retransmit_mark()
473 if (chunk->transport) in sctp_retransmit_mark()
474 chunk->transport->flight_size -= in sctp_retransmit_mark()
475 sctp_data_size(chunk); in sctp_retransmit_mark()
476 q->outstanding_bytes -= sctp_data_size(chunk); in sctp_retransmit_mark()
477 q->asoc->peer.rwnd += sctp_data_size(chunk); in sctp_retransmit_mark()
487 (chunk->fast_retransmit == SCTP_NEED_FRTX)) || in sctp_retransmit_mark()
488 (reason != SCTP_RTXR_FAST_RTX && !chunk->tsn_gap_acked)) { in sctp_retransmit_mark()
491 * C) Any time a DATA chunk is marked for in sctp_retransmit_mark()
497 q->asoc->peer.rwnd += sctp_data_size(chunk); in sctp_retransmit_mark()
498 q->outstanding_bytes -= sctp_data_size(chunk); in sctp_retransmit_mark()
499 if (chunk->transport) in sctp_retransmit_mark()
500 transport->flight_size -= sctp_data_size(chunk); in sctp_retransmit_mark()
507 chunk->tsn_missing_report = 0; in sctp_retransmit_mark()
509 /* If a chunk that is being used for RTT measurement in sctp_retransmit_mark()
510 * has to be retransmitted, we cannot use this chunk in sctp_retransmit_mark()
513 * data chunk is sent. in sctp_retransmit_mark()
515 if (chunk->rtt_in_progress) { in sctp_retransmit_mark()
516 chunk->rtt_in_progress = 0; in sctp_retransmit_mark()
520 /* Move the chunk to the retransmit queue. The chunks in sctp_retransmit_mark()
602 struct sctp_chunk *chunk, *chunk1; in __sctp_outq_flush_rtx() local
636 list_for_each_entry_safe(chunk, chunk1, lqueue, transmitted_list) { in __sctp_outq_flush_rtx()
637 /* If the chunk is abandoned, move it to abandoned list. */ in __sctp_outq_flush_rtx()
638 if (sctp_chunk_abandoned(chunk)) { in __sctp_outq_flush_rtx()
639 list_del_init(&chunk->transmitted_list); in __sctp_outq_flush_rtx()
641 &chunk->transmitted_list); in __sctp_outq_flush_rtx()
648 * next chunk. in __sctp_outq_flush_rtx()
650 if (chunk->tsn_gap_acked) { in __sctp_outq_flush_rtx()
651 list_move_tail(&chunk->transmitted_list, in __sctp_outq_flush_rtx()
659 if (fast_rtx && !chunk->fast_retransmit) in __sctp_outq_flush_rtx()
663 /* Attempt to append this chunk to the packet. */ in __sctp_outq_flush_rtx()
664 status = sctp_packet_append_chunk(pkt, chunk); in __sctp_outq_flush_rtx()
684 * Otherwise, try appending this chunk again. in __sctp_outq_flush_rtx()
691 /* Bundle next chunk in the next round. */ in __sctp_outq_flush_rtx()
713 /* The append was successful, so add this chunk to in __sctp_outq_flush_rtx()
716 list_move_tail(&chunk->transmitted_list, in __sctp_outq_flush_rtx()
719 /* Mark the chunk as ineligible for fast retransmit in __sctp_outq_flush_rtx()
722 if (chunk->fast_retransmit == SCTP_NEED_FRTX) in __sctp_outq_flush_rtx()
723 chunk->fast_retransmit = SCTP_DONT_FRTX; in __sctp_outq_flush_rtx()
768 struct sctp_chunk *chunk, gfp_t gfp) in sctp_packet_singleton() argument
778 if (sctp_packet_append_chunk(&singleton, chunk) != SCTP_XMIT_OK) { in sctp_packet_singleton()
779 list_del_init(&chunk->list); in sctp_packet_singleton()
780 sctp_chunk_free(chunk); in sctp_packet_singleton()
801 struct sctp_chunk *chunk) in sctp_outq_select_transport() argument
803 struct sctp_transport *new_transport = chunk->transport; in sctp_outq_select_transport()
806 if (!sctp_chunk_is_data(chunk)) { in sctp_outq_select_transport()
808 * the destination address of the chunk in sctp_outq_select_transport()
816 if (ctx->transport && sctp_cmp_addr_exact(&chunk->dest, in sctp_outq_select_transport()
821 &chunk->dest); in sctp_outq_select_transport()
836 /* If the chunk is Heartbeat or Heartbeat Ack, in sctp_outq_select_transport()
837 * send it to chunk->transport, even if it's in sctp_outq_select_transport()
844 * HEARTBEAT chunk to which this ack is responding. in sctp_outq_select_transport()
849 type = chunk->chunk_hdr->type; in sctp_outq_select_transport()
881 struct sctp_chunk *chunk, *tmp; in sctp_outq_flush_ctrl() local
885 list_for_each_entry_safe(chunk, tmp, &ctx->q->control_chunk_list, list) { in sctp_outq_flush_ctrl()
892 * packet except on carrying an ASCONF Chunk. in sctp_outq_flush_ctrl()
895 chunk->chunk_hdr->type != SCTP_CID_ASCONF) in sctp_outq_flush_ctrl()
898 list_del_init(&chunk->list); in sctp_outq_flush_ctrl()
901 * the first chunk as we don't have a transport by then. in sctp_outq_flush_ctrl()
903 sctp_outq_select_transport(ctx, chunk); in sctp_outq_flush_ctrl()
905 switch (chunk->chunk_hdr->type) { in sctp_outq_flush_ctrl()
914 error = sctp_packet_singleton(ctx->transport, chunk, in sctp_outq_flush_ctrl()
924 if (sctp_test_T_bit(chunk)) in sctp_outq_flush_ctrl()
944 if (chunk->pmtu_probe) { in sctp_outq_flush_ctrl()
946 chunk, ctx->gfp); in sctp_outq_flush_ctrl()
959 status = sctp_packet_transmit_chunk(ctx->packet, chunk, in sctp_outq_flush_ctrl()
962 /* put the chunk back */ in sctp_outq_flush_ctrl()
963 list_add(&chunk->list, &ctx->q->control_chunk_list); in sctp_outq_flush_ctrl()
972 if (chunk->chunk_hdr->type == SCTP_CID_FWD_TSN || in sctp_outq_flush_ctrl()
973 chunk->chunk_hdr->type == SCTP_CID_I_FWD_TSN) { in sctp_outq_flush_ctrl()
978 if (chunk == ctx->asoc->strreset_chunk) in sctp_outq_flush_ctrl()
984 /* We built a chunk with an illegal type! */ in sctp_outq_flush_ctrl()
1023 * one chunk can get bundled with a COOKIE-ECHO. in sctp_outq_flush_rtx()
1040 struct sctp_chunk *chunk; in sctp_outq_flush_data() local
1047 * chunk. in sctp_outq_flush_data()
1084 while ((chunk = sctp_outq_dequeue_data(ctx->q)) != NULL) { in sctp_outq_flush_data()
1085 __u32 sid = ntohs(chunk->subh.data_hdr->stream); in sctp_outq_flush_data()
1088 /* Has this chunk expired? */ in sctp_outq_flush_data()
1089 if (sctp_chunk_abandoned(chunk)) { in sctp_outq_flush_data()
1090 sctp_sched_dequeue_done(ctx->q, chunk); in sctp_outq_flush_data()
1091 sctp_chunk_fail(chunk, 0); in sctp_outq_flush_data()
1092 sctp_chunk_free(chunk); in sctp_outq_flush_data()
1097 sctp_outq_head_data(ctx->q, chunk); in sctp_outq_flush_data()
1101 sctp_outq_select_transport(ctx, chunk); in sctp_outq_flush_data()
1103 pr_debug("%s: outq:%p, chunk:%p[%s], tx-tsn:0x%x skb->head:%p skb->users:%d\n", in sctp_outq_flush_data()
1104 __func__, ctx->q, chunk, chunk && chunk->chunk_hdr ? in sctp_outq_flush_data()
1105 sctp_cname(SCTP_ST_CHUNK(chunk->chunk_hdr->type)) : in sctp_outq_flush_data()
1106 "illegal chunk", ntohl(chunk->subh.data_hdr->tsn), in sctp_outq_flush_data()
1107 chunk->skb ? chunk->skb->head : NULL, chunk->skb ? in sctp_outq_flush_data()
1108 refcount_read(&chunk->skb->users) : -1); in sctp_outq_flush_data()
1110 /* Add the chunk to the packet. */ in sctp_outq_flush_data()
1111 status = sctp_packet_transmit_chunk(ctx->packet, chunk, 0, in sctp_outq_flush_data()
1114 /* We could not append this chunk, so put in sctp_outq_flush_data()
1115 * the chunk back on the output queue. in sctp_outq_flush_data()
1118 __func__, ntohl(chunk->subh.data_hdr->tsn), in sctp_outq_flush_data()
1121 sctp_outq_head_data(ctx->q, chunk); in sctp_outq_flush_data()
1127 * chunk header. in sctp_outq_flush_data()
1130 chunk->chunk_hdr->flags |= SCTP_DATA_SACK_IMM; in sctp_outq_flush_data()
1131 if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) in sctp_outq_flush_data()
1137 * chunk as sent, sched-wise. in sctp_outq_flush_data()
1139 sctp_sched_dequeue_done(ctx->q, chunk); in sctp_outq_flush_data()
1141 list_add_tail(&chunk->transmitted_list, in sctp_outq_flush_data()
1147 /* Only let one DATA chunk get bundled with a in sctp_outq_flush_data()
1148 * COOKIE-ECHO chunk. in sctp_outq_flush_data()
1224 /* Update unack_data based on the incoming SACK chunk */
1248 int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk) in sctp_outq_sack() argument
1251 struct sctp_sackhdr *sack = chunk->subh.sack_hdr; in sctp_outq_sack()
1339 transport, &chunk->source, sack, in sctp_outq_sack()
1379 SCTP_PR_PRIO_ENABLED(chunk->sinfo.sinfo_flags)) in sctp_outq_sack()
1463 /* Move the chunk to abandoned list. */ in sctp_check_transmitted()
1466 /* If this chunk has not been acked, stop in sctp_check_transmitted()
1483 * the outstanding bytes for this chunk, so only in sctp_check_transmitted()
1487 /* If this chunk is being used for RTT in sctp_check_transmitted()
1528 /* If the chunk hasn't been marked as ACKED, in sctp_check_transmitted()
1530 * chunk had a valid transport (it will not in sctp_check_transmitted()
1548 * that acknowledges the DATA chunk in sctp_check_transmitted()
1562 * 'Stray DATA chunk(s)' record the highest TSN in sctp_check_transmitted()
1565 * acknowledged DATA chunk is one not in sctp_check_transmitted()
1569 * chunk that acknowledges, for the first time, in sctp_check_transmitted()
1570 * the receipt of a DATA chunk, all the still in sctp_check_transmitted()
1573 * chunk, are qualified as 'Stray DATA chunks'. in sctp_check_transmitted()
1593 * chunk was originally in sctp_check_transmitted()
1618 * DATA chunk was last sent. in sctp_check_transmitted()
1666 * only one data chunk in flight to the receiver. in sctp_check_transmitted()
1715 struct sctp_chunk *chunk; in sctp_mark_missing() local
1721 list_for_each_entry(chunk, transmitted_queue, transmitted_list) { in sctp_mark_missing()
1723 tsn = ntohl(chunk->subh.data_hdr->tsn); in sctp_mark_missing()
1729 * chunk if it has NOT been fast retransmitted or marked for in sctp_mark_missing()
1732 if (chunk->fast_retransmit == SCTP_CAN_FRTX && in sctp_mark_missing()
1733 !chunk->tsn_gap_acked && in sctp_mark_missing()
1737 * this chunk as missing. in sctp_mark_missing()
1740 chunk->transport, in sctp_mark_missing()
1742 chunk->tsn_missing_report++; in sctp_mark_missing()
1745 __func__, tsn, chunk->tsn_missing_report); in sctp_mark_missing()
1749 * M4) If any DATA chunk is found to have a in sctp_mark_missing()
1751 * value larger than or equal to 3, mark that chunk for in sctp_mark_missing()
1755 if (chunk->tsn_missing_report >= 3) { in sctp_mark_missing()
1756 chunk->fast_retransmit = SCTP_NEED_FRTX; in sctp_mark_missing()
1821 /* Create and add a fwdtsn chunk to the outq's control queue if needed. */
1830 struct sctp_chunk *chunk; in sctp_generate_fwdtsn() local
1847 * the chunk next in the out-queue space is marked as "abandoned" as in sctp_generate_fwdtsn()
1867 chunk = list_entry(lchunk, struct sctp_chunk, in sctp_generate_fwdtsn()
1869 tsn = ntohl(chunk->subh.data_hdr->tsn); in sctp_generate_fwdtsn()
1876 sctp_chunk_free(chunk); in sctp_generate_fwdtsn()
1880 if (chunk->chunk_hdr->flags & in sctp_generate_fwdtsn()
1885 chunk->subh.data_hdr->stream); in sctp_generate_fwdtsn()
1887 chunk->subh.data_hdr->stream; in sctp_generate_fwdtsn()
1889 chunk->subh.data_hdr->ssn; in sctp_generate_fwdtsn()
1902 * chunk containing the latest value of the in sctp_generate_fwdtsn()