Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/cc/cc_cubic.h
Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | |||||
* the value of cwnd at the last congestion event. | * the value of cwnd at the last congestion event. | ||||
*/ | */ | ||||
static __inline unsigned long | static __inline unsigned long | ||||
tf_cwnd(int ticks_since_cong, int rtt_ticks, unsigned long wmax, | tf_cwnd(int ticks_since_cong, int rtt_ticks, unsigned long wmax, | ||||
uint32_t smss) | uint32_t smss) | ||||
{ | { | ||||
/* Equation 4 of I-D. */ | /* Equation 4 of I-D. */ | ||||
return (((wmax * CUBIC_BETA) + (((THREE_X_PT3 * ticks_since_cong * | return (((wmax * CUBIC_BETA) + | ||||
smss) << CUBIC_SHIFT) / TWO_SUB_PT3 / rtt_ticks)) >> CUBIC_SHIFT); | (((THREE_X_PT3 * (unsigned long)ticks_since_cong * | ||||
(unsigned long)smss) << CUBIC_SHIFT) / TWO_SUB_PT3 / rtt_ticks)) | |||||
>> CUBIC_SHIFT); | |||||
} | } | ||||
#endif /* _NETINET_CC_CUBIC_H_ */ | #endif /* _NETINET_CC_CUBIC_H_ */ |