diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /net/sctp/output.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'net/sctp/output.c')
-rw-r--r-- | net/sctp/output.c | 49 |
1 files changed, 13 insertions, 36 deletions
diff --git a/net/sctp/output.c b/net/sctp/output.c index 5cbda8f1ddfd..fad261d41ec2 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <linux/ip.h> | 48 | #include <linux/ip.h> |
49 | #include <linux/ipv6.h> | 49 | #include <linux/ipv6.h> |
50 | #include <linux/init.h> | 50 | #include <linux/init.h> |
51 | #include <linux/slab.h> | ||
51 | #include <net/inet_ecn.h> | 52 | #include <net/inet_ecn.h> |
52 | #include <net/ip.h> | 53 | #include <net/ip.h> |
53 | #include <net/icmp.h> | 54 | #include <net/icmp.h> |
@@ -429,23 +430,22 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
429 | list_del_init(&chunk->list); | 430 | list_del_init(&chunk->list); |
430 | if (sctp_chunk_is_data(chunk)) { | 431 | if (sctp_chunk_is_data(chunk)) { |
431 | 432 | ||
432 | if (!chunk->has_tsn) { | 433 | if (!chunk->resent) { |
433 | sctp_chunk_assign_ssn(chunk); | ||
434 | sctp_chunk_assign_tsn(chunk); | ||
435 | 434 | ||
436 | /* 6.3.1 C4) When data is in flight and when allowed | 435 | /* 6.3.1 C4) When data is in flight and when allowed |
437 | * by rule C5, a new RTT measurement MUST be made each | 436 | * by rule C5, a new RTT measurement MUST be made each |
438 | * round trip. Furthermore, new RTT measurements | 437 | * round trip. Furthermore, new RTT measurements |
439 | * SHOULD be made no more than once per round-trip | 438 | * SHOULD be made no more than once per round-trip |
440 | * for a given destination transport address. | 439 | * for a given destination transport address. |
441 | */ | 440 | */ |
442 | 441 | ||
443 | if (!tp->rto_pending) { | 442 | if (!tp->rto_pending) { |
444 | chunk->rtt_in_progress = 1; | 443 | chunk->rtt_in_progress = 1; |
445 | tp->rto_pending = 1; | 444 | tp->rto_pending = 1; |
446 | } | 445 | } |
447 | } else | 446 | } |
448 | chunk->resent = 1; | 447 | |
448 | chunk->resent = 1; | ||
449 | 449 | ||
450 | has_data = 1; | 450 | has_data = 1; |
451 | } | 451 | } |
@@ -557,8 +557,6 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
557 | struct timer_list *timer; | 557 | struct timer_list *timer; |
558 | unsigned long timeout; | 558 | unsigned long timeout; |
559 | 559 | ||
560 | tp->last_time_used = jiffies; | ||
561 | |||
562 | /* Restart the AUTOCLOSE timer when sending data. */ | 560 | /* Restart the AUTOCLOSE timer when sending data. */ |
563 | if (sctp_state(asoc, ESTABLISHED) && asoc->autoclose) { | 561 | if (sctp_state(asoc, ESTABLISHED) && asoc->autoclose) { |
564 | timer = &asoc->timers[SCTP_EVENT_TIMEOUT_AUTOCLOSE]; | 562 | timer = &asoc->timers[SCTP_EVENT_TIMEOUT_AUTOCLOSE]; |
@@ -617,7 +615,6 @@ static sctp_xmit_t sctp_packet_can_append_data(struct sctp_packet *packet, | |||
617 | sctp_xmit_t retval = SCTP_XMIT_OK; | 615 | sctp_xmit_t retval = SCTP_XMIT_OK; |
618 | size_t datasize, rwnd, inflight, flight_size; | 616 | size_t datasize, rwnd, inflight, flight_size; |
619 | struct sctp_transport *transport = packet->transport; | 617 | struct sctp_transport *transport = packet->transport; |
620 | __u32 max_burst_bytes; | ||
621 | struct sctp_association *asoc = transport->asoc; | 618 | struct sctp_association *asoc = transport->asoc; |
622 | struct sctp_outq *q = &asoc->outqueue; | 619 | struct sctp_outq *q = &asoc->outqueue; |
623 | 620 | ||
@@ -650,28 +647,6 @@ static sctp_xmit_t sctp_packet_can_append_data(struct sctp_packet *packet, | |||
650 | } | 647 | } |
651 | } | 648 | } |
652 | 649 | ||
653 | /* sctpimpguide-05 2.14.2 | ||
654 | * D) When the time comes for the sender to | ||
655 | * transmit new DATA chunks, the protocol parameter Max.Burst MUST | ||
656 | * first be applied to limit how many new DATA chunks may be sent. | ||
657 | * The limit is applied by adjusting cwnd as follows: | ||
658 | * if ((flightsize + Max.Burst * MTU) < cwnd) | ||
659 | * cwnd = flightsize + Max.Burst * MTU | ||
660 | */ | ||
661 | max_burst_bytes = asoc->max_burst * asoc->pathmtu; | ||
662 | if ((flight_size + max_burst_bytes) < transport->cwnd) { | ||
663 | transport->cwnd = flight_size + max_burst_bytes; | ||
664 | SCTP_DEBUG_PRINTK("%s: cwnd limited by max_burst: " | ||
665 | "transport: %p, cwnd: %d, " | ||
666 | "ssthresh: %d, flight_size: %d, " | ||
667 | "pba: %d\n", | ||
668 | __func__, transport, | ||
669 | transport->cwnd, | ||
670 | transport->ssthresh, | ||
671 | transport->flight_size, | ||
672 | transport->partial_bytes_acked); | ||
673 | } | ||
674 | |||
675 | /* RFC 2960 6.1 Transmission of DATA Chunks | 650 | /* RFC 2960 6.1 Transmission of DATA Chunks |
676 | * | 651 | * |
677 | * B) At any given time, the sender MUST NOT transmit new data | 652 | * B) At any given time, the sender MUST NOT transmit new data |
@@ -747,6 +722,8 @@ static void sctp_packet_append_data(struct sctp_packet *packet, | |||
747 | /* Has been accepted for transmission. */ | 722 | /* Has been accepted for transmission. */ |
748 | if (!asoc->peer.prsctp_capable) | 723 | if (!asoc->peer.prsctp_capable) |
749 | chunk->msg->can_abandon = 0; | 724 | chunk->msg->can_abandon = 0; |
725 | sctp_chunk_assign_tsn(chunk); | ||
726 | sctp_chunk_assign_ssn(chunk); | ||
750 | } | 727 | } |
751 | 728 | ||
752 | static sctp_xmit_t sctp_packet_will_fit(struct sctp_packet *packet, | 729 | static sctp_xmit_t sctp_packet_will_fit(struct sctp_packet *packet, |