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

Function check_environment

dpdk/app/test/test_link_bonding_mode4.c:1518–1561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1516}
1517
1518static int
1519check_environment(void)
1520{
1521 struct member_conf *port;
1522 uint8_t i, env_state;
1523 uint16_t members[RTE_DIM(test_params.member_ports)];
1524 int members_count;
1525
1526 env_state = 0;
1527 FOR_EACH_PORT(i, port) {
1528 if (rte_ring_count(port->rx_queue) != 0)
1529 env_state |= 0x01;
1530
1531 if (rte_ring_count(port->tx_queue) != 0)
1532 env_state |= 0x02;
1533
1534 if (port->bonding != 0)
1535 env_state |= 0x04;
1536
1537 if (port->lacp_parnter_state != 0)
1538 env_state |= 0x08;
1539
1540 if (env_state != 0)
1541 break;
1542 }
1543
1544 members_count = rte_eth_bond_members_get(test_params.bonding_port_id,
1545 members, RTE_DIM(members));
1546
1547 if (members_count != 0)
1548 env_state |= 0x10;
1549
1550 TEST_ASSERT_EQUAL(env_state, 0,
1551 "Environment not clean (port %u):%s%s%s%s%s",
1552 port->port_id,
1553 env_state & 0x01 ? " member rx queue not clean" : "",
1554 env_state & 0x02 ? " member tx queue not clean" : "",
1555 env_state & 0x04 ? " port marked as enmemberd" : "",
1556 env_state & 0x80 ? " member state is not reset" : "",
1557 env_state & 0x10 ? " member count not equal 0" : ".");
1558
1559
1560 return TEST_SUCCESS;
1561}
1562
1563static int
1564test_mode4_executor(int (*test_func)(void))

Callers 1

test_mode4_executorFunction · 0.70

Calls 2

rte_ring_countFunction · 0.85
rte_eth_bond_members_getFunction · 0.85

Tested by

no test coverage detected