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