MCPcopy Create free account
hub / github.com/F-Stack/f-stack / calc_drop_prob

Function calc_drop_prob

dpdk/app/test/test_red.c:214–229  ·  view source on GitHub ↗

* calculate the drop probability */

Source from the content-addressed store, hash-verified

212 * calculate the drop probability
213 */
214static double calc_drop_prob(uint32_t min_th, uint32_t max_th,
215 uint32_t maxp_inv, uint32_t avg)
216{
217 double drop_prob = 0.0;
218
219 if (avg < min_th) {
220 drop_prob = 0.0;
221 } else if (avg < max_th) {
222 drop_prob = (1.0 / (double)maxp_inv)
223 * ((double)(avg - min_th)
224 / (double)(max_th - min_th));
225 } else {
226 drop_prob = 1.0;
227 }
228 return drop_prob;
229}
230
231/**
232 * check if drop rate matches drop probability within tolerance

Callers 4

func_test1Function · 0.85
func_test2Function · 0.85
func_test5Function · 0.85
ovfl_test1Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected