* check if drop rate matches drop probability within tolerance */
| 205 | * check if drop rate matches drop probability within tolerance |
| 206 | */ |
| 207 | static 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 |