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

Function check_drop_rate

dpdk/app/test/test_pie.c:207–222  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

205 * check if drop rate matches drop probability within tolerance
206 */
207static int check_drop_rate(double *diff, double drop_rate, double drop_prob,
208 double tolerance)
209{
210 double abs_diff = 0.0;
211 int ret = 1;
212
213 abs_diff = fabs(drop_rate - drop_prob);
214 if ((int)abs_diff == 0) {
215 *diff = 0.0;
216 } else {
217 *diff = (abs_diff / drop_prob) * 100.0;
218 if (*diff > tolerance)
219 ret = 0;
220 }
221 return ret;
222}
223
224/**
225 * initialize the test rte_pie config

Callers 1

func_test2Function · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected