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

Function test_create_bonding_device

dpdk/app/test/test_link_bonding.c:263–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263static int
264test_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
304static int

Callers

nothing calls this directly

Calls 6

rte_eth_bond_createFunction · 0.85
rte_socket_idFunction · 0.85
rte_eth_bond_mode_setFunction · 0.85
rte_eth_bond_members_getFunction · 0.85
configure_ethdevFunction · 0.70

Tested by

no test coverage detected