]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet/tcp_cc.h
xnu-7195.50.7.100.1.tar.gz
[apple/xnu.git] / bsd / netinet / tcp_cc.h
index 3f484dac04f19e39510490aa046edc8b56a18cac..8bd1778ae769c627545b2b136ed8dd391aae40ed 100644 (file)
@@ -222,6 +222,7 @@ extern struct zone *tcp_cc_zone;
 extern struct tcp_cc_algo* tcp_cc_algo_list[TCP_CC_ALGO_COUNT];
 
 #define CC_ALGO(tp) (tcp_cc_algo_list[tp->tcp_cc_index])
+#define TCP_CC_CWND_INIT_PKTS 10
 #define TCP_CC_CWND_INIT_BYTES  4380
 /*
  * The congestion window will have to be reset after a
@@ -243,5 +244,15 @@ extern void tcp_cc_adjust_nonvalidated_cwnd(struct tcpcb *tp);
 extern u_int32_t tcp_get_max_pipeack(struct tcpcb *tp);
 extern void tcp_clear_pipeack_state(struct tcpcb *tp);
 
+static inline uint32_t
+tcp_initial_cwnd(struct tcpcb *tp)
+{
+       if (tcp_cubic_minor_fixes) {
+               return TCP_CC_CWND_INIT_PKTS * tp->t_maxseg;
+       } else {
+               return TCP_CC_CWND_INIT_BYTES;
+       }
+}
+
 #endif /* KERNEL_PRIVATE */
 #endif /* _NETINET_CC_H_ */