| 261 | } |
| 262 | |
| 263 | static int |
| 264 | test_create_bonding_device(void) |
| 265 | { |
| 266 | int current_member_count; |
| 267 | |
| 268 | uint16_t members[RTE_MAX_ETHPORTS]; |
| 269 | |
| 270 | /* Don't try to recreate bonding device if re-running test suite*/ |
| 271 | if (test_params->bonding_port_id == -1) { |
| 272 | test_params->bonding_port_id = rte_eth_bond_create(BONDING_DEV_NAME, |
| 273 | test_params->bonding_mode, rte_socket_id()); |
| 274 | |
| 275 | TEST_ASSERT(test_params->bonding_port_id >= 0, |
| 276 | "Failed to create bonding ethdev %s", BONDING_DEV_NAME); |
| 277 | |
| 278 | TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonding_port_id, 0, 0), |
| 279 | "Failed to configure bonding ethdev %s", BONDING_DEV_NAME); |
| 280 | } |
| 281 | |
| 282 | TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonding_port_id, |
| 283 | test_params->bonding_mode), "Failed to set ethdev %d to mode %d", |
| 284 | test_params->bonding_port_id, test_params->bonding_mode); |
| 285 | |
| 286 | current_member_count = rte_eth_bond_members_get(test_params->bonding_port_id, |
| 287 | members, RTE_MAX_ETHPORTS); |
| 288 | |
| 289 | TEST_ASSERT_EQUAL(current_member_count, 0, |
| 290 | "Number of members %d is great than expected %d.", |
| 291 | current_member_count, 0); |
| 292 | |
| 293 | current_member_count = rte_eth_bond_active_members_get( |
| 294 | test_params->bonding_port_id, members, RTE_MAX_ETHPORTS); |
| 295 | |
| 296 | TEST_ASSERT_EQUAL(current_member_count, 0, |
| 297 | "Number of active members %d is great than expected %d.", |
| 298 | current_member_count, 0); |
| 299 | |
| 300 | return 0; |
| 301 | } |
| 302 | |
| 303 | |
| 304 | static int |
nothing calls this directly
no test coverage detected