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

Function ovfl_test1

dpdk/app/test/test_red.c:1613–1694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1611};
1612
1613static enum test_result ovfl_test1(struct test_config *tcfg)
1614{
1615 enum test_result result = PASS;
1616 uint32_t avg = 0;
1617 uint32_t i = 0;
1618 double drop_rate = 0.0;
1619 double drop_prob = 0.0;
1620 double diff = 0.0;
1621 int ret = 0;
1622
1623 printf("%s", tcfg->msg);
1624
1625 if (test_rte_red_init(tcfg) != PASS) {
1626
1627 result = FAIL;
1628 goto out;
1629 }
1630
1631 /**
1632 * reset rte_red run-time data
1633 */
1634 rte_red_rt_data_init(tcfg->tqueue->rdata);
1635
1636 /**
1637 * increase actual queue size
1638 */
1639 for (i = 0; i < tcfg->tqueue->q_ramp_up; i++) {
1640 ret = rte_red_enqueue(tcfg->tconfig->rconfig, tcfg->tqueue->rdata,
1641 *tcfg->tqueue->q, get_port_ts());
1642
1643 if (ret == 0) {
1644 if (++(*tcfg->tqueue->q) >= *tcfg->tlevel)
1645 break;
1646 }
1647 }
1648
1649 /**
1650 * enqueue
1651 */
1652 for (i = 0; i < tcfg->tqueue->avg_ramp_up; i++) {
1653 ret = rte_red_enqueue(tcfg->tconfig->rconfig, tcfg->tqueue->rdata,
1654 *tcfg->tqueue->q, get_port_ts());
1655 ovfl_check_avg((*tcfg->tqueue->rdata).avg);
1656 avg = rte_red_get_avg_int(tcfg->tconfig->rconfig, tcfg->tqueue->rdata);
1657 if (avg == *tcfg->tlevel) {
1658 if (ret == 0)
1659 (*tcfg->tvar->enqueued)++;
1660 else
1661 (*tcfg->tvar->dropped)++;
1662 }
1663 }
1664
1665 /**
1666 * check if target average queue size has been reached
1667 */
1668 avg = rte_red_get_avg_int(tcfg->tconfig->rconfig, tcfg->tqueue->rdata);
1669 if (avg != *tcfg->tlevel) {
1670 result = FAIL;

Callers

nothing calls this directly

Calls 10

test_rte_red_initFunction · 0.85
rte_red_rt_data_initFunction · 0.85
rte_red_enqueueFunction · 0.85
ovfl_check_avgFunction · 0.85
rte_red_get_avg_intFunction · 0.85
calc_drop_probFunction · 0.85
get_port_tsFunction · 0.70
calc_drop_rateFunction · 0.70
check_drop_rateFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected