diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-11-12 21:16:13 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-11-12 21:16:13 -0500 |
commit | bce943278dc4aa03b0ef9c7cf8b1b7110eda8b91 (patch) | |
tree | 4225e979eb543e1970eb2b38174bd5dbdfd42237 /net/sctp/outqueue.c | |
parent | 91cf45f02af5c871251165d000c3f42a2a0b0552 (diff) | |
parent | 9abed245a6dc94c32b2f45a1ecc51a0829d11470 (diff) |
Merge branch 'pending' of master.kernel.org:/pub/scm/linux/kernel/git/vxy/lksctp-dev
Diffstat (limited to 'net/sctp/outqueue.c')
-rw-r--r-- | net/sctp/outqueue.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index 28f4fe77ceee..fa76f235169b 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
@@ -382,7 +382,7 @@ static void sctp_insert_list(struct list_head *head, struct list_head *new) | |||
382 | /* Mark all the eligible packets on a transport for retransmission. */ | 382 | /* Mark all the eligible packets on a transport for retransmission. */ |
383 | void sctp_retransmit_mark(struct sctp_outq *q, | 383 | void sctp_retransmit_mark(struct sctp_outq *q, |
384 | struct sctp_transport *transport, | 384 | struct sctp_transport *transport, |
385 | __u8 fast_retransmit) | 385 | __u8 reason) |
386 | { | 386 | { |
387 | struct list_head *lchunk, *ltemp; | 387 | struct list_head *lchunk, *ltemp; |
388 | struct sctp_chunk *chunk; | 388 | struct sctp_chunk *chunk; |
@@ -412,20 +412,20 @@ void sctp_retransmit_mark(struct sctp_outq *q, | |||
412 | continue; | 412 | continue; |
413 | } | 413 | } |
414 | 414 | ||
415 | /* If we are doing retransmission due to a fast retransmit, | 415 | /* If we are doing retransmission due to a timeout or pmtu |
416 | * only the chunk's that are marked for fast retransmit | 416 | * discovery, only the chunks that are not yet acked should |
417 | * should be added to the retransmit queue. If we are doing | 417 | * be added to the retransmit queue. |
418 | * retransmission due to a timeout or pmtu discovery, only the | ||
419 | * chunks that are not yet acked should be added to the | ||
420 | * retransmit queue. | ||
421 | */ | 418 | */ |
422 | if ((fast_retransmit && (chunk->fast_retransmit > 0)) || | 419 | if ((reason == SCTP_RTXR_FAST_RTX && |
423 | (!fast_retransmit && !chunk->tsn_gap_acked)) { | 420 | (chunk->fast_retransmit > 0)) || |
421 | (reason != SCTP_RTXR_FAST_RTX && !chunk->tsn_gap_acked)) { | ||
424 | /* If this chunk was sent less then 1 rto ago, do not | 422 | /* If this chunk was sent less then 1 rto ago, do not |
425 | * retransmit this chunk, but give the peer time | 423 | * retransmit this chunk, but give the peer time |
426 | * to acknowlege it. | 424 | * to acknowlege it. Do this only when |
425 | * retransmitting due to T3 timeout. | ||
427 | */ | 426 | */ |
428 | if ((jiffies - chunk->sent_at) < transport->rto) | 427 | if (reason == SCTP_RTXR_T3_RTX && |
428 | (jiffies - chunk->sent_at) < transport->last_rto) | ||
429 | continue; | 429 | continue; |
430 | 430 | ||
431 | /* RFC 2960 6.2.1 Processing a Received SACK | 431 | /* RFC 2960 6.2.1 Processing a Received SACK |
@@ -467,10 +467,10 @@ void sctp_retransmit_mark(struct sctp_outq *q, | |||
467 | } | 467 | } |
468 | } | 468 | } |
469 | 469 | ||
470 | SCTP_DEBUG_PRINTK("%s: transport: %p, fast_retransmit: %d, " | 470 | SCTP_DEBUG_PRINTK("%s: transport: %p, reason: %d, " |
471 | "cwnd: %d, ssthresh: %d, flight_size: %d, " | 471 | "cwnd: %d, ssthresh: %d, flight_size: %d, " |
472 | "pba: %d\n", __FUNCTION__, | 472 | "pba: %d\n", __FUNCTION__, |
473 | transport, fast_retransmit, | 473 | transport, reason, |
474 | transport->cwnd, transport->ssthresh, | 474 | transport->cwnd, transport->ssthresh, |
475 | transport->flight_size, | 475 | transport->flight_size, |
476 | transport->partial_bytes_acked); | 476 | transport->partial_bytes_acked); |
@@ -484,7 +484,6 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport, | |||
484 | sctp_retransmit_reason_t reason) | 484 | sctp_retransmit_reason_t reason) |
485 | { | 485 | { |
486 | int error = 0; | 486 | int error = 0; |
487 | __u8 fast_retransmit = 0; | ||
488 | 487 | ||
489 | switch(reason) { | 488 | switch(reason) { |
490 | case SCTP_RTXR_T3_RTX: | 489 | case SCTP_RTXR_T3_RTX: |
@@ -499,16 +498,18 @@ void sctp_retransmit(struct sctp_outq *q, struct sctp_transport *transport, | |||
499 | case SCTP_RTXR_FAST_RTX: | 498 | case SCTP_RTXR_FAST_RTX: |
500 | SCTP_INC_STATS(SCTP_MIB_FAST_RETRANSMITS); | 499 | SCTP_INC_STATS(SCTP_MIB_FAST_RETRANSMITS); |
501 | sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_FAST_RTX); | 500 | sctp_transport_lower_cwnd(transport, SCTP_LOWER_CWND_FAST_RTX); |
502 | fast_retransmit = 1; | ||
503 | break; | 501 | break; |
504 | case SCTP_RTXR_PMTUD: | 502 | case SCTP_RTXR_PMTUD: |
505 | SCTP_INC_STATS(SCTP_MIB_PMTUD_RETRANSMITS); | 503 | SCTP_INC_STATS(SCTP_MIB_PMTUD_RETRANSMITS); |
506 | break; | 504 | break; |
505 | case SCTP_RTXR_T1_RTX: | ||
506 | SCTP_INC_STATS(SCTP_MIB_T1_RETRANSMITS); | ||
507 | break; | ||
507 | default: | 508 | default: |
508 | BUG(); | 509 | BUG(); |
509 | } | 510 | } |
510 | 511 | ||
511 | sctp_retransmit_mark(q, transport, fast_retransmit); | 512 | sctp_retransmit_mark(q, transport, reason); |
512 | 513 | ||
513 | /* PR-SCTP A5) Any time the T3-rtx timer expires, on any destination, | 514 | /* PR-SCTP A5) Any time the T3-rtx timer expires, on any destination, |
514 | * the sender SHOULD try to advance the "Advanced.Peer.Ack.Point" by | 515 | * the sender SHOULD try to advance the "Advanced.Peer.Ack.Point" by |
@@ -641,7 +642,8 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, | |||
641 | 642 | ||
642 | /* If we are here due to a retransmit timeout or a fast | 643 | /* If we are here due to a retransmit timeout or a fast |
643 | * retransmit and if there are any chunks left in the retransmit | 644 | * retransmit and if there are any chunks left in the retransmit |
644 | * queue that could not fit in the PMTU sized packet, they need * to be marked as ineligible for a subsequent fast retransmit. | 645 | * queue that could not fit in the PMTU sized packet, they need |
646 | * to be marked as ineligible for a subsequent fast retransmit. | ||
645 | */ | 647 | */ |
646 | if (rtx_timeout && !lchunk) { | 648 | if (rtx_timeout && !lchunk) { |
647 | list_for_each(lchunk1, lqueue) { | 649 | list_for_each(lchunk1, lqueue) { |
@@ -660,10 +662,9 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt, | |||
660 | int sctp_outq_uncork(struct sctp_outq *q) | 662 | int sctp_outq_uncork(struct sctp_outq *q) |
661 | { | 663 | { |
662 | int error = 0; | 664 | int error = 0; |
663 | if (q->cork) { | 665 | if (q->cork) |
664 | q->cork = 0; | 666 | q->cork = 0; |
665 | error = sctp_outq_flush(q, 0); | 667 | error = sctp_outq_flush(q, 0); |
666 | } | ||
667 | return error; | 668 | return error; |
668 | } | 669 | } |
669 | 670 | ||