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

Function test_mode4_executor

dpdk/app/test/test_link_bonding_mode4.c:1563–1602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1561}
1562
1563static int
1564test_mode4_executor(int (*test_func)(void))
1565{
1566 struct member_conf *port;
1567 int test_result;
1568 uint8_t i;
1569 void *pkt;
1570
1571 /* Check if environment is clean. Fail to launch a test if there was
1572 * a critical error before that prevented to reset environment. */
1573 TEST_ASSERT_SUCCESS(check_environment(),
1574 "Refusing to launch test in dirty environment.");
1575
1576 RTE_VERIFY(test_func != NULL);
1577 test_result = (*test_func)();
1578
1579 /* If test succeed check if environment wast left in good condition. */
1580 if (test_result == TEST_SUCCESS)
1581 test_result = check_environment();
1582
1583 /* Reset environment in case test failed to do that. */
1584 if (test_result != TEST_SUCCESS) {
1585 TEST_ASSERT_SUCCESS(remove_members_and_stop_bonding_device(),
1586 "Failed to stop bonding device");
1587
1588 FOR_EACH_PORT(i, port) {
1589 while (rte_ring_count(port->rx_queue) != 0) {
1590 if (rte_ring_dequeue(port->rx_queue, &pkt) == 0)
1591 rte_pktmbuf_free(pkt);
1592 }
1593
1594 while (rte_ring_count(port->tx_queue) != 0) {
1595 if (rte_ring_dequeue(port->tx_queue, &pkt) == 0)
1596 rte_pktmbuf_free(pkt);
1597 }
1598 }
1599 }
1600
1601 return test_result;
1602}
1603
1604static int
1605test_mode4_agg_mode_selection_wrapper(void){

Calls 5

rte_ring_countFunction · 0.85
rte_ring_dequeueFunction · 0.85
rte_pktmbuf_freeFunction · 0.85
check_environmentFunction · 0.70

Tested by

no test coverage detected