• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/net/ipv4/

Lines Matching refs:ca

48 static inline u32 htcp_cong_time(const struct htcp *ca)
50 return jiffies - ca->last_cong;
53 static inline u32 htcp_ccount(const struct htcp *ca)
55 return htcp_cong_time(ca) / ca->minRTT;
58 static inline void htcp_reset(struct htcp *ca)
60 ca->undo_last_cong = ca->last_cong;
61 ca->undo_maxRTT = ca->maxRTT;
62 ca->undo_old_maxB = ca->old_maxB;
64 ca->last_cong = jiffies;
70 struct htcp *ca = inet_csk_ca(sk);
72 ca->last_cong = ca->undo_last_cong;
73 ca->maxRTT = ca->undo_maxRTT;
74 ca->old_maxB = ca->undo_old_maxB;
76 return max(tp->snd_cwnd, (tp->snd_ssthresh << 7) / ca->beta);
83 struct htcp *ca = inet_csk_ca(sk);
87 if (ca->minRTT > srtt || !ca->minRTT)
88 ca->minRTT = srtt;
92 && tp->snd_ssthresh < 0xFFFF && htcp_ccount(ca) > 3) {
93 if (ca->maxRTT < ca->minRTT)
94 ca->maxRTT = ca->minRTT;
95 if (ca->maxRTT < srtt
96 && srtt <= ca->maxRTT + msecs_to_jiffies(20))
97 ca->maxRTT = srtt;
105 struct htcp *ca = inet_csk_ca(sk);
109 ca->pkts_acked = pkts_acked;
117 ca->packetcount = 0;
118 ca->lasttime = now;
122 ca->packetcount += pkts_acked;
124 if (ca->packetcount >= tp->snd_cwnd - (ca->alpha >> 7 ? : 1)
125 && now - ca->lasttime >= ca->minRTT
126 && ca->minRTT > 0) {
127 __u32 cur_Bi = ca->packetcount * HZ / (now - ca->lasttime);
129 if (htcp_ccount(ca) <= 3) {
131 ca->minB = ca->maxB = ca->Bi = cur_Bi;
133 ca->Bi = (3 * ca->Bi + cur_Bi) / 4;
134 if (ca->Bi > ca->maxB)
135 ca->maxB = ca->Bi;
136 if (ca->minB > ca->maxB)
137 ca->minB = ca->maxB;
139 ca->packetcount = 0;
140 ca->lasttime = now;
144 static inline void htcp_beta_update(struct htcp *ca, u32 minRTT, u32 maxRTT)
147 u32 maxB = ca->maxB;
148 u32 old_maxB = ca->old_maxB;
149 ca->old_maxB = ca->maxB;
152 ca->beta = BETA_MIN;
153 ca->modeswitch = 0;
158 if (ca->modeswitch && minRTT > msecs_to_jiffies(10) && maxRTT) {
159 ca->beta = (minRTT << 7) / maxRTT;
160 if (ca->beta < BETA_MIN)
161 ca->beta = BETA_MIN;
162 else if (ca->beta > BETA_MAX)
163 ca->beta = BETA_MAX;
165 ca->beta = BETA_MIN;
166 ca->modeswitch = 1;
170 static inline void htcp_alpha_update(struct htcp *ca)
172 u32 minRTT = ca->minRTT;
174 u32 diff = htcp_cong_time(ca);
191 ca->alpha = 2 * factor * ((1 << 7) - ca->beta);
192 if (!ca->alpha)
193 ca->alpha = ALPHA_BASE;
207 struct htcp *ca = inet_csk_ca(sk);
208 u32 minRTT = ca->minRTT;
209 u32 maxRTT = ca->maxRTT;
211 htcp_beta_update(ca, minRTT, maxRTT);
212 htcp_alpha_update(ca);
216 ca->maxRTT = minRTT + ((maxRTT - minRTT) * 95) / 100;
222 const struct htcp *ca = inet_csk_ca(sk);
225 return max((tp->snd_cwnd * ca->beta) >> 7, 2U);
232 struct htcp *ca = inet_csk_ca(sk);
245 if ((tp->snd_cwnd_cnt * ca->alpha)>>7 >= tp->snd_cwnd) {
249 htcp_alpha_update(ca);
251 tp->snd_cwnd_cnt += ca->pkts_acked;
253 ca->pkts_acked = 1;
259 struct htcp *ca = inet_csk_ca(sk);
261 memset(ca, 0, sizeof(struct htcp));
262 ca->alpha = ALPHA_BASE;
263 ca->beta = BETA_MIN;
264 ca->pkts_acked = 1;
265 ca->last_cong = jiffies;
273 struct htcp *ca = inet_csk_ca(sk);
274 ca->last_cong = jiffies;