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
599 struct sctp_chunk *chunk, *chunk1;
633 list_for_each_entry_safe(chunk, chunk1, lqueue, transmitted_list) {
634 /* If the chunk is abandoned, move it to abandoned list. */
635 if (sctp_chunk_abandoned(chunk)) {
636 list_del_init(&chunk->transmitted_list);
638 &chunk->transmitted_list);
645 * next chunk.
647 if (chunk->tsn_gap_acked) {
648 list_move_tail(&chunk->transmitted_list,
656 if (fast_rtx && !chunk->fast_retransmit)
660 /* Attempt to append this chunk to the packet. */
661 status = sctp_packet_append_chunk(pkt, chunk);
681 * Otherwise, try appending this chunk again.
688 /* Bundle next chunk in the next round. */
710 /* The append was successful, so add this chunk to
713 list_move_tail(&chunk->transmitted_list,
716 /* Mark the chunk as ineligible for fast retransmit
719 if (chunk->fast_retransmit == SCTP_NEED_FRTX)
720 chunk->fast_retransmit = SCTP_DONT_FRTX;
765 struct sctp_chunk *chunk, gfp_t gfp)
775 sctp_packet_append_chunk(&singleton, chunk);
794 struct sctp_chunk *chunk)
796 struct sctp_transport *new_transport = chunk->transport;
799 if (!sctp_chunk_is_data(chunk)) {
801 * the destination address of the chunk
809 if (ctx->transport && sctp_cmp_addr_exact(&chunk->dest,
814 &chunk->dest);
829 /* If the chunk is Heartbeat or Heartbeat Ack,
830 * send it to chunk->transport, even if it's
837 * HEARTBEAT chunk to which this ack is responding.
842 type = chunk->chunk_hdr->type;
874 struct sctp_chunk *chunk, *tmp;
878 list_for_each_entry_safe(chunk, tmp, &ctx->q->control_chunk_list, list) {
888 chunk->chunk_hdr->type != SCTP_CID_ASCONF)
891 list_del_init(&chunk->list);
894 * the first chunk as we don't have a transport by then.
896 sctp_outq_select_transport(ctx, chunk);
898 switch (chunk->chunk_hdr->type) {
907 error = sctp_packet_singleton(ctx->transport, chunk,
916 if (sctp_test_T_bit(chunk))
943 status = sctp_packet_transmit_chunk(ctx->packet, chunk,
946 /* put the chunk back */
947 list_add(&chunk->list, &ctx->q->control_chunk_list);
956 if (chunk->chunk_hdr->type == SCTP_CID_FWD_TSN ||
957 chunk->chunk_hdr->type == SCTP_CID_I_FWD_TSN) {
962 if (chunk == ctx->asoc->strreset_chunk)
968 /* We built a chunk with an illegal type! */
1007 * one chunk can get bundled with a COOKIE-ECHO.
1024 struct sctp_chunk *chunk;
1031 * chunk.
1068 while ((chunk = sctp_outq_dequeue_data(ctx->q)) != NULL) {
1069 __u32 sid = ntohs(chunk->subh.data_hdr->stream);
1072 /* Has this chunk expired? */
1073 if (sctp_chunk_abandoned(chunk)) {
1074 sctp_sched_dequeue_done(ctx->q, chunk);
1075 sctp_chunk_fail(chunk, 0);
1076 sctp_chunk_free(chunk);
1081 sctp_outq_head_data(ctx->q, chunk);
1085 sctp_outq_select_transport(ctx, chunk);
1087 pr_debug("%s: outq:%p, chunk:%p[%s], tx-tsn:0x%x skb->head:%p skb->users:%d\n",
1088 __func__, ctx->q, chunk, chunk && chunk->chunk_hdr ?
1089 sctp_cname(SCTP_ST_CHUNK(chunk->chunk_hdr->type)) :
1090 "illegal chunk", ntohl(chunk->subh.data_hdr->tsn),
1091 chunk->skb ? chunk->skb->head : NULL, chunk->skb ?
1092 refcount_read(&chunk->skb->users) : -1);
1094 /* Add the chunk to the packet. */
1095 status = sctp_packet_transmit_chunk(ctx->packet, chunk, 0,
1098 /* We could not append this chunk, so put
1099 * the chunk back on the output queue.
1102 __func__, ntohl(chunk->subh.data_hdr->tsn),
1105 sctp_outq_head_data(ctx->q, chunk);
1111 * chunk header.
1114 chunk->chunk_hdr->flags |= SCTP_DATA_SACK_IMM;
1115 if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
1121 * chunk as sent, sched-wise.
1123 sctp_sched_dequeue_done(ctx->q, chunk);
1125 list_add_tail(&chunk->transmitted_list,
1131 /* Only let one DATA chunk get bundled with a
1132 * COOKIE-ECHO chunk.
1201 /* Update unack_data based on the incoming SACK chunk */
1225 int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk)
1228 struct sctp_sackhdr *sack = chunk->subh.sack_hdr;
1313 transport, &chunk->source, sack,
1353 SCTP_PR_PRIO_ENABLED(chunk->sinfo.sinfo_flags))
1437 /* Move the chunk to abandoned list. */
1440 /* If this chunk has not been acked, stop
1457 * the outstanding bytes for this chunk, so only
1461 /* If this chunk is being used for RTT
1502 /* If the chunk hasn't been marked as ACKED,
1504 * chunk had a valid transport (it will not
1522 * that acknowledges the DATA chunk
1536 * 'Stray DATA chunk(s)' record the highest TSN
1539 * acknowledged DATA chunk is one not
1543 * chunk that acknowledges, for the first time,
1544 * the receipt of a DATA chunk, all the still
1547 * chunk, are qualified as 'Stray DATA chunks'.
1567 * chunk was originally
1592 * DATA chunk was last sent.
1640 * only one data chunk in flight to the receiver.
1689 struct sctp_chunk *chunk;
1695 list_for_each_entry(chunk, transmitted_queue, transmitted_list) {
1697 tsn = ntohl(chunk->subh.data_hdr->tsn);
1703 * chunk if it has NOT been fast retransmitted or marked for
1706 if (chunk->fast_retransmit == SCTP_CAN_FRTX &&
1707 !chunk->tsn_gap_acked &&
1711 * this chunk as missing.
1714 chunk->transport,
1716 chunk->tsn_missing_report++;
1719 __func__, tsn, chunk->tsn_missing_report);
1723 * M4) If any DATA chunk is found to have a
1725 * value larger than or equal to 3, mark that chunk for
1729 if (chunk->tsn_missing_report >= 3) {
1730 chunk->fast_retransmit = SCTP_NEED_FRTX;
1795 /* Create and add a fwdtsn chunk to the outq's control queue if needed. */
1804 struct sctp_chunk *chunk;
1821 * the chunk next in the out-queue space is marked as "abandoned" as
1841 chunk = list_entry(lchunk, struct sctp_chunk,
1843 tsn = ntohl(chunk->subh.data_hdr->tsn);
1850 sctp_chunk_free(chunk);
1854 if (chunk->chunk_hdr->flags &
1859 chunk->subh.data_hdr->stream);
1861 chunk->subh.data_hdr->stream;
1863 chunk->subh.data_hdr->ssn;
1876 * chunk containing the latest value of the