Lines Matching refs:chunk
46 struct sctp_chunk *chunk);
48 struct sctp_chunk *chunk);
50 struct sctp_chunk *chunk);
52 struct sctp_chunk *chunk,
117 /* If there a is a prepend chunk stick it on the list before
121 struct sctp_chunk *chunk = sctp_get_ecne_prepend(asoc);
123 if (chunk)
124 sctp_packet_append_chunk(packet, chunk);
161 struct sctp_chunk *chunk, *tmp;
165 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) {
166 list_del_init(&chunk->list);
167 sctp_chunk_free(chunk);
171 /* This routine tries to append the chunk to the offered packet. If adding
172 * the chunk causes the packet to exceed the path MTU and COOKIE_ECHO chunk
174 * Data can be bundled with a packet containing a COOKIE_ECHO chunk as long
179 struct sctp_chunk *chunk,
184 pr_debug("%s: packet:%p size:%zu chunk:%p size:%d\n", __func__,
185 packet, packet->size, chunk, chunk->skb ? chunk->skb->len : -1);
187 switch ((retval = (sctp_packet_append_chunk(packet, chunk)))) {
194 chunk->skb->sk->sk_err = -error;
201 chunk);
214 /* Try to bundle an auth chunk into the packet. */
216 struct sctp_chunk *chunk)
226 /* See if this is an auth chunk we are bundling or if
229 if (chunk->chunk_hdr->type == SCTP_CID_AUTH || pkt->has_auth)
232 /* if the peer did not request this chunk to be authenticated,
235 if (!chunk->auth)
238 auth = sctp_make_auth(asoc, chunk->shkey->key_id);
242 auth->shkey = chunk->shkey;
255 struct sctp_chunk *chunk)
262 if (sctp_chunk_is_data(chunk) && !pkt->has_sack &&
299 /* Append a chunk to the offered packet reporting back any inability to do
303 struct sctp_chunk *chunk)
305 __u16 chunk_len = SCTP_PAD4(ntohs(chunk->chunk_hdr->length));
308 /* Check to see if this chunk will fit into the packet */
309 retval = sctp_packet_will_fit(packet, chunk, chunk_len);
313 /* We believe that this chunk is OK to add to the packet */
314 switch (chunk->chunk_hdr->type) {
318 sctp_packet_append_data(packet, chunk);
325 /* timestamp the chunk for rtx purposes */
326 chunk->sent_at = jiffies;
328 chunk->sent_count++;
336 if (chunk->asoc)
337 chunk->asoc->stats.osacks++;
342 packet->auth = chunk;
346 /* It is OK to send this chunk. */
347 list_add_tail(&chunk->list, &packet->chunk_list);
349 chunk->transport = packet->transport;
354 /* Append a chunk to the offered packet reporting back any inability to do
358 struct sctp_chunk *chunk)
362 pr_debug("%s: packet:%p chunk:%p\n", __func__, packet, chunk);
368 if (sctp_chunk_is_data(chunk)) {
369 retval = sctp_packet_can_append_data(packet, chunk);
374 /* Try to bundle AUTH chunk */
375 retval = sctp_packet_bundle_auth(packet, chunk);
379 /* Try to bundle SACK chunk */
380 retval = sctp_packet_bundle_sack(packet, chunk);
384 retval = __sctp_packet_append_chunk(packet, chunk);
411 struct sctp_chunk *chunk, *tmp;
429 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list,
431 int padded = SCTP_PAD4(chunk->skb->len);
433 if (chunk == packet->auth)
450 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) {
453 list_del_init(&chunk->list);
454 if (sctp_chunk_is_data(chunk)) {
455 if (!sctp_chunk_retransmitted(chunk) &&
457 chunk->rtt_in_progress = 1;
462 padding = SCTP_PAD4(chunk->skb->len) - chunk->skb->len;
464 skb_put_zero(chunk->skb, padding);
466 if (chunk == packet->auth)
470 skb_put_data(nskb, chunk->skb->data, chunk->skb->len);
472 pr_debug("*** Chunk:%p[%s] %s 0x%x, length:%d, chunk->skb->len:%d, rtt_in_progress:%d\n",
473 chunk,
474 sctp_cname(SCTP_ST_CHUNK(chunk->chunk_hdr->type)),
475 chunk->has_tsn ? "TSN" : "No TSN",
476 chunk->has_tsn ? ntohl(chunk->subh.data_hdr->tsn) : 0,
477 ntohs(chunk->chunk_hdr->length), chunk->skb->len,
478 chunk->rtt_in_progress);
480 pkt_size -= SCTP_PAD4(chunk->skb->len);
482 if (!sctp_chunk_is_data(chunk) && chunk != packet->auth)
483 sctp_chunk_free(chunk);
549 struct sctp_chunk *chunk, *tmp;
559 chunk = list_entry(packet->chunk_list.next, struct sctp_chunk, list);
560 sk = chunk->skb->sk;
634 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) {
635 list_del_init(&chunk->list);
636 if (!sctp_chunk_is_data(chunk))
637 sctp_chunk_free(chunk);
647 /* This private function check to see if a chunk can be added */
649 struct sctp_chunk *chunk)
662 * is 0), the data sender can always have one DATA chunk in flight to
673 datasize = sctp_data_size(chunk);
676 /* We have (at least) one data chunk in flight,
693 if (chunk->fast_retransmit != SCTP_NEED_FRTX &&
715 /* Check whether this chunk and all the rest of pending data will fit
718 if (chunk->skb->len + q->out_qlen > transport->pathmtu -
719 packet->overhead - sctp_datachk_len(&chunk->asoc->stream) - 4)
724 if (!chunk->msg->can_delay)
731 /* This private function does management things when adding DATA chunk */
733 struct sctp_chunk *chunk)
736 size_t datasize = sctp_data_size(chunk);
753 sctp_chunk_assign_tsn(chunk);
754 asoc->stream.si->assign_number(chunk);
758 struct sctp_chunk *chunk,
764 /* Don't bundle in this packet if this chunk's auth key doesn't
766 * don't bundle the chunk with auth key if other chunks in this
769 if ((packet->auth && chunk->shkey != packet->auth->shkey) ||
770 (!packet->auth && chunk->shkey &&
771 chunk->chunk_hdr->type != SCTP_CID_AUTH))
784 * 1. The packet is empty (meaning this chunk is greater
790 (!packet->has_data && chunk->auth)) {
799 /* Similarly, if this chunk was built before a PMTU
810 /* It is also okay to fragment if the chunk we are
811 * adding is a control chunk, but only if current packet
816 if (!sctp_chunk_is_data(chunk) && packet->has_data)