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

Function check_drop_rate

dpdk/app/test/test_red.c:234–249  ·  view source on GitHub ↗

* check if drop rate matches drop probability within tolerance */

Source from the content-addressed store, hash-verified

232 * check if drop rate matches drop probability within tolerance
233 */
234static int check_drop_rate(double *diff, double drop_rate, double drop_prob, double tolerance)
235{
236 double abs_diff = 0.0;
237 int ret = 1;
238
239 abs_diff = fabs(drop_rate - drop_prob);
240 if ((int)abs_diff == 0) {
241 *diff = 0.0;
242 } else {
243 *diff = (abs_diff / drop_prob) * 100.0;
244 if (*diff > tolerance) {
245 ret = 0;
246 }
247 }
248 return ret;
249}
250
251/**
252 * check if average queue size is within tolerance

Callers 4

func_test1Function · 0.70
func_test2Function · 0.70
func_test5Function · 0.70
ovfl_test1Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected