Print this page
5295 remove maxburst logic from TCP's send algorithm Reviewed by: Dan McDonald <danmcd@omniti.com>


   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
  25  * Copyright 2011 Joyent, Inc.  All rights reserved.

  26  */
  27 
  28 #include <sys/types.h>
  29 #include <sys/strlog.h>
  30 #include <sys/strsun.h>
  31 #include <sys/squeue_impl.h>
  32 #include <sys/squeue.h>
  33 #include <sys/callo.h>
  34 #include <sys/strsubr.h>
  35 
  36 #include <inet/common.h>
  37 #include <inet/ip.h>
  38 #include <inet/ip_ire.h>
  39 #include <inet/ip_rts.h>
  40 #include <inet/tcp.h>
  41 #include <inet/tcp_impl.h>
  42 
  43 /*
  44  * Implementation of TCP Timers.
  45  * =============================


1049         /*
1050          * This is after a timeout and tcp_rto is backed off.  Set
1051          * tcp_set_timer to 1 so that next time RTO is updated, we will
1052          * restart the timer with a correct value.
1053          */
1054         tcp->tcp_set_timer = 1;
1055         mss = tcp->tcp_snxt - tcp->tcp_suna;
1056         if (mss > tcp->tcp_mss)
1057                 mss = tcp->tcp_mss;
1058         if (mss > tcp->tcp_swnd && tcp->tcp_swnd != 0)
1059                 mss = tcp->tcp_swnd;
1060 
1061         if ((mp = tcp->tcp_xmit_head) != NULL)
1062                 mp->b_prev = (mblk_t *)ddi_get_lbolt();
1063         mp = tcp_xmit_mp(tcp, mp, mss, NULL, NULL, tcp->tcp_suna, B_TRUE, &mss,
1064             B_TRUE);
1065 
1066         /*
1067          * When slow start after retransmission begins, start with
1068          * this seq no.  tcp_rexmit_max marks the end of special slow
1069          * start phase.  tcp_snd_burst controls how many segments
1070          * can be sent because of an ack.
1071          */
1072         tcp->tcp_rexmit_nxt = tcp->tcp_suna;
1073         tcp->tcp_snd_burst = TCP_CWND_SS;
1074         if ((tcp->tcp_valid_bits & TCP_FSS_VALID) &&
1075             (tcp->tcp_unsent == 0)) {
1076                 tcp->tcp_rexmit_max = tcp->tcp_fss;
1077         } else {
1078                 tcp->tcp_rexmit_max = tcp->tcp_snxt;
1079         }
1080         tcp->tcp_rexmit = B_TRUE;
1081         tcp->tcp_dupack_cnt = 0;
1082 
1083         /*
1084          * Remove all rexmit SACK blk to start from fresh.
1085          */
1086         if (tcp->tcp_snd_sack_ok)
1087                 TCP_NOTSACK_REMOVE_ALL(tcp->tcp_notsack_list, tcp);
1088         if (mp == NULL) {
1089                 return;
1090         }
1091 
1092         tcp->tcp_csuna = tcp->tcp_snxt;
1093         TCPS_BUMP_MIB(tcps, tcpRetransSegs);


   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
  25  * Copyright 2011 Joyent, Inc.  All rights reserved.
  26  * Copyright (c) 2014 by Delphix. All rights reserved.
  27  */
  28 
  29 #include <sys/types.h>
  30 #include <sys/strlog.h>
  31 #include <sys/strsun.h>
  32 #include <sys/squeue_impl.h>
  33 #include <sys/squeue.h>
  34 #include <sys/callo.h>
  35 #include <sys/strsubr.h>
  36 
  37 #include <inet/common.h>
  38 #include <inet/ip.h>
  39 #include <inet/ip_ire.h>
  40 #include <inet/ip_rts.h>
  41 #include <inet/tcp.h>
  42 #include <inet/tcp_impl.h>
  43 
  44 /*
  45  * Implementation of TCP Timers.
  46  * =============================


1050         /*
1051          * This is after a timeout and tcp_rto is backed off.  Set
1052          * tcp_set_timer to 1 so that next time RTO is updated, we will
1053          * restart the timer with a correct value.
1054          */
1055         tcp->tcp_set_timer = 1;
1056         mss = tcp->tcp_snxt - tcp->tcp_suna;
1057         if (mss > tcp->tcp_mss)
1058                 mss = tcp->tcp_mss;
1059         if (mss > tcp->tcp_swnd && tcp->tcp_swnd != 0)
1060                 mss = tcp->tcp_swnd;
1061 
1062         if ((mp = tcp->tcp_xmit_head) != NULL)
1063                 mp->b_prev = (mblk_t *)ddi_get_lbolt();
1064         mp = tcp_xmit_mp(tcp, mp, mss, NULL, NULL, tcp->tcp_suna, B_TRUE, &mss,
1065             B_TRUE);
1066 
1067         /*
1068          * When slow start after retransmission begins, start with
1069          * this seq no.  tcp_rexmit_max marks the end of special slow
1070          * start phase.

1071          */
1072         tcp->tcp_rexmit_nxt = tcp->tcp_suna;

1073         if ((tcp->tcp_valid_bits & TCP_FSS_VALID) &&
1074             (tcp->tcp_unsent == 0)) {
1075                 tcp->tcp_rexmit_max = tcp->tcp_fss;
1076         } else {
1077                 tcp->tcp_rexmit_max = tcp->tcp_snxt;
1078         }
1079         tcp->tcp_rexmit = B_TRUE;
1080         tcp->tcp_dupack_cnt = 0;
1081 
1082         /*
1083          * Remove all rexmit SACK blk to start from fresh.
1084          */
1085         if (tcp->tcp_snd_sack_ok)
1086                 TCP_NOTSACK_REMOVE_ALL(tcp->tcp_notsack_list, tcp);
1087         if (mp == NULL) {
1088                 return;
1089         }
1090 
1091         tcp->tcp_csuna = tcp->tcp_snxt;
1092         TCPS_BUMP_MIB(tcps, tcpRetransSegs);