sctp_timer.c (171440) | sctp_timer.c (171477) |
---|---|
1/*- 2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * a) Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. --- 17 unchanged lines hidden (view full) --- 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31/* $KAME: sctp_timer.c,v 1.29 2005/03/06 16:04:18 itojun Exp $ */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2007, by Cisco Systems, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * a) Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. --- 17 unchanged lines hidden (view full) --- 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31/* $KAME: sctp_timer.c,v 1.29 2005/03/06 16:04:18 itojun Exp $ */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_timer.c 171440 2007-07-14 09:36:28Z rrs $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/sctp_timer.c 171477 2007-07-17 20:58:26Z rrs $"); |
35 36#define _IP_VHL 37#include <netinet/sctp_os.h> 38#include <netinet/sctp_pcb.h> 39#ifdef INET6 40#include <netinet6/sctp6_var.h> 41#endif 42#include <netinet/sctp_var.h> --- 163 unchanged lines hidden (view full) --- 206 * state, also set the destination to the PF 207 * state. 208 */ 209 /* 210 * Add debug message here if destination is 211 * not in PF state. 212 */ 213 /* Stop any running T3 timers here? */ | 35 36#define _IP_VHL 37#include <netinet/sctp_os.h> 38#include <netinet/sctp_pcb.h> 39#ifdef INET6 40#include <netinet6/sctp6_var.h> 41#endif 42#include <netinet/sctp_var.h> --- 163 unchanged lines hidden (view full) --- 206 * state, also set the destination to the PF 207 * state. 208 */ 209 /* 210 * Add debug message here if destination is 211 * not in PF state. 212 */ 213 /* Stop any running T3 timers here? */ |
214 if (sctp_cmt_pf) { | 214 if (sctp_cmt_on_off && sctp_cmt_pf) { |
215 net->dest_state &= ~SCTP_ADDR_PF; 216 SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n", 217 net); 218 } 219 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, 220 stcb, 221 SCTP_FAILED_THRESHOLD, 222 (void *)net); --- 513 unchanged lines hidden (view full) --- 736 sctp_total_flight_decrease(stcb, chk); 737 stcb->asoc.peers_rwnd += chk->send_size; 738 stcb->asoc.peers_rwnd += sctp_peer_chunk_oh; 739 } 740 chk->sent = SCTP_DATAGRAM_RESEND; 741 SCTP_STAT_INCR(sctps_markedretrans); 742 743 /* reset the TSN for striking and other FR stuff */ | 215 net->dest_state &= ~SCTP_ADDR_PF; 216 SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from PF to unreachable.\n", 217 net); 218 } 219 sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_DOWN, 220 stcb, 221 SCTP_FAILED_THRESHOLD, 222 (void *)net); --- 513 unchanged lines hidden (view full) --- 736 sctp_total_flight_decrease(stcb, chk); 737 stcb->asoc.peers_rwnd += chk->send_size; 738 stcb->asoc.peers_rwnd += sctp_peer_chunk_oh; 739 } 740 chk->sent = SCTP_DATAGRAM_RESEND; 741 SCTP_STAT_INCR(sctps_markedretrans); 742 743 /* reset the TSN for striking and other FR stuff */ |
744 chk->window_probe = 0; | |
745 chk->rec.data.doing_fast_retransmit = 0; 746 /* Clear any time so NO RTT is being done */ 747 chk->do_rtt = 0; 748 if (alt != net) { 749 sctp_free_remote_addr(chk->whoTo); 750 chk->no_fr_allowed = 1; 751 chk->whoTo = alt; 752 atomic_add_int(&alt->ref_count, 1); --- 43 unchanged lines hidden (view full) --- 796 if ((stcb->asoc.sent_queue_retran_cnt == 0) && (could_be_sent)) { 797 /* fix it so we retransmit the highest acked anyway */ 798 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); 799 cnt_mk++; 800 could_be_sent->sent = SCTP_DATAGRAM_RESEND; 801 } 802 if (stcb->asoc.sent_queue_retran_cnt != cnt_mk) { 803#ifdef INVARIANTS | 744 chk->rec.data.doing_fast_retransmit = 0; 745 /* Clear any time so NO RTT is being done */ 746 chk->do_rtt = 0; 747 if (alt != net) { 748 sctp_free_remote_addr(chk->whoTo); 749 chk->no_fr_allowed = 1; 750 chk->whoTo = alt; 751 atomic_add_int(&alt->ref_count, 1); --- 43 unchanged lines hidden (view full) --- 795 if ((stcb->asoc.sent_queue_retran_cnt == 0) && (could_be_sent)) { 796 /* fix it so we retransmit the highest acked anyway */ 797 sctp_ucount_incr(stcb->asoc.sent_queue_retran_cnt); 798 cnt_mk++; 799 could_be_sent->sent = SCTP_DATAGRAM_RESEND; 800 } 801 if (stcb->asoc.sent_queue_retran_cnt != cnt_mk) { 802#ifdef INVARIANTS |
804 SCTP_PRINTF("Local Audit says there are %d for retran asoc cnt:%d\n", 805 cnt_mk, stcb->asoc.sent_queue_retran_cnt); | 803 SCTP_PRINTF("Local Audit says there are %d for retran asoc cnt:%d we marked:%d this time\n", 804 cnt_mk, stcb->asoc.sent_queue_retran_cnt, num_mk); |
806#endif 807#ifndef SCTP_AUDITING_ENABLED 808 stcb->asoc.sent_queue_retran_cnt = cnt_mk; 809#endif 810 } 811 /* Now check for a ECN Echo that may be stranded */ 812 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { 813 if ((chk->whoTo == net) && --- 125 unchanged lines hidden (view full) --- 939 940 /* 941 * JRS 5/14/07 - If CMT PF is on and the destination if not already 942 * in PF state, set the destination to PF state and store the 943 * current time as the time that the destination was last active. In 944 * addition, find an alternate destination with PF-based 945 * find_alt_net(). 946 */ | 805#endif 806#ifndef SCTP_AUDITING_ENABLED 807 stcb->asoc.sent_queue_retran_cnt = cnt_mk; 808#endif 809 } 810 /* Now check for a ECN Echo that may be stranded */ 811 TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { 812 if ((chk->whoTo == net) && --- 125 unchanged lines hidden (view full) --- 938 939 /* 940 * JRS 5/14/07 - If CMT PF is on and the destination if not already 941 * in PF state, set the destination to PF state and store the 942 * current time as the time that the destination was last active. In 943 * addition, find an alternate destination with PF-based 944 * find_alt_net(). 945 */ |
947 if (sctp_cmt_pf) { | 946 if (sctp_cmt_on_off && sctp_cmt_pf) { |
948 if ((net->dest_state & SCTP_ADDR_PF) != SCTP_ADDR_PF) { 949 net->dest_state |= SCTP_ADDR_PF; | 947 if ((net->dest_state & SCTP_ADDR_PF) != SCTP_ADDR_PF) { 948 net->dest_state |= SCTP_ADDR_PF; |
950 net->last_active = ticks; | 949 net->last_active = sctp_get_tick_count(); |
951 SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from active to PF.\n", 952 net); 953 } 954 alt = sctp_find_alternate_net(stcb, net, 2); 955 } else if (sctp_cmt_on_off) { 956 /* 957 * CMT: Using RTX_SSTHRESH policy for CMT. If CMT is being 958 * used, then pick dest with largest ssthresh for any --- 99 unchanged lines hidden (view full) --- 1058 * from any net structures. 1059 */ 1060 if (sctp_set_primary_addr(stcb, 1061 (struct sockaddr *)NULL, 1062 alt) == 0) { 1063 net->dest_state |= SCTP_ADDR_WAS_PRIMARY; 1064 } 1065 } | 950 SCTPDBG(SCTP_DEBUG_TIMER4, "Destination %p moved from active to PF.\n", 951 net); 952 } 953 alt = sctp_find_alternate_net(stcb, net, 2); 954 } else if (sctp_cmt_on_off) { 955 /* 956 * CMT: Using RTX_SSTHRESH policy for CMT. If CMT is being 957 * used, then pick dest with largest ssthresh for any --- 99 unchanged lines hidden (view full) --- 1057 * from any net structures. 1058 */ 1059 if (sctp_set_primary_addr(stcb, 1060 (struct sockaddr *)NULL, 1061 alt) == 0) { 1062 net->dest_state |= SCTP_ADDR_WAS_PRIMARY; 1063 } 1064 } |
1066 } else if (sctp_cmt_pf && (net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF) { | 1065 } else if (sctp_cmt_on_off && sctp_cmt_pf && (net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF) { |
1067 /* 1068 * JRS 5/14/07 - If the destination hasn't failed completely 1069 * but is in PF state, a PF-heartbeat needs to be sent 1070 * manually. 1071 */ 1072 if (sctp_send_hb(stcb, 1, net) < 0) 1073 return 1; 1074 } --- 825 unchanged lines hidden --- | 1066 /* 1067 * JRS 5/14/07 - If the destination hasn't failed completely 1068 * but is in PF state, a PF-heartbeat needs to be sent 1069 * manually. 1070 */ 1071 if (sctp_send_hb(stcb, 1, net) < 0) 1072 return 1; 1073 } --- 825 unchanged lines hidden --- |