From 25aea59871533585bbaa18bdf7757e48aecb5380 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 30 Mar 2023 10:24:03 -0700 Subject: [PATCH 05/12] bonding: replace use of slave device with child device The term slave is inherited from the Linux bonding device and does not conform to the Linux Foundation Non-Inclusive Naming policy. Other networking products, operating systems, and 802 standards do not use the terms master or slave. For DPDK change to using the terms parent and child when referring to devices that are managed in bond device. Mark the old visible API's as deprecated and remove from the ABI. Signed-off-by: Stephen Hemminger --- app/test-pmd/testpmd.c | 112 +- app/test-pmd/testpmd.h | 8 +- app/test/test_link_bonding.c | 2724 ++++++++--------- app/test/test_link_bonding_mode4.c | 584 ++-- app/test/test_link_bonding_rssconf.c | 166 +- doc/guides/howto/lm_bond_virtio_sriov.rst | 24 +- doc/guides/nics/bnxt.rst | 4 +- .../link_bonding_poll_mode_drv_lib.rst | 222 +- doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +- drivers/net/bonding/bonding_testpmd.c | 178 +- drivers/net/bonding/eth_bond_8023ad_private.h | 40 +- drivers/net/bonding/eth_bond_private.h | 116 +- drivers/net/bonding/rte_eth_bond.h | 102 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 370 +-- drivers/net/bonding/rte_eth_bond_8023ad.h | 66 +- drivers/net/bonding/rte_eth_bond_alb.c | 44 +- drivers/net/bonding/rte_eth_bond_alb.h | 20 +- drivers/net/bonding/rte_eth_bond_api.c | 464 +-- drivers/net/bonding/rte_eth_bond_args.c | 32 +- drivers/net/bonding/rte_eth_bond_flow.c | 54 +- drivers/net/bonding/rte_eth_bond_pmd.c | 1368 ++++----- drivers/net/bonding/version.map | 10 +- examples/bond/main.c | 40 +- lib/ethdev/rte_ethdev.h | 6 +- 24 files changed, 3391 insertions(+), 3367 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 5cb6f9252395..64465d0f151d 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -588,27 +588,27 @@ eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, } static int -change_bonding_slave_port_status(portid_t bond_pid, bool is_stop) +change_bonding_child_port_status(portid_t bond_pid, bool is_stop) { #ifdef RTE_NET_BOND - portid_t slave_pids[RTE_MAX_ETHPORTS]; + portid_t child_pids[RTE_MAX_ETHPORTS]; struct rte_port *port; - int num_slaves; - portid_t slave_pid; + int num_children; + portid_t child_pid; int i; - num_slaves = rte_eth_bond_slaves_get(bond_pid, slave_pids, + num_children = rte_eth_bond_children_get(bond_pid, child_pids, RTE_MAX_ETHPORTS); - if (num_slaves < 0) { - fprintf(stderr, "Failed to get slave list for port = %u\n", + if (num_children < 0) { + fprintf(stderr, "Failed to get child list for port = %u\n", bond_pid); - return num_slaves; + return num_children; } - for (i = 0; i < num_slaves; i++) { - slave_pid = slave_pids[i]; - port = &ports[slave_pid]; + for (i = 0; i < num_children; i++) { + child_pid = child_pids[i]; + port = &ports[child_pid]; port->port_status = is_stop ? RTE_PORT_STOPPED : RTE_PORT_STARTED; } @@ -632,12 +632,12 @@ eth_dev_start_mp(uint16_t port_id) struct rte_port *port = &ports[port_id]; /* - * Starting a bonded port also starts all slaves under the bonded + * Starting a bonded port also starts all children under the bonded * device. So if this port is bond device, we need to modify the - * port status of these slaves. + * port status of these children. */ if (port->bond_flag == 1) - return change_bonding_slave_port_status(port_id, false); + return change_bonding_child_port_status(port_id, false); } return 0; @@ -656,12 +656,12 @@ eth_dev_stop_mp(uint16_t port_id) struct rte_port *port = &ports[port_id]; /* - * Stopping a bonded port also stops all slaves under the bonded + * Stopping a bonded port also stops all children under the bonded * device. So if this port is bond device, we need to modify the - * port status of these slaves. + * port status of these children. */ if (port->bond_flag == 1) - return change_bonding_slave_port_status(port_id, true); + return change_bonding_child_port_status(port_id, true); } return 0; @@ -2610,7 +2610,7 @@ all_ports_started(void) port = &ports[pi]; /* Check if there is a port which is not started */ if ((port->port_status != RTE_PORT_STARTED) && - (port->slave_flag == 0)) + (port->child_flag == 0)) return 0; } @@ -2624,7 +2624,7 @@ port_is_stopped(portid_t port_id) struct rte_port *port = &ports[port_id]; if ((port->port_status != RTE_PORT_STOPPED) && - (port->slave_flag == 0)) + (port->child_flag == 0)) return 0; return 1; } @@ -2970,8 +2970,8 @@ fill_xstats_display_info(void) /* * Some capabilities (like, rx_offload_capa and tx_offload_capa) of bonding - * device in dev_info is zero when no slave is added. And its capability - * will be updated when add a new slave device. So adding a slave device need + * device in dev_info is zero when no child is added. And its capability + * will be updated when add a new child device. So adding a child device need * to update the port configurations of bonding device. */ static void @@ -3028,7 +3028,7 @@ start_port(portid_t pid) if (pid != pi && pid != (portid_t)RTE_PORT_ALL) continue; - if (port_is_bonding_slave(pi)) { + if (port_is_bonding_child(pi)) { fprintf(stderr, "Please remove port %d from bonded device.\n", pi); @@ -3350,7 +3350,7 @@ stop_port(portid_t pid) continue; } - if (port_is_bonding_slave(pi)) { + if (port_is_bonding_child(pi)) { fprintf(stderr, "Please remove port %d from bonded device.\n", pi); @@ -3439,28 +3439,28 @@ flush_port_owned_resources(portid_t pi) } static void -clear_bonding_slave_device(portid_t *slave_pids, uint16_t num_slaves) +clear_bonding_child_device(portid_t *child_pids, uint16_t num_children) { struct rte_port *port; - portid_t slave_pid; + portid_t child_pid; uint16_t i; - for (i = 0; i < num_slaves; i++) { - slave_pid = slave_pids[i]; - if (port_is_started(slave_pid) == 1) { - if (rte_eth_dev_stop(slave_pid) != 0) + for (i = 0; i < num_children; i++) { + child_pid = child_pids[i]; + if (port_is_started(child_pid) == 1) { + if (rte_eth_dev_stop(child_pid) != 0) fprintf(stderr, "rte_eth_dev_stop failed for port %u\n", - slave_pid); + child_pid); - port = &ports[slave_pid]; + port = &ports[child_pid]; port->port_status = RTE_PORT_STOPPED; } - clear_port_slave_flag(slave_pid); + clear_port_child_flag(child_pid); - /* Close slave device when testpmd quit or is killed. */ + /* Close child device when testpmd quit or is killed. */ if (cl_quit == 1 || f_quit == 1) - rte_eth_dev_close(slave_pid); + rte_eth_dev_close(child_pid); } } @@ -3469,8 +3469,8 @@ close_port(portid_t pid) { portid_t pi; struct rte_port *port; - portid_t slave_pids[RTE_MAX_ETHPORTS]; - int num_slaves = 0; + portid_t child_pids[RTE_MAX_ETHPORTS]; + int num_children = 0; if (port_id_is_invalid(pid, ENABLED_WARN)) return; @@ -3488,7 +3488,7 @@ close_port(portid_t pid) continue; } - if (port_is_bonding_slave(pi)) { + if (port_is_bonding_child(pi)) { fprintf(stderr, "Please remove port %d from bonded device.\n", pi); @@ -3505,17 +3505,17 @@ close_port(portid_t pid) flush_port_owned_resources(pi); #ifdef RTE_NET_BOND if (port->bond_flag == 1) - num_slaves = rte_eth_bond_slaves_get(pi, - slave_pids, RTE_MAX_ETHPORTS); + num_children = rte_eth_bond_children_get(pi, + child_pids, RTE_MAX_ETHPORTS); #endif rte_eth_dev_close(pi); /* - * If this port is bonded device, all slaves under the + * If this port is bonded device, all children under the * device need to be removed or closed. */ - if (port->bond_flag == 1 && num_slaves > 0) - clear_bonding_slave_device(slave_pids, - num_slaves); + if (port->bond_flag == 1 && num_children > 0) + clear_bonding_child_device(child_pids, + num_children); } free_xstats_display_info(pi); @@ -3555,7 +3555,7 @@ reset_port(portid_t pid) continue; } - if (port_is_bonding_slave(pi)) { + if (port_is_bonding_child(pi)) { fprintf(stderr, "Please remove port %d from bonded device.\n", pi); @@ -4203,38 +4203,38 @@ init_port_config(void) } } -void set_port_slave_flag(portid_t slave_pid) +void set_port_child_flag(portid_t child_pid) { struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag = 1; + port = &ports[child_pid]; + port->child_flag = 1; } -void clear_port_slave_flag(portid_t slave_pid) +void clear_port_child_flag(portid_t child_pid) { struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag = 0; + port = &ports[child_pid]; + port->child_flag = 0; } -uint8_t port_is_bonding_slave(portid_t slave_pid) +uint8_t port_is_bonding_child(portid_t child_pid) { struct rte_port *port; struct rte_eth_dev_info dev_info; int ret; - port = &ports[slave_pid]; - ret = eth_dev_info_get_print_err(slave_pid, &dev_info); + port = &ports[child_pid]; + ret = eth_dev_info_get_print_err(child_pid, &dev_info); if (ret != 0) { TESTPMD_LOG(ERR, "Failed to get device info for port id %d," - "cannot determine if the port is a bonded slave", - slave_pid); + "cannot determine if the port is a bonded child", + child_pid); return 0; } - if ((*dev_info.dev_flags & RTE_ETH_DEV_BONDED_SLAVE) || (port->slave_flag == 1)) + if ((*dev_info.dev_flags & RTE_ETH_DEV_BONDED_CHILD) || (port->child_flag == 1)) return 1; return 0; } diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index bdfbfd36d3c5..51cf600dc49e 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -321,7 +321,7 @@ struct rte_port { uint32_t mc_addr_nb; /**< nb. of addr. in mc_addr_pool */ queueid_t queue_nb; /**< nb. of queues for flow rules */ uint32_t queue_sz; /**< size of a queue for flow rules */ - uint8_t slave_flag : 1, /**< bonding slave port */ + uint8_t child_flag : 1, /**< bonding child port */ bond_flag : 1, /**< port is bond device */ fwd_mac_swap : 1, /**< swap packet MAC before forward */ update_conf : 1; /**< need to update bonding device configuration */ @@ -1082,9 +1082,9 @@ void stop_packet_forwarding(void); void dev_set_link_up(portid_t pid); void dev_set_link_down(portid_t pid); void init_port_config(void); -void set_port_slave_flag(portid_t slave_pid); -void clear_port_slave_flag(portid_t slave_pid); -uint8_t port_is_bonding_slave(portid_t slave_pid); +void set_port_child_flag(portid_t child_pid); +void clear_port_child_flag(portid_t child_pid); +uint8_t port_is_bonding_child(portid_t child_pid); int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode, enum rte_eth_nb_tcs num_tcs, diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c index 5c496352c2b3..a0e1e8e833fe 100644 --- a/app/test/test_link_bonding.c +++ b/app/test/test_link_bonding.c @@ -59,13 +59,13 @@ #define INVALID_BONDING_MODE (-1) -uint8_t slave_mac[] = {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 }; +uint8_t child_mac[] = {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 }; uint8_t bonded_mac[] = {0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF }; struct link_bonding_unittest_params { int16_t bonded_port_id; - int16_t slave_port_ids[TEST_MAX_NUMBER_OF_PORTS]; - uint16_t bonded_slave_count; + int16_t child_port_ids[TEST_MAX_NUMBER_OF_PORTS]; + uint16_t bonded_child_count; uint8_t bonding_mode; uint16_t nb_rx_q; @@ -73,7 +73,7 @@ struct link_bonding_unittest_params { struct rte_mempool *mbuf_pool; - struct rte_ether_addr *default_slave_mac; + struct rte_ether_addr *default_child_mac; struct rte_ether_addr *default_bonded_mac; /* Packet Headers */ @@ -90,8 +90,8 @@ static struct rte_udp_hdr pkt_udp_hdr; static struct link_bonding_unittest_params default_params = { .bonded_port_id = -1, - .slave_port_ids = { -1 }, - .bonded_slave_count = 0, + .child_port_ids = { -1 }, + .bonded_child_count = 0, .bonding_mode = BONDING_MODE_ROUND_ROBIN, .nb_rx_q = 1, @@ -99,7 +99,7 @@ static struct link_bonding_unittest_params default_params = { .mbuf_pool = NULL, - .default_slave_mac = (struct rte_ether_addr *)slave_mac, + .default_child_mac = (struct rte_ether_addr *)child_mac, .default_bonded_mac = (struct rte_ether_addr *)bonded_mac, .pkt_eth_hdr = NULL, @@ -202,8 +202,8 @@ configure_ethdev(uint16_t port_id, uint8_t start, uint8_t en_isr) return 0; } -static int slaves_initialized; -static int mac_slaves_initialized; +static int children_initialized; +static int mac_children_initialized; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cvar = PTHREAD_COND_INITIALIZER; @@ -213,7 +213,7 @@ static int test_setup(void) { int i, nb_mbuf_per_pool; - struct rte_ether_addr *mac_addr = (struct rte_ether_addr *)slave_mac; + struct rte_ether_addr *mac_addr = (struct rte_ether_addr *)child_mac; /* Allocate ethernet packet header with space for VLAN header */ if (test_params->pkt_eth_hdr == NULL) { @@ -235,7 +235,7 @@ test_setup(void) } /* Create / Initialize virtual eth devs */ - if (!slaves_initialized) { + if (!children_initialized) { for (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++) { char pmd_name[RTE_ETH_NAME_MAX_LEN]; @@ -243,16 +243,16 @@ test_setup(void) snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "eth_virt_%d", i); - test_params->slave_port_ids[i] = virtual_ethdev_create(pmd_name, + test_params->child_port_ids[i] = virtual_ethdev_create(pmd_name, mac_addr, rte_socket_id(), 1); - TEST_ASSERT(test_params->slave_port_ids[i] >= 0, + TEST_ASSERT(test_params->child_port_ids[i] >= 0, "Failed to create virtual virtual ethdev %s", pmd_name); TEST_ASSERT_SUCCESS(configure_ethdev( - test_params->slave_port_ids[i], 1, 0), + test_params->child_port_ids[i], 1, 0), "Failed to configure virtual ethdev %s", pmd_name); } - slaves_initialized = 1; + children_initialized = 1; } return 0; @@ -261,9 +261,9 @@ test_setup(void) static int test_create_bonded_device(void) { - int current_slave_count; + int current_child_count; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; /* Don't try to recreate bonded device if re-running test suite*/ if (test_params->bonded_port_id == -1) { @@ -281,19 +281,19 @@ test_create_bonded_device(void) test_params->bonding_mode), "Failed to set ethdev %d to mode %d", test_params->bonded_port_id, test_params->bonding_mode); - current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); + current_child_count = rte_eth_bond_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_slave_count, 0, - "Number of slaves %d is great than expected %d.", - current_slave_count, 0); + TEST_ASSERT_EQUAL(current_child_count, 0, + "Number of children %d is great than expected %d.", + current_child_count, 0); - current_slave_count = rte_eth_bond_active_slaves_get( - test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS); + current_child_count = rte_eth_bond_active_children_get( + test_params->bonded_port_id, children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_slave_count, 0, - "Number of active slaves %d is great than expected %d.", - current_slave_count, 0); + TEST_ASSERT_EQUAL(current_child_count, 0, + "Number of active children %d is great than expected %d.", + current_child_count, 0); return 0; } @@ -329,46 +329,46 @@ test_create_bonded_device_with_invalid_params(void) } static int -test_add_slave_to_bonded_device(void) +test_add_child_to_bonded_device(void) { - int current_slave_count; + int current_child_count; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params->bonded_port_id, - test_params->slave_port_ids[test_params->bonded_slave_count]), - "Failed to add slave (%d) to bonded port (%d).", - test_params->slave_port_ids[test_params->bonded_slave_count], + TEST_ASSERT_SUCCESS(rte_eth_bond_child_add(test_params->bonded_port_id, + test_params->child_port_ids[test_params->bonded_child_count]), + "Failed to add child (%d) to bonded port (%d).", + test_params->child_port_ids[test_params->bonded_child_count], test_params->bonded_port_id); - current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count + 1, - "Number of slaves (%d) is greater than expected (%d).", - current_slave_count, test_params->bonded_slave_count + 1); + current_child_count = rte_eth_bond_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(current_child_count, test_params->bonded_child_count + 1, + "Number of children (%d) is greater than expected (%d).", + current_child_count, test_params->bonded_child_count + 1); - current_slave_count = rte_eth_bond_active_slaves_get( - test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_slave_count, 0, - "Number of active slaves (%d) is not as expected (%d).\n", - current_slave_count, 0); + current_child_count = rte_eth_bond_active_children_get( + test_params->bonded_port_id, children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(current_child_count, 0, + "Number of active children (%d) is not as expected (%d).\n", + current_child_count, 0); - test_params->bonded_slave_count++; + test_params->bonded_child_count++; return 0; } static int -test_add_slave_to_invalid_bonded_device(void) +test_add_child_to_invalid_bonded_device(void) { /* Invalid port ID */ - TEST_ASSERT_FAIL(rte_eth_bond_slave_add(test_params->bonded_port_id + 5, - test_params->slave_port_ids[test_params->bonded_slave_count]), + TEST_ASSERT_FAIL(rte_eth_bond_child_add(test_params->bonded_port_id + 5, + test_params->child_port_ids[test_params->bonded_child_count]), "Expected call to failed as invalid port specified."); /* Non bonded device */ - TEST_ASSERT_FAIL(rte_eth_bond_slave_add(test_params->slave_port_ids[0], - test_params->slave_port_ids[test_params->bonded_slave_count]), + TEST_ASSERT_FAIL(rte_eth_bond_child_add(test_params->child_port_ids[0], + test_params->child_port_ids[test_params->bonded_child_count]), "Expected call to failed as invalid port specified."); return 0; @@ -376,63 +376,63 @@ test_add_slave_to_invalid_bonded_device(void) static int -test_remove_slave_from_bonded_device(void) +test_remove_child_from_bonded_device(void) { - int current_slave_count; + int current_child_count; struct rte_ether_addr read_mac_addr, *mac_addr; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(test_params->bonded_port_id, - test_params->slave_port_ids[test_params->bonded_slave_count-1]), - "Failed to remove slave %d from bonded port (%d).", - test_params->slave_port_ids[test_params->bonded_slave_count-1], + TEST_ASSERT_SUCCESS(rte_eth_bond_child_remove(test_params->bonded_port_id, + test_params->child_port_ids[test_params->bonded_child_count-1]), + "Failed to remove child %d from bonded port (%d).", + test_params->child_port_ids[test_params->bonded_child_count-1], test_params->bonded_port_id); - current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); + current_child_count = rte_eth_bond_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count - 1, - "Number of slaves (%d) is great than expected (%d).\n", - current_slave_count, test_params->bonded_slave_count - 1); + TEST_ASSERT_EQUAL(current_child_count, test_params->bonded_child_count - 1, + "Number of children (%d) is great than expected (%d).\n", + current_child_count, test_params->bonded_child_count - 1); - mac_addr = (struct rte_ether_addr *)slave_mac; + mac_addr = (struct rte_ether_addr *)child_mac; mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = - test_params->bonded_slave_count-1; + test_params->bonded_child_count-1; TEST_ASSERT_SUCCESS(rte_eth_macaddr_get( - test_params->slave_port_ids[test_params->bonded_slave_count-1], + test_params->child_port_ids[test_params->bonded_child_count-1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[test_params->bonded_slave_count-1]); + test_params->child_port_ids[test_params->bonded_child_count-1]); TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)), "bonded port mac address not set to that of primary port\n"); rte_eth_stats_reset( - test_params->slave_port_ids[test_params->bonded_slave_count-1]); + test_params->child_port_ids[test_params->bonded_child_count-1]); virtual_ethdev_simulate_link_status_interrupt(test_params->bonded_port_id, 0); - test_params->bonded_slave_count--; + test_params->bonded_child_count--; return 0; } static int -test_remove_slave_from_invalid_bonded_device(void) +test_remove_child_from_invalid_bonded_device(void) { /* Invalid port ID */ - TEST_ASSERT_FAIL(rte_eth_bond_slave_remove( + TEST_ASSERT_FAIL(rte_eth_bond_child_remove( test_params->bonded_port_id + 5, - test_params->slave_port_ids[test_params->bonded_slave_count - 1]), + test_params->child_port_ids[test_params->bonded_child_count - 1]), "Expected call to failed as invalid port specified."); /* Non bonded device */ - TEST_ASSERT_FAIL(rte_eth_bond_slave_remove( - test_params->slave_port_ids[0], - test_params->slave_port_ids[test_params->bonded_slave_count - 1]), + TEST_ASSERT_FAIL(rte_eth_bond_child_remove( + test_params->child_port_ids[0], + test_params->child_port_ids[test_params->bonded_child_count - 1]), "Expected call to failed as invalid port specified."); return 0; @@ -441,19 +441,19 @@ test_remove_slave_from_invalid_bonded_device(void) static int bonded_id = 2; static int -test_add_already_bonded_slave_to_bonded_device(void) +test_add_already_bonded_child_to_bonded_device(void) { - int port_id, current_slave_count; - uint16_t slaves[RTE_MAX_ETHPORTS]; + int port_id, current_child_count; + uint16_t children[RTE_MAX_ETHPORTS]; char pmd_name[RTE_ETH_NAME_MAX_LEN]; - test_add_slave_to_bonded_device(); + test_add_child_to_bonded_device(); - current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_slave_count, 1, - "Number of slaves (%d) is not that expected (%d).", - current_slave_count, 1); + current_child_count = rte_eth_bond_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(current_child_count, 1, + "Number of children (%d) is not that expected (%d).", + current_child_count, 1); snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "%s_%d", BONDED_DEV_NAME, ++bonded_id); @@ -461,93 +461,93 @@ test_add_already_bonded_slave_to_bonded_device(void) rte_socket_id()); TEST_ASSERT(port_id >= 0, "Failed to create bonded device."); - TEST_ASSERT(rte_eth_bond_slave_add(port_id, - test_params->slave_port_ids[test_params->bonded_slave_count - 1]) + TEST_ASSERT(rte_eth_bond_child_add(port_id, + test_params->child_port_ids[test_params->bonded_child_count - 1]) < 0, - "Added slave (%d) to bonded port (%d) unexpectedly.", - test_params->slave_port_ids[test_params->bonded_slave_count-1], + "Added child (%d) to bonded port (%d) unexpectedly.", + test_params->child_port_ids[test_params->bonded_child_count-1], port_id); - return test_remove_slave_from_bonded_device(); + return test_remove_child_from_bonded_device(); } static int -test_get_slaves_from_bonded_device(void) +test_get_children_from_bonded_device(void) { - int current_slave_count; - uint16_t slaves[RTE_MAX_ETHPORTS]; + int current_child_count; + uint16_t children[RTE_MAX_ETHPORTS]; - TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), - "Failed to add slave to bonded device"); + TEST_ASSERT_SUCCESS(test_add_child_to_bonded_device(), + "Failed to add child to bonded device"); /* Invalid port id */ - current_slave_count = rte_eth_bond_slaves_get(INVALID_PORT_ID, slaves, + current_child_count = rte_eth_bond_children_get(INVALID_PORT_ID, children, RTE_MAX_ETHPORTS); - TEST_ASSERT(current_slave_count < 0, + TEST_ASSERT(current_child_count < 0, "Invalid port id unexpectedly succeeded"); - current_slave_count = rte_eth_bond_active_slaves_get(INVALID_PORT_ID, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT(current_slave_count < 0, + current_child_count = rte_eth_bond_active_children_get(INVALID_PORT_ID, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT(current_child_count < 0, "Invalid port id unexpectedly succeeded"); - /* Invalid slaves pointer */ - current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, + /* Invalid children pointer */ + current_child_count = rte_eth_bond_children_get(test_params->bonded_port_id, NULL, RTE_MAX_ETHPORTS); - TEST_ASSERT(current_slave_count < 0, - "Invalid slave array unexpectedly succeeded"); + TEST_ASSERT(current_child_count < 0, + "Invalid child array unexpectedly succeeded"); - current_slave_count = rte_eth_bond_active_slaves_get( + current_child_count = rte_eth_bond_active_children_get( test_params->bonded_port_id, NULL, RTE_MAX_ETHPORTS); - TEST_ASSERT(current_slave_count < 0, - "Invalid slave array unexpectedly succeeded"); + TEST_ASSERT(current_child_count < 0, + "Invalid child array unexpectedly succeeded"); /* non bonded device*/ - current_slave_count = rte_eth_bond_slaves_get( - test_params->slave_port_ids[0], NULL, RTE_MAX_ETHPORTS); - TEST_ASSERT(current_slave_count < 0, + current_child_count = rte_eth_bond_children_get( + test_params->child_port_ids[0], NULL, RTE_MAX_ETHPORTS); + TEST_ASSERT(current_child_count < 0, "Invalid port id unexpectedly succeeded"); - current_slave_count = rte_eth_bond_active_slaves_get( - test_params->slave_port_ids[0], NULL, RTE_MAX_ETHPORTS); - TEST_ASSERT(current_slave_count < 0, + current_child_count = rte_eth_bond_active_children_get( + test_params->child_port_ids[0], NULL, RTE_MAX_ETHPORTS); + TEST_ASSERT(current_child_count < 0, "Invalid port id unexpectedly succeeded"); - TEST_ASSERT_SUCCESS(test_remove_slave_from_bonded_device(), - "Failed to remove slaves from bonded device"); + TEST_ASSERT_SUCCESS(test_remove_child_from_bonded_device(), + "Failed to remove children from bonded device"); return 0; } static int -test_add_remove_multiple_slaves_to_from_bonded_device(void) +test_add_remove_multiple_children_to_from_bonded_device(void) { int i; for (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++) - TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), - "Failed to add slave to bonded device"); + TEST_ASSERT_SUCCESS(test_add_child_to_bonded_device(), + "Failed to add child to bonded device"); for (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++) - TEST_ASSERT_SUCCESS(test_remove_slave_from_bonded_device(), - "Failed to remove slaves from bonded device"); + TEST_ASSERT_SUCCESS(test_remove_child_from_bonded_device(), + "Failed to remove children from bonded device"); return 0; } static void -enable_bonded_slaves(void) +enable_bonded_children(void) { int i; - for (i = 0; i < test_params->bonded_slave_count; i++) { - virtual_ethdev_tx_burst_fn_set_success(test_params->slave_port_ids[i], + for (i = 0; i < test_params->bonded_child_count; i++) { + virtual_ethdev_tx_burst_fn_set_success(test_params->child_port_ids[i], 1); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 1); + test_params->child_port_ids[i], 1); } } @@ -556,34 +556,34 @@ test_start_bonded_device(void) { struct rte_eth_link link_status; - int current_slave_count, current_bonding_mode, primary_port; - uint16_t slaves[RTE_MAX_ETHPORTS]; + int current_child_count, current_bonding_mode, primary_port; + uint16_t children[RTE_MAX_ETHPORTS]; int retval; - /* Add slave to bonded device*/ - TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), - "Failed to add slave to bonded device"); + /* Add child to bonded device*/ + TEST_ASSERT_SUCCESS(test_add_child_to_bonded_device(), + "Failed to add child to bonded device"); TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params->bonded_port_id), "Failed to start bonded pmd eth device %d.", test_params->bonded_port_id); /* Change link status of virtual pmd so it will be added to the active - * slave list of the bonded device*/ + * child list of the bonded device*/ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[test_params->bonded_slave_count-1], 1); + test_params->child_port_ids[test_params->bonded_child_count-1], 1); - current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count, - "Number of slaves (%d) is not expected value (%d).", - current_slave_count, test_params->bonded_slave_count); + current_child_count = rte_eth_bond_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(current_child_count, test_params->bonded_child_count, + "Number of children (%d) is not expected value (%d).", + current_child_count, test_params->bonded_child_count); - current_slave_count = rte_eth_bond_active_slaves_get( - test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count, - "Number of active slaves (%d) is not expected value (%d).", - current_slave_count, test_params->bonded_slave_count); + current_child_count = rte_eth_bond_active_children_get( + test_params->bonded_port_id, children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(current_child_count, test_params->bonded_child_count, + "Number of active children (%d) is not expected value (%d).", + current_child_count, test_params->bonded_child_count); current_bonding_mode = rte_eth_bond_mode_get(test_params->bonded_port_id); TEST_ASSERT_EQUAL(current_bonding_mode, test_params->bonding_mode, @@ -591,9 +591,9 @@ test_start_bonded_device(void) current_bonding_mode, test_params->bonding_mode); primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); - TEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[0], + TEST_ASSERT_EQUAL(primary_port, test_params->child_port_ids[0], "Primary port (%d) is not expected value (%d).", - primary_port, test_params->slave_port_ids[0]); + primary_port, test_params->child_port_ids[0]); retval = rte_eth_link_get(test_params->bonded_port_id, &link_status); TEST_ASSERT(retval >= 0, @@ -609,8 +609,8 @@ test_start_bonded_device(void) static int test_stop_bonded_device(void) { - int current_slave_count; - uint16_t slaves[RTE_MAX_ETHPORTS]; + int current_child_count; + uint16_t children[RTE_MAX_ETHPORTS]; struct rte_eth_link link_status; int retval; @@ -627,29 +627,29 @@ test_stop_bonded_device(void) "Bonded port (%d) status (%d) is not expected value (%d).", test_params->bonded_port_id, link_status.link_status, 0); - current_slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_slave_count, test_params->bonded_slave_count, - "Number of slaves (%d) is not expected value (%d).", - current_slave_count, test_params->bonded_slave_count); + current_child_count = rte_eth_bond_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(current_child_count, test_params->bonded_child_count, + "Number of children (%d) is not expected value (%d).", + current_child_count, test_params->bonded_child_count); - current_slave_count = rte_eth_bond_active_slaves_get( - test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(current_slave_count, 0, - "Number of active slaves (%d) is not expected value (%d).", - current_slave_count, 0); + current_child_count = rte_eth_bond_active_children_get( + test_params->bonded_port_id, children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(current_child_count, 0, + "Number of active children (%d) is not expected value (%d).", + current_child_count, 0); return 0; } static int -remove_slaves_and_stop_bonded_device(void) +remove_children_and_stop_bonded_device(void) { - /* Clean up and remove slaves from bonded device */ + /* Clean up and remove children from bonded device */ free_virtualpmd_tx_queue(); - while (test_params->bonded_slave_count > 0) - TEST_ASSERT_SUCCESS(test_remove_slave_from_bonded_device(), - "test_remove_slave_from_bonded_device failed"); + while (test_params->bonded_child_count > 0) + TEST_ASSERT_SUCCESS(test_remove_child_from_bonded_device(), + "test_remove_child_from_bonded_device failed"); TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), "Failed to stop bonded port %u", @@ -681,10 +681,10 @@ test_set_bonding_mode(void) INVALID_PORT_ID); /* Non bonded device */ - TEST_ASSERT_FAIL(rte_eth_bond_mode_set(test_params->slave_port_ids[0], + TEST_ASSERT_FAIL(rte_eth_bond_mode_set(test_params->child_port_ids[0], bonding_modes[i]), "Expected call to failed as invalid port (%d) specified.", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id, bonding_modes[i]), @@ -704,26 +704,26 @@ test_set_bonding_mode(void) INVALID_PORT_ID); /* Non bonded device */ - bonding_mode = rte_eth_bond_mode_get(test_params->slave_port_ids[0]); + bonding_mode = rte_eth_bond_mode_get(test_params->child_port_ids[0]); TEST_ASSERT(bonding_mode < 0, "Expected call to failed as invalid port (%d) specified.", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); } - return remove_slaves_and_stop_bonded_device(); + return remove_children_and_stop_bonded_device(); } static int -test_set_primary_slave(void) +test_set_primary_child(void) { int i, j, retval; struct rte_ether_addr read_mac_addr; struct rte_ether_addr *expected_mac_addr; - /* Add 4 slaves to bonded device */ - for (i = test_params->bonded_slave_count; i < 4; i++) - TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), - "Failed to add slave to bonded device."); + /* Add 4 children to bonded device */ + for (i = test_params->bonded_child_count; i < 4; i++) + TEST_ASSERT_SUCCESS(test_add_child_to_bonded_device(), + "Failed to add child to bonded device."); TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id, BONDING_MODE_ROUND_ROBIN), @@ -732,34 +732,34 @@ test_set_primary_slave(void) /* Invalid port ID */ TEST_ASSERT_FAIL(rte_eth_bond_primary_set(INVALID_PORT_ID, - test_params->slave_port_ids[i]), + test_params->child_port_ids[i]), "Expected call to failed as invalid port specified."); /* Non bonded device */ - TEST_ASSERT_FAIL(rte_eth_bond_primary_set(test_params->slave_port_ids[i], - test_params->slave_port_ids[i]), + TEST_ASSERT_FAIL(rte_eth_bond_primary_set(test_params->child_port_ids[i], + test_params->child_port_ids[i]), "Expected call to failed as invalid port specified."); - /* Set slave as primary - * Verify slave it is now primary slave - * Verify that MAC address of bonded device is that of primary slave - * Verify that MAC address of all bonded slaves are that of primary slave + /* Set child as primary + * Verify child it is now primary child + * Verify that MAC address of bonded device is that of primary child + * Verify that MAC address of all bonded children are that of primary child */ for (i = 0; i < 4; i++) { TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id, - test_params->slave_port_ids[i]), + test_params->child_port_ids[i]), "Failed to set bonded port (%d) primary port to (%d)", - test_params->bonded_port_id, test_params->slave_port_ids[i]); + test_params->bonded_port_id, test_params->child_port_ids[i]); retval = rte_eth_bond_primary_get(test_params->bonded_port_id); TEST_ASSERT(retval >= 0, "Failed to read primary port from bonded port (%d)\n", test_params->bonded_port_id); - TEST_ASSERT_EQUAL(retval, test_params->slave_port_ids[i], + TEST_ASSERT_EQUAL(retval, test_params->child_port_ids[i], "Bonded port (%d) primary port (%d) not expected value (%d)\n", test_params->bonded_port_id, retval, - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); /* stop/start bonded eth dev to apply new MAC */ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), @@ -770,13 +770,13 @@ test_set_primary_slave(void) "Failed to start bonded port %d", test_params->bonded_port_id); - expected_mac_addr = (struct rte_ether_addr *)&slave_mac; + expected_mac_addr = (struct rte_ether_addr *)&child_mac; expected_mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = i; - /* Check primary slave MAC */ - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr), + /* Check primary child MAC */ + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), "bonded port mac address not set to that of primary port\n"); @@ -789,16 +789,16 @@ test_set_primary_slave(void) sizeof(read_mac_addr)), "bonded port mac address not set to that of primary port\n"); - /* Check other slaves MACs */ + /* Check other children MACs */ for (j = 0; j < 4; j++) { if (j != i) { - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[j], + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[j], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[j]); + test_params->child_port_ids[j]); TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "slave port mac address not set to that of primary " + "child port mac address not set to that of primary " "port"); } } @@ -809,14 +809,14 @@ test_set_primary_slave(void) TEST_ASSERT_FAIL(rte_eth_bond_primary_get(test_params->bonded_port_id + 10), "read primary port from expectedly"); - /* Test with slave port */ - TEST_ASSERT_FAIL(rte_eth_bond_primary_get(test_params->slave_port_ids[0]), + /* Test with child port */ + TEST_ASSERT_FAIL(rte_eth_bond_primary_get(test_params->child_port_ids[0]), "read primary port from expectedly\n"); - TEST_ASSERT_SUCCESS(remove_slaves_and_stop_bonded_device(), - "Failed to stop and remove slaves from bonded device"); + TEST_ASSERT_SUCCESS(remove_children_and_stop_bonded_device(), + "Failed to stop and remove children from bonded device"); - /* No slaves */ + /* No children */ TEST_ASSERT(rte_eth_bond_primary_get(test_params->bonded_port_id) < 0, "read primary port from expectedly\n"); @@ -840,7 +840,7 @@ test_set_explicit_bonded_mac(void) /* Non bonded device */ TEST_ASSERT_FAIL(rte_eth_bond_mac_address_set( - test_params->slave_port_ids[0], mac_addr), + test_params->child_port_ids[0], mac_addr), "Expected call to failed as invalid port specified."); /* NULL MAC address */ @@ -853,10 +853,10 @@ test_set_explicit_bonded_mac(void) "Failed to set MAC address on bonded port (%d)", test_params->bonded_port_id); - /* Add 4 slaves to bonded device */ - for (i = test_params->bonded_slave_count; i < 4; i++) { - TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), - "Failed to add slave to bonded device.\n"); + /* Add 4 children to bonded device */ + for (i = test_params->bonded_child_count; i < 4; i++) { + TEST_ASSERT_SUCCESS(test_add_child_to_bonded_device(), + "Failed to add child to bonded device.\n"); } /* Check bonded MAC */ @@ -866,14 +866,14 @@ test_set_explicit_bonded_mac(void) TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)), "bonded port mac address not set to that of primary port"); - /* Check other slaves MACs */ + /* Check other children MACs */ for (i = 0; i < 4; i++) { - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_SUCCESS(memcmp(mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "slave port mac address not set to that of primary port"); + "child port mac address not set to that of primary port"); } /* test resetting mac address on bonded device */ @@ -883,13 +883,13 @@ test_set_explicit_bonded_mac(void) test_params->bonded_port_id); TEST_ASSERT_FAIL( - rte_eth_bond_mac_address_reset(test_params->slave_port_ids[0]), + rte_eth_bond_mac_address_reset(test_params->child_port_ids[0]), "Reset MAC address on bonded port (%d) unexpectedly", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); - /* test resetting mac address on bonded device with no slaves */ - TEST_ASSERT_SUCCESS(remove_slaves_and_stop_bonded_device(), - "Failed to remove slaves and stop bonded device"); + /* test resetting mac address on bonded device with no children */ + TEST_ASSERT_SUCCESS(remove_children_and_stop_bonded_device(), + "Failed to remove children and stop bonded device"); TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_reset(test_params->bonded_port_id), "Failed to reset MAC address on bonded port (%d)", @@ -898,25 +898,25 @@ test_set_explicit_bonded_mac(void) return 0; } -#define BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT (3) +#define BONDED_INIT_MAC_ASSIGNMENT_CHILD_COUNT (3) static int test_set_bonded_port_initialization_mac_assignment(void) { - int i, slave_count; + int i, child_count; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; static int bonded_port_id = -1; - static int slave_port_ids[BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT]; + static int child_port_ids[BONDED_INIT_MAC_ASSIGNMENT_CHILD_COUNT]; - struct rte_ether_addr slave_mac_addr, bonded_mac_addr, read_mac_addr; + struct rte_ether_addr child_mac_addr, bonded_mac_addr, read_mac_addr; /* Initialize default values for MAC addresses */ - memcpy(&slave_mac_addr, slave_mac, sizeof(struct rte_ether_addr)); - memcpy(&bonded_mac_addr, slave_mac, sizeof(struct rte_ether_addr)); + memcpy(&child_mac_addr, child_mac, sizeof(struct rte_ether_addr)); + memcpy(&bonded_mac_addr, child_mac, sizeof(struct rte_ether_addr)); /* - * 1. a - Create / configure bonded / slave ethdevs + * 1. a - Create / configure bonded / child ethdevs */ if (bonded_port_id == -1) { bonded_port_id = rte_eth_bond_create("net_bonding_mac_ass_test", @@ -927,46 +927,46 @@ test_set_bonded_port_initialization_mac_assignment(void) "Failed to configure bonded ethdev"); } - if (!mac_slaves_initialized) { - for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) { + if (!mac_children_initialized) { + for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_CHILD_COUNT; i++) { char pmd_name[RTE_ETH_NAME_MAX_LEN]; - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = + child_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = i + 100; snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, - "eth_slave_%d", i); + "eth_child_%d", i); - slave_port_ids[i] = virtual_ethdev_create(pmd_name, - &slave_mac_addr, rte_socket_id(), 1); + child_port_ids[i] = virtual_ethdev_create(pmd_name, + &child_mac_addr, rte_socket_id(), 1); - TEST_ASSERT(slave_port_ids[i] >= 0, - "Failed to create slave ethdev %s", + TEST_ASSERT(child_port_ids[i] >= 0, + "Failed to create child ethdev %s", pmd_name); - TEST_ASSERT_SUCCESS(configure_ethdev(slave_port_ids[i], 1, 0), + TEST_ASSERT_SUCCESS(configure_ethdev(child_port_ids[i], 1, 0), "Failed to configure virtual ethdev %s", pmd_name); } - mac_slaves_initialized = 1; + mac_children_initialized = 1; } /* - * 2. Add slave ethdevs to bonded device + * 2. Add child ethdevs to bonded device */ - for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) { - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(bonded_port_id, - slave_port_ids[i]), - "Failed to add slave (%d) to bonded port (%d).", - slave_port_ids[i], bonded_port_id); + for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_CHILD_COUNT; i++) { + TEST_ASSERT_SUCCESS(rte_eth_bond_child_add(bonded_port_id, + child_port_ids[i]), + "Failed to add child (%d) to bonded port (%d).", + child_port_ids[i], bonded_port_id); } - slave_count = rte_eth_bond_slaves_get(bonded_port_id, slaves, + child_count = rte_eth_bond_children_get(bonded_port_id, children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT, slave_count, - "Number of slaves (%d) is not as expected (%d)", - slave_count, BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT); + TEST_ASSERT_EQUAL(BONDED_INIT_MAC_ASSIGNMENT_CHILD_COUNT, child_count, + "Number of children (%d) is not as expected (%d)", + child_count, BONDED_INIT_MAC_ASSIGNMENT_CHILD_COUNT); /* @@ -982,16 +982,16 @@ test_set_bonded_port_initialization_mac_assignment(void) /* 4. a - Start bonded ethdev - * b - Enable slave devices - * c - Verify bonded/slaves ethdev MAC addresses + * b - Enable child devices + * c - Verify bonded/children ethdev MAC addresses */ TEST_ASSERT_SUCCESS(rte_eth_dev_start(bonded_port_id), "Failed to start bonded pmd eth device %d.", bonded_port_id); - for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) { + for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_CHILD_COUNT; i++) { virtual_ethdev_simulate_link_status_interrupt( - slave_port_ids[i], 1); + child_port_ids[i], 1); } TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(bonded_port_id, &read_mac_addr), @@ -1001,36 +1001,36 @@ test_set_bonded_port_initialization_mac_assignment(void) sizeof(read_mac_addr)), "bonded port mac address not as expected"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - slave_port_ids[0]); + child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "slave port 0 mac address not as expected"); + "child port 0 mac address not as expected"); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr), + child_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100; + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - slave_port_ids[1]); - TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr, + child_port_ids[1]); + TEST_ASSERT_SUCCESS(memcmp(&child_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "slave port 1 mac address not as expected"); + "child port 1 mac address not as expected"); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr), + child_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100; + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(child_port_ids[2], &read_mac_addr), "Failed to get mac address (port %d)", - slave_port_ids[2]); - TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr, + child_port_ids[2]); + TEST_ASSERT_SUCCESS(memcmp(&child_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "slave port 2 mac address not as expected"); + "child port 2 mac address not as expected"); /* 7. a - Change primary port * b - Stop / Start bonded port - * d - Verify slave ethdev MAC addresses + * d - Verify child ethdev MAC addresses */ TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(bonded_port_id, - slave_port_ids[2]), + child_port_ids[2]), "failed to set primary port on bonded device."); TEST_ASSERT_SUCCESS(rte_eth_dev_stop(bonded_port_id), @@ -1048,94 +1048,94 @@ test_set_bonded_port_initialization_mac_assignment(void) sizeof(read_mac_addr)), "bonded port mac address not as expected"); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr), + child_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100; + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - slave_port_ids[0]); - TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr, + child_port_ids[0]); + TEST_ASSERT_SUCCESS(memcmp(&child_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "slave port 0 mac address not as expected"); + "child port 0 mac address not as expected"); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr), + child_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100; + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - slave_port_ids[1]); - TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr, + child_port_ids[1]); + TEST_ASSERT_SUCCESS(memcmp(&child_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "slave port 1 mac address not as expected"); + "child port 1 mac address not as expected"); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(child_port_ids[2], &read_mac_addr), "Failed to get mac address (port %d)", - slave_port_ids[2]); + child_port_ids[2]); TEST_ASSERT_SUCCESS(memcmp(&bonded_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "slave port 2 mac address not as expected"); + "child port 2 mac address not as expected"); /* 6. a - Stop bonded ethdev - * b - remove slave ethdevs - * c - Verify slave ethdevs MACs are restored + * b - remove child ethdevs + * c - Verify child ethdevs MACs are restored */ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(bonded_port_id), "Failed to stop bonded port %u", bonded_port_id); - for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) { - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(bonded_port_id, - slave_port_ids[i]), - "Failed to remove slave %d from bonded port (%d).", - slave_port_ids[i], bonded_port_id); + for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_CHILD_COUNT; i++) { + TEST_ASSERT_SUCCESS(rte_eth_bond_child_remove(bonded_port_id, + child_port_ids[i]), + "Failed to remove child %d from bonded port (%d).", + child_port_ids[i], bonded_port_id); } - slave_count = rte_eth_bond_slaves_get(bonded_port_id, slaves, + child_count = rte_eth_bond_children_get(bonded_port_id, children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, 0, - "Number of slaves (%d) is great than expected (%d).", - slave_count, 0); + TEST_ASSERT_EQUAL(child_count, 0, + "Number of children (%d) is great than expected (%d).", + child_count, 0); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr), + child_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100; + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - slave_port_ids[0]); - TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr, + child_port_ids[0]); + TEST_ASSERT_SUCCESS(memcmp(&child_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "slave port 0 mac address not as expected"); + "child port 0 mac address not as expected"); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr), + child_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100; + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - slave_port_ids[1]); - TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr, + child_port_ids[1]); + TEST_ASSERT_SUCCESS(memcmp(&child_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "slave port 1 mac address not as expected"); + "child port 1 mac address not as expected"); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr), + child_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100; + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(child_port_ids[2], &read_mac_addr), "Failed to get mac address (port %d)", - slave_port_ids[2]); - TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr, + child_port_ids[2]); + TEST_ASSERT_SUCCESS(memcmp(&child_mac_addr, &read_mac_addr, sizeof(read_mac_addr)), - "slave port 2 mac address not as expected"); + "child port 2 mac address not as expected"); return 0; } static int -initialize_bonded_device_with_slaves(uint8_t bonding_mode, uint8_t bond_en_isr, - uint16_t number_of_slaves, uint8_t enable_slave) +initialize_bonded_device_with_children(uint8_t bonding_mode, uint8_t bond_en_isr, + uint16_t number_of_children, uint8_t enable_child) { /* Configure bonded device */ TEST_ASSERT_SUCCESS(configure_ethdev(test_params->bonded_port_id, 0, bond_en_isr), "Failed to configure bonding port (%d) in mode %d " - "with (%d) slaves.", test_params->bonded_port_id, bonding_mode, - number_of_slaves); - - /* Add slaves to bonded device */ - while (number_of_slaves > test_params->bonded_slave_count) - TEST_ASSERT_SUCCESS(test_add_slave_to_bonded_device(), - "Failed to add slave (%d to bonding port (%d).", - test_params->bonded_slave_count - 1, + "with (%d) children.", test_params->bonded_port_id, bonding_mode, + number_of_children); + + /* Add children to bonded device */ + while (number_of_children > test_params->bonded_child_count) + TEST_ASSERT_SUCCESS(test_add_child_to_bonded_device(), + "Failed to add child (%d to bonding port (%d).", + test_params->bonded_child_count - 1, test_params->bonded_port_id); /* Set link bonding mode */ @@ -1148,40 +1148,40 @@ initialize_bonded_device_with_slaves(uint8_t bonding_mode, uint8_t bond_en_isr, "Failed to start bonded pmd eth device %d.", test_params->bonded_port_id); - if (enable_slave) - enable_bonded_slaves(); + if (enable_child) + enable_bonded_children(); return 0; } static int -test_adding_slave_after_bonded_device_started(void) +test_adding_child_after_bonded_device_started(void) { int i; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ROUND_ROBIN, 0, 4, 0), - "Failed to add slaves to bonded device"); + "Failed to add children to bonded device"); - /* Enabled slave devices */ - for (i = 0; i < test_params->bonded_slave_count + 1; i++) { + /* Enabled child devices */ + for (i = 0; i < test_params->bonded_child_count + 1; i++) { virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 1); + test_params->child_port_ids[i], 1); } - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params->bonded_port_id, - test_params->slave_port_ids[test_params->bonded_slave_count]), - "Failed to add slave to bonded port.\n"); + TEST_ASSERT_SUCCESS(rte_eth_bond_child_add(test_params->bonded_port_id, + test_params->child_port_ids[test_params->bonded_child_count]), + "Failed to add child to bonded port.\n"); rte_eth_stats_reset( - test_params->slave_port_ids[test_params->bonded_slave_count]); + test_params->child_port_ids[test_params->bonded_child_count]); - test_params->bonded_slave_count++; + test_params->bonded_child_count++; - return remove_slaves_and_stop_bonded_device(); + return remove_children_and_stop_bonded_device(); } -#define TEST_STATUS_INTERRUPT_SLAVE_COUNT 4 +#define TEST_STATUS_INTERRUPT_CHILD_COUNT 4 #define TEST_LSC_WAIT_TIMEOUT_US 500000 int test_lsc_interrupt_count; @@ -1237,13 +1237,13 @@ lsc_timeout(int wait_us) static int test_status_interrupt(void) { - int slave_count; - uint16_t slaves[RTE_MAX_ETHPORTS]; + int child_count; + uint16_t children[RTE_MAX_ETHPORTS]; - /* initialized bonding device with T slaves */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* initialized bonding device with T children */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ROUND_ROBIN, 1, - TEST_STATUS_INTERRUPT_SLAVE_COUNT, 1), + TEST_STATUS_INTERRUPT_CHILD_COUNT, 1), "Failed to initialise bonded device"); test_lsc_interrupt_count = 0; @@ -1253,27 +1253,27 @@ test_status_interrupt(void) RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback, &test_params->bonded_port_id); - slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); + child_count = rte_eth_bond_active_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, TEST_STATUS_INTERRUPT_SLAVE_COUNT, - "Number of active slaves (%d) is not as expected (%d)", - slave_count, TEST_STATUS_INTERRUPT_SLAVE_COUNT); + TEST_ASSERT_EQUAL(child_count, TEST_STATUS_INTERRUPT_CHILD_COUNT, + "Number of active children (%d) is not as expected (%d)", + child_count, TEST_STATUS_INTERRUPT_CHILD_COUNT); - /* Bring all 4 slaves link status to down and test that we have received a + /* Bring all 4 children link status to down and test that we have received a * lsc interrupts */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[0], 0); + test_params->child_port_ids[0], 0); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[1], 0); + test_params->child_port_ids[1], 0); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[2], 0); + test_params->child_port_ids[2], 0); TEST_ASSERT_EQUAL(test_lsc_interrupt_count, 0, "Received a link status change interrupt unexpectedly"); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[3], 0); + test_params->child_port_ids[3], 0); TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) == 0, "timed out waiting for interrupt"); @@ -1281,18 +1281,18 @@ test_status_interrupt(void) TEST_ASSERT(test_lsc_interrupt_count > 0, "Did not receive link status change interrupt"); - slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); + child_count = rte_eth_bond_active_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, 0, - "Number of active slaves (%d) is not as expected (%d)", - slave_count, 0); + TEST_ASSERT_EQUAL(child_count, 0, + "Number of active children (%d) is not as expected (%d)", + child_count, 0); - /* bring one slave port up so link status will change */ + /* bring one child port up so link status will change */ test_lsc_interrupt_count = 0; virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[0], 1); + test_params->child_port_ids[0], 1); TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) == 0, "timed out waiting for interrupt"); @@ -1301,12 +1301,12 @@ test_status_interrupt(void) TEST_ASSERT(test_lsc_interrupt_count > 0, "Did not receive link status change interrupt"); - /* Verify that calling the same slave lsc interrupt doesn't cause another + /* Verify that calling the same child lsc interrupt doesn't cause another * lsc interrupt from bonded device */ test_lsc_interrupt_count = 0; virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[0], 1); + test_params->child_port_ids[0], 1); TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) != 0, "received unexpected interrupt"); @@ -1320,8 +1320,8 @@ test_status_interrupt(void) RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback, &test_params->bonded_port_id); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -1398,11 +1398,11 @@ test_roundrobin_tx_burst(void) struct rte_mbuf *pkt_burst[MAX_PKT_BURST]; struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ROUND_ROBIN, 0, 2, 1), "Failed to initialise bonded device"); - burst_size = 20 * test_params->bonded_slave_count; + burst_size = 20 * test_params->bonded_child_count; TEST_ASSERT(burst_size <= MAX_PKT_BURST, "Burst size specified is greater than supported."); @@ -1423,20 +1423,20 @@ test_roundrobin_tx_burst(void) test_params->bonded_port_id, (unsigned int)port_stats.opackets, burst_size); - /* Verify slave ports tx stats */ - for (i = 0; i < test_params->bonded_slave_count; i++) { - rte_eth_stats_get(test_params->slave_port_ids[i], &port_stats); + /* Verify child ports tx stats */ + for (i = 0; i < test_params->bonded_child_count; i++) { + rte_eth_stats_get(test_params->child_port_ids[i], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, - (uint64_t)burst_size / test_params->bonded_slave_count, - "Slave Port (%d) opackets value (%u) not as expected (%d)\n", + (uint64_t)burst_size / test_params->bonded_child_count, + "Child Port (%d) opackets value (%u) not as expected (%d)\n", test_params->bonded_port_id, (unsigned int)port_stats.opackets, - burst_size / test_params->bonded_slave_count); + burst_size / test_params->bonded_child_count); } - /* Put all slaves down and try and transmit */ - for (i = 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i = 0; i < test_params->bonded_child_count; i++) { virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 0); + test_params->child_port_ids[i], 0); } /* Send burst on bonded port */ @@ -1444,8 +1444,8 @@ test_roundrobin_tx_burst(void) pkt_burst, burst_size), 0, "tx burst return unexpected value"); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -1471,13 +1471,13 @@ free_mbufs(struct rte_mbuf **mbufs, int nb_mbufs) rte_pktmbuf_free(mbufs[i]); } -#define TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT (2) -#define TEST_RR_SLAVE_TX_FAIL_BURST_SIZE (64) -#define TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT (22) -#define TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX (1) +#define TEST_RR_CHILD_TX_FAIL_CHILD_COUNT (2) +#define TEST_RR_CHILD_TX_FAIL_BURST_SIZE (64) +#define TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT (22) +#define TEST_RR_CHILD_TX_FAIL_FAILING_CHILD_IDX (1) static int -test_roundrobin_tx_burst_slave_tx_fail(void) +test_roundrobin_tx_burst_child_tx_fail(void) { struct rte_mbuf *pkt_burst[MAX_PKT_BURST]; struct rte_mbuf *expected_tx_fail_pkts[MAX_PKT_BURST]; @@ -1486,49 +1486,49 @@ test_roundrobin_tx_burst_slave_tx_fail(void) int i, first_fail_idx, tx_count; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ROUND_ROBIN, 0, - TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT, 1), + TEST_RR_CHILD_TX_FAIL_CHILD_COUNT, 1), "Failed to initialise bonded device"); /* Generate test bursts of packets to transmit */ TEST_ASSERT_EQUAL(generate_test_burst(pkt_burst, - TEST_RR_SLAVE_TX_FAIL_BURST_SIZE, 0, 1, 0, 0, 0), - TEST_RR_SLAVE_TX_FAIL_BURST_SIZE, + TEST_RR_CHILD_TX_FAIL_BURST_SIZE, 0, 1, 0, 0, 0), + TEST_RR_CHILD_TX_FAIL_BURST_SIZE, "Failed to generate test packet burst"); /* Copy references to packets which we expect not to be transmitted */ - first_fail_idx = (TEST_RR_SLAVE_TX_FAIL_BURST_SIZE - - (TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT * - TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT)) + - TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX; + first_fail_idx = (TEST_RR_CHILD_TX_FAIL_BURST_SIZE - + (TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT * + TEST_RR_CHILD_TX_FAIL_CHILD_COUNT)) + + TEST_RR_CHILD_TX_FAIL_FAILING_CHILD_IDX; - for (i = 0; i < TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT; i++) { + for (i = 0; i < TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT; i++) { expected_tx_fail_pkts[i] = pkt_burst[first_fail_idx + - (i * TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT)]; + (i * TEST_RR_CHILD_TX_FAIL_CHILD_COUNT)]; } - /* Set virtual slave to only fail transmission of - * TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT packets in burst */ + /* Set virtual child to only fail transmission of + * TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT packets in burst */ virtual_ethdev_tx_burst_fn_set_success( - test_params->slave_port_ids[TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX], + test_params->child_port_ids[TEST_RR_CHILD_TX_FAIL_FAILING_CHILD_IDX], 0); virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count( - test_params->slave_port_ids[TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX], - TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT); + test_params->child_port_ids[TEST_RR_CHILD_TX_FAIL_FAILING_CHILD_IDX], + TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT); tx_count = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkt_burst, - TEST_RR_SLAVE_TX_FAIL_BURST_SIZE); + TEST_RR_CHILD_TX_FAIL_BURST_SIZE); - TEST_ASSERT_EQUAL(tx_count, TEST_RR_SLAVE_TX_FAIL_BURST_SIZE - - TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT, + TEST_ASSERT_EQUAL(tx_count, TEST_RR_CHILD_TX_FAIL_BURST_SIZE - + TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT, "Transmitted (%d) an unexpected (%d) number of packets", tx_count, - TEST_RR_SLAVE_TX_FAIL_BURST_SIZE - - TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT); + TEST_RR_CHILD_TX_FAIL_BURST_SIZE - + TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT); /* Verify that failed packet are expected failed packets */ - for (i = 0; i < TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT; i++) { + for (i = 0; i < TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT; i++) { TEST_ASSERT_EQUAL(expected_tx_fail_pkts[i], pkt_burst[i + tx_count], "expected mbuf (%d) pointer %p not expected pointer %p", i, expected_tx_fail_pkts[i], pkt_burst[i + tx_count]); @@ -1538,45 +1538,45 @@ test_roundrobin_tx_burst_slave_tx_fail(void) rte_eth_stats_get(test_params->bonded_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, - (uint64_t)TEST_RR_SLAVE_TX_FAIL_BURST_SIZE - - TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT, + (uint64_t)TEST_RR_CHILD_TX_FAIL_BURST_SIZE - + TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT, "Bonded Port (%d) opackets value (%u) not as expected (%d)", test_params->bonded_port_id, (unsigned int)port_stats.opackets, - TEST_RR_SLAVE_TX_FAIL_BURST_SIZE - - TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT); + TEST_RR_CHILD_TX_FAIL_BURST_SIZE - + TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT); - /* Verify slave ports tx stats */ - for (i = 0; i < test_params->bonded_slave_count; i++) { - int slave_expected_tx_count; + /* Verify child ports tx stats */ + for (i = 0; i < test_params->bonded_child_count; i++) { + int child_expected_tx_count; - rte_eth_stats_get(test_params->slave_port_ids[i], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[i], &port_stats); - slave_expected_tx_count = TEST_RR_SLAVE_TX_FAIL_BURST_SIZE / - test_params->bonded_slave_count; + child_expected_tx_count = TEST_RR_CHILD_TX_FAIL_BURST_SIZE / + test_params->bonded_child_count; - if (i == TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX) - slave_expected_tx_count = slave_expected_tx_count - - TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT; + if (i == TEST_RR_CHILD_TX_FAIL_FAILING_CHILD_IDX) + child_expected_tx_count = child_expected_tx_count - + TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT; TEST_ASSERT_EQUAL(port_stats.opackets, - (uint64_t)slave_expected_tx_count, - "Slave Port (%d) opackets value (%u) not as expected (%d)", - test_params->slave_port_ids[i], - (unsigned int)port_stats.opackets, slave_expected_tx_count); + (uint64_t)child_expected_tx_count, + "Child Port (%d) opackets value (%u) not as expected (%d)", + test_params->child_port_ids[i], + (unsigned int)port_stats.opackets, child_expected_tx_count); } /* Verify that all mbufs have a ref value of zero */ TEST_ASSERT_SUCCESS(verify_mbufs_ref_count(&pkt_burst[tx_count], - TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT, 1), + TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT, 1), "mbufs refcnts not as expected"); - free_mbufs(&pkt_burst[tx_count], TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT); + free_mbufs(&pkt_burst[tx_count], TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int -test_roundrobin_rx_burst_on_single_slave(void) +test_roundrobin_rx_burst_on_single_child(void) { struct rte_mbuf *gen_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; @@ -1585,19 +1585,19 @@ test_roundrobin_rx_burst_on_single_slave(void) int i, j, burst_size = 25; - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ROUND_ROBIN, 0, 4, 1), - "Failed to initialize bonded device with slaves"); + "Failed to initialize bonded device with children"); /* Generate test bursts of packets to transmit */ TEST_ASSERT_EQUAL(generate_test_burst( gen_pkt_burst, burst_size, 0, 1, 0, 0, 0), burst_size, "burst generation failed"); - for (i = 0; i < test_params->bonded_slave_count; i++) { - /* Add rx data to slave */ - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i], + for (i = 0; i < test_params->bonded_child_count; i++) { + /* Add rx data to child */ + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[i], &gen_pkt_burst[0], burst_size); /* Call rx burst on bonded device */ @@ -1616,25 +1616,25 @@ test_roundrobin_rx_burst_on_single_slave(void) - /* Verify bonded slave devices rx count */ - /* Verify slave ports tx stats */ - for (j = 0; j < test_params->bonded_slave_count; j++) { - rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats); + /* Verify bonded child devices rx count */ + /* Verify child ports tx stats */ + for (j = 0; j < test_params->bonded_child_count; j++) { + rte_eth_stats_get(test_params->child_port_ids[j], &port_stats); if (i == j) { TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, - "Slave Port (%d) ipackets value (%u) not as expected" - " (%d)", test_params->slave_port_ids[i], + "Child Port (%d) ipackets value (%u) not as expected" + " (%d)", test_params->child_port_ids[i], (unsigned int)port_stats.ipackets, burst_size); } else { TEST_ASSERT_EQUAL(port_stats.ipackets, 0, - "Slave Port (%d) ipackets value (%u) not as expected" - " (%d)", test_params->slave_port_ids[i], + "Child Port (%d) ipackets value (%u) not as expected" + " (%d)", test_params->child_port_ids[i], (unsigned int)port_stats.ipackets, 0); } - /* Reset bonded slaves stats */ - rte_eth_stats_reset(test_params->slave_port_ids[j]); + /* Reset bonded children stats */ + rte_eth_stats_reset(test_params->child_port_ids[j]); } /* reset bonded device stats */ rte_eth_stats_reset(test_params->bonded_port_id); @@ -1646,38 +1646,38 @@ test_roundrobin_rx_burst_on_single_slave(void) } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT (3) +#define TEST_ROUNDROBIN_TX_BURST_CHILD_COUNT (3) static int -test_roundrobin_rx_burst_on_multiple_slaves(void) +test_roundrobin_rx_burst_on_multiple_children(void) { - struct rte_mbuf *gen_pkt_burst[TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT][MAX_PKT_BURST]; + struct rte_mbuf *gen_pkt_burst[TEST_ROUNDROBIN_TX_BURST_CHILD_COUNT][MAX_PKT_BURST]; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - int burst_size[TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT] = { 15, 13, 36 }; + int burst_size[TEST_ROUNDROBIN_TX_BURST_CHILD_COUNT] = { 15, 13, 36 }; int i, nb_rx; - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ROUND_ROBIN, 0, 4, 1), - "Failed to initialize bonded device with slaves"); + "Failed to initialize bonded device with children"); /* Generate test bursts of packets to transmit */ - for (i = 0; i < TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT; i++) { + for (i = 0; i < TEST_ROUNDROBIN_TX_BURST_CHILD_COUNT; i++) { TEST_ASSERT_EQUAL(generate_test_burst( &gen_pkt_burst[i][0], burst_size[i], 0, 1, 0, 0, 0), burst_size[i], "burst generation failed"); } - /* Add rx data to slaves */ - for (i = 0; i < TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT; i++) { - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i], + /* Add rx data to children */ + for (i = 0; i < TEST_ROUNDROBIN_TX_BURST_CHILD_COUNT; i++) { + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[i], &gen_pkt_burst[i][0], burst_size[i]); } @@ -1697,29 +1697,29 @@ test_roundrobin_rx_burst_on_multiple_slaves(void) test_params->bonded_port_id, (unsigned int)port_stats.ipackets, burst_size[0] + burst_size[1] + burst_size[2]); - /* Verify bonded slave devices rx counts */ - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + /* Verify bonded child devices rx counts */ + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0], - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[0], + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[0], (unsigned int)port_stats.ipackets, burst_size[0]); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[1], - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[1], (unsigned int)port_stats.ipackets, + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[1], (unsigned int)port_stats.ipackets, burst_size[1]); - rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[2], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[2], - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[2], + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[2], (unsigned int)port_stats.ipackets, burst_size[2]); - rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[3], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, 0, - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[3], + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[3], (unsigned int)port_stats.ipackets, 0); /* free mbufs */ @@ -1727,8 +1727,8 @@ test_roundrobin_rx_burst_on_multiple_slaves(void) rte_pktmbuf_free(rx_pkt_burst[i]); } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -1739,48 +1739,48 @@ test_roundrobin_verify_mac_assignment(void) int i; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &expected_mac_addr_0), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[2], &expected_mac_addr_2), + test_params->child_port_ids[0]); + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[2], &expected_mac_addr_2), "Failed to get mac address (port %d)", - test_params->slave_port_ids[2]); + test_params->child_port_ids[2]); - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ROUND_ROBIN, 0, 4, 1), - "Failed to initialize bonded device with slaves"); + "Failed to initialize bonded device with children"); - /* Verify that all MACs are the same as first slave added to bonded dev */ - for (i = 0; i < test_params->bonded_slave_count; i++) { - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr), + /* Verify that all MACs are the same as first child added to bonded dev */ + for (i = 0; i < test_params->bonded_child_count; i++) { + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[i]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[i]); } /* change primary and verify that MAC addresses haven't changed */ TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id, - test_params->slave_port_ids[2]), + test_params->child_port_ids[2]), "Failed to set bonded port (%d) primary port to (%d)", - test_params->bonded_port_id, test_params->slave_port_ids[i]); + test_params->bonded_port_id, test_params->child_port_ids[i]); - for (i = 0; i < test_params->bonded_slave_count; i++) { - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr), + for (i = 0; i < test_params->bonded_child_count; i++) { + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address has changed to that of primary" + "child port (%d) mac address has changed to that of primary" " port without stop/start toggle of bonded device", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); } /* stop / start bonded device and verify that primary MAC address is - * propagate to bonded device and slaves */ + * propagate to bonded device and children */ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), "Failed to stop bonded port %u", test_params->bonded_port_id); @@ -1794,16 +1794,16 @@ test_roundrobin_verify_mac_assignment(void) TEST_ASSERT_SUCCESS( memcmp(&expected_mac_addr_2, &read_mac_addr, sizeof(read_mac_addr)), "bonded port (%d) mac address not set to that of new primary port", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); - for (i = 0; i < test_params->bonded_slave_count; i++) { - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr), + for (i = 0; i < test_params->bonded_child_count; i++) { + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_2, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of new primary" - " port", test_params->slave_port_ids[i]); + "child port (%d) mac address not set to that of new primary" + " port", test_params->child_port_ids[i]); } /* Set explicit MAC address */ @@ -1818,19 +1818,19 @@ test_roundrobin_verify_mac_assignment(void) TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr, sizeof(read_mac_addr)), "bonded port (%d) mac address not set to that of new primary port", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); - for (i = 0; i < test_params->bonded_slave_count; i++) { - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr), + for (i = 0; i < test_params->bonded_child_count; i++) { + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr, - sizeof(read_mac_addr)), "slave port (%d) mac address not set to" - " that of new primary port\n", test_params->slave_port_ids[i]); + sizeof(read_mac_addr)), "child port (%d) mac address not set to" + " that of new primary port\n", test_params->child_port_ids[i]); } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -1839,10 +1839,10 @@ test_roundrobin_verify_promiscuous_enable_disable(void) int i, promiscuous_en; int ret; - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ROUND_ROBIN, 0, 4, 1), - "Failed to initialize bonded device with slaves"); + "Failed to initialize bonded device with children"); ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); TEST_ASSERT_SUCCESS(ret, @@ -1854,12 +1854,12 @@ test_roundrobin_verify_promiscuous_enable_disable(void) "Port (%d) promiscuous mode not enabled", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { promiscuous_en = rte_eth_promiscuous_get( - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_EQUAL(promiscuous_en, 1, - "slave port (%d) promiscuous mode not enabled", - test_params->slave_port_ids[i]); + "child port (%d) promiscuous mode not enabled", + test_params->child_port_ids[i]); } ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); @@ -1872,76 +1872,76 @@ test_roundrobin_verify_promiscuous_enable_disable(void) "Port (%d) promiscuous mode not disabled\n", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { promiscuous_en = rte_eth_promiscuous_get( - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_EQUAL(promiscuous_en, 0, "Port (%d) promiscuous mode not disabled\n", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define TEST_RR_LINK_STATUS_SLAVE_COUNT (4) -#define TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT (2) +#define TEST_RR_LINK_STATUS_CHILD_COUNT (4) +#define TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_CHILD_COUNT (2) static int -test_roundrobin_verify_slave_link_status_change_behaviour(void) +test_roundrobin_verify_child_link_status_change_behaviour(void) { struct rte_mbuf *tx_pkt_burst[MAX_PKT_BURST] = { NULL }; - struct rte_mbuf *gen_pkt_burst[TEST_RR_LINK_STATUS_SLAVE_COUNT][MAX_PKT_BURST]; + struct rte_mbuf *gen_pkt_burst[TEST_RR_LINK_STATUS_CHILD_COUNT][MAX_PKT_BURST]; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; - int i, burst_size, slave_count; + int i, burst_size, child_count; /* NULL all pointers in array to simplify cleanup */ memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst)); - /* Initialize bonded device with TEST_RR_LINK_STATUS_SLAVE_COUNT slaves + /* Initialize bonded device with TEST_RR_LINK_STATUS_CHILD_COUNT children * in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( - BONDING_MODE_ROUND_ROBIN, 0, TEST_RR_LINK_STATUS_SLAVE_COUNT, 1), - "Failed to initialize bonded device with slaves"); + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( + BONDING_MODE_ROUND_ROBIN, 0, TEST_RR_LINK_STATUS_CHILD_COUNT, 1), + "Failed to initialize bonded device with children"); - /* Verify Current Slaves Count /Active Slave Count is */ - slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves, + /* Verify Current Childs Count /Active Child Count is */ + child_count = rte_eth_bond_children_get(test_params->bonded_port_id, children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT, - "Number of slaves (%d) is not as expected (%d).", - slave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT); + TEST_ASSERT_EQUAL(child_count, TEST_RR_LINK_STATUS_CHILD_COUNT, + "Number of children (%d) is not as expected (%d).", + child_count, TEST_RR_LINK_STATUS_CHILD_COUNT); - slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT, - "Number of active slaves (%d) is not as expected (%d).", - slave_count, TEST_RR_LINK_STATUS_SLAVE_COUNT); + child_count = rte_eth_bond_active_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(child_count, TEST_RR_LINK_STATUS_CHILD_COUNT, + "Number of active children (%d) is not as expected (%d).", + child_count, TEST_RR_LINK_STATUS_CHILD_COUNT); - /* Set 2 slaves eth_devs link status to down */ + /* Set 2 children eth_devs link status to down */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[1], 0); + test_params->child_port_ids[1], 0); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[3], 0); + test_params->child_port_ids[3], 0); - slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, - TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT, - "Number of active slaves (%d) is not as expected (%d).\n", - slave_count, TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT); + child_count = rte_eth_bond_active_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(child_count, + TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_CHILD_COUNT, + "Number of active children (%d) is not as expected (%d).\n", + child_count, TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_CHILD_COUNT); burst_size = 20; - /* Verify that pkts are not sent on slaves with link status down: + /* Verify that pkts are not sent on children with link status down: * * 1. Generate test burst of traffic * 2. Transmit burst on bonded eth_dev * 3. Verify stats for bonded eth_dev (opackets = burst_size) - * 4. Verify stats for slave eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0) + * 4. Verify stats for child eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0) */ TEST_ASSERT_EQUAL( generate_test_burst(tx_pkt_burst, burst_size, 0, 1, 0, 0, 0), @@ -1960,41 +1960,41 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void) test_params->bonded_port_id, (int)port_stats.opackets, burst_size); - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)10, "Port (%d) opackets stats (%d) not expected (%d) value", - test_params->slave_port_ids[0], (int)port_stats.opackets, 10); + test_params->child_port_ids[0], (int)port_stats.opackets, 10); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)0, "Port (%d) opackets stats (%d) not expected (%d) value", - test_params->slave_port_ids[1], (int)port_stats.opackets, 0); + test_params->child_port_ids[1], (int)port_stats.opackets, 0); - rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[2], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)10, "Port (%d) opackets stats (%d) not expected (%d) value", - test_params->slave_port_ids[2], (int)port_stats.opackets, 10); + test_params->child_port_ids[2], (int)port_stats.opackets, 10); - rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[3], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)0, "Port (%d) opackets stats (%d) not expected (%d) value", - test_params->slave_port_ids[3], (int)port_stats.opackets, 0); + test_params->child_port_ids[3], (int)port_stats.opackets, 0); - /* Verify that pkts are not sent on slaves with link status down: + /* Verify that pkts are not sent on children with link status down: * * 1. Generate test bursts of traffic * 2. Add bursts on to virtual eth_devs * 3. Rx burst on bonded eth_dev, expected (burst_ size * - * TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT) received + * TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_CHILD_COUNT) received * 4. Verify stats for bonded eth_dev - * 6. Verify stats for slave eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0) + * 6. Verify stats for child eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0) */ - for (i = 0; i < TEST_RR_LINK_STATUS_SLAVE_COUNT; i++) { + for (i = 0; i < TEST_RR_LINK_STATUS_CHILD_COUNT; i++) { TEST_ASSERT_EQUAL(generate_test_burst( &gen_pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0), burst_size, "failed to generate packet burst"); - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i], + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[i], &gen_pkt_burst[i][0], burst_size); } @@ -2014,49 +2014,49 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void) rte_pktmbuf_free(rx_pkt_burst[i]); } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT (2) +#define TEST_RR_POLLING_LINK_STATUS_CHILD_COUNT (2) -uint8_t polling_slave_mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00 }; +uint8_t polling_child_mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00 }; -int polling_test_slaves[TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT] = { -1, -1 }; +int polling_test_children[TEST_RR_POLLING_LINK_STATUS_CHILD_COUNT] = { -1, -1 }; static int -test_roundrobin_verfiy_polling_slave_link_status_change(void) +test_roundrobin_verfiy_polling_child_link_status_change(void) { struct rte_ether_addr *mac_addr = - (struct rte_ether_addr *)polling_slave_mac; - char slave_name[RTE_ETH_NAME_MAX_LEN]; + (struct rte_ether_addr *)polling_child_mac; + char child_name[RTE_ETH_NAME_MAX_LEN]; int i; - for (i = 0; i < TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT; i++) { - /* Generate slave name / MAC address */ - snprintf(slave_name, RTE_ETH_NAME_MAX_LEN, "eth_virt_poll_%d", i); + for (i = 0; i < TEST_RR_POLLING_LINK_STATUS_CHILD_COUNT; i++) { + /* Generate child name / MAC address */ + snprintf(child_name, RTE_ETH_NAME_MAX_LEN, "eth_virt_poll_%d", i); mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = i; - /* Create slave devices with no ISR Support */ - if (polling_test_slaves[i] == -1) { - polling_test_slaves[i] = virtual_ethdev_create(slave_name, mac_addr, + /* Create child devices with no ISR Support */ + if (polling_test_children[i] == -1) { + polling_test_children[i] = virtual_ethdev_create(child_name, mac_addr, rte_socket_id(), 0); - TEST_ASSERT(polling_test_slaves[i] >= 0, - "Failed to create virtual virtual ethdev %s\n", slave_name); + TEST_ASSERT(polling_test_children[i] >= 0, + "Failed to create virtual virtual ethdev %s\n", child_name); - /* Configure slave */ - TEST_ASSERT_SUCCESS(configure_ethdev(polling_test_slaves[i], 0, 0), - "Failed to configure virtual ethdev %s(%d)", slave_name, - polling_test_slaves[i]); + /* Configure child */ + TEST_ASSERT_SUCCESS(configure_ethdev(polling_test_children[i], 0, 0), + "Failed to configure virtual ethdev %s(%d)", child_name, + polling_test_children[i]); } - /* Add slave to bonded device */ - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params->bonded_port_id, - polling_test_slaves[i]), - "Failed to add slave %s(%d) to bonded device %d", - slave_name, polling_test_slaves[i], + /* Add child to bonded device */ + TEST_ASSERT_SUCCESS(rte_eth_bond_child_add(test_params->bonded_port_id, + polling_test_children[i]), + "Failed to add child %s(%d) to bonded device %d", + child_name, polling_test_children[i], test_params->bonded_port_id); } @@ -2071,26 +2071,26 @@ test_roundrobin_verfiy_polling_slave_link_status_change(void) RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback, &test_params->bonded_port_id); - /* link status change callback for first slave link up */ + /* link status change callback for first child link up */ test_lsc_interrupt_count = 0; - virtual_ethdev_set_link_status(polling_test_slaves[0], 1); + virtual_ethdev_set_link_status(polling_test_children[0], 1); TEST_ASSERT_SUCCESS(lsc_timeout(15000), "timed out waiting for interrupt"); - /* no link status change callback for second slave link up */ + /* no link status change callback for second child link up */ test_lsc_interrupt_count = 0; - virtual_ethdev_set_link_status(polling_test_slaves[1], 1); + virtual_ethdev_set_link_status(polling_test_children[1], 1); TEST_ASSERT_FAIL(lsc_timeout(15000), "unexpectedly succeeded"); - /* link status change callback for both slave links down */ + /* link status change callback for both child links down */ test_lsc_interrupt_count = 0; - virtual_ethdev_set_link_status(polling_test_slaves[0], 0); - virtual_ethdev_set_link_status(polling_test_slaves[1], 0); + virtual_ethdev_set_link_status(polling_test_children[0], 0); + virtual_ethdev_set_link_status(polling_test_children[1], 0); TEST_ASSERT_SUCCESS(lsc_timeout(20000), "timed out waiting for interrupt"); @@ -2100,17 +2100,17 @@ test_roundrobin_verfiy_polling_slave_link_status_change(void) &test_params->bonded_port_id); - /* Clean up and remove slaves from bonded device */ - for (i = 0; i < TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT; i++) { + /* Clean up and remove children from bonded device */ + for (i = 0; i < TEST_RR_POLLING_LINK_STATUS_CHILD_COUNT; i++) { TEST_ASSERT_SUCCESS( - rte_eth_bond_slave_remove(test_params->bonded_port_id, - polling_test_slaves[i]), - "Failed to remove slave %d from bonded port (%d)", - polling_test_slaves[i], test_params->bonded_port_id); + rte_eth_bond_child_remove(test_params->bonded_port_id, + polling_test_children[i]), + "Failed to remove child %d from bonded port (%d)", + polling_test_children[i], test_params->bonded_port_id); } - return remove_slaves_and_stop_bonded_device(); + return remove_children_and_stop_bonded_device(); } @@ -2123,9 +2123,9 @@ test_activebackup_tx_burst(void) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ACTIVE_BACKUP, 0, 1, 1), - "Failed to initialize bonded device with slaves"); + "Failed to initialize bonded device with children"); initialize_eth_header(test_params->pkt_eth_hdr, (struct rte_ether_addr *)src_mac, @@ -2136,7 +2136,7 @@ test_activebackup_tx_burst(void) pktlen = initialize_ipv4_header(test_params->pkt_ipv4_hdr, src_addr, dst_addr_0, pktlen); - burst_size = 20 * test_params->bonded_slave_count; + burst_size = 20 * test_params->bonded_child_count; TEST_ASSERT(burst_size < MAX_PKT_BURST, "Burst size specified is greater than supported."); @@ -2160,38 +2160,38 @@ test_activebackup_tx_burst(void) primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); - /* Verify slave ports tx stats */ - for (i = 0; i < test_params->bonded_slave_count; i++) { - rte_eth_stats_get(test_params->slave_port_ids[i], &port_stats); - if (test_params->slave_port_ids[i] == primary_port) { + /* Verify child ports tx stats */ + for (i = 0; i < test_params->bonded_child_count; i++) { + rte_eth_stats_get(test_params->child_port_ids[i], &port_stats); + if (test_params->child_port_ids[i] == primary_port) { TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, - "Slave Port (%d) opackets value (%u) not as expected (%d)", + "Child Port (%d) opackets value (%u) not as expected (%d)", test_params->bonded_port_id, (unsigned int)port_stats.opackets, - burst_size / test_params->bonded_slave_count); + burst_size / test_params->bonded_child_count); } else { TEST_ASSERT_EQUAL(port_stats.opackets, 0, - "Slave Port (%d) opackets value (%u) not as expected (%d)", + "Child Port (%d) opackets value (%u) not as expected (%d)", test_params->bonded_port_id, (unsigned int)port_stats.opackets, 0); } } - /* Put all slaves down and try and transmit */ - for (i = 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i = 0; i < test_params->bonded_child_count; i++) { virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 0); + test_params->child_port_ids[i], 0); } /* Send burst on bonded port */ TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst, burst_size), 0, "Sending empty burst failed"); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT (4) +#define TEST_ACTIVE_BACKUP_RX_BURST_CHILD_COUNT (4) static int test_activebackup_rx_burst(void) @@ -2205,24 +2205,24 @@ test_activebackup_rx_burst(void) int i, j, burst_size = 17; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ACTIVE_BACKUP, 0, - TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT, 1), - "Failed to initialize bonded device with slaves"); + TEST_ACTIVE_BACKUP_RX_BURST_CHILD_COUNT, 1), + "Failed to initialize bonded device with children"); primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); TEST_ASSERT(primary_port >= 0, - "failed to get primary slave for bonded port (%d)", + "failed to get primary child for bonded port (%d)", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { /* Generate test bursts of packets to transmit */ TEST_ASSERT_EQUAL(generate_test_burst( &gen_pkt_burst[0], burst_size, 0, 1, 0, 0, 0), burst_size, "burst generation failed"); - /* Add rx data to slave */ - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i], + /* Add rx data to child */ + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[i], &gen_pkt_burst[0], burst_size); /* Call rx burst on bonded device */ @@ -2230,7 +2230,7 @@ test_activebackup_rx_burst(void) &rx_pkt_burst[0], MAX_PKT_BURST), burst_size, "rte_eth_rx_burst failed"); - if (test_params->slave_port_ids[i] == primary_port) { + if (test_params->child_port_ids[i] == primary_port) { /* Verify bonded device rx count */ rte_eth_stats_get(test_params->bonded_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, @@ -2238,27 +2238,27 @@ test_activebackup_rx_burst(void) test_params->bonded_port_id, (unsigned int)port_stats.ipackets, burst_size); - /* Verify bonded slave devices rx count */ - for (j = 0; j < test_params->bonded_slave_count; j++) { - rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats); + /* Verify bonded child devices rx count */ + for (j = 0; j < test_params->bonded_child_count; j++) { + rte_eth_stats_get(test_params->child_port_ids[j], &port_stats); if (i == j) { TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, - "Slave Port (%d) ipackets value (%u) not as " - "expected (%d)", test_params->slave_port_ids[i], + "Child Port (%d) ipackets value (%u) not as " + "expected (%d)", test_params->child_port_ids[i], (unsigned int)port_stats.ipackets, burst_size); } else { TEST_ASSERT_EQUAL(port_stats.ipackets, 0, - "Slave Port (%d) ipackets value (%u) not as " - "expected (%d)\n", test_params->slave_port_ids[i], + "Child Port (%d) ipackets value (%u) not as " + "expected (%d)\n", test_params->child_port_ids[i], (unsigned int)port_stats.ipackets, 0); } } } else { - for (j = 0; j < test_params->bonded_slave_count; j++) { - rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats); + for (j = 0; j < test_params->bonded_child_count; j++) { + rte_eth_stats_get(test_params->child_port_ids[j], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, 0, - "Slave Port (%d) ipackets value (%u) not as expected " - "(%d)", test_params->slave_port_ids[i], + "Child Port (%d) ipackets value (%u) not as expected " + "(%d)", test_params->child_port_ids[i], (unsigned int)port_stats.ipackets, 0); } } @@ -2275,8 +2275,8 @@ test_activebackup_rx_burst(void) rte_eth_stats_reset(test_params->bonded_port_id); } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -2285,14 +2285,14 @@ test_activebackup_verify_promiscuous_enable_disable(void) int i, primary_port, promiscuous_en; int ret; - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ACTIVE_BACKUP, 0, 4, 1), - "Failed to initialize bonded device with slaves"); + "Failed to initialize bonded device with children"); primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); TEST_ASSERT(primary_port >= 0, - "failed to get primary slave for bonded port (%d)", + "failed to get primary child for bonded port (%d)", test_params->bonded_port_id); ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); @@ -2304,17 +2304,17 @@ test_activebackup_verify_promiscuous_enable_disable(void) "Port (%d) promiscuous mode not enabled", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { promiscuous_en = rte_eth_promiscuous_get( - test_params->slave_port_ids[i]); - if (primary_port == test_params->slave_port_ids[i]) { + test_params->child_port_ids[i]); + if (primary_port == test_params->child_port_ids[i]) { TEST_ASSERT_EQUAL(promiscuous_en, 1, - "slave port (%d) promiscuous mode not enabled", - test_params->slave_port_ids[i]); + "child port (%d) promiscuous mode not enabled", + test_params->child_port_ids[i]); } else { TEST_ASSERT_EQUAL(promiscuous_en, 0, - "slave port (%d) promiscuous mode enabled", - test_params->slave_port_ids[i]); + "child port (%d) promiscuous mode enabled", + test_params->child_port_ids[i]); } } @@ -2328,16 +2328,16 @@ test_activebackup_verify_promiscuous_enable_disable(void) "Port (%d) promiscuous mode not disabled\n", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { promiscuous_en = rte_eth_promiscuous_get( - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_EQUAL(promiscuous_en, 0, - "slave port (%d) promiscuous mode not disabled\n", - test_params->slave_port_ids[i]); + "child port (%d) promiscuous mode not disabled\n", + test_params->child_port_ids[i]); } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -2346,19 +2346,19 @@ test_activebackup_verify_mac_assignment(void) struct rte_ether_addr read_mac_addr; struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &expected_mac_addr_0), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1), + test_params->child_port_ids[0]); + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &expected_mac_addr_1), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); - /* Initialize bonded device with 2 slaves in active backup mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 2 children in active backup mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ACTIVE_BACKUP, 0, 2, 1), - "Failed to initialize bonded device with slaves"); + "Failed to initialize bonded device with children"); - /* Verify that bonded MACs is that of first slave and that the other slave + /* Verify that bonded MACs is that of first child and that the other child * MAC hasn't been changed */ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), "Failed to get mac address (port %d)", @@ -2368,27 +2368,27 @@ test_activebackup_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of primary port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[0]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not as expected", - test_params->slave_port_ids[1]); + "child port (%d) mac address not as expected", + test_params->child_port_ids[1]); /* change primary and verify that MAC addresses haven't changed */ TEST_ASSERT_EQUAL(rte_eth_bond_primary_set(test_params->bonded_port_id, - test_params->slave_port_ids[1]), 0, + test_params->child_port_ids[1]), 0, "Failed to set bonded port (%d) primary port to (%d)", - test_params->bonded_port_id, test_params->slave_port_ids[1]); + test_params->bonded_port_id, test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), "Failed to get mac address (port %d)", @@ -2398,24 +2398,24 @@ test_activebackup_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of primary port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[0]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not as expected", - test_params->slave_port_ids[1]); + "child port (%d) mac address not as expected", + test_params->child_port_ids[1]); /* stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and slaves */ + * propagated to bonded device and children */ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), "Failed to stop bonded port %u", @@ -2432,21 +2432,21 @@ test_activebackup_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of primary port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not as expected", - test_params->slave_port_ids[0]); + "child port (%d) mac address not as expected", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[1]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[1]); /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( @@ -2462,36 +2462,36 @@ test_activebackup_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of bonded port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not as expected", - test_params->slave_port_ids[0]); + "child port (%d) mac address not as expected", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of bonded port", - test_params->slave_port_ids[1]); + "child port (%d) mac address not set to that of bonded port", + test_params->child_port_ids[1]); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int -test_activebackup_verify_slave_link_status_change_failover(void) +test_activebackup_verify_child_link_status_change_failover(void) { - struct rte_mbuf *pkt_burst[TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT][MAX_PKT_BURST]; + struct rte_mbuf *pkt_burst[TEST_ACTIVE_BACKUP_RX_BURST_CHILD_COUNT][MAX_PKT_BURST]; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; - int i, burst_size, slave_count, primary_port; + int i, burst_size, child_count, primary_port; burst_size = 21; @@ -2502,96 +2502,96 @@ test_activebackup_verify_slave_link_status_change_failover(void) &pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0), burst_size, "generate_test_burst failed"); - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ACTIVE_BACKUP, 0, - TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT, 1), - "Failed to initialize bonded device with slaves"); + TEST_ACTIVE_BACKUP_RX_BURST_CHILD_COUNT, 1), + "Failed to initialize bonded device with children"); - /* Verify Current Slaves Count /Active Slave Count is */ - slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves, + /* Verify Current Childs Count /Active Child Count is */ + child_count = rte_eth_bond_children_get(test_params->bonded_port_id, children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, 4, - "Number of slaves (%d) is not as expected (%d).", - slave_count, 4); + TEST_ASSERT_EQUAL(child_count, 4, + "Number of children (%d) is not as expected (%d).", + child_count, 4); - slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, 4, - "Number of active slaves (%d) is not as expected (%d).", - slave_count, 4); + child_count = rte_eth_bond_active_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(child_count, 4, + "Number of active children (%d) is not as expected (%d).", + child_count, 4); primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); - TEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[0], + TEST_ASSERT_EQUAL(primary_port, test_params->child_port_ids[0], "Primary port not as expected"); - /* Bring 2 slaves down and verify active slave count */ + /* Bring 2 children down and verify active child count */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[1], 0); + test_params->child_port_ids[1], 0); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[3], 0); + test_params->child_port_ids[3], 0); - TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get( - test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 2, - "Number of active slaves (%d) is not as expected (%d).", - slave_count, 2); + TEST_ASSERT_EQUAL(rte_eth_bond_active_children_get( + test_params->bonded_port_id, children, RTE_MAX_ETHPORTS), 2, + "Number of active children (%d) is not as expected (%d).", + child_count, 2); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[1], 1); + test_params->child_port_ids[1], 1); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[3], 1); + test_params->child_port_ids[3], 1); - /* Bring primary port down, verify that active slave count is 3 and primary + /* Bring primary port down, verify that active child count is 3 and primary * has changed */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[0], 0); + test_params->child_port_ids[0], 0); - TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get( - test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), + TEST_ASSERT_EQUAL(rte_eth_bond_active_children_get( + test_params->bonded_port_id, children, RTE_MAX_ETHPORTS), 3, - "Number of active slaves (%d) is not as expected (%d).", - slave_count, 3); + "Number of active children (%d) is not as expected (%d).", + child_count, 3); primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); - TEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[2], + TEST_ASSERT_EQUAL(primary_port, test_params->child_port_ids[2], "Primary port not as expected"); - /* Verify that pkts are sent on new primary slave */ + /* Verify that pkts are sent on new primary child */ TEST_ASSERT_EQUAL(rte_eth_tx_burst( test_params->bonded_port_id, 0, &pkt_burst[0][0], burst_size), burst_size, "rte_eth_tx_burst failed"); - rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[2], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, "(%d) port_stats.opackets not as expected", - test_params->slave_port_ids[2]); + test_params->child_port_ids[2]); - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, 0, "(%d) port_stats.opackets not as expected\n", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, 0, "(%d) port_stats.opackets not as expected\n", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); - rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[3], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, 0, "(%d) port_stats.opackets not as expected\n", - test_params->slave_port_ids[3]); + test_params->child_port_ids[3]); /* Generate packet burst for testing */ - for (i = 0; i < TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT; i++) { + for (i = 0; i < TEST_ACTIVE_BACKUP_RX_BURST_CHILD_COUNT; i++) { TEST_ASSERT_EQUAL(generate_test_burst( &pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0), burst_size, "generate_test_burst failed"); virtual_ethdev_add_mbufs_to_rx_queue( - test_params->slave_port_ids[i], &pkt_burst[i][0], burst_size); + test_params->child_port_ids[i], &pkt_burst[i][0], burst_size); } TEST_ASSERT_EQUAL(rte_eth_rx_burst( @@ -2604,28 +2604,28 @@ test_activebackup_verify_slave_link_status_change_failover(void) "(%d) port_stats.ipackets not as expected", test_params->bonded_port_id); - rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[2], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, "(%d) port_stats.opackets not as expected", - test_params->slave_port_ids[2]); + test_params->child_port_ids[2]); - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, 0, "(%d) port_stats.opackets not as expected", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, 0, "(%d) port_stats.opackets not as expected", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); - rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[3], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, 0, "(%d) port_stats.opackets not as expected", - test_params->slave_port_ids[3]); + test_params->child_port_ids[3]); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } /** Balance Mode Tests */ @@ -2633,9 +2633,9 @@ test_activebackup_verify_slave_link_status_change_failover(void) static int test_balance_xmit_policy_configuration(void) { - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_ACTIVE_BACKUP, 0, 2, 1), - "Failed to initialize_bonded_device_with_slaves."); + "Failed to initialize_bonded_device_with_children."); /* Invalid port id */ TEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_set( @@ -2644,7 +2644,7 @@ test_balance_xmit_policy_configuration(void) /* Set xmit policy on non bonded device */ TEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_set( - test_params->slave_port_ids[0], BALANCE_XMIT_POLICY_LAYER2), + test_params->child_port_ids[0], BALANCE_XMIT_POLICY_LAYER2), "Expected call to failed as invalid port specified."); @@ -2677,25 +2677,25 @@ test_balance_xmit_policy_configuration(void) TEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_get(INVALID_PORT_ID), "Expected call to failed as invalid port specified."); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT (2) +#define TEST_BALANCE_L2_TX_BURST_CHILD_COUNT (2) static int test_balance_l2_tx_burst(void) { - struct rte_mbuf *pkts_burst[TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT][MAX_PKT_BURST]; - int burst_size[TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT] = { 10, 15 }; + struct rte_mbuf *pkts_burst[TEST_BALANCE_L2_TX_BURST_CHILD_COUNT][MAX_PKT_BURST]; + int burst_size[TEST_BALANCE_L2_TX_BURST_CHILD_COUNT] = { 10, 15 }; uint16_t pktlen; int i; struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( - BONDING_MODE_BALANCE, 0, TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT, 1), - "Failed to initialize_bonded_device_with_slaves."); + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( + BONDING_MODE_BALANCE, 0, TEST_BALANCE_L2_TX_BURST_CHILD_COUNT, 1), + "Failed to initialize_bonded_device_with_children."); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER2), @@ -2730,7 +2730,7 @@ test_balance_l2_tx_burst(void) "failed to generate packet burst"); /* Send burst 1 on bonded port */ - for (i = 0; i < TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT; i++) { + for (i = 0; i < TEST_BALANCE_L2_TX_BURST_CHILD_COUNT; i++) { TEST_ASSERT_EQUAL(rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkts_burst[i][0], burst_size[i]), burst_size[i], "Failed to transmit packet burst"); @@ -2745,24 +2745,24 @@ test_balance_l2_tx_burst(void) burst_size[0] + burst_size[1]); - /* Verify slave ports tx stats */ - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + /* Verify child ports tx stats */ + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size[0], - "Slave Port (%d) opackets value (%u) not as expected (%d)", - test_params->slave_port_ids[0], (unsigned int)port_stats.opackets, + "Child Port (%d) opackets value (%u) not as expected (%d)", + test_params->child_port_ids[0], (unsigned int)port_stats.opackets, burst_size[0]); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size[1], - "Slave Port (%d) opackets value (%u) not as expected (%d)\n", - test_params->slave_port_ids[1], (unsigned int)port_stats.opackets, + "Child Port (%d) opackets value (%u) not as expected (%d)\n", + test_params->child_port_ids[1], (unsigned int)port_stats.opackets, burst_size[1]); - /* Put all slaves down and try and transmit */ - for (i = 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i = 0; i < test_params->bonded_child_count; i++) { virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 0); + test_params->child_port_ids[i], 0); } /* Send burst on bonded port */ @@ -2770,8 +2770,8 @@ test_balance_l2_tx_burst(void) test_params->bonded_port_id, 0, &pkts_burst[0][0], burst_size[0]), 0, "Expected zero packet"); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -2785,9 +2785,9 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_BALANCE, 0, 2, 1), - "Failed to initialize_bonded_device_with_slaves."); + "Failed to initialize_bonded_device_with_children."); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER23), @@ -2825,24 +2825,24 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, test_params->bonded_port_id, (unsigned int)port_stats.opackets, nb_tx_1 + nb_tx_2); - /* Verify slave ports tx stats */ - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + /* Verify child ports tx stats */ + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)nb_tx_1, - "Slave Port (%d) opackets value (%u) not as expected (%d)", - test_params->slave_port_ids[0], (unsigned int)port_stats.opackets, + "Child Port (%d) opackets value (%u) not as expected (%d)", + test_params->child_port_ids[0], (unsigned int)port_stats.opackets, nb_tx_1); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)nb_tx_2, - "Slave Port (%d) opackets value (%u) not as expected (%d)", - test_params->slave_port_ids[1], (unsigned int)port_stats.opackets, + "Child Port (%d) opackets value (%u) not as expected (%d)", + test_params->child_port_ids[1], (unsigned int)port_stats.opackets, nb_tx_2); - /* Put all slaves down and try and transmit */ - for (i = 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i = 0; i < test_params->bonded_child_count; i++) { virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 0); + test_params->child_port_ids[i], 0); } /* Send burst on bonded port */ @@ -2851,8 +2851,8 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, burst_size_1), 0, "Expected zero packet"); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -2897,9 +2897,9 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_BALANCE, 0, 2, 1), - "Failed to initialize_bonded_device_with_slaves."); + "Failed to initialize_bonded_device_with_children."); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER34), @@ -2938,24 +2938,24 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, test_params->bonded_port_id, (unsigned int)port_stats.opackets, nb_tx_1 + nb_tx_2); - /* Verify slave ports tx stats */ - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + /* Verify child ports tx stats */ + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)nb_tx_1, - "Slave Port (%d) opackets value (%u) not as expected (%d)", - test_params->slave_port_ids[0], (unsigned int)port_stats.opackets, + "Child Port (%d) opackets value (%u) not as expected (%d)", + test_params->child_port_ids[0], (unsigned int)port_stats.opackets, nb_tx_1); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)nb_tx_2, - "Slave Port (%d) opackets value (%u) not as expected (%d)", - test_params->slave_port_ids[1], (unsigned int)port_stats.opackets, + "Child Port (%d) opackets value (%u) not as expected (%d)", + test_params->child_port_ids[1], (unsigned int)port_stats.opackets, nb_tx_2); - /* Put all slaves down and try and transmit */ - for (i = 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i = 0; i < test_params->bonded_child_count; i++) { virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 0); + test_params->child_port_ids[i], 0); } /* Send burst on bonded port */ @@ -2963,8 +2963,8 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ipv4, test_params->bonded_port_id, 0, pkts_burst_1, burst_size_1), 0, "Expected zero packet"); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -3003,27 +3003,27 @@ test_balance_l34_tx_burst_ipv6_toggle_udp_port(void) return balance_l34_tx_burst(0, 0, 0, 0, 1); } -#define TEST_BAL_SLAVE_TX_FAIL_SLAVE_COUNT (2) -#define TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 (40) -#define TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2 (20) -#define TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT (25) -#define TEST_BAL_SLAVE_TX_FAIL_FAILING_SLAVE_IDX (0) +#define TEST_BAL_CHILD_TX_FAIL_CHILD_COUNT (2) +#define TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1 (40) +#define TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2 (20) +#define TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT (25) +#define TEST_BAL_CHILD_TX_FAIL_FAILING_CHILD_IDX (0) static int -test_balance_tx_burst_slave_tx_fail(void) +test_balance_tx_burst_child_tx_fail(void) { - struct rte_mbuf *pkts_burst_1[TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1]; - struct rte_mbuf *pkts_burst_2[TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2]; + struct rte_mbuf *pkts_burst_1[TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1]; + struct rte_mbuf *pkts_burst_2[TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2]; - struct rte_mbuf *expected_fail_pkts[TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT]; + struct rte_mbuf *expected_fail_pkts[TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT]; struct rte_eth_stats port_stats; int i, first_tx_fail_idx, tx_count_1, tx_count_2; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_BALANCE, 0, - TEST_BAL_SLAVE_TX_FAIL_SLAVE_COUNT, 1), + TEST_BAL_CHILD_TX_FAIL_CHILD_COUNT, 1), "Failed to initialise bonded device"); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( @@ -3033,46 +3033,46 @@ test_balance_tx_burst_slave_tx_fail(void) /* Generate test bursts for transmission */ TEST_ASSERT_EQUAL(generate_test_burst(pkts_burst_1, - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1, 0, 0, 0, 0, 0), - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1, + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1, 0, 0, 0, 0, 0), + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1, "Failed to generate test packet burst 1"); - first_tx_fail_idx = TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 - - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT; + first_tx_fail_idx = TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1 - + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT; /* copy mbuf references for expected transmission failures */ - for (i = 0; i < TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT; i++) + for (i = 0; i < TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT; i++) expected_fail_pkts[i] = pkts_burst_1[i + first_tx_fail_idx]; TEST_ASSERT_EQUAL(generate_test_burst(pkts_burst_2, - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2, 0, 0, 1, 0, 0), - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2, + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2, 0, 0, 1, 0, 0), + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2, "Failed to generate test packet burst 2"); - /* Set virtual slave TEST_BAL_SLAVE_TX_FAIL_FAILING_SLAVE_IDX to only fail - * transmission of TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT packets of burst */ + /* Set virtual child TEST_BAL_CHILD_TX_FAIL_FAILING_CHILD_IDX to only fail + * transmission of TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT packets of burst */ virtual_ethdev_tx_burst_fn_set_success( - test_params->slave_port_ids[TEST_BAL_SLAVE_TX_FAIL_FAILING_SLAVE_IDX], + test_params->child_port_ids[TEST_BAL_CHILD_TX_FAIL_FAILING_CHILD_IDX], 0); virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count( - test_params->slave_port_ids[TEST_BAL_SLAVE_TX_FAIL_FAILING_SLAVE_IDX], - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT); + test_params->child_port_ids[TEST_BAL_CHILD_TX_FAIL_FAILING_CHILD_IDX], + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT); /* Transmit burst 1 */ tx_count_1 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_1, - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1); + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1); - TEST_ASSERT_EQUAL(tx_count_1, TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 - - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT, + TEST_ASSERT_EQUAL(tx_count_1, TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1 - + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT, "Transmitted (%d) packets, expected to transmit (%d) packets", - tx_count_1, TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 - - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT); + tx_count_1, TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1 - + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT); /* Verify that failed packet are expected failed packets */ - for (i = 0; i < TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT; i++) { + for (i = 0; i < TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT; i++) { TEST_ASSERT_EQUAL(expected_fail_pkts[i], pkts_burst_1[i + tx_count_1], "expected mbuf (%d) pointer %p not expected pointer %p", i, expected_fail_pkts[i], pkts_burst_1[i + tx_count_1]); @@ -3080,94 +3080,94 @@ test_balance_tx_burst_slave_tx_fail(void) /* Transmit burst 2 */ tx_count_2 = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst_2, - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2); + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2); - TEST_ASSERT_EQUAL(tx_count_2, TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2, + TEST_ASSERT_EQUAL(tx_count_2, TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2, "Transmitted (%d) packets, expected to transmit (%d) packets", - tx_count_2, TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2); + tx_count_2, TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2); /* Verify bonded port tx stats */ rte_eth_stats_get(test_params->bonded_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, - (uint64_t)((TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 - - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT) + - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2), + (uint64_t)((TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1 - + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT) + + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2), "Bonded Port (%d) opackets value (%u) not as expected (%d)", test_params->bonded_port_id, (unsigned int)port_stats.opackets, - (TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 - - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT) + - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2); + (TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1 - + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT) + + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2); - /* Verify slave ports tx stats */ + /* Verify child ports tx stats */ - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t) - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 - - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT, - "Slave Port (%d) opackets value (%u) not as expected (%d)", - test_params->slave_port_ids[0], + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1 - + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT, + "Child Port (%d) opackets value (%u) not as expected (%d)", + test_params->child_port_ids[0], (unsigned int)port_stats.opackets, - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 - - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT); + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1 - + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, - (uint64_t)TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2, - "Slave Port (%d) opackets value (%u) not as expected (%d)", - test_params->slave_port_ids[1], + (uint64_t)TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2, + "Child Port (%d) opackets value (%u) not as expected (%d)", + test_params->child_port_ids[1], (unsigned int)port_stats.opackets, - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2); + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2); /* Verify that all mbufs have a ref value of zero */ TEST_ASSERT_SUCCESS(verify_mbufs_ref_count(&pkts_burst_1[tx_count_1], - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT, 1), + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT, 1), "mbufs refcnts not as expected"); free_mbufs(&pkts_burst_1[tx_count_1], - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT); + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define TEST_BALANCE_RX_BURST_SLAVE_COUNT (3) +#define TEST_BALANCE_RX_BURST_CHILD_COUNT (3) static int test_balance_rx_burst(void) { - struct rte_mbuf *gen_pkt_burst[TEST_BALANCE_RX_BURST_SLAVE_COUNT][MAX_PKT_BURST]; + struct rte_mbuf *gen_pkt_burst[TEST_BALANCE_RX_BURST_CHILD_COUNT][MAX_PKT_BURST]; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - int burst_size[TEST_BALANCE_RX_BURST_SLAVE_COUNT] = { 10, 5, 30 }; + int burst_size[TEST_BALANCE_RX_BURST_CHILD_COUNT] = { 10, 5, 30 }; int i, j; memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst)); - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_BALANCE, 0, 3, 1), "Failed to initialise bonded device"); /* Generate test bursts of packets to transmit */ - for (i = 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) { + for (i = 0; i < TEST_BALANCE_RX_BURST_CHILD_COUNT; i++) { TEST_ASSERT_EQUAL(generate_test_burst( &gen_pkt_burst[i][0], burst_size[i], 0, 0, 1, 0, 0), burst_size[i], "failed to generate packet burst"); } - /* Add rx data to slaves */ - for (i = 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) { - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i], + /* Add rx data to children */ + for (i = 0; i < TEST_BALANCE_RX_BURST_CHILD_COUNT; i++) { + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[i], &gen_pkt_burst[i][0], burst_size[i]); } @@ -3187,33 +3187,33 @@ test_balance_rx_burst(void) burst_size[0] + burst_size[1] + burst_size[2]); - /* Verify bonded slave devices rx counts */ - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + /* Verify bonded child devices rx counts */ + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0], - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[0], + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[0], (unsigned int)port_stats.ipackets, burst_size[0]); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[1], - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[1], (unsigned int)port_stats.ipackets, + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[1], (unsigned int)port_stats.ipackets, burst_size[1]); - rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[2], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[2], - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[2], (unsigned int)port_stats.ipackets, + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[2], (unsigned int)port_stats.ipackets, burst_size[2]); - rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[3], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, 0, - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[3], (unsigned int)port_stats.ipackets, + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[3], (unsigned int)port_stats.ipackets, 0); /* free mbufs */ - for (i = 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) { + for (i = 0; i < TEST_BALANCE_RX_BURST_CHILD_COUNT; i++) { for (j = 0; j < MAX_PKT_BURST; j++) { if (gen_pkt_burst[i][j] != NULL) { rte_pktmbuf_free(gen_pkt_burst[i][j]); @@ -3222,8 +3222,8 @@ test_balance_rx_burst(void) } } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -3232,8 +3232,8 @@ test_balance_verify_promiscuous_enable_disable(void) int i; int ret; - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_BALANCE, 0, 4, 1), "Failed to initialise bonded device"); @@ -3246,11 +3246,11 @@ test_balance_verify_promiscuous_enable_disable(void) "Port (%d) promiscuous mode not enabled", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { TEST_ASSERT_EQUAL(rte_eth_promiscuous_get( - test_params->slave_port_ids[i]), 1, + test_params->child_port_ids[i]), 1, "Port (%d) promiscuous mode not enabled", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); } ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); @@ -3262,15 +3262,15 @@ test_balance_verify_promiscuous_enable_disable(void) "Port (%d) promiscuous mode not disabled", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { TEST_ASSERT_EQUAL(rte_eth_promiscuous_get( - test_params->slave_port_ids[i]), 0, + test_params->child_port_ids[i]), 0, "Port (%d) promiscuous mode not disabled", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -3279,19 +3279,19 @@ test_balance_verify_mac_assignment(void) struct rte_ether_addr read_mac_addr; struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &expected_mac_addr_0), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1), + test_params->child_port_ids[0]); + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &expected_mac_addr_1), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); - /* Initialize bonded device with 2 slaves in active backup mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 2 children in active backup mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_BALANCE, 0, 2, 1), "Failed to initialise bonded device"); - /* Verify that bonded MACs is that of first slave and that the other slave + /* Verify that bonded MACs is that of first child and that the other child * MAC hasn't been changed */ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), "Failed to get mac address (port %d)", @@ -3301,27 +3301,27 @@ test_balance_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of primary port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[0]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[1]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[1]); /* change primary and verify that MAC addresses haven't changed */ TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id, - test_params->slave_port_ids[1]), + test_params->child_port_ids[1]), "Failed to set bonded port (%d) primary port to (%d)\n", - test_params->bonded_port_id, test_params->slave_port_ids[1]); + test_params->bonded_port_id, test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), "Failed to get mac address (port %d)", @@ -3331,24 +3331,24 @@ test_balance_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of primary port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[0]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[1]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[1]); /* stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and slaves */ + * propagated to bonded device and children */ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), "Failed to stop bonded port %u", @@ -3365,21 +3365,21 @@ test_balance_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of primary port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[0]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[1]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[1]); /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( @@ -3395,44 +3395,44 @@ test_balance_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of bonded port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not as expected\n", - test_params->slave_port_ids[0]); + "child port (%d) mac address not as expected\n", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of bonded port", - test_params->slave_port_ids[1]); + "child port (%d) mac address not set to that of bonded port", + test_params->child_port_ids[1]); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define TEST_BALANCE_LINK_STATUS_SLAVE_COUNT (4) +#define TEST_BALANCE_LINK_STATUS_CHILD_COUNT (4) static int -test_balance_verify_slave_link_status_change_behaviour(void) +test_balance_verify_child_link_status_change_behaviour(void) { - struct rte_mbuf *pkt_burst[TEST_BALANCE_LINK_STATUS_SLAVE_COUNT][MAX_PKT_BURST]; + struct rte_mbuf *pkt_burst[TEST_BALANCE_LINK_STATUS_CHILD_COUNT][MAX_PKT_BURST]; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; - int i, burst_size, slave_count; + int i, burst_size, child_count; memset(pkt_burst, 0, sizeof(pkt_burst)); - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( - BONDING_MODE_BALANCE, 0, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT, 1), + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( + BONDING_MODE_BALANCE, 0, TEST_BALANCE_LINK_STATUS_CHILD_COUNT, 1), "Failed to initialise bonded device"); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( @@ -3440,32 +3440,32 @@ test_balance_verify_slave_link_status_change_behaviour(void) "Failed to set balance xmit policy."); - /* Verify Current Slaves Count /Active Slave Count is */ - slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves, + /* Verify Current Childs Count /Active Child Count is */ + child_count = rte_eth_bond_children_get(test_params->bonded_port_id, children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT, - "Number of slaves (%d) is not as expected (%d).", - slave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT); + TEST_ASSERT_EQUAL(child_count, TEST_BALANCE_LINK_STATUS_CHILD_COUNT, + "Number of children (%d) is not as expected (%d).", + child_count, TEST_BALANCE_LINK_STATUS_CHILD_COUNT); - slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT, - "Number of active slaves (%d) is not as expected (%d).", - slave_count, TEST_BALANCE_LINK_STATUS_SLAVE_COUNT); + child_count = rte_eth_bond_active_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(child_count, TEST_BALANCE_LINK_STATUS_CHILD_COUNT, + "Number of active children (%d) is not as expected (%d).", + child_count, TEST_BALANCE_LINK_STATUS_CHILD_COUNT); - /* Set 2 slaves link status to down */ + /* Set 2 children link status to down */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[1], 0); + test_params->child_port_ids[1], 0); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[3], 0); + test_params->child_port_ids[3], 0); - TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get( - test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 2, - "Number of active slaves (%d) is not as expected (%d).", - slave_count, 2); + TEST_ASSERT_EQUAL(rte_eth_bond_active_children_get( + test_params->bonded_port_id, children, RTE_MAX_ETHPORTS), 2, + "Number of active children (%d) is not as expected (%d).", + child_count, 2); /* Send to sets of packet burst and verify that they are balanced across - * slaves */ + * children */ burst_size = 21; TEST_ASSERT_EQUAL(generate_test_burst( @@ -3491,27 +3491,27 @@ test_balance_verify_slave_link_status_change_behaviour(void) test_params->bonded_port_id, (int)port_stats.opackets, burst_size + burst_size); - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, "(%d) port_stats.opackets (%d) not as expected (%d).", - test_params->slave_port_ids[0], (int)port_stats.opackets, + test_params->child_port_ids[0], (int)port_stats.opackets, burst_size); - rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[2], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, "(%d) port_stats.opackets (%d) not as expected (%d).", - test_params->slave_port_ids[2], (int)port_stats.opackets, + test_params->child_port_ids[2], (int)port_stats.opackets, burst_size); - /* verify that all packets get send on primary slave when no other slaves + /* verify that all packets get send on primary child when no other children * are available */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[2], 0); + test_params->child_port_ids[2], 0); - TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get( - test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 1, - "Number of active slaves (%d) is not as expected (%d).", - slave_count, 1); + TEST_ASSERT_EQUAL(rte_eth_bond_active_children_get( + test_params->bonded_port_id, children, RTE_MAX_ETHPORTS), 1, + "Number of active children (%d) is not as expected (%d).", + child_count, 1); TEST_ASSERT_EQUAL(generate_test_burst( &pkt_burst[1][0], burst_size, 0, 1, 1, 0, 0), burst_size, @@ -3528,31 +3528,31 @@ test_balance_verify_slave_link_status_change_behaviour(void) test_params->bonded_port_id, (int)port_stats.opackets, burst_size + burst_size + burst_size); - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size + burst_size), "(%d) port_stats.opackets (%d) not as expected (%d).", - test_params->slave_port_ids[0], (int)port_stats.opackets, + test_params->child_port_ids[0], (int)port_stats.opackets, burst_size + burst_size); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[0], 0); + test_params->child_port_ids[0], 0); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[1], 1); + test_params->child_port_ids[1], 1); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[2], 1); + test_params->child_port_ids[2], 1); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[3], 1); + test_params->child_port_ids[3], 1); - for (i = 0; i < TEST_BALANCE_LINK_STATUS_SLAVE_COUNT; i++) { + for (i = 0; i < TEST_BALANCE_LINK_STATUS_CHILD_COUNT; i++) { TEST_ASSERT_EQUAL(generate_test_burst( &pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0), burst_size, "Failed to generate packet burst"); - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i], + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[i], &pkt_burst[i][0], burst_size); } - /* Verify that pkts are not received on slaves with link status down */ + /* Verify that pkts are not received on children with link status down */ rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst, MAX_PKT_BURST); @@ -3564,8 +3564,8 @@ test_balance_verify_slave_link_status_change_behaviour(void) test_params->bonded_port_id, (int)port_stats.ipackets, burst_size * 3); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -3576,7 +3576,7 @@ test_broadcast_tx_burst(void) struct rte_eth_stats port_stats; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_BROADCAST, 0, 2, 1), "Failed to initialise bonded device"); @@ -3590,7 +3590,7 @@ test_broadcast_tx_burst(void) pktlen = initialize_ipv4_header(test_params->pkt_ipv4_hdr, src_addr, dst_addr_0, pktlen); - burst_size = 20 * test_params->bonded_slave_count; + burst_size = 20 * test_params->bonded_child_count; TEST_ASSERT(burst_size < MAX_PKT_BURST, "Burst size specified is greater than supported."); @@ -3611,25 +3611,25 @@ test_broadcast_tx_burst(void) /* Verify bonded port tx stats */ rte_eth_stats_get(test_params->bonded_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, - (uint64_t)burst_size * test_params->bonded_slave_count, + (uint64_t)burst_size * test_params->bonded_child_count, "Bonded Port (%d) opackets value (%u) not as expected (%d)", test_params->bonded_port_id, (unsigned int)port_stats.opackets, burst_size); - /* Verify slave ports tx stats */ - for (i = 0; i < test_params->bonded_slave_count; i++) { - rte_eth_stats_get(test_params->slave_port_ids[i], &port_stats); + /* Verify child ports tx stats */ + for (i = 0; i < test_params->bonded_child_count; i++) { + rte_eth_stats_get(test_params->child_port_ids[i], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, - "Slave Port (%d) opackets value (%u) not as expected (%d)\n", + "Child Port (%d) opackets value (%u) not as expected (%d)\n", test_params->bonded_port_id, (unsigned int)port_stats.opackets, burst_size); } - /* Put all slaves down and try and transmit */ - for (i = 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i = 0; i < test_params->bonded_child_count; i++) { virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 0); + test_params->child_port_ids[i], 0); } /* Send burst on bonded port */ @@ -3637,159 +3637,159 @@ test_broadcast_tx_burst(void) test_params->bonded_port_id, 0, pkts_burst, burst_size), 0, "transmitted an unexpected number of packets"); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define TEST_BCAST_SLAVE_TX_FAIL_SLAVE_COUNT (3) -#define TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE (40) -#define TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT (15) -#define TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT (10) +#define TEST_BCAST_CHILD_TX_FAIL_CHILD_COUNT (3) +#define TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE (40) +#define TEST_BCAST_CHILD_TX_FAIL_MAX_PACKETS_COUNT (15) +#define TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT (10) static int -test_broadcast_tx_burst_slave_tx_fail(void) +test_broadcast_tx_burst_child_tx_fail(void) { - struct rte_mbuf *pkts_burst[TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE]; - struct rte_mbuf *expected_fail_pkts[TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT]; + struct rte_mbuf *pkts_burst[TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE]; + struct rte_mbuf *expected_fail_pkts[TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT]; struct rte_eth_stats port_stats; int i, tx_count; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_BROADCAST, 0, - TEST_BCAST_SLAVE_TX_FAIL_SLAVE_COUNT, 1), + TEST_BCAST_CHILD_TX_FAIL_CHILD_COUNT, 1), "Failed to initialise bonded device"); /* Generate test bursts for transmission */ TEST_ASSERT_EQUAL(generate_test_burst(pkts_burst, - TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE, 0, 0, 0, 0, 0), - TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE, + TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE, 0, 0, 0, 0, 0), + TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE, "Failed to generate test packet burst"); - for (i = 0; i < TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT; i++) { - expected_fail_pkts[i] = pkts_burst[TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE - - TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT + i]; + for (i = 0; i < TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT; i++) { + expected_fail_pkts[i] = pkts_burst[TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE - + TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT + i]; } - /* Set virtual slave TEST_BAL_SLAVE_TX_FAIL_FAILING_SLAVE_IDX to only fail - * transmission of TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT packets of burst */ + /* Set virtual child TEST_BAL_CHILD_TX_FAIL_FAILING_CHILD_IDX to only fail + * transmission of TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT packets of burst */ virtual_ethdev_tx_burst_fn_set_success( - test_params->slave_port_ids[0], + test_params->child_port_ids[0], 0); virtual_ethdev_tx_burst_fn_set_success( - test_params->slave_port_ids[1], + test_params->child_port_ids[1], 0); virtual_ethdev_tx_burst_fn_set_success( - test_params->slave_port_ids[2], + test_params->child_port_ids[2], 0); virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count( - test_params->slave_port_ids[0], - TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT); + test_params->child_port_ids[0], + TEST_BCAST_CHILD_TX_FAIL_MAX_PACKETS_COUNT); virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count( - test_params->slave_port_ids[1], - TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT); + test_params->child_port_ids[1], + TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT); virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count( - test_params->slave_port_ids[2], - TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT); + test_params->child_port_ids[2], + TEST_BCAST_CHILD_TX_FAIL_MAX_PACKETS_COUNT); /* Transmit burst */ tx_count = rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burst, - TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE); + TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE); - TEST_ASSERT_EQUAL(tx_count, TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE - - TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT, + TEST_ASSERT_EQUAL(tx_count, TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE - + TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT, "Transmitted (%d) packets, expected to transmit (%d) packets", - tx_count, TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE - - TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT); + tx_count, TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE - + TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT); /* Verify that failed packet are expected failed packets */ - for (i = 0; i < TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT; i++) { + for (i = 0; i < TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT; i++) { TEST_ASSERT_EQUAL(expected_fail_pkts[i], pkts_burst[i + tx_count], "expected mbuf (%d) pointer %p not expected pointer %p", i, expected_fail_pkts[i], pkts_burst[i + tx_count]); } - /* Verify slave ports tx stats */ + /* Verify child ports tx stats */ - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, - (uint64_t)TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE - - TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT, + (uint64_t)TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE - + TEST_BCAST_CHILD_TX_FAIL_MAX_PACKETS_COUNT, "Port (%d) opackets value (%u) not as expected (%d)", test_params->bonded_port_id, (unsigned int)port_stats.opackets, - TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE - - TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT); + TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE - + TEST_BCAST_CHILD_TX_FAIL_MAX_PACKETS_COUNT); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, - (uint64_t)TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE - - TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT, + (uint64_t)TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE - + TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT, "Port (%d) opackets value (%u) not as expected (%d)", test_params->bonded_port_id, (unsigned int)port_stats.opackets, - TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE - - TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT); + TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE - + TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT); - rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[2], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, - (uint64_t)TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE - - TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT, + (uint64_t)TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE - + TEST_BCAST_CHILD_TX_FAIL_MAX_PACKETS_COUNT, "Port (%d) opackets value (%u) not as expected (%d)", test_params->bonded_port_id, (unsigned int)port_stats.opackets, - TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE - - TEST_BCAST_SLAVE_TX_FAIL_MAX_PACKETS_COUNT); + TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE - + TEST_BCAST_CHILD_TX_FAIL_MAX_PACKETS_COUNT); /* Verify that all mbufs who transmission failed have a ref value of one */ TEST_ASSERT_SUCCESS(verify_mbufs_ref_count(&pkts_burst[tx_count], - TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT, 1), + TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT, 1), "mbufs refcnts not as expected"); free_mbufs(&pkts_burst[tx_count], - TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT); + TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define BROADCAST_RX_BURST_NUM_OF_SLAVES (3) +#define BROADCAST_RX_BURST_NUM_OF_CHILDS (3) static int test_broadcast_rx_burst(void) { - struct rte_mbuf *gen_pkt_burst[BROADCAST_RX_BURST_NUM_OF_SLAVES][MAX_PKT_BURST]; + struct rte_mbuf *gen_pkt_burst[BROADCAST_RX_BURST_NUM_OF_CHILDS][MAX_PKT_BURST]; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - int burst_size[BROADCAST_RX_BURST_NUM_OF_SLAVES] = { 10, 5, 30 }; + int burst_size[BROADCAST_RX_BURST_NUM_OF_CHILDS] = { 10, 5, 30 }; int i, j; memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst)); - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_BROADCAST, 0, 3, 1), "Failed to initialise bonded device"); /* Generate test bursts of packets to transmit */ - for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_SLAVES; i++) { + for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_CHILDS; i++) { TEST_ASSERT_EQUAL(generate_test_burst( &gen_pkt_burst[i][0], burst_size[i], 0, 0, 1, 0, 0), burst_size[i], "failed to generate packet burst"); } - /* Add rx data to slave 0 */ - for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_SLAVES; i++) { - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i], + /* Add rx data to child 0 */ + for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_CHILDS; i++) { + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[i], &gen_pkt_burst[i][0], burst_size[i]); } @@ -3810,33 +3810,33 @@ test_broadcast_rx_burst(void) burst_size[0] + burst_size[1] + burst_size[2]); - /* Verify bonded slave devices rx counts */ - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + /* Verify bonded child devices rx counts */ + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[0], - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[0], (unsigned int)port_stats.ipackets, + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[0], (unsigned int)port_stats.ipackets, burst_size[0]); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[1], - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[0], (unsigned int)port_stats.ipackets, + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[0], (unsigned int)port_stats.ipackets, burst_size[1]); - rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[2], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size[2], - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[2], (unsigned int)port_stats.ipackets, + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[2], (unsigned int)port_stats.ipackets, burst_size[2]); - rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[3], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, 0, - "Slave Port (%d) ipackets value (%u) not as expected (%d)", - test_params->slave_port_ids[3], (unsigned int)port_stats.ipackets, + "Child Port (%d) ipackets value (%u) not as expected (%d)", + test_params->child_port_ids[3], (unsigned int)port_stats.ipackets, 0); /* free mbufs allocate for rx testing */ - for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_SLAVES; i++) { + for (i = 0; i < BROADCAST_RX_BURST_NUM_OF_CHILDS; i++) { for (j = 0; j < MAX_PKT_BURST; j++) { if (gen_pkt_burst[i][j] != NULL) { rte_pktmbuf_free(gen_pkt_burst[i][j]); @@ -3845,8 +3845,8 @@ test_broadcast_rx_burst(void) } } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -3855,8 +3855,8 @@ test_broadcast_verify_promiscuous_enable_disable(void) int i; int ret; - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_BROADCAST, 0, 4, 1), "Failed to initialise bonded device"); @@ -3870,11 +3870,11 @@ test_broadcast_verify_promiscuous_enable_disable(void) "Port (%d) promiscuous mode not enabled", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { TEST_ASSERT_EQUAL(rte_eth_promiscuous_get( - test_params->slave_port_ids[i]), 1, + test_params->child_port_ids[i]), 1, "Port (%d) promiscuous mode not enabled", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); } ret = rte_eth_promiscuous_disable(test_params->bonded_port_id); @@ -3886,15 +3886,15 @@ test_broadcast_verify_promiscuous_enable_disable(void) "Port (%d) promiscuous mode not disabled", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { TEST_ASSERT_EQUAL(rte_eth_promiscuous_get( - test_params->slave_port_ids[i]), 0, + test_params->child_port_ids[i]), 0, "Port (%d) promiscuous mode not disabled", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -3905,49 +3905,49 @@ test_broadcast_verify_mac_assignment(void) int i; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &expected_mac_addr_0), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[2], &expected_mac_addr_1), + test_params->child_port_ids[0]); + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[2], &expected_mac_addr_1), "Failed to get mac address (port %d)", - test_params->slave_port_ids[2]); + test_params->child_port_ids[2]); - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_BROADCAST, 0, 4, 1), "Failed to initialise bonded device"); - /* Verify that all MACs are the same as first slave added to bonded + /* Verify that all MACs are the same as first child added to bonded * device */ - for (i = 0; i < test_params->bonded_slave_count; i++) { - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr), + for (i = 0; i < test_params->bonded_child_count; i++) { + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[i]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[i]); } /* change primary and verify that MAC addresses haven't changed */ TEST_ASSERT_SUCCESS(rte_eth_bond_primary_set(test_params->bonded_port_id, - test_params->slave_port_ids[2]), + test_params->child_port_ids[2]), "Failed to set bonded port (%d) primary port to (%d)", - test_params->bonded_port_id, test_params->slave_port_ids[i]); + test_params->bonded_port_id, test_params->child_port_ids[i]); - for (i = 0; i < test_params->bonded_slave_count; i++) { - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr), + for (i = 0; i < test_params->bonded_child_count; i++) { + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address has changed to that of primary " + "child port (%d) mac address has changed to that of primary " "port without stop/start toggle of bonded device", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); } /* stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and slaves */ + * propagated to bonded device and children */ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), "Failed to stop bonded port %u", @@ -3962,16 +3962,16 @@ test_broadcast_verify_mac_assignment(void) TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), "bonded port (%d) mac address not set to that of new primary port", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); - for (i = 0; i < test_params->bonded_slave_count; i++) { - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr), + for (i = 0; i < test_params->bonded_child_count; i++) { + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of new primary " - "port", test_params->slave_port_ids[i]); + "child port (%d) mac address not set to that of new primary " + "port", test_params->child_port_ids[i]); } /* Set explicit MAC address */ @@ -3986,71 +3986,71 @@ test_broadcast_verify_mac_assignment(void) TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr, sizeof(read_mac_addr)), "bonded port (%d) mac address not set to that of new primary port", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); - for (i = 0; i < test_params->bonded_slave_count; i++) { - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr), + for (i = 0; i < test_params->bonded_child_count; i++) { + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[i], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_SUCCESS(memcmp(bonded_mac, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of new primary " - "port", test_params->slave_port_ids[i]); + "child port (%d) mac address not set to that of new primary " + "port", test_params->child_port_ids[i]); } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define BROADCAST_LINK_STATUS_NUM_OF_SLAVES (4) +#define BROADCAST_LINK_STATUS_NUM_OF_CHILDS (4) static int -test_broadcast_verify_slave_link_status_change_behaviour(void) +test_broadcast_verify_child_link_status_change_behaviour(void) { - struct rte_mbuf *pkt_burst[BROADCAST_LINK_STATUS_NUM_OF_SLAVES][MAX_PKT_BURST]; + struct rte_mbuf *pkt_burst[BROADCAST_LINK_STATUS_NUM_OF_CHILDS][MAX_PKT_BURST]; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; - int i, burst_size, slave_count; + int i, burst_size, child_count; memset(pkt_burst, 0, sizeof(pkt_burst)); - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( - BONDING_MODE_BROADCAST, 0, BROADCAST_LINK_STATUS_NUM_OF_SLAVES, + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( + BONDING_MODE_BROADCAST, 0, BROADCAST_LINK_STATUS_NUM_OF_CHILDS, 1), "Failed to initialise bonded device"); - /* Verify Current Slaves Count /Active Slave Count is */ - slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves, + /* Verify Current Childs Count /Active Child Count is */ + child_count = rte_eth_bond_children_get(test_params->bonded_port_id, children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, 4, - "Number of slaves (%d) is not as expected (%d).", - slave_count, 4); + TEST_ASSERT_EQUAL(child_count, 4, + "Number of children (%d) is not as expected (%d).", + child_count, 4); - slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, 4, - "Number of active slaves (%d) is not as expected (%d).", - slave_count, 4); + child_count = rte_eth_bond_active_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(child_count, 4, + "Number of active children (%d) is not as expected (%d).", + child_count, 4); - /* Set 2 slaves link status to down */ + /* Set 2 children link status to down */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[1], 0); + test_params->child_port_ids[1], 0); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[3], 0); + test_params->child_port_ids[3], 0); - slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, 2, - "Number of active slaves (%d) is not as expected (%d).", - slave_count, 2); + child_count = rte_eth_bond_active_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(child_count, 2, + "Number of active children (%d) is not as expected (%d).", + child_count, 2); - for (i = 0; i < test_params->bonded_slave_count; i++) - rte_eth_stats_reset(test_params->slave_port_ids[i]); + for (i = 0; i < test_params->bonded_child_count; i++) + rte_eth_stats_reset(test_params->child_port_ids[i]); - /* Verify that pkts are not sent on slaves with link status down */ + /* Verify that pkts are not sent on children with link status down */ burst_size = 21; TEST_ASSERT_EQUAL(generate_test_burst( @@ -4062,43 +4062,43 @@ test_broadcast_verify_slave_link_status_change_behaviour(void) "rte_eth_tx_burst failed\n"); rte_eth_stats_get(test_params->bonded_port_id, &port_stats); - TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size * slave_count), + TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size * child_count), "(%d) port_stats.opackets (%d) not as expected (%d)\n", test_params->bonded_port_id, (int)port_stats.opackets, - burst_size * slave_count); + burst_size * child_count); - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, "(%d) port_stats.opackets not as expected", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, 0, "(%d) port_stats.opackets not as expected", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); - rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[2], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)burst_size, "(%d) port_stats.opackets not as expected", - test_params->slave_port_ids[2]); + test_params->child_port_ids[2]); - rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[3], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, 0, "(%d) port_stats.opackets not as expected", - test_params->slave_port_ids[3]); + test_params->child_port_ids[3]); - for (i = 0; i < BROADCAST_LINK_STATUS_NUM_OF_SLAVES; i++) { + for (i = 0; i < BROADCAST_LINK_STATUS_NUM_OF_CHILDS; i++) { TEST_ASSERT_EQUAL(generate_test_burst( &pkt_burst[i][0], burst_size, 0, 0, 1, 0, 0), burst_size, "failed to generate packet burst"); - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i], + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[i], &pkt_burst[i][0], burst_size); } - /* Verify that pkts are not received on slaves with link status down */ + /* Verify that pkts are not received on children with link status down */ TEST_ASSERT_EQUAL(rte_eth_rx_burst( test_params->bonded_port_id, 0, rx_pkt_burst, MAX_PKT_BURST), burst_size + burst_size, "rte_eth_rx_burst failed"); @@ -4110,8 +4110,8 @@ test_broadcast_verify_slave_link_status_change_behaviour(void) "(%d) port_stats.ipackets not as expected\n", test_params->bonded_port_id); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -4146,21 +4146,21 @@ testsuite_teardown(void) free(test_params->pkt_eth_hdr); test_params->pkt_eth_hdr = NULL; - /* Clean up and remove slaves from bonded device */ - remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + remove_children_and_stop_bonded_device(); } static void free_virtualpmd_tx_queue(void) { - int i, slave_port, to_free_cnt; + int i, child_port, to_free_cnt; struct rte_mbuf *pkts_to_free[MAX_PKT_BURST]; /* Free tx queue of virtual pmd */ - for (slave_port = 0; slave_port < test_params->bonded_slave_count; - slave_port++) { + for (child_port = 0; child_port < test_params->bonded_child_count; + child_port++) { to_free_cnt = virtual_ethdev_get_mbufs_from_tx_queue( - test_params->slave_port_ids[slave_port], + test_params->child_port_ids[child_port], pkts_to_free, MAX_PKT_BURST); for (i = 0; i < to_free_cnt; i++) rte_pktmbuf_free(pkts_to_free[i]); @@ -4177,11 +4177,11 @@ test_tlb_tx_burst(void) uint64_t sum_ports_opackets = 0, all_bond_opackets = 0, all_bond_obytes = 0; uint16_t pktlen; - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children (BONDING_MODE_TLB, 1, 3, 1), "Failed to initialise bonded device"); - burst_size = 20 * test_params->bonded_slave_count; + burst_size = 20 * test_params->bonded_child_count; TEST_ASSERT(burst_size < MAX_PKT_BURST, "Burst size specified is greater than supported.\n"); @@ -4197,7 +4197,7 @@ test_tlb_tx_burst(void) RTE_ETHER_TYPE_IPV4, 0, 0); } else { initialize_eth_header(test_params->pkt_eth_hdr, - (struct rte_ether_addr *)test_params->default_slave_mac, + (struct rte_ether_addr *)test_params->default_child_mac, (struct rte_ether_addr *)dst_mac_0, RTE_ETHER_TYPE_IPV4, 0, 0); } @@ -4234,26 +4234,26 @@ test_tlb_tx_burst(void) burst_size); - /* Verify slave ports tx stats */ - for (i = 0; i < test_params->bonded_slave_count; i++) { - rte_eth_stats_get(test_params->slave_port_ids[i], &port_stats[i]); + /* Verify child ports tx stats */ + for (i = 0; i < test_params->bonded_child_count; i++) { + rte_eth_stats_get(test_params->child_port_ids[i], &port_stats[i]); sum_ports_opackets += port_stats[i].opackets; } TEST_ASSERT_EQUAL(sum_ports_opackets, (uint64_t)all_bond_opackets, - "Total packets sent by slaves is not equal to packets sent by bond interface"); + "Total packets sent by children is not equal to packets sent by bond interface"); - /* checking if distribution of packets is balanced over slaves */ - for (i = 0; i < test_params->bonded_slave_count; i++) { + /* checking if distribution of packets is balanced over children */ + for (i = 0; i < test_params->bonded_child_count; i++) { TEST_ASSERT(port_stats[i].obytes > 0 && port_stats[i].obytes < all_bond_obytes, - "Packets are not balanced over slaves"); + "Packets are not balanced over children"); } - /* Put all slaves down and try and transmit */ - for (i = 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i = 0; i < test_params->bonded_child_count; i++) { virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 0); + test_params->child_port_ids[i], 0); } /* Send burst on bonded port */ @@ -4261,11 +4261,11 @@ test_tlb_tx_burst(void) burst_size); TEST_ASSERT_EQUAL(nb_tx, 0, " bad number of packet in burst"); - /* Clean ugit checkout masterp and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT (4) +#define TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_CHILD_COUNT (4) static int test_tlb_rx_burst(void) @@ -4279,26 +4279,26 @@ test_tlb_rx_burst(void) uint16_t i, j, nb_rx, burst_size = 17; - /* Initialize bonded device with 4 slaves in transmit load balancing mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in transmit load balancing mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_TLB, - TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT, 1, 1), + TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_CHILD_COUNT, 1, 1), "Failed to initialize bonded device"); primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); TEST_ASSERT(primary_port >= 0, - "failed to get primary slave for bonded port (%d)", + "failed to get primary child for bonded port (%d)", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { /* Generate test bursts of packets to transmit */ TEST_ASSERT_EQUAL(generate_test_burst( &gen_pkt_burst[0], burst_size, 0, 1, 0, 0, 0), burst_size, "burst generation failed"); - /* Add rx data to slave */ - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[i], + /* Add rx data to child */ + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[i], &gen_pkt_burst[0], burst_size); /* Call rx burst on bonded device */ @@ -4307,7 +4307,7 @@ test_tlb_rx_burst(void) TEST_ASSERT_EQUAL(nb_rx, burst_size, "rte_eth_rx_burst failed\n"); - if (test_params->slave_port_ids[i] == primary_port) { + if (test_params->child_port_ids[i] == primary_port) { /* Verify bonded device rx count */ rte_eth_stats_get(test_params->bonded_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, @@ -4315,27 +4315,27 @@ test_tlb_rx_burst(void) test_params->bonded_port_id, (unsigned int)port_stats.ipackets, burst_size); - /* Verify bonded slave devices rx count */ - for (j = 0; j < test_params->bonded_slave_count; j++) { - rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats); + /* Verify bonded child devices rx count */ + for (j = 0; j < test_params->bonded_child_count; j++) { + rte_eth_stats_get(test_params->child_port_ids[j], &port_stats); if (i == j) { TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size, - "Slave Port (%d) ipackets value (%u) not as expected (%d)\n", - test_params->slave_port_ids[i], + "Child Port (%d) ipackets value (%u) not as expected (%d)\n", + test_params->child_port_ids[i], (unsigned int)port_stats.ipackets, burst_size); } else { TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)0, - "Slave Port (%d) ipackets value (%u) not as expected (%d)\n", - test_params->slave_port_ids[i], + "Child Port (%d) ipackets value (%u) not as expected (%d)\n", + test_params->child_port_ids[i], (unsigned int)port_stats.ipackets, 0); } } } else { - for (j = 0; j < test_params->bonded_slave_count; j++) { - rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats); + for (j = 0; j < test_params->bonded_child_count; j++) { + rte_eth_stats_get(test_params->child_port_ids[j], &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)0, - "Slave Port (%d) ipackets value (%u) not as expected (%d)\n", - test_params->slave_port_ids[i], + "Child Port (%d) ipackets value (%u) not as expected (%d)\n", + test_params->child_port_ids[i], (unsigned int)port_stats.ipackets, 0); } } @@ -4348,8 +4348,8 @@ test_tlb_rx_burst(void) rte_eth_stats_reset(test_params->bonded_port_id); } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -4358,14 +4358,14 @@ test_tlb_verify_promiscuous_enable_disable(void) int i, primary_port, promiscuous_en; int ret; - /* Initialize bonded device with 4 slaves in transmit load balancing mode */ - TEST_ASSERT_SUCCESS( initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in transmit load balancing mode */ + TEST_ASSERT_SUCCESS( initialize_bonded_device_with_children( BONDING_MODE_TLB, 0, 4, 1), "Failed to initialize bonded device"); primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); TEST_ASSERT(primary_port >= 0, - "failed to get primary slave for bonded port (%d)", + "failed to get primary child for bonded port (%d)", test_params->bonded_port_id); ret = rte_eth_promiscuous_enable(test_params->bonded_port_id); @@ -4377,10 +4377,10 @@ test_tlb_verify_promiscuous_enable_disable(void) TEST_ASSERT_EQUAL(promiscuous_en, (int)1, "Port (%d) promiscuous mode not enabled\n", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { promiscuous_en = rte_eth_promiscuous_get( - test_params->slave_port_ids[i]); - if (primary_port == test_params->slave_port_ids[i]) { + test_params->child_port_ids[i]); + if (primary_port == test_params->child_port_ids[i]) { TEST_ASSERT_EQUAL(promiscuous_en, (int)1, "Port (%d) promiscuous mode not enabled\n", test_params->bonded_port_id); @@ -4402,16 +4402,16 @@ test_tlb_verify_promiscuous_enable_disable(void) "Port (%d) promiscuous mode not disabled\n", test_params->bonded_port_id); - for (i = 0; i < test_params->bonded_slave_count; i++) { + for (i = 0; i < test_params->bonded_child_count; i++) { promiscuous_en = rte_eth_promiscuous_get( - test_params->slave_port_ids[i]); + test_params->child_port_ids[i]); TEST_ASSERT_EQUAL(promiscuous_en, (int)0, - "slave port (%d) promiscuous mode not disabled\n", - test_params->slave_port_ids[i]); + "child port (%d) promiscuous mode not disabled\n", + test_params->child_port_ids[i]); } - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int @@ -4420,19 +4420,19 @@ test_tlb_verify_mac_assignment(void) struct rte_ether_addr read_mac_addr; struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1; - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &expected_mac_addr_0), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1), + test_params->child_port_ids[0]); + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &expected_mac_addr_1), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); - /* Initialize bonded device with 2 slaves in active backup mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 2 children in active backup mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_TLB, 0, 2, 1), "Failed to initialize bonded device"); - /* Verify that bonded MACs is that of first slave and that the other slave + /* Verify that bonded MACs is that of first child and that the other child * MAC hasn't been changed */ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), "Failed to get mac address (port %d)", @@ -4442,27 +4442,27 @@ test_tlb_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of primary port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[0]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not as expected", - test_params->slave_port_ids[1]); + "child port (%d) mac address not as expected", + test_params->child_port_ids[1]); /* change primary and verify that MAC addresses haven't changed */ TEST_ASSERT_EQUAL(rte_eth_bond_primary_set(test_params->bonded_port_id, - test_params->slave_port_ids[1]), 0, + test_params->child_port_ids[1]), 0, "Failed to set bonded port (%d) primary port to (%d)", - test_params->bonded_port_id, test_params->slave_port_ids[1]); + test_params->bonded_port_id, test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), "Failed to get mac address (port %d)", @@ -4472,24 +4472,24 @@ test_tlb_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of primary port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[0]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not as expected", - test_params->slave_port_ids[1]); + "child port (%d) mac address not as expected", + test_params->child_port_ids[1]); /* stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and slaves */ + * propagated to bonded device and children */ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), "Failed to stop bonded port %u", @@ -4506,21 +4506,21 @@ test_tlb_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of primary port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not as expected", - test_params->slave_port_ids[0]); + "child port (%d) mac address not as expected", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_1, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of primary port", - test_params->slave_port_ids[1]); + "child port (%d) mac address not set to that of primary port", + test_params->child_port_ids[1]); /* Set explicit MAC address */ @@ -4537,36 +4537,36 @@ test_tlb_verify_mac_assignment(void) "bonded port (%d) mac address not set to that of bonded port", test_params->bonded_port_id); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[0], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[0], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); TEST_ASSERT_SUCCESS(memcmp(&expected_mac_addr_0, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not as expected", - test_params->slave_port_ids[0]); + "child port (%d) mac address not as expected", + test_params->child_port_ids[0]); - TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->slave_port_ids[1], &read_mac_addr), + TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->child_port_ids[1], &read_mac_addr), "Failed to get mac address (port %d)", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); TEST_ASSERT_SUCCESS(memcmp(&bonded_mac, &read_mac_addr, sizeof(read_mac_addr)), - "slave port (%d) mac address not set to that of bonded port", - test_params->slave_port_ids[1]); + "child port (%d) mac address not set to that of bonded port", + test_params->child_port_ids[1]); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } static int -test_tlb_verify_slave_link_status_change_failover(void) +test_tlb_verify_child_link_status_change_failover(void) { - struct rte_mbuf *pkt_burst[TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT][MAX_PKT_BURST]; + struct rte_mbuf *pkt_burst[TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_CHILD_COUNT][MAX_PKT_BURST]; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] = { NULL }; struct rte_eth_stats port_stats; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; - int i, burst_size, slave_count, primary_port; + int i, burst_size, child_count, primary_port; burst_size = 21; @@ -4574,61 +4574,61 @@ test_tlb_verify_slave_link_status_change_failover(void) - /* Initialize bonded device with 4 slaves in round robin mode */ - TEST_ASSERT_SUCCESS(initialize_bonded_device_with_slaves( + /* Initialize bonded device with 4 children in round robin mode */ + TEST_ASSERT_SUCCESS(initialize_bonded_device_with_children( BONDING_MODE_TLB, 0, - TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT, 1), - "Failed to initialize bonded device with slaves"); + TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_CHILD_COUNT, 1), + "Failed to initialize bonded device with children"); - /* Verify Current Slaves Count /Active Slave Count is */ - slave_count = rte_eth_bond_slaves_get(test_params->bonded_port_id, slaves, + /* Verify Current Childs Count /Active Child Count is */ + child_count = rte_eth_bond_children_get(test_params->bonded_port_id, children, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, 4, - "Number of slaves (%d) is not as expected (%d).\n", - slave_count, 4); + TEST_ASSERT_EQUAL(child_count, 4, + "Number of children (%d) is not as expected (%d).\n", + child_count, 4); - slave_count = rte_eth_bond_active_slaves_get(test_params->bonded_port_id, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT_EQUAL(slave_count, (int)4, - "Number of slaves (%d) is not as expected (%d).\n", - slave_count, 4); + child_count = rte_eth_bond_active_children_get(test_params->bonded_port_id, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT_EQUAL(child_count, (int)4, + "Number of children (%d) is not as expected (%d).\n", + child_count, 4); primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); - TEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[0], + TEST_ASSERT_EQUAL(primary_port, test_params->child_port_ids[0], "Primary port not as expected"); - /* Bring 2 slaves down and verify active slave count */ + /* Bring 2 children down and verify active child count */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[1], 0); + test_params->child_port_ids[1], 0); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[3], 0); + test_params->child_port_ids[3], 0); - TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get( - test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 2, - "Number of active slaves (%d) is not as expected (%d).", - slave_count, 2); + TEST_ASSERT_EQUAL(rte_eth_bond_active_children_get( + test_params->bonded_port_id, children, RTE_MAX_ETHPORTS), 2, + "Number of active children (%d) is not as expected (%d).", + child_count, 2); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[1], 1); + test_params->child_port_ids[1], 1); virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[3], 1); + test_params->child_port_ids[3], 1); - /* Bring primary port down, verify that active slave count is 3 and primary + /* Bring primary port down, verify that active child count is 3 and primary * has changed */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[0], 0); + test_params->child_port_ids[0], 0); - TEST_ASSERT_EQUAL(rte_eth_bond_active_slaves_get( - test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS), 3, - "Number of active slaves (%d) is not as expected (%d).", - slave_count, 3); + TEST_ASSERT_EQUAL(rte_eth_bond_active_children_get( + test_params->bonded_port_id, children, RTE_MAX_ETHPORTS), 3, + "Number of active children (%d) is not as expected (%d).", + child_count, 3); primary_port = rte_eth_bond_primary_get(test_params->bonded_port_id); - TEST_ASSERT_EQUAL(primary_port, test_params->slave_port_ids[2], + TEST_ASSERT_EQUAL(primary_port, test_params->child_port_ids[2], "Primary port not as expected"); rte_delay_us(500000); - /* Verify that pkts are sent on new primary slave */ + /* Verify that pkts are sent on new primary child */ for (i = 0; i < 4; i++) { TEST_ASSERT_EQUAL(generate_test_burst( &pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0), burst_size, @@ -4639,36 +4639,36 @@ test_tlb_verify_slave_link_status_change_failover(void) rte_delay_us(11000); } - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); TEST_ASSERT_EQUAL(port_stats.opackets, (int8_t)0, "(%d) port_stats.opackets not as expected\n", - test_params->slave_port_ids[0]); + test_params->child_port_ids[0]); - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); TEST_ASSERT_NOT_EQUAL(port_stats.opackets, (int8_t)0, "(%d) port_stats.opackets not as expected\n", - test_params->slave_port_ids[1]); + test_params->child_port_ids[1]); - rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[2], &port_stats); TEST_ASSERT_NOT_EQUAL(port_stats.opackets, (int8_t)0, "(%d) port_stats.opackets not as expected\n", - test_params->slave_port_ids[2]); + test_params->child_port_ids[2]); - rte_eth_stats_get(test_params->slave_port_ids[3], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[3], &port_stats); TEST_ASSERT_NOT_EQUAL(port_stats.opackets, (int8_t)0, "(%d) port_stats.opackets not as expected\n", - test_params->slave_port_ids[3]); + test_params->child_port_ids[3]); /* Generate packet burst for testing */ - for (i = 0; i < TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT; i++) { + for (i = 0; i < TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_CHILD_COUNT; i++) { if (generate_test_burst(&pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0) != burst_size) return -1; virtual_ethdev_add_mbufs_to_rx_queue( - test_params->slave_port_ids[i], &pkt_burst[i][0], burst_size); + test_params->child_port_ids[i], &pkt_burst[i][0], burst_size); } if (rte_eth_rx_burst(test_params->bonded_port_id, 0, rx_pkt_burst, @@ -4684,11 +4684,11 @@ test_tlb_verify_slave_link_status_change_failover(void) "(%d) port_stats.ipackets not as expected\n", test_params->bonded_port_id); - /* Clean up and remove slaves from bonded device */ - return remove_slaves_and_stop_bonded_device(); + /* Clean up and remove children from bonded device */ + return remove_children_and_stop_bonded_device(); } -#define TEST_ALB_SLAVE_COUNT 2 +#define TEST_ALB_CHILD_COUNT 2 static uint8_t mac_client1[] = {0x00, 0xAA, 0x55, 0xFF, 0xCC, 1}; static uint8_t mac_client2[] = {0x00, 0xAA, 0x55, 0xFF, 0xCC, 2}; @@ -4710,23 +4710,23 @@ test_alb_change_mac_in_reply_sent(void) struct rte_ether_hdr *eth_pkt; struct rte_arp_hdr *arp_pkt; - int slave_idx, nb_pkts, pkt_idx; + int child_idx, nb_pkts, pkt_idx; int retval = 0; struct rte_ether_addr bond_mac, client_mac; - struct rte_ether_addr *slave_mac1, *slave_mac2; + struct rte_ether_addr *child_mac1, *child_mac2; TEST_ASSERT_SUCCESS( - initialize_bonded_device_with_slaves(BONDING_MODE_ALB, - 0, TEST_ALB_SLAVE_COUNT, 1), - "Failed to initialize_bonded_device_with_slaves."); + initialize_bonded_device_with_children(BONDING_MODE_ALB, + 0, TEST_ALB_CHILD_COUNT, 1), + "Failed to initialize_bonded_device_with_children."); /* Flush tx queue */ rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); - for (slave_idx = 0; slave_idx < test_params->bonded_slave_count; - slave_idx++) { + for (child_idx = 0; child_idx < test_params->bonded_child_count; + child_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( - test_params->slave_port_ids[slave_idx], pkts_sent, + test_params->child_port_ids[child_idx], pkts_sent, MAX_PKT_BURST); } @@ -4782,18 +4782,18 @@ test_alb_change_mac_in_reply_sent(void) RTE_ARP_OP_REPLY); rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1); - slave_mac1 = - rte_eth_devices[test_params->slave_port_ids[0]].data->mac_addrs; - slave_mac2 = - rte_eth_devices[test_params->slave_port_ids[1]].data->mac_addrs; + child_mac1 = + rte_eth_devices[test_params->child_port_ids[0]].data->mac_addrs; + child_mac2 = + rte_eth_devices[test_params->child_port_ids[1]].data->mac_addrs; /* * Checking if packets are properly distributed on bonding ports. Packets * 0 and 2 should be sent on port 0 and packets 1 and 3 on port 1. */ - for (slave_idx = 0; slave_idx < test_params->bonded_slave_count; slave_idx++) { + for (child_idx = 0; child_idx < test_params->bonded_child_count; child_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( - test_params->slave_port_ids[slave_idx], pkts_sent, + test_params->child_port_ids[child_idx], pkts_sent, MAX_PKT_BURST); for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) { @@ -4802,14 +4802,14 @@ test_alb_change_mac_in_reply_sent(void) arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct rte_ether_hdr)); - if (slave_idx%2 == 0) { - if (!rte_is_same_ether_addr(slave_mac1, + if (child_idx%2 == 0) { + if (!rte_is_same_ether_addr(child_mac1, &arp_pkt->arp_data.arp_sha)) { retval = -1; goto test_end; } } else { - if (!rte_is_same_ether_addr(slave_mac2, + if (!rte_is_same_ether_addr(child_mac2, &arp_pkt->arp_data.arp_sha)) { retval = -1; goto test_end; @@ -4819,7 +4819,7 @@ test_alb_change_mac_in_reply_sent(void) } test_end: - retval += remove_slaves_and_stop_bonded_device(); + retval += remove_children_and_stop_bonded_device(); return retval; } @@ -4832,22 +4832,22 @@ test_alb_reply_from_client(void) struct rte_mbuf *pkt; struct rte_mbuf *pkts_sent[MAX_PKT_BURST]; - int slave_idx, nb_pkts, pkt_idx, nb_pkts_sum = 0; + int child_idx, nb_pkts, pkt_idx, nb_pkts_sum = 0; int retval = 0; struct rte_ether_addr bond_mac, client_mac; - struct rte_ether_addr *slave_mac1, *slave_mac2; + struct rte_ether_addr *child_mac1, *child_mac2; TEST_ASSERT_SUCCESS( - initialize_bonded_device_with_slaves(BONDING_MODE_ALB, - 0, TEST_ALB_SLAVE_COUNT, 1), - "Failed to initialize_bonded_device_with_slaves."); + initialize_bonded_device_with_children(BONDING_MODE_ALB, + 0, TEST_ALB_CHILD_COUNT, 1), + "Failed to initialize_bonded_device_with_children."); /* Flush tx queue */ rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); - for (slave_idx = 0; slave_idx < test_params->bonded_slave_count; slave_idx++) { + for (child_idx = 0; child_idx < test_params->bonded_child_count; child_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( - test_params->slave_port_ids[slave_idx], pkts_sent, + test_params->child_port_ids[child_idx], pkts_sent, MAX_PKT_BURST); } @@ -4868,7 +4868,7 @@ test_alb_reply_from_client(void) sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host, RTE_ARP_OP_REPLY); - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt, + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[0], &pkt, 1); pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); @@ -4880,7 +4880,7 @@ test_alb_reply_from_client(void) sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client2, ip_host, RTE_ARP_OP_REPLY); - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt, + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[0], &pkt, 1); pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); @@ -4892,7 +4892,7 @@ test_alb_reply_from_client(void) sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client3, ip_host, RTE_ARP_OP_REPLY); - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt, + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[0], &pkt, 1); pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); @@ -4904,7 +4904,7 @@ test_alb_reply_from_client(void) sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client4, ip_host, RTE_ARP_OP_REPLY); - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt, + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[0], &pkt, 1); /* @@ -4914,15 +4914,15 @@ test_alb_reply_from_client(void) rte_eth_rx_burst(test_params->bonded_port_id, 0, pkts_sent, MAX_PKT_BURST); rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); - slave_mac1 = rte_eth_devices[test_params->slave_port_ids[0]].data->mac_addrs; - slave_mac2 = rte_eth_devices[test_params->slave_port_ids[1]].data->mac_addrs; + child_mac1 = rte_eth_devices[test_params->child_port_ids[0]].data->mac_addrs; + child_mac2 = rte_eth_devices[test_params->child_port_ids[1]].data->mac_addrs; /* - * Checking if update ARP packets were properly send on slave ports. + * Checking if update ARP packets were properly send on child ports. */ - for (slave_idx = 0; slave_idx < test_params->bonded_slave_count; slave_idx++) { + for (child_idx = 0; child_idx < test_params->bonded_child_count; child_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( - test_params->slave_port_ids[slave_idx], pkts_sent, MAX_PKT_BURST); + test_params->child_port_ids[child_idx], pkts_sent, MAX_PKT_BURST); nb_pkts_sum += nb_pkts; for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) { @@ -4931,14 +4931,14 @@ test_alb_reply_from_client(void) arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct rte_ether_hdr)); - if (slave_idx%2 == 0) { - if (!rte_is_same_ether_addr(slave_mac1, + if (child_idx%2 == 0) { + if (!rte_is_same_ether_addr(child_mac1, &arp_pkt->arp_data.arp_sha)) { retval = -1; goto test_end; } } else { - if (!rte_is_same_ether_addr(slave_mac2, + if (!rte_is_same_ether_addr(child_mac2, &arp_pkt->arp_data.arp_sha)) { retval = -1; goto test_end; @@ -4954,7 +4954,7 @@ test_alb_reply_from_client(void) } test_end: - retval += remove_slaves_and_stop_bonded_device(); + retval += remove_children_and_stop_bonded_device(); return retval; } @@ -4968,21 +4968,21 @@ test_alb_receive_vlan_reply(void) struct rte_mbuf *pkt; struct rte_mbuf *pkts_sent[MAX_PKT_BURST]; - int slave_idx, nb_pkts, pkt_idx; + int child_idx, nb_pkts, pkt_idx; int retval = 0; struct rte_ether_addr bond_mac, client_mac; TEST_ASSERT_SUCCESS( - initialize_bonded_device_with_slaves(BONDING_MODE_ALB, - 0, TEST_ALB_SLAVE_COUNT, 1), - "Failed to initialize_bonded_device_with_slaves."); + initialize_bonded_device_with_children(BONDING_MODE_ALB, + 0, TEST_ALB_CHILD_COUNT, 1), + "Failed to initialize_bonded_device_with_children."); /* Flush tx queue */ rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); - for (slave_idx = 0; slave_idx < test_params->bonded_slave_count; slave_idx++) { + for (child_idx = 0; child_idx < test_params->bonded_child_count; child_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( - test_params->slave_port_ids[slave_idx], pkts_sent, + test_params->child_port_ids[child_idx], pkts_sent, MAX_PKT_BURST); } @@ -5007,7 +5007,7 @@ test_alb_receive_vlan_reply(void) arp_pkt = (struct rte_arp_hdr *)((char *)(vlan_pkt + 1)); initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host, RTE_ARP_OP_REPLY); - virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt, + virtual_ethdev_add_mbufs_to_rx_queue(test_params->child_port_ids[0], &pkt, 1); rte_eth_rx_burst(test_params->bonded_port_id, 0, pkts_sent, MAX_PKT_BURST); @@ -5016,9 +5016,9 @@ test_alb_receive_vlan_reply(void) /* * Checking if VLAN headers in generated ARP Update packet are correct. */ - for (slave_idx = 0; slave_idx < test_params->bonded_slave_count; slave_idx++) { + for (child_idx = 0; child_idx < test_params->bonded_child_count; child_idx++) { nb_pkts = virtual_ethdev_get_mbufs_from_tx_queue( - test_params->slave_port_ids[slave_idx], pkts_sent, + test_params->child_port_ids[child_idx], pkts_sent, MAX_PKT_BURST); for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) { @@ -5049,7 +5049,7 @@ test_alb_receive_vlan_reply(void) } test_end: - retval += remove_slaves_and_stop_bonded_device(); + retval += remove_children_and_stop_bonded_device(); return retval; } @@ -5062,9 +5062,9 @@ test_alb_ipv4_tx(void) retval = 0; TEST_ASSERT_SUCCESS( - initialize_bonded_device_with_slaves(BONDING_MODE_ALB, - 0, TEST_ALB_SLAVE_COUNT, 1), - "Failed to initialize_bonded_device_with_slaves."); + initialize_bonded_device_with_children(BONDING_MODE_ALB, + 0, TEST_ALB_CHILD_COUNT, 1), + "Failed to initialize_bonded_device_with_children."); burst_size = 32; @@ -5085,7 +5085,7 @@ test_alb_ipv4_tx(void) } test_end: - retval += remove_slaves_and_stop_bonded_device(); + retval += remove_children_and_stop_bonded_device(); return retval; } @@ -5096,34 +5096,34 @@ static struct unit_test_suite link_bonding_test_suite = { .unit_test_cases = { TEST_CASE(test_create_bonded_device), TEST_CASE(test_create_bonded_device_with_invalid_params), - TEST_CASE(test_add_slave_to_bonded_device), - TEST_CASE(test_add_slave_to_invalid_bonded_device), - TEST_CASE(test_remove_slave_from_bonded_device), - TEST_CASE(test_remove_slave_from_invalid_bonded_device), - TEST_CASE(test_get_slaves_from_bonded_device), - TEST_CASE(test_add_already_bonded_slave_to_bonded_device), - TEST_CASE(test_add_remove_multiple_slaves_to_from_bonded_device), + TEST_CASE(test_add_child_to_bonded_device), + TEST_CASE(test_add_child_to_invalid_bonded_device), + TEST_CASE(test_remove_child_from_bonded_device), + TEST_CASE(test_remove_child_from_invalid_bonded_device), + TEST_CASE(test_get_children_from_bonded_device), + TEST_CASE(test_add_already_bonded_child_to_bonded_device), + TEST_CASE(test_add_remove_multiple_children_to_from_bonded_device), TEST_CASE(test_start_bonded_device), TEST_CASE(test_stop_bonded_device), TEST_CASE(test_set_bonding_mode), - TEST_CASE(test_set_primary_slave), + TEST_CASE(test_set_primary_child), TEST_CASE(test_set_explicit_bonded_mac), TEST_CASE(test_set_bonded_port_initialization_mac_assignment), TEST_CASE(test_status_interrupt), - TEST_CASE(test_adding_slave_after_bonded_device_started), + TEST_CASE(test_adding_child_after_bonded_device_started), TEST_CASE(test_roundrobin_tx_burst), - TEST_CASE(test_roundrobin_tx_burst_slave_tx_fail), - TEST_CASE(test_roundrobin_rx_burst_on_single_slave), - TEST_CASE(test_roundrobin_rx_burst_on_multiple_slaves), + TEST_CASE(test_roundrobin_tx_burst_child_tx_fail), + TEST_CASE(test_roundrobin_rx_burst_on_single_child), + TEST_CASE(test_roundrobin_rx_burst_on_multiple_children), TEST_CASE(test_roundrobin_verify_promiscuous_enable_disable), TEST_CASE(test_roundrobin_verify_mac_assignment), - TEST_CASE(test_roundrobin_verify_slave_link_status_change_behaviour), - TEST_CASE(test_roundrobin_verfiy_polling_slave_link_status_change), + TEST_CASE(test_roundrobin_verify_child_link_status_change_behaviour), + TEST_CASE(test_roundrobin_verfiy_polling_child_link_status_change), TEST_CASE(test_activebackup_tx_burst), TEST_CASE(test_activebackup_rx_burst), TEST_CASE(test_activebackup_verify_promiscuous_enable_disable), TEST_CASE(test_activebackup_verify_mac_assignment), - TEST_CASE(test_activebackup_verify_slave_link_status_change_failover), + TEST_CASE(test_activebackup_verify_child_link_status_change_failover), TEST_CASE(test_balance_xmit_policy_configuration), TEST_CASE(test_balance_l2_tx_burst), TEST_CASE(test_balance_l23_tx_burst_ipv4_toggle_ip_addr), @@ -5137,26 +5137,26 @@ static struct unit_test_suite link_bonding_test_suite = { TEST_CASE(test_balance_l34_tx_burst_ipv6_toggle_ip_addr), TEST_CASE(test_balance_l34_tx_burst_vlan_ipv6_toggle_ip_addr), TEST_CASE(test_balance_l34_tx_burst_ipv6_toggle_udp_port), - TEST_CASE(test_balance_tx_burst_slave_tx_fail), + TEST_CASE(test_balance_tx_burst_child_tx_fail), TEST_CASE(test_balance_rx_burst), TEST_CASE(test_balance_verify_promiscuous_enable_disable), TEST_CASE(test_balance_verify_mac_assignment), - TEST_CASE(test_balance_verify_slave_link_status_change_behaviour), + TEST_CASE(test_balance_verify_child_link_status_change_behaviour), TEST_CASE(test_tlb_tx_burst), TEST_CASE(test_tlb_rx_burst), TEST_CASE(test_tlb_verify_mac_assignment), TEST_CASE(test_tlb_verify_promiscuous_enable_disable), - TEST_CASE(test_tlb_verify_slave_link_status_change_failover), + TEST_CASE(test_tlb_verify_child_link_status_change_failover), TEST_CASE(test_alb_change_mac_in_reply_sent), TEST_CASE(test_alb_reply_from_client), TEST_CASE(test_alb_receive_vlan_reply), TEST_CASE(test_alb_ipv4_tx), TEST_CASE(test_broadcast_tx_burst), - TEST_CASE(test_broadcast_tx_burst_slave_tx_fail), + TEST_CASE(test_broadcast_tx_burst_child_tx_fail), TEST_CASE(test_broadcast_rx_burst), TEST_CASE(test_broadcast_verify_promiscuous_enable_disable), TEST_CASE(test_broadcast_verify_mac_assignment), - TEST_CASE(test_broadcast_verify_slave_link_status_change_behaviour), + TEST_CASE(test_broadcast_verify_child_link_status_change_behaviour), TEST_CASE(test_reconfigure_bonded_device), TEST_CASE(test_close_bonded_device), diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c index 21c512c94b89..b20ad9c4000d 100644 --- a/app/test/test_link_bonding_mode4.c +++ b/app/test/test_link_bonding_mode4.c @@ -31,7 +31,7 @@ #include "test.h" -#define SLAVE_COUNT (4) +#define CHILD_COUNT (4) #define RX_RING_SIZE 1024 #define TX_RING_SIZE 1024 @@ -46,15 +46,15 @@ #define BONDED_DEV_NAME ("net_bonding_m4_bond_dev") -#define SLAVE_DEV_NAME_FMT ("net_virt_%d") -#define SLAVE_RX_QUEUE_FMT ("net_virt_%d_rx") -#define SLAVE_TX_QUEUE_FMT ("net_virt_%d_tx") +#define CHILD_DEV_NAME_FMT ("net_virt_%d") +#define CHILD_RX_QUEUE_FMT ("net_virt_%d_rx") +#define CHILD_TX_QUEUE_FMT ("net_virt_%d_tx") #define INVALID_SOCKET_ID (-1) #define INVALID_PORT_ID (0xFF) #define INVALID_BONDING_MODE (-1) -static const struct rte_ether_addr slave_mac_default = { +static const struct rte_ether_addr child_mac_default = { { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } }; @@ -70,7 +70,7 @@ static const struct rte_ether_addr slow_protocol_mac_addr = { { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x02 } }; -struct slave_conf { +struct child_conf { struct rte_ring *rx_queue; struct rte_ring *tx_queue; uint16_t port_id; @@ -86,21 +86,21 @@ struct ether_vlan_hdr { struct link_bonding_unittest_params { uint8_t bonded_port_id; - struct slave_conf slave_ports[SLAVE_COUNT]; + struct child_conf child_ports[CHILD_COUNT]; struct rte_mempool *mbuf_pool; }; -#define TEST_DEFAULT_SLAVE_COUNT RTE_DIM(test_params.slave_ports) -#define TEST_RX_SLAVE_COUT TEST_DEFAULT_SLAVE_COUNT -#define TEST_TX_SLAVE_COUNT TEST_DEFAULT_SLAVE_COUNT -#define TEST_MARKER_SLAVE_COUT TEST_DEFAULT_SLAVE_COUNT -#define TEST_EXPIRED_SLAVE_COUNT TEST_DEFAULT_SLAVE_COUNT -#define TEST_PROMISC_SLAVE_COUNT TEST_DEFAULT_SLAVE_COUNT +#define TEST_DEFAULT_CHILD_COUNT RTE_DIM(test_params.child_ports) +#define TEST_RX_CHILD_COUT TEST_DEFAULT_CHILD_COUNT +#define TEST_TX_CHILD_COUNT TEST_DEFAULT_CHILD_COUNT +#define TEST_MARKER_CHILD_COUT TEST_DEFAULT_CHILD_COUNT +#define TEST_EXPIRED_CHILD_COUNT TEST_DEFAULT_CHILD_COUNT +#define TEST_PROMISC_CHILD_COUNT TEST_DEFAULT_CHILD_COUNT static struct link_bonding_unittest_params test_params = { .bonded_port_id = INVALID_PORT_ID, - .slave_ports = { [0 ... SLAVE_COUNT - 1] = { .port_id = INVALID_PORT_ID} }, + .child_ports = { [0 ... CHILD_COUNT - 1] = { .port_id = INVALID_PORT_ID} }, .mbuf_pool = NULL, }; @@ -120,58 +120,58 @@ static uint8_t lacpdu_rx_count[RTE_MAX_ETHPORTS] = {0, }; #define FOR_EACH(_i, _item, _array, _size) \ for (_i = 0, _item = &_array[0]; _i < _size && (_item = &_array[_i]); _i++) -/* Macro for iterating over every port that can be used as a slave +/* Macro for iterating over every port that can be used as a child * in this test. - * _i variable used as an index in test_params->slave_ports - * _slave pointer to &test_params->slave_ports[_idx] + * _i variable used as an index in test_params->child_ports + * _child pointer to &test_params->child_ports[_idx] */ #define FOR_EACH_PORT(_i, _port) \ - FOR_EACH(_i, _port, test_params.slave_ports, \ - RTE_DIM(test_params.slave_ports)) + FOR_EACH(_i, _port, test_params.child_ports, \ + RTE_DIM(test_params.child_ports)) -/* Macro for iterating over every port that can be used as a slave +/* Macro for iterating over every port that can be used as a child * in this test and satisfy given condition. * - * _i variable used as an index in test_params->slave_ports - * _slave pointer to &test_params->slave_ports[_idx] + * _i variable used as an index in test_params->child_ports + * _child pointer to &test_params->child_ports[_idx] * _condition condition that need to be checked */ #define FOR_EACH_PORT_IF(_i, _port, _condition) FOR_EACH_PORT((_i), (_port)) \ if (!!(_condition)) -/* Macro for iterating over every port that is currently a slave of a bonded +/* Macro for iterating over every port that is currently a child of a bonded * device. - * _i variable used as an index in test_params->slave_ports - * _slave pointer to &test_params->slave_ports[_idx] + * _i variable used as an index in test_params->child_ports + * _child pointer to &test_params->child_ports[_idx] * */ -#define FOR_EACH_SLAVE(_i, _slave) \ - FOR_EACH_PORT_IF(_i, _slave, (_slave)->bonded != 0) +#define FOR_EACH_CHILD(_i, _child) \ + FOR_EACH_PORT_IF(_i, _child, (_child)->bonded != 0) /* - * Returns packets from slaves TX queue. - * slave slave port + * Returns packets from children TX queue. + * child child port * buffer for packets * size size of buffer * return number of packets or negative error number */ static int -slave_get_pkts(struct slave_conf *slave, struct rte_mbuf **buf, uint16_t size) +child_get_pkts(struct child_conf *child, struct rte_mbuf **buf, uint16_t size) { - return rte_ring_dequeue_burst(slave->tx_queue, (void **)buf, + return rte_ring_dequeue_burst(child->tx_queue, (void **)buf, size, NULL); } /* - * Injects given packets into slaves RX queue. - * slave slave port + * Injects given packets into children RX queue. + * child child port * buffer for packets * size number of packets to be injected * return number of queued packets or negative error number */ static int -slave_put_pkts(struct slave_conf *slave, struct rte_mbuf **buf, uint16_t size) +child_put_pkts(struct child_conf *child, struct rte_mbuf **buf, uint16_t size) { - return rte_ring_enqueue_burst(slave->rx_queue, (void **)buf, + return rte_ring_enqueue_burst(child->rx_queue, (void **)buf, size, NULL); } @@ -219,79 +219,79 @@ configure_ethdev(uint16_t port_id, uint8_t start) } static int -add_slave(struct slave_conf *slave, uint8_t start) +add_child(struct child_conf *child, uint8_t start) { struct rte_ether_addr addr, addr_check; int retval; /* Some sanity check */ - RTE_VERIFY(test_params.slave_ports <= slave && - slave - test_params.slave_ports < (int)RTE_DIM(test_params.slave_ports)); - RTE_VERIFY(slave->bonded == 0); - RTE_VERIFY(slave->port_id != INVALID_PORT_ID); + RTE_VERIFY(test_params.child_ports <= child && + child - test_params.child_ports < (int)RTE_DIM(test_params.child_ports)); + RTE_VERIFY(child->bonded == 0); + RTE_VERIFY(child->port_id != INVALID_PORT_ID); - rte_ether_addr_copy(&slave_mac_default, &addr); - addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = slave->port_id; + rte_ether_addr_copy(&child_mac_default, &addr); + addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = child->port_id; - rte_eth_dev_mac_addr_remove(slave->port_id, &addr); + rte_eth_dev_mac_addr_remove(child->port_id, &addr); - TEST_ASSERT_SUCCESS(rte_eth_dev_mac_addr_add(slave->port_id, &addr, 0), - "Failed to set slave MAC address"); + TEST_ASSERT_SUCCESS(rte_eth_dev_mac_addr_add(child->port_id, &addr, 0), + "Failed to set child MAC address"); - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params.bonded_port_id, - slave->port_id), - "Failed to add slave (idx=%u, id=%u) to bonding (id=%u)", - (uint8_t)(slave - test_params.slave_ports), slave->port_id, + TEST_ASSERT_SUCCESS(rte_eth_bond_child_add(test_params.bonded_port_id, + child->port_id), + "Failed to add child (idx=%u, id=%u) to bonding (id=%u)", + (uint8_t)(child - test_params.child_ports), child->port_id, test_params.bonded_port_id); - slave->bonded = 1; + child->bonded = 1; if (start) { - TEST_ASSERT_SUCCESS(rte_eth_dev_start(slave->port_id), - "Failed to start slave %u", slave->port_id); + TEST_ASSERT_SUCCESS(rte_eth_dev_start(child->port_id), + "Failed to start child %u", child->port_id); } - retval = rte_eth_macaddr_get(slave->port_id, &addr_check); - TEST_ASSERT_SUCCESS(retval, "Failed to get slave mac address: %s", + retval = rte_eth_macaddr_get(child->port_id, &addr_check); + TEST_ASSERT_SUCCESS(retval, "Failed to get child mac address: %s", strerror(-retval)); TEST_ASSERT_EQUAL(rte_is_same_ether_addr(&addr, &addr_check), 1, - "Slave MAC address is not as expected"); + "Child MAC address is not as expected"); - RTE_VERIFY(slave->lacp_parnter_state == 0); + RTE_VERIFY(child->lacp_parnter_state == 0); return 0; } static int -remove_slave(struct slave_conf *slave) +remove_child(struct child_conf *child) { - ptrdiff_t slave_idx = slave - test_params.slave_ports; + ptrdiff_t child_idx = child - test_params.child_ports; - RTE_VERIFY(test_params.slave_ports <= slave && - slave_idx < (ptrdiff_t)RTE_DIM(test_params.slave_ports)); + RTE_VERIFY(test_params.child_ports <= child && + child_idx < (ptrdiff_t)RTE_DIM(test_params.child_ports)); - RTE_VERIFY(slave->bonded == 1); - RTE_VERIFY(slave->port_id != INVALID_PORT_ID); + RTE_VERIFY(child->bonded == 1); + RTE_VERIFY(child->port_id != INVALID_PORT_ID); - TEST_ASSERT_EQUAL(rte_ring_count(slave->rx_queue), 0, - "Slave %u tx queue not empty while removing from bonding.", - slave->port_id); + TEST_ASSERT_EQUAL(rte_ring_count(child->rx_queue), 0, + "Child %u tx queue not empty while removing from bonding.", + child->port_id); - TEST_ASSERT_EQUAL(rte_ring_count(slave->rx_queue), 0, - "Slave %u tx queue not empty while removing from bonding.", - slave->port_id); + TEST_ASSERT_EQUAL(rte_ring_count(child->rx_queue), 0, + "Child %u tx queue not empty while removing from bonding.", + child->port_id); - TEST_ASSERT_EQUAL(rte_eth_bond_slave_remove(test_params.bonded_port_id, - slave->port_id), 0, - "Failed to remove slave (idx=%u, id=%u) from bonding (id=%u)", - (uint8_t)slave_idx, slave->port_id, + TEST_ASSERT_EQUAL(rte_eth_bond_child_remove(test_params.bonded_port_id, + child->port_id), 0, + "Failed to remove child (idx=%u, id=%u) from bonding (id=%u)", + (uint8_t)child_idx, child->port_id, test_params.bonded_port_id); - slave->bonded = 0; - slave->lacp_parnter_state = 0; + child->bonded = 0; + child->lacp_parnter_state = 0; return 0; } static void -lacp_recv_cb(uint16_t slave_id, struct rte_mbuf *lacp_pkt) +lacp_recv_cb(uint16_t child_id, struct rte_mbuf *lacp_pkt) { struct rte_ether_hdr *hdr; struct slow_protocol_frame *slow_hdr; @@ -304,22 +304,22 @@ lacp_recv_cb(uint16_t slave_id, struct rte_mbuf *lacp_pkt) slow_hdr = rte_pktmbuf_mtod(lacp_pkt, struct slow_protocol_frame *); RTE_VERIFY(slow_hdr->slow_protocol.subtype == SLOW_SUBTYPE_LACP); - lacpdu_rx_count[slave_id]++; + lacpdu_rx_count[child_id]++; rte_pktmbuf_free(lacp_pkt); } static int -initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm) +initialize_bonded_device_with_children(uint16_t child_count, uint8_t external_sm) { uint8_t i; int ret; RTE_VERIFY(test_params.bonded_port_id != INVALID_PORT_ID); - for (i = 0; i < slave_count; i++) { - TEST_ASSERT_SUCCESS(add_slave(&test_params.slave_ports[i], 1), + for (i = 0; i < child_count; i++) { + TEST_ASSERT_SUCCESS(add_child(&test_params.child_ports[i], 1), "Failed to add port %u to bonded device.\n", - test_params.slave_ports[i].port_id); + test_params.child_ports[i].port_id); } /* Reset mode 4 configuration */ @@ -345,34 +345,34 @@ initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t external_sm) } static int -remove_slaves_and_stop_bonded_device(void) +remove_children_and_stop_bonded_device(void) { - struct slave_conf *slave; + struct child_conf *child; int retval; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; uint16_t i; TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params.bonded_port_id), "Failed to stop bonded port %u", test_params.bonded_port_id); - FOR_EACH_SLAVE(i, slave) - remove_slave(slave); + FOR_EACH_CHILD(i, child) + remove_child(child); - retval = rte_eth_bond_slaves_get(test_params.bonded_port_id, slaves, - RTE_DIM(slaves)); + retval = rte_eth_bond_children_get(test_params.bonded_port_id, children, + RTE_DIM(children)); TEST_ASSERT_EQUAL(retval, 0, - "Expected bonded device %u have 0 slaves but returned %d.", + "Expected bonded device %u have 0 children but returned %d.", test_params.bonded_port_id, retval); - FOR_EACH_PORT(i, slave) { - TEST_ASSERT_SUCCESS(rte_eth_dev_stop(slave->port_id), + FOR_EACH_PORT(i, child) { + TEST_ASSERT_SUCCESS(rte_eth_dev_stop(child->port_id), "Failed to stop bonded port %u", - slave->port_id); + child->port_id); - TEST_ASSERT(slave->bonded == 0, - "Port id=%u is still marked as enslaved.", slave->port_id); + TEST_ASSERT(child->bonded == 0, + "Port id=%u is still marked as enchildd.", child->port_id); } return TEST_SUCCESS; @@ -383,7 +383,7 @@ test_setup(void) { int retval, nb_mbuf_per_pool; char name[RTE_ETH_NAME_MAX_LEN]; - struct slave_conf *port; + struct child_conf *port; const uint8_t socket_id = rte_socket_id(); uint16_t i; @@ -400,10 +400,10 @@ test_setup(void) /* Create / initialize ring eth devs. */ FOR_EACH_PORT(i, port) { - port = &test_params.slave_ports[i]; + port = &test_params.child_ports[i]; if (port->rx_queue == NULL) { - retval = snprintf(name, RTE_DIM(name), SLAVE_RX_QUEUE_FMT, i); + retval = snprintf(name, RTE_DIM(name), CHILD_RX_QUEUE_FMT, i); TEST_ASSERT(retval <= (int)RTE_DIM(name) - 1, "Name too long"); port->rx_queue = rte_ring_create(name, RX_RING_SIZE, socket_id, 0); TEST_ASSERT(port->rx_queue != NULL, @@ -412,7 +412,7 @@ test_setup(void) } if (port->tx_queue == NULL) { - retval = snprintf(name, RTE_DIM(name), SLAVE_TX_QUEUE_FMT, i); + retval = snprintf(name, RTE_DIM(name), CHILD_TX_QUEUE_FMT, i); TEST_ASSERT(retval <= (int)RTE_DIM(name) - 1, "Name too long"); port->tx_queue = rte_ring_create(name, TX_RING_SIZE, socket_id, 0); TEST_ASSERT_NOT_NULL(port->tx_queue, @@ -421,7 +421,7 @@ test_setup(void) } if (port->port_id == INVALID_PORT_ID) { - retval = snprintf(name, RTE_DIM(name), SLAVE_DEV_NAME_FMT, i); + retval = snprintf(name, RTE_DIM(name), CHILD_DEV_NAME_FMT, i); TEST_ASSERT(retval < (int)RTE_DIM(name) - 1, "Name too long"); retval = rte_eth_from_rings(name, &port->rx_queue, 1, &port->tx_queue, 1, socket_id); @@ -460,7 +460,7 @@ test_setup(void) static void testsuite_teardown(void) { - struct slave_conf *port; + struct child_conf *port; uint8_t i; /* Only stop ports. @@ -480,7 +480,7 @@ testsuite_teardown(void) * frame but not LACP */ static int -make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt) +make_lacp_reply(struct child_conf *child, struct rte_mbuf *pkt) { struct rte_ether_hdr *hdr; struct slow_protocol_frame *slow_hdr; @@ -501,11 +501,11 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt) /* Change source address to partner address */ rte_ether_addr_copy(&parnter_mac_default, &slow_hdr->eth_hdr.src_addr); slow_hdr->eth_hdr.src_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = - slave->port_id; + child->port_id; lacp = (struct lacpdu *) &slow_hdr->slow_protocol; /* Save last received state */ - slave->lacp_parnter_state = lacp->actor.state; + child->lacp_parnter_state = lacp->actor.state; /* Change it into LACP replay by matching parameters. */ memcpy(&lacp->partner.port_params, &lacp->actor.port_params, sizeof(struct port_params)); @@ -523,27 +523,27 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt) } /* - * Reads packets from given slave, search for LACP packet and reply them. + * Reads packets from given child, search for LACP packet and reply them. * - * Receives burst of packets from slave. Looks for LACP packet. Drops + * Receives burst of packets from child. Looks for LACP packet. Drops * all other packets. Prepares response LACP and sends it back. * * return number of LACP received and replied, -1 on error. */ static int -bond_handshake_reply(struct slave_conf *slave) +bond_handshake_reply(struct child_conf *child) { int retval; struct rte_mbuf *rx_buf[MAX_PKT_BURST]; struct rte_mbuf *lacp_tx_buf[MAX_PKT_BURST]; uint16_t lacp_tx_buf_cnt = 0, i; - retval = slave_get_pkts(slave, rx_buf, RTE_DIM(rx_buf)); - TEST_ASSERT(retval >= 0, "Getting slave %u packets failed.", - slave->port_id); + retval = child_get_pkts(child, rx_buf, RTE_DIM(rx_buf)); + TEST_ASSERT(retval >= 0, "Getting child %u packets failed.", + child->port_id); for (i = 0; i < (uint16_t)retval; i++) { - if (make_lacp_reply(slave, rx_buf[i]) == 0) { + if (make_lacp_reply(child, rx_buf[i]) == 0) { /* reply with actor's LACP */ lacp_tx_buf[lacp_tx_buf_cnt++] = rx_buf[i]; } else @@ -553,7 +553,7 @@ bond_handshake_reply(struct slave_conf *slave) if (lacp_tx_buf_cnt == 0) return 0; - retval = slave_put_pkts(slave, lacp_tx_buf, lacp_tx_buf_cnt); + retval = child_put_pkts(child, lacp_tx_buf, lacp_tx_buf_cnt); if (retval <= lacp_tx_buf_cnt) { /* retval might be negative */ for (i = RTE_MAX(0, retval); retval < lacp_tx_buf_cnt; retval++) @@ -561,24 +561,24 @@ bond_handshake_reply(struct slave_conf *slave) } TEST_ASSERT_EQUAL(retval, lacp_tx_buf_cnt, - "Failed to equeue lacp packets into slave %u tx queue.", - slave->port_id); + "Failed to equeue lacp packets into child %u tx queue.", + child->port_id); return lacp_tx_buf_cnt; } /* - * Function check if given slave tx queue contains packets that make mode 4 - * handshake complete. It will drain slave queue. + * Function check if given child tx queue contains packets that make mode 4 + * handshake complete. It will drain child queue. * return 0 if handshake not completed, 1 if handshake was complete, */ static int -bond_handshake_done(struct slave_conf *slave) +bond_handshake_done(struct child_conf *child) { const uint8_t expected_state = STATE_LACP_ACTIVE | STATE_SYNCHRONIZATION | STATE_AGGREGATION | STATE_COLLECTING | STATE_DISTRIBUTING; - return slave->lacp_parnter_state == expected_state; + return child->lacp_parnter_state == expected_state; } static unsigned @@ -603,32 +603,32 @@ bond_get_update_timeout_ms(void) static int bond_handshake(void) { - struct slave_conf *slave; + struct child_conf *child; struct rte_mbuf *buf[MAX_PKT_BURST]; uint16_t nb_pkts; - uint8_t all_slaves_done, i, j; - uint8_t status[RTE_DIM(test_params.slave_ports)] = { 0 }; + uint8_t all_children_done, i, j; + uint8_t status[RTE_DIM(test_params.child_ports)] = { 0 }; const unsigned delay = bond_get_update_timeout_ms(); /* Exchange LACP frames */ - all_slaves_done = 0; - for (i = 0; i < 30 && all_slaves_done == 0; ++i) { + all_children_done = 0; + for (i = 0; i < 30 && all_children_done == 0; ++i) { rte_delay_ms(delay); - all_slaves_done = 1; - FOR_EACH_SLAVE(j, slave) { - /* If response already send, skip slave */ + all_children_done = 1; + FOR_EACH_CHILD(j, child) { + /* If response already send, skip child */ if (status[j] != 0) continue; - if (bond_handshake_reply(slave) < 0) { - all_slaves_done = 0; + if (bond_handshake_reply(child) < 0) { + all_children_done = 0; break; } - status[j] = bond_handshake_done(slave); + status[j] = bond_handshake_done(child); if (status[j] == 0) - all_slaves_done = 0; + all_children_done = 0; } nb_pkts = bond_tx(NULL, 0); @@ -639,26 +639,26 @@ bond_handshake(void) TEST_ASSERT_EQUAL(nb_pkts, 0, "Packets received unexpectedly"); } /* If response didn't send - report failure */ - TEST_ASSERT_EQUAL(all_slaves_done, 1, "Bond handshake failed\n"); + TEST_ASSERT_EQUAL(all_children_done, 1, "Bond handshake failed\n"); /* If flags doesn't match - report failure */ - return all_slaves_done == 1 ? TEST_SUCCESS : TEST_FAILED; + return all_children_done == 1 ? TEST_SUCCESS : TEST_FAILED; } -#define TEST_LACP_SLAVE_COUT RTE_DIM(test_params.slave_ports) +#define TEST_LACP_CHILD_COUT RTE_DIM(test_params.child_ports) static int test_mode4_lacp(void) { int retval; - retval = initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0); + retval = initialize_bonded_device_with_children(TEST_LACP_CHILD_COUT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); /* Test LACP handshake function */ retval = bond_handshake(); TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); - retval = remove_slaves_and_stop_bonded_device(); + retval = remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); return TEST_SUCCESS; @@ -668,7 +668,7 @@ test_mode4_agg_mode_selection(void) { int retval; /* Test and verify for Stable mode */ - retval = initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0); + retval = initialize_bonded_device_with_children(TEST_LACP_CHILD_COUT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); @@ -684,12 +684,12 @@ test_mode4_agg_mode_selection(void) TEST_ASSERT_EQUAL(retval, AGG_STABLE, "Wrong agg mode received from bonding device"); - retval = remove_slaves_and_stop_bonded_device(); + retval = remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); /* test and verify for Bandwidth mode */ - retval = initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0); + retval = initialize_bonded_device_with_children(TEST_LACP_CHILD_COUT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); @@ -706,11 +706,11 @@ test_mode4_agg_mode_selection(void) TEST_ASSERT_EQUAL(retval, AGG_BANDWIDTH, "Wrong agg mode received from bonding device"); - retval = remove_slaves_and_stop_bonded_device(); + retval = remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); /* test and verify selection for count mode */ - retval = initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0); + retval = initialize_bonded_device_with_children(TEST_LACP_CHILD_COUT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); @@ -726,7 +726,7 @@ test_mode4_agg_mode_selection(void) TEST_ASSERT_EQUAL(retval, AGG_COUNT, "Wrong agg mode received from bonding device"); - retval = remove_slaves_and_stop_bonded_device(); + retval = remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); return TEST_SUCCESS; @@ -780,7 +780,7 @@ generate_packets(struct rte_ether_addr *src_mac, } static int -generate_and_put_packets(struct slave_conf *slave, +generate_and_put_packets(struct child_conf *child, struct rte_ether_addr *src_mac, struct rte_ether_addr *dst_mac, uint16_t count) { @@ -791,12 +791,12 @@ generate_and_put_packets(struct slave_conf *slave, if (retval != (int)count) return retval; - retval = slave_put_pkts(slave, pkts, count); + retval = child_put_pkts(child, pkts, count); if (retval > 0 && retval != count) free_pkts(&pkts[retval], count - retval); TEST_ASSERT_EQUAL(retval, count, - "Failed to enqueue packets into slave %u RX queue", slave->port_id); + "Failed to enqueue packets into child %u RX queue", child->port_id); return TEST_SUCCESS; } @@ -804,7 +804,7 @@ generate_and_put_packets(struct slave_conf *slave, static int test_mode4_rx(void) { - struct slave_conf *slave; + struct child_conf *child; uint16_t i, j; uint16_t expected_pkts_cnt; @@ -819,7 +819,7 @@ test_mode4_rx(void) struct rte_ether_addr dst_mac; struct rte_ether_addr bonded_mac; - retval = initialize_bonded_device_with_slaves(TEST_PROMISC_SLAVE_COUNT, + retval = initialize_bonded_device_with_children(TEST_PROMISC_CHILD_COUNT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); @@ -838,7 +838,7 @@ test_mode4_rx(void) dst_mac.addr_bytes[0] += 2; /* First try with promiscuous mode enabled. - * Add 2 packets to each slave. First with bonding MAC address, second with + * Add 2 packets to each child. First with bonding MAC address, second with * different. Check if we received all of them. */ retval = rte_eth_promiscuous_enable(test_params.bonded_port_id); TEST_ASSERT_SUCCESS(retval, @@ -846,16 +846,16 @@ test_mode4_rx(void) test_params.bonded_port_id, rte_strerror(-retval)); expected_pkts_cnt = 0; - FOR_EACH_SLAVE(i, slave) { - retval = generate_and_put_packets(slave, &src_mac, &bonded_mac, 1); - TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to slave %u", - slave->port_id); + FOR_EACH_CHILD(i, child) { + retval = generate_and_put_packets(child, &src_mac, &bonded_mac, 1); + TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to child %u", + child->port_id); - retval = generate_and_put_packets(slave, &src_mac, &dst_mac, 1); - TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to slave %u", - slave->port_id); + retval = generate_and_put_packets(child, &src_mac, &dst_mac, 1); + TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to child %u", + child->port_id); - /* Expect 2 packets per slave */ + /* Expect 2 packets per child */ expected_pkts_cnt += 2; } @@ -894,16 +894,16 @@ test_mode4_rx(void) test_params.bonded_port_id, rte_strerror(-retval)); expected_pkts_cnt = 0; - FOR_EACH_SLAVE(i, slave) { - retval = generate_and_put_packets(slave, &src_mac, &bonded_mac, 1); - TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to slave %u", - slave->port_id); + FOR_EACH_CHILD(i, child) { + retval = generate_and_put_packets(child, &src_mac, &bonded_mac, 1); + TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to child %u", + child->port_id); - retval = generate_and_put_packets(slave, &src_mac, &dst_mac, 1); - TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to slave %u", - slave->port_id); + retval = generate_and_put_packets(child, &src_mac, &dst_mac, 1); + TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to child %u", + child->port_id); - /* Expect only one packet per slave */ + /* Expect only one packet per child */ expected_pkts_cnt += 1; } @@ -927,19 +927,19 @@ test_mode4_rx(void) TEST_ASSERT_EQUAL(retval, expected_pkts_cnt, "Expected %u packets but received only %d", expected_pkts_cnt, retval); - /* Link down test: simulate link down for first slave. */ + /* Link down test: simulate link down for first child. */ delay = bond_get_update_timeout_ms(); - uint8_t slave_down_id = INVALID_PORT_ID; + uint8_t child_down_id = INVALID_PORT_ID; - /* Find first slave and make link down on it*/ - FOR_EACH_SLAVE(i, slave) { - rte_eth_dev_set_link_down(slave->port_id); - slave_down_id = slave->port_id; + /* Find first child and make link down on it*/ + FOR_EACH_CHILD(i, child) { + rte_eth_dev_set_link_down(child->port_id); + child_down_id = child->port_id; break; } - RTE_VERIFY(slave_down_id != INVALID_PORT_ID); + RTE_VERIFY(child_down_id != INVALID_PORT_ID); /* Give some time to rearrange bonding */ for (i = 0; i < 3; i++) { @@ -949,16 +949,16 @@ test_mode4_rx(void) TEST_ASSERT_SUCCESS(bond_handshake(), "Handshake after link down failed"); - /* Put packet to each slave */ - FOR_EACH_SLAVE(i, slave) { + /* Put packet to each child */ + FOR_EACH_CHILD(i, child) { void *pkt = NULL; - dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = slave->port_id; - retval = generate_and_put_packets(slave, &src_mac, &dst_mac, 1); + dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = child->port_id; + retval = generate_and_put_packets(child, &src_mac, &dst_mac, 1); TEST_ASSERT_SUCCESS(retval, "Failed to generate test packet burst."); - src_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = slave->port_id; - retval = generate_and_put_packets(slave, &src_mac, &bonded_mac, 1); + src_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = child->port_id; + retval = generate_and_put_packets(child, &src_mac, &bonded_mac, 1); TEST_ASSERT_SUCCESS(retval, "Failed to generate test packet burst."); retval = bond_rx(pkts, RTE_DIM(pkts)); @@ -967,36 +967,36 @@ test_mode4_rx(void) if (retval > 0) free_pkts(pkts, retval); - while (rte_ring_dequeue(slave->rx_queue, (void **)&pkt) == 0) + while (rte_ring_dequeue(child->rx_queue, (void **)&pkt) == 0) rte_pktmbuf_free(pkt); - if (slave_down_id == slave->port_id) + if (child_down_id == child->port_id) TEST_ASSERT_EQUAL(retval, 0, "Packets received unexpectedly."); else TEST_ASSERT_NOT_EQUAL(retval, 0, - "Expected to receive some packets on slave %u.", - slave->port_id); - rte_eth_dev_start(slave->port_id); + "Expected to receive some packets on child %u.", + child->port_id); + rte_eth_dev_start(child->port_id); for (j = 0; j < 5; j++) { - TEST_ASSERT(bond_handshake_reply(slave) >= 0, + TEST_ASSERT(bond_handshake_reply(child) >= 0, "Handshake after link up"); - if (bond_handshake_done(slave) == 1) + if (bond_handshake_done(child) == 1) break; } - TEST_ASSERT(j < 5, "Failed to aggregate slave after link up"); + TEST_ASSERT(j < 5, "Failed to aggregate child after link up"); } - remove_slaves_and_stop_bonded_device(); + remove_children_and_stop_bonded_device(); return TEST_SUCCESS; } static int test_mode4_tx_burst(void) { - struct slave_conf *slave; + struct child_conf *child; uint16_t i, j; uint16_t exp_pkts_cnt, pkts_cnt = 0; @@ -1008,7 +1008,7 @@ test_mode4_tx_burst(void) { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } }; struct rte_ether_addr bonded_mac; - retval = initialize_bonded_device_with_slaves(TEST_TX_SLAVE_COUNT, 0); + retval = initialize_bonded_device_with_children(TEST_TX_CHILD_COUNT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); retval = bond_handshake(); @@ -1036,19 +1036,19 @@ test_mode4_tx_burst(void) TEST_ASSERT_EQUAL(retval, pkts_cnt, "TX on bonded device failed"); - /* Check if packets were transmitted properly. Every slave should have + /* Check if packets were transmitted properly. Every child should have * at least one packet, and sum must match. Under normal operation * there should be no LACP nor MARKER frames. */ pkts_cnt = 0; - FOR_EACH_SLAVE(i, slave) { + FOR_EACH_CHILD(i, child) { uint16_t normal_cnt, slow_cnt; - retval = slave_get_pkts(slave, pkts, RTE_DIM(pkts)); + retval = child_get_pkts(child, pkts, RTE_DIM(pkts)); normal_cnt = 0; slow_cnt = 0; for (j = 0; j < retval; j++) { - if (make_lacp_reply(slave, pkts[j]) == 1) + if (make_lacp_reply(child, pkts[j]) == 1) normal_cnt++; else slow_cnt++; @@ -1056,11 +1056,11 @@ test_mode4_tx_burst(void) free_pkts(pkts, normal_cnt + slow_cnt); TEST_ASSERT_EQUAL(slow_cnt, 0, - "slave %u unexpectedly transmitted %d SLOW packets", slave->port_id, + "child %u unexpectedly transmitted %d SLOW packets", child->port_id, slow_cnt); TEST_ASSERT_NOT_EQUAL(normal_cnt, 0, - "slave %u did not transmitted any packets", slave->port_id); + "child %u did not transmitted any packets", child->port_id); pkts_cnt += normal_cnt; } @@ -1069,18 +1069,18 @@ test_mode4_tx_burst(void) "Expected %u packets but transmitted only %d", exp_pkts_cnt, pkts_cnt); /* Link down test: - * simulate link down for first slave. */ + * simulate link down for first child. */ delay = bond_get_update_timeout_ms(); - uint8_t slave_down_id = INVALID_PORT_ID; + uint8_t child_down_id = INVALID_PORT_ID; - FOR_EACH_SLAVE(i, slave) { - rte_eth_dev_set_link_down(slave->port_id); - slave_down_id = slave->port_id; + FOR_EACH_CHILD(i, child) { + rte_eth_dev_set_link_down(child->port_id); + child_down_id = child->port_id; break; } - RTE_VERIFY(slave_down_id != INVALID_PORT_ID); + RTE_VERIFY(child_down_id != INVALID_PORT_ID); /* Give some time to rearrange bonding. */ for (i = 0; i < 3; i++) { @@ -1110,19 +1110,19 @@ test_mode4_tx_burst(void) TEST_ASSERT_EQUAL(retval, pkts_cnt, "TX on bonded device failed"); - /* Check if packets was transmitted properly. Every slave should have + /* Check if packets was transmitted properly. Every child should have * at least one packet, and sum must match. Under normal operation * there should be no LACP nor MARKER frames. */ pkts_cnt = 0; - FOR_EACH_SLAVE(i, slave) { + FOR_EACH_CHILD(i, child) { uint16_t normal_cnt, slow_cnt; - retval = slave_get_pkts(slave, pkts, RTE_DIM(pkts)); + retval = child_get_pkts(child, pkts, RTE_DIM(pkts)); normal_cnt = 0; slow_cnt = 0; for (j = 0; j < retval; j++) { - if (make_lacp_reply(slave, pkts[j]) == 1) + if (make_lacp_reply(child, pkts[j]) == 1) normal_cnt++; else slow_cnt++; @@ -1130,17 +1130,17 @@ test_mode4_tx_burst(void) free_pkts(pkts, normal_cnt + slow_cnt); - if (slave_down_id == slave->port_id) { + if (child_down_id == child->port_id) { TEST_ASSERT_EQUAL(normal_cnt + slow_cnt, 0, - "slave %u enexpectedly transmitted %u packets", - normal_cnt + slow_cnt, slave->port_id); + "child %u enexpectedly transmitted %u packets", + normal_cnt + slow_cnt, child->port_id); } else { TEST_ASSERT_EQUAL(slow_cnt, 0, - "slave %u unexpectedly transmitted %d SLOW packets", - slave->port_id, slow_cnt); + "child %u unexpectedly transmitted %d SLOW packets", + child->port_id, slow_cnt); TEST_ASSERT_NOT_EQUAL(normal_cnt, 0, - "slave %u did not transmitted any packets", slave->port_id); + "child %u did not transmitted any packets", child->port_id); } pkts_cnt += normal_cnt; @@ -1149,11 +1149,11 @@ test_mode4_tx_burst(void) TEST_ASSERT_EQUAL(exp_pkts_cnt, pkts_cnt, "Expected %u packets but transmitted only %d", exp_pkts_cnt, pkts_cnt); - return remove_slaves_and_stop_bonded_device(); + return remove_children_and_stop_bonded_device(); } static void -init_marker(struct rte_mbuf *pkt, struct slave_conf *slave) +init_marker(struct rte_mbuf *pkt, struct child_conf *child) { struct marker_header *marker_hdr = rte_pktmbuf_mtod(pkt, struct marker_header *); @@ -1166,7 +1166,7 @@ init_marker(struct rte_mbuf *pkt, struct slave_conf *slave) rte_ether_addr_copy(&parnter_mac_default, &marker_hdr->eth_hdr.src_addr); marker_hdr->eth_hdr.src_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = - slave->port_id; + child->port_id; marker_hdr->eth_hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW); @@ -1177,7 +1177,7 @@ init_marker(struct rte_mbuf *pkt, struct slave_conf *slave) offsetof(struct marker, reserved_90) - offsetof(struct marker, requester_port); RTE_VERIFY(marker_hdr->marker.info_length == 16); - marker_hdr->marker.requester_port = slave->port_id + 1; + marker_hdr->marker.requester_port = child->port_id + 1; marker_hdr->marker.tlv_type_terminator = TLV_TYPE_TERMINATOR_INFORMATION; marker_hdr->marker.terminator_length = 0; } @@ -1185,7 +1185,7 @@ init_marker(struct rte_mbuf *pkt, struct slave_conf *slave) static int test_mode4_marker(void) { - struct slave_conf *slave; + struct child_conf *child; struct rte_mbuf *pkts[MAX_PKT_BURST]; struct rte_mbuf *marker_pkt; struct marker_header *marker_hdr; @@ -1196,7 +1196,7 @@ test_mode4_marker(void) uint8_t i, j; const uint16_t ethtype_slow_be = rte_be_to_cpu_16(RTE_ETHER_TYPE_SLOW); - retval = initialize_bonded_device_with_slaves(TEST_MARKER_SLAVE_COUT, + retval = initialize_bonded_device_with_children(TEST_MARKER_CHILD_COUT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); @@ -1205,17 +1205,17 @@ test_mode4_marker(void) TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); delay = bond_get_update_timeout_ms(); - FOR_EACH_SLAVE(i, slave) { + FOR_EACH_CHILD(i, child) { marker_pkt = rte_pktmbuf_alloc(test_params.mbuf_pool); TEST_ASSERT_NOT_NULL(marker_pkt, "Failed to allocate marker packet"); - init_marker(marker_pkt, slave); + init_marker(marker_pkt, child); - retval = slave_put_pkts(slave, &marker_pkt, 1); + retval = child_put_pkts(child, &marker_pkt, 1); if (retval != 1) rte_pktmbuf_free(marker_pkt); TEST_ASSERT_EQUAL(retval, 1, - "Failed to send marker packet to slave %u", slave->port_id); + "Failed to send marker packet to child %u", child->port_id); for (j = 0; j < 20; ++j) { rte_delay_ms(delay); @@ -1233,13 +1233,13 @@ test_mode4_marker(void) /* Check if LACP packet was send by state machines First and only packet must be a maker response */ - retval = slave_get_pkts(slave, pkts, MAX_PKT_BURST); + retval = child_get_pkts(child, pkts, MAX_PKT_BURST); if (retval == 0) continue; if (retval > 1) free_pkts(pkts, retval); - TEST_ASSERT_EQUAL(retval, 1, "failed to get slave packets"); + TEST_ASSERT_EQUAL(retval, 1, "failed to get child packets"); nb_pkts = retval; marker_hdr = rte_pktmbuf_mtod(pkts[0], struct marker_header *); @@ -1263,7 +1263,7 @@ test_mode4_marker(void) TEST_ASSERT(j < 20, "Marker response not found"); } - retval = remove_slaves_and_stop_bonded_device(); + retval = remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); return TEST_SUCCESS; @@ -1272,7 +1272,7 @@ test_mode4_marker(void) static int test_mode4_expired(void) { - struct slave_conf *slave, *exp_slave = NULL; + struct child_conf *child, *exp_child = NULL; struct rte_mbuf *pkts[MAX_PKT_BURST]; int retval; uint32_t old_delay; @@ -1282,7 +1282,7 @@ test_mode4_expired(void) struct rte_eth_bond_8023ad_conf conf; - retval = initialize_bonded_device_with_slaves(TEST_EXPIRED_SLAVE_COUNT, + retval = initialize_bonded_device_with_children(TEST_EXPIRED_CHILD_COUNT, 0); /* Set custom timeouts to make test last shorter. */ rte_eth_bond_8023ad_conf_get(test_params.bonded_port_id, &conf); @@ -1298,8 +1298,8 @@ test_mode4_expired(void) /* Wait for new settings to be applied. */ for (i = 0; i < old_delay/conf.update_timeout_ms * 2; i++) { - FOR_EACH_SLAVE(j, slave) - bond_handshake_reply(slave); + FOR_EACH_CHILD(j, child) + bond_handshake_reply(child); rte_delay_ms(conf.update_timeout_ms); } @@ -1307,13 +1307,13 @@ test_mode4_expired(void) retval = bond_handshake(); TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); - /* Find first slave */ - FOR_EACH_SLAVE(i, slave) { - exp_slave = slave; + /* Find first child */ + FOR_EACH_CHILD(i, child) { + exp_child = child; break; } - RTE_VERIFY(exp_slave != NULL); + RTE_VERIFY(exp_child != NULL); /* When one of partners do not send or respond to LACP frame in * conf.long_timeout_ms time, internal state machines should detect this @@ -1325,16 +1325,16 @@ test_mode4_expired(void) TEST_ASSERT_EQUAL(retval, 0, "Unexpectedly received %d packets", retval); - FOR_EACH_SLAVE(i, slave) { - retval = bond_handshake_reply(slave); + FOR_EACH_CHILD(i, child) { + retval = bond_handshake_reply(child); TEST_ASSERT(retval >= 0, "Handshake failed"); - /* Remove replay for slave that suppose to be expired. */ - if (slave == exp_slave) { - while (rte_ring_count(slave->rx_queue) > 0) { + /* Remove replay for child that suppose to be expired. */ + if (child == exp_child) { + while (rte_ring_count(child->rx_queue) > 0) { void *pkt = NULL; - rte_ring_dequeue(slave->rx_queue, &pkt); + rte_ring_dequeue(child->rx_queue, &pkt); rte_pktmbuf_free(pkt); } } @@ -1348,17 +1348,17 @@ test_mode4_expired(void) retval); } - /* After test only expected slave should be in EXPIRED state */ - FOR_EACH_SLAVE(i, slave) { - if (slave == exp_slave) - TEST_ASSERT(slave->lacp_parnter_state & STATE_EXPIRED, - "Slave %u should be in expired.", slave->port_id); + /* After test only expected child should be in EXPIRED state */ + FOR_EACH_CHILD(i, child) { + if (child == exp_child) + TEST_ASSERT(child->lacp_parnter_state & STATE_EXPIRED, + "Child %u should be in expired.", child->port_id); else - TEST_ASSERT_EQUAL(bond_handshake_done(slave), 1, - "Slave %u should be operational.", slave->port_id); + TEST_ASSERT_EQUAL(bond_handshake_done(child), 1, + "Child %u should be operational.", child->port_id); } - retval = remove_slaves_and_stop_bonded_device(); + retval = remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); return TEST_SUCCESS; @@ -1372,17 +1372,17 @@ test_mode4_ext_ctrl(void) * . try to transmit lacpdu (should fail) * . try to set collecting and distributing flags (should fail) * reconfigure w/external sm - * . transmit one lacpdu on each slave using new api - * . make sure each slave receives one lacpdu using the callback api - * . transmit one data pdu on each slave (should fail) + * . transmit one lacpdu on each child using new api + * . make sure each child receives one lacpdu using the callback api + * . transmit one data pdu on each child (should fail) * . enable distribution and collection, send one data pdu each again */ int retval; - struct slave_conf *slave = NULL; + struct child_conf *child = NULL; uint8_t i; - struct rte_mbuf *lacp_tx_buf[SLAVE_COUNT]; + struct rte_mbuf *lacp_tx_buf[CHILD_COUNT]; struct rte_ether_addr src_mac, dst_mac; struct lacpdu_header lacpdu = { .lacpdu = { @@ -1396,30 +1396,30 @@ test_mode4_ext_ctrl(void) initialize_eth_header(&lacpdu.eth_hdr, &src_mac, &dst_mac, RTE_ETHER_TYPE_SLOW, 0, 0); - for (i = 0; i < SLAVE_COUNT; i++) { + for (i = 0; i < CHILD_COUNT; i++) { lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool); rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu, sizeof(lacpdu)); rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu); } - retval = initialize_bonded_device_with_slaves(TEST_TX_SLAVE_COUNT, 0); + retval = initialize_bonded_device_with_children(TEST_TX_CHILD_COUNT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); - FOR_EACH_SLAVE(i, slave) { + FOR_EACH_CHILD(i, child) { TEST_ASSERT_FAIL(rte_eth_bond_8023ad_ext_slowtx( test_params.bonded_port_id, - slave->port_id, lacp_tx_buf[i]), - "Slave should not allow manual LACP xmit"); + child->port_id, lacp_tx_buf[i]), + "Child should not allow manual LACP xmit"); TEST_ASSERT_FAIL(rte_eth_bond_8023ad_ext_collect( test_params.bonded_port_id, - slave->port_id, 1), - "Slave should not allow external state controls"); + child->port_id, 1), + "Child should not allow external state controls"); } free_pkts(lacp_tx_buf, RTE_DIM(lacp_tx_buf)); - retval = remove_slaves_and_stop_bonded_device(); + retval = remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Bonded device cleanup failed."); return TEST_SUCCESS; @@ -1430,13 +1430,13 @@ static int test_mode4_ext_lacp(void) { int retval; - struct slave_conf *slave = NULL; - uint8_t all_slaves_done = 0, i; + struct child_conf *child = NULL; + uint8_t all_children_done = 0, i; uint16_t nb_pkts; const unsigned int delay = bond_get_update_timeout_ms(); - struct rte_mbuf *lacp_tx_buf[SLAVE_COUNT]; - struct rte_mbuf *buf[SLAVE_COUNT]; + struct rte_mbuf *lacp_tx_buf[CHILD_COUNT]; + struct rte_mbuf *buf[CHILD_COUNT]; struct rte_ether_addr src_mac, dst_mac; struct lacpdu_header lacpdu = { .lacpdu = { @@ -1450,14 +1450,14 @@ test_mode4_ext_lacp(void) initialize_eth_header(&lacpdu.eth_hdr, &src_mac, &dst_mac, RTE_ETHER_TYPE_SLOW, 0, 0); - for (i = 0; i < SLAVE_COUNT; i++) { + for (i = 0; i < CHILD_COUNT; i++) { lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool); rte_memcpy(rte_pktmbuf_mtod(lacp_tx_buf[i], char *), &lacpdu, sizeof(lacpdu)); rte_pktmbuf_pkt_len(lacp_tx_buf[i]) = sizeof(lacpdu); } - retval = initialize_bonded_device_with_slaves(TEST_TX_SLAVE_COUNT, 1); + retval = initialize_bonded_device_with_children(TEST_TX_CHILD_COUNT, 1); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); memset(lacpdu_rx_count, 0, sizeof(lacpdu_rx_count)); @@ -1466,22 +1466,22 @@ test_mode4_ext_lacp(void) for (i = 0; i < 30; ++i) rte_delay_ms(delay); - FOR_EACH_SLAVE(i, slave) { + FOR_EACH_CHILD(i, child) { retval = rte_eth_bond_8023ad_ext_slowtx( test_params.bonded_port_id, - slave->port_id, lacp_tx_buf[i]); + child->port_id, lacp_tx_buf[i]); TEST_ASSERT_SUCCESS(retval, - "Slave should allow manual LACP xmit"); + "Child should allow manual LACP xmit"); } nb_pkts = bond_tx(NULL, 0); TEST_ASSERT_EQUAL(nb_pkts, 0, "Packets transmitted unexpectedly"); - FOR_EACH_SLAVE(i, slave) { - nb_pkts = slave_get_pkts(slave, buf, RTE_DIM(buf)); - TEST_ASSERT_EQUAL(nb_pkts, 1, "found %u packets on slave %d\n", + FOR_EACH_CHILD(i, child) { + nb_pkts = child_get_pkts(child, buf, RTE_DIM(buf)); + TEST_ASSERT_EQUAL(nb_pkts, 1, "found %u packets on child %d\n", nb_pkts, i); - slave_put_pkts(slave, buf, nb_pkts); + child_put_pkts(child, buf, nb_pkts); } nb_pkts = bond_rx(buf, RTE_DIM(buf)); @@ -1489,26 +1489,26 @@ test_mode4_ext_lacp(void) TEST_ASSERT_EQUAL(nb_pkts, 0, "Packets received unexpectedly"); /* wait for the periodic callback to run */ - for (i = 0; i < 30 && all_slaves_done == 0; ++i) { + for (i = 0; i < 30 && all_children_done == 0; ++i) { uint8_t s, total = 0; rte_delay_ms(delay); - FOR_EACH_SLAVE(s, slave) { - total += lacpdu_rx_count[slave->port_id]; + FOR_EACH_CHILD(s, child) { + total += lacpdu_rx_count[child->port_id]; } - if (total >= SLAVE_COUNT) - all_slaves_done = 1; + if (total >= CHILD_COUNT) + all_children_done = 1; } - FOR_EACH_SLAVE(i, slave) { - TEST_ASSERT_EQUAL(lacpdu_rx_count[slave->port_id], 1, - "Slave port %u should have received 1 lacpdu (count=%u)", - slave->port_id, - lacpdu_rx_count[slave->port_id]); + FOR_EACH_CHILD(i, child) { + TEST_ASSERT_EQUAL(lacpdu_rx_count[child->port_id], 1, + "Child port %u should have received 1 lacpdu (count=%u)", + child->port_id, + lacpdu_rx_count[child->port_id]); } - retval = remove_slaves_and_stop_bonded_device(); + retval = remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); return TEST_SUCCESS; @@ -1517,10 +1517,10 @@ test_mode4_ext_lacp(void) static int check_environment(void) { - struct slave_conf *port; + struct child_conf *port; uint8_t i, env_state; - uint16_t slaves[RTE_DIM(test_params.slave_ports)]; - int slaves_count; + uint16_t children[RTE_DIM(test_params.child_ports)]; + int children_count; env_state = 0; FOR_EACH_PORT(i, port) { @@ -1540,20 +1540,20 @@ check_environment(void) break; } - slaves_count = rte_eth_bond_slaves_get(test_params.bonded_port_id, - slaves, RTE_DIM(slaves)); + children_count = rte_eth_bond_children_get(test_params.bonded_port_id, + children, RTE_DIM(children)); - if (slaves_count != 0) + if (children_count != 0) env_state |= 0x10; TEST_ASSERT_EQUAL(env_state, 0, "Environment not clean (port %u):%s%s%s%s%s", port->port_id, - env_state & 0x01 ? " slave rx queue not clean" : "", - env_state & 0x02 ? " slave tx queue not clean" : "", - env_state & 0x04 ? " port marked as enslaved" : "", - env_state & 0x80 ? " slave state is not reset" : "", - env_state & 0x10 ? " slave count not equal 0" : "."); + env_state & 0x01 ? " child rx queue not clean" : "", + env_state & 0x02 ? " child tx queue not clean" : "", + env_state & 0x04 ? " port marked as enchildd" : "", + env_state & 0x80 ? " child state is not reset" : "", + env_state & 0x10 ? " child count not equal 0" : "."); return TEST_SUCCESS; @@ -1562,7 +1562,7 @@ check_environment(void) static int test_mode4_executor(int (*test_func)(void)) { - struct slave_conf *port; + struct child_conf *port; int test_result; uint8_t i; void *pkt; @@ -1581,7 +1581,7 @@ test_mode4_executor(int (*test_func)(void)) /* Reset environment in case test failed to do that. */ if (test_result != TEST_SUCCESS) { - TEST_ASSERT_SUCCESS(remove_slaves_and_stop_bonded_device(), + TEST_ASSERT_SUCCESS(remove_children_and_stop_bonded_device(), "Failed to stop bonded device"); FOR_EACH_PORT(i, port) { diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c index 464fb2dbd0bf..b1eee6bd4d5a 100644 --- a/app/test/test_link_bonding_rssconf.c +++ b/app/test/test_link_bonding_rssconf.c @@ -27,15 +27,15 @@ #include "test.h" -#define SLAVE_COUNT (4) +#define CHILD_COUNT (4) #define RXTX_RING_SIZE 1024 #define RXTX_QUEUE_COUNT 4 #define BONDED_DEV_NAME ("net_bonding_rss") -#define SLAVE_DEV_NAME_FMT ("net_null%d") -#define SLAVE_RXTX_QUEUE_FMT ("rssconf_slave%d_q%d") +#define CHILD_DEV_NAME_FMT ("net_null%d") +#define CHILD_RXTX_QUEUE_FMT ("rssconf_child%d_q%d") #define NUM_MBUFS 8191 #define MBUF_SIZE (1600 + RTE_PKTMBUF_HEADROOM) @@ -46,7 +46,7 @@ #define INVALID_PORT_ID (0xFF) #define INVALID_BONDING_MODE (-1) -struct slave_conf { +struct child_conf { uint16_t port_id; struct rte_eth_dev_info dev_info; @@ -54,7 +54,7 @@ struct slave_conf { uint8_t rss_key[40]; struct rte_eth_rss_reta_entry64 reta_conf[512 / RTE_ETH_RETA_GROUP_SIZE]; - uint8_t is_slave; + uint8_t is_child; struct rte_ring *rxtx_queue[RXTX_QUEUE_COUNT]; }; @@ -62,15 +62,15 @@ struct link_bonding_rssconf_unittest_params { uint8_t bond_port_id; struct rte_eth_dev_info bond_dev_info; struct rte_eth_rss_reta_entry64 bond_reta_conf[512 / RTE_ETH_RETA_GROUP_SIZE]; - struct slave_conf slave_ports[SLAVE_COUNT]; + struct child_conf child_ports[CHILD_COUNT]; struct rte_mempool *mbuf_pool; }; static struct link_bonding_rssconf_unittest_params test_params = { .bond_port_id = INVALID_PORT_ID, - .slave_ports = { - [0 ... SLAVE_COUNT - 1] = { .port_id = INVALID_PORT_ID, .is_slave = 0} + .child_ports = { + [0 ... CHILD_COUNT - 1] = { .port_id = INVALID_PORT_ID, .is_child = 0} }, .mbuf_pool = NULL, }; @@ -107,14 +107,14 @@ static struct rte_eth_conf rss_pmd_conf = { #define FOR_EACH(_i, _item, _array, _size) \ for (_i = 0, _item = &_array[0]; _i < _size && (_item = &_array[_i]); _i++) -/* Macro for iterating over every port that can be used as a slave +/* Macro for iterating over every port that can be used as a child * in this test. - * _i variable used as an index in test_params->slave_ports - * _slave pointer to &test_params->slave_ports[_idx] + * _i variable used as an index in test_params->child_ports + * _child pointer to &test_params->child_ports[_idx] */ #define FOR_EACH_PORT(_i, _port) \ - FOR_EACH(_i, _port, test_params.slave_ports, \ - RTE_DIM(test_params.slave_ports)) + FOR_EACH(_i, _port, test_params.child_ports, \ + RTE_DIM(test_params.child_ports)) static int configure_ethdev(uint16_t port_id, struct rte_eth_conf *eth_conf, @@ -151,21 +151,21 @@ configure_ethdev(uint16_t port_id, struct rte_eth_conf *eth_conf, } /** - * Remove all slaves from bonding + * Remove all children from bonding */ static int -remove_slaves(void) +remove_children(void) { unsigned n; - struct slave_conf *port; + struct child_conf *port; FOR_EACH_PORT(n, port) { - port = &test_params.slave_ports[n]; - if (port->is_slave) { - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove( + port = &test_params.child_ports[n]; + if (port->is_child) { + TEST_ASSERT_SUCCESS(rte_eth_bond_child_remove( test_params.bond_port_id, port->port_id), - "Cannot remove slave %d from bonding", port->port_id); - port->is_slave = 0; + "Cannot remove child %d from bonding", port->port_id); + port->is_child = 0; } } @@ -173,30 +173,30 @@ remove_slaves(void) } static int -remove_slaves_and_stop_bonded_device(void) +remove_children_and_stop_bonded_device(void) { - TEST_ASSERT_SUCCESS(remove_slaves(), "Removing slaves"); + TEST_ASSERT_SUCCESS(remove_children(), "Removing children"); TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params.bond_port_id), "Failed to stop port %u", test_params.bond_port_id); return TEST_SUCCESS; } /** - * Add all slaves to bonding + * Add all children to bonding */ static int -bond_slaves(void) +bond_children(void) { unsigned n; - struct slave_conf *port; + struct child_conf *port; FOR_EACH_PORT(n, port) { - port = &test_params.slave_ports[n]; - if (!port->is_slave) { - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params.bond_port_id, - port->port_id), "Cannot attach slave %d to the bonding", + port = &test_params.child_ports[n]; + if (!port->is_child) { + TEST_ASSERT_SUCCESS(rte_eth_bond_child_add(test_params.bond_port_id, + port->port_id), "Cannot attach child %d to the bonding", port->port_id); - port->is_slave = 1; + port->is_child = 1; } } @@ -223,11 +223,11 @@ reta_set(uint16_t port_id, uint8_t value, int reta_size) } /** - * Check if slaves RETA is synchronized with bonding port. Returns 1 if slave + * Check if children RETA is synchronized with bonding port. Returns 1 if child * port is synced with bonding port. */ static int -reta_check_synced(struct slave_conf *port) +reta_check_synced(struct child_conf *port) { unsigned i; @@ -264,10 +264,10 @@ bond_reta_fetch(void) { } /** - * Fetch slaves RETA + * Fetch children RETA */ static int -slave_reta_fetch(struct slave_conf *port) { +child_reta_fetch(struct child_conf *port) { unsigned j; for (j = 0; j < port->dev_info.reta_size / RTE_ETH_RETA_GROUP_SIZE; j++) @@ -280,49 +280,49 @@ slave_reta_fetch(struct slave_conf *port) { } /** - * Remove and add slave to check if slaves configuration is synced with - * the bonding ports values after adding new slave. + * Remove and add child to check if children configuration is synced with + * the bonding ports values after adding new child. */ static int -slave_remove_and_add(void) +child_remove_and_add(void) { - struct slave_conf *port = &(test_params.slave_ports[0]); + struct child_conf *port = &(test_params.child_ports[0]); - /* 1. Remove first slave from bonding */ - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(test_params.bond_port_id, - port->port_id), "Cannot remove slave #d from bonding"); + /* 1. Remove first child from bonding */ + TEST_ASSERT_SUCCESS(rte_eth_bond_child_remove(test_params.bond_port_id, + port->port_id), "Cannot remove child #d from bonding"); - /* 2. Change removed (ex-)slave and bonding configuration to different + /* 2. Change removed (ex-)child and bonding configuration to different * values */ reta_set(test_params.bond_port_id, 1, test_params.bond_dev_info.reta_size); bond_reta_fetch(); reta_set(port->port_id, 2, port->dev_info.reta_size); - slave_reta_fetch(port); + child_reta_fetch(port); TEST_ASSERT(reta_check_synced(port) == 0, - "Removed slave didn't should be synchronized with bonding port"); + "Removed child didn't should be synchronized with bonding port"); - /* 3. Add (ex-)slave and check if configuration changed*/ - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params.bond_port_id, - port->port_id), "Cannot add slave"); + /* 3. Add (ex-)child and check if configuration changed*/ + TEST_ASSERT_SUCCESS(rte_eth_bond_child_add(test_params.bond_port_id, + port->port_id), "Cannot add child"); bond_reta_fetch(); - slave_reta_fetch(port); + child_reta_fetch(port); return reta_check_synced(port); } /** - * Test configuration propagation over slaves. + * Test configuration propagation over children. */ static int test_propagate(void) { unsigned i; uint8_t n; - struct slave_conf *port; + struct child_conf *port; uint8_t bond_rss_key[40]; struct rte_eth_rss_conf bond_rss_conf; @@ -349,18 +349,18 @@ test_propagate(void) retval = rte_eth_dev_rss_hash_update(test_params.bond_port_id, &bond_rss_conf); - TEST_ASSERT_SUCCESS(retval, "Cannot set slaves hash function"); + TEST_ASSERT_SUCCESS(retval, "Cannot set children hash function"); FOR_EACH_PORT(n, port) { - port = &test_params.slave_ports[n]; + port = &test_params.child_ports[n]; retval = rte_eth_dev_rss_hash_conf_get(port->port_id, &port->rss_conf); TEST_ASSERT_SUCCESS(retval, - "Cannot take slaves RSS configuration"); + "Cannot take children RSS configuration"); TEST_ASSERT(port->rss_conf.rss_hf == rss_hf, - "Hash function not propagated for slave %d", + "Hash function not propagated for child %d", port->port_id); } @@ -376,11 +376,11 @@ test_propagate(void) /* Set all keys to zero */ FOR_EACH_PORT(n, port) { - port = &test_params.slave_ports[n]; + port = &test_params.child_ports[n]; memset(port->rss_conf.rss_key, 0, 40); retval = rte_eth_dev_rss_hash_update(port->port_id, &port->rss_conf); - TEST_ASSERT_SUCCESS(retval, "Cannot set slaves RSS keys"); + TEST_ASSERT_SUCCESS(retval, "Cannot set children RSS keys"); } memset(bond_rss_key, i, sizeof(bond_rss_key)); @@ -393,18 +393,18 @@ test_propagate(void) TEST_ASSERT_SUCCESS(retval, "Cannot set bonded port RSS keys"); FOR_EACH_PORT(n, port) { - port = &test_params.slave_ports[n]; + port = &test_params.child_ports[n]; retval = rte_eth_dev_rss_hash_conf_get(port->port_id, &(port->rss_conf)); TEST_ASSERT_SUCCESS(retval, - "Cannot take slaves RSS configuration"); + "Cannot take children RSS configuration"); /* compare keys */ retval = memcmp(port->rss_conf.rss_key, bond_rss_key, sizeof(bond_rss_key)); - TEST_ASSERT(retval == 0, "Key value not propagated for slave %d", + TEST_ASSERT(retval == 0, "Key value not propagated for child %d", port->port_id); } } @@ -416,10 +416,10 @@ test_propagate(void) /* Set all keys to zero */ FOR_EACH_PORT(n, port) { - port = &test_params.slave_ports[n]; + port = &test_params.child_ports[n]; retval = reta_set(port->port_id, (i + 1) % RXTX_QUEUE_COUNT, port->dev_info.reta_size); - TEST_ASSERT_SUCCESS(retval, "Cannot set slaves RETA"); + TEST_ASSERT_SUCCESS(retval, "Cannot set children RETA"); } TEST_ASSERT_SUCCESS(reta_set(test_params.bond_port_id, @@ -429,9 +429,9 @@ test_propagate(void) bond_reta_fetch(); FOR_EACH_PORT(n, port) { - port = &test_params.slave_ports[n]; + port = &test_params.child_ports[n]; - slave_reta_fetch(port); + child_reta_fetch(port); TEST_ASSERT(reta_check_synced(port) == 1, "RETAs inconsistent"); } } @@ -459,29 +459,29 @@ test_rss(void) "Error during getting device (port %u) info: %s\n", test_params.bond_port_id, strerror(-ret)); - TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed"); + TEST_ASSERT_SUCCESS(bond_children(), "Bonding children failed"); TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params.bond_port_id), "Failed to start bonding port (%d).", test_params.bond_port_id); TEST_ASSERT_SUCCESS(test_propagate(), "Propagation test failed"); - TEST_ASSERT(slave_remove_and_add() == 1, "remove and add slaves success."); + TEST_ASSERT(child_remove_and_add() == 1, "remove and add children success."); - remove_slaves_and_stop_bonded_device(); + remove_children_and_stop_bonded_device(); return TEST_SUCCESS; } /** - * Test RSS configuration over bonded and slaves. + * Test RSS configuration over bonded and children. */ static int test_rss_config_lazy(void) { struct rte_eth_rss_conf bond_rss_conf = {0}; - struct slave_conf *port; + struct child_conf *port; uint8_t rss_key[40]; uint64_t rss_hf; int retval; @@ -502,18 +502,18 @@ test_rss_config_lazy(void) TEST_ASSERT(retval != 0, "Succeeded in setting bonded port hash function"); } - /* Set all keys to zero for all slaves */ + /* Set all keys to zero for all children */ FOR_EACH_PORT(n, port) { - port = &test_params.slave_ports[n]; + port = &test_params.child_ports[n]; retval = rte_eth_dev_rss_hash_conf_get(port->port_id, &port->rss_conf); - TEST_ASSERT_SUCCESS(retval, "Cannot get slaves RSS configuration"); + TEST_ASSERT_SUCCESS(retval, "Cannot get children RSS configuration"); memset(port->rss_key, 0, sizeof(port->rss_key)); port->rss_conf.rss_key = port->rss_key; port->rss_conf.rss_key_len = sizeof(port->rss_key); retval = rte_eth_dev_rss_hash_update(port->port_id, &port->rss_conf); - TEST_ASSERT(retval != 0, "Succeeded in setting slaves RSS keys"); + TEST_ASSERT(retval != 0, "Succeeded in setting children RSS keys"); } /* Set RSS keys for bonded port */ @@ -529,10 +529,10 @@ test_rss_config_lazy(void) /* Test RETA propagation */ for (i = 0; i < RXTX_QUEUE_COUNT; i++) { FOR_EACH_PORT(n, port) { - port = &test_params.slave_ports[n]; + port = &test_params.child_ports[n]; retval = reta_set(port->port_id, (i + 1) % RXTX_QUEUE_COUNT, port->dev_info.reta_size); - TEST_ASSERT(retval != 0, "Succeeded in setting slaves RETA"); + TEST_ASSERT(retval != 0, "Succeeded in setting children RETA"); } retval = reta_set(test_params.bond_port_id, i % RXTX_QUEUE_COUNT, @@ -560,14 +560,14 @@ test_rss_lazy(void) "Error during getting device (port %u) info: %s\n", test_params.bond_port_id, strerror(-ret)); - TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed"); + TEST_ASSERT_SUCCESS(bond_children(), "Bonding children failed"); TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params.bond_port_id), "Failed to start bonding port (%d).", test_params.bond_port_id); TEST_ASSERT_SUCCESS(test_rss_config_lazy(), "Succeeded in setting RSS hash when RX_RSS mq_mode is turned off"); - remove_slaves_and_stop_bonded_device(); + remove_children_and_stop_bonded_device(); return TEST_SUCCESS; } @@ -579,13 +579,13 @@ test_setup(void) int retval; int port_id; char name[256]; - struct slave_conf *port; + struct child_conf *port; struct rte_ether_addr mac_addr = { .addr_bytes = {0} }; if (test_params.mbuf_pool == NULL) { test_params.mbuf_pool = rte_pktmbuf_pool_create( - "RSS_MBUF_POOL", NUM_MBUFS * SLAVE_COUNT, + "RSS_MBUF_POOL", NUM_MBUFS * CHILD_COUNT, MBUF_CACHE_SIZE, 0, MBUF_SIZE, rte_socket_id()); TEST_ASSERT(test_params.mbuf_pool != NULL, @@ -594,10 +594,10 @@ test_setup(void) /* Create / initialize ring eth devs. */ FOR_EACH_PORT(n, port) { - port = &test_params.slave_ports[n]; + port = &test_params.child_ports[n]; port_id = rte_eth_dev_count_avail(); - snprintf(name, sizeof(name), SLAVE_DEV_NAME_FMT, port_id); + snprintf(name, sizeof(name), CHILD_DEV_NAME_FMT, port_id); retval = rte_vdev_init(name, "size=64,copy=0"); TEST_ASSERT_SUCCESS(retval, "Failed to create null device '%s'\n", @@ -647,7 +647,7 @@ test_setup(void) static void testsuite_teardown(void) { - struct slave_conf *port; + struct child_conf *port; uint8_t i; /* Only stop ports. @@ -685,7 +685,7 @@ test_rssconf_executor(int (*test_func)(void)) /* Reset environment in case test failed to do that. */ if (test_result != TEST_SUCCESS) { - TEST_ASSERT_SUCCESS(remove_slaves_and_stop_bonded_device(), + TEST_ASSERT_SUCCESS(remove_children_and_stop_bonded_device(), "Failed to stop bonded device"); } diff --git a/doc/guides/howto/lm_bond_virtio_sriov.rst b/doc/guides/howto/lm_bond_virtio_sriov.rst index e854ae214ef9..a64a04247c0e 100644 --- a/doc/guides/howto/lm_bond_virtio_sriov.rst +++ b/doc/guides/howto/lm_bond_virtio_sriov.rst @@ -17,8 +17,8 @@ Test Setup ---------- A bonded device is created in the VM. -The virtio and VF PMD's are added as slaves to the bonded device. -The VF is set as the primary slave of the bonded device. +The virtio and VF PMD's are added as childern to the bonded device. +The VF is set as the primary child of the bonded device. A bridge must be set up on the Host connecting the tap device, which is the backend of the Virtio device and the Physical Function (PF) device. @@ -116,13 +116,13 @@ Bonding is port 2 (P2). testpmd> create bonded device 1 0 Created new bonded device net_bond_testpmd_0 on (port 2). - testpmd> add bonding slave 0 2 - testpmd> add bonding slave 1 2 + testpmd> add bonding child 0 2 + testpmd> add bonding child 1 2 testpmd> show bonding config 2 The syntax of the ``testpmd`` command is: -set bonding primary (slave id) (port id) +set bonding primary (child id) (port id) Set primary to P1 before starting bonding port. @@ -139,7 +139,7 @@ Set primary to P1 before starting bonding port. testpmd> show bonding config 2 -Primary is now P1. There are 2 active slaves. +Primary is now P1. There are 2 active children. Use P2 only for forwarding. @@ -151,7 +151,7 @@ Use P2 only for forwarding. testpmd> start testpmd> show bonding config 2 -Primary is now P1. There are 2 active slaves. +Primary is now P1. There are 2 active children. .. code-block:: console @@ -163,10 +163,10 @@ VF traffic is seen at P1 and P2. testpmd> clear port stats all testpmd> set bonding primary 0 2 - testpmd> remove bonding slave 1 2 + testpmd> remove bonding child 1 2 testpmd> show bonding config 2 -Primary is now P0. There is 1 active slave. +Primary is now P0. There is 1 active child. .. code-block:: console @@ -210,7 +210,7 @@ On host_server_1: Terminal 1 testpmd> show bonding config 2 -Primary is now P0. There is 1 active slave. +Primary is now P0. There is 1 active child. .. code-block:: console @@ -346,7 +346,7 @@ The ``mac_addr`` command only works with the Kernel PF for Niantic. testpmd> show port stats all. testpmd> show config fwd testpmd> show bonding config 2 - testpmd> add bonding slave 1 2 + testpmd> add bonding child 1 2 testpmd> set bonding primary 1 2 testpmd> show bonding config 2 testpmd> show port stats all @@ -355,7 +355,7 @@ VF traffic is seen at P1 (VF) and P2 (Bonded device). .. code-block:: console - testpmd> remove bonding slave 0 2 + testpmd> remove bonding child 0 2 testpmd> show bonding config 2 testpmd> port stop 0 testpmd> port close 0 diff --git a/doc/guides/nics/bnxt.rst b/doc/guides/nics/bnxt.rst index 0b09b0c50a7b..dd91264cd8a2 100644 --- a/doc/guides/nics/bnxt.rst +++ b/doc/guides/nics/bnxt.rst @@ -781,8 +781,8 @@ DPDK implements a light-weight library to allow PMDs to be bonded together and p .. code-block:: console -   dpdk-testpmd -l 0-3 -n4 --vdev 'net_bonding0,mode=0,slave=,slave=,mac=XX:XX:XX:XX:XX:XX’ – --socket_num=1 – -i --port-topology=chained - (ex) dpdk-testpmd -l 1,3,5,7,9 -n4 --vdev 'net_bonding0,mode=0,slave=0000:82:00.0,slave=0000:82:00.1,mac=00:1e:67:1d:fd:1d' – --socket-num=1 – -i --port-topology=chained +   dpdk-testpmd -l 0-3 -n4 --vdev 'net_bonding0,mode=0,child=,child=,mac=XX:XX:XX:XX:XX:XX’ – --socket_num=1 – -i --port-topology=chained + (ex) dpdk-testpmd -l 1,3,5,7,9 -n4 --vdev 'net_bonding0,mode=0,child=0000:82:00.0,child=0000:82:00.1,mac=00:1e:67:1d:fd:1d' – --socket-num=1 – -i --port-topology=chained Vector Processing ----------------- diff --git a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst index 1f66154e356d..f07bb281a727 100644 --- a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +++ b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst @@ -16,14 +16,14 @@ allows physical PMDs to be bonded together to create a single logical PMD. The Link Bonding PMD library(librte_net_bond) supports bonding of groups of ``rte_eth_dev`` ports of the same speed and duplex to provide similar capabilities to that found in Linux bonding driver to allow the aggregation -of multiple (slave) NICs into a single logical interface between a server +of multiple (child) NICs into a single logical interface between a server and a switch. The new bonded PMD will then process these interfaces based on the mode of operation specified to provide support for features such as redundant links, fault tolerance and/or load balancing. The librte_net_bond library exports a C API which provides an API for the creation of bonded devices as well as the configuration and management of the -bonded device and its slave devices. +bonded device and its child devices. .. note:: @@ -45,7 +45,7 @@ Currently the Link Bonding PMD library supports following modes of operation: This mode provides load balancing and fault tolerance by transmission of - packets in sequential order from the first available slave device through + packets in sequential order from the first available child device through the last. Packets are bulk dequeued from devices then serviced in a round-robin manner. This mode does not guarantee in order reception of packets and down stream should be able to handle out of order packets. @@ -57,9 +57,9 @@ Currently the Link Bonding PMD library supports following modes of operation: Active Backup (Mode 1) - In this mode only one slave in the bond is active at any time, a different - slave becomes active if, and only if, the primary active slave fails, - thereby providing fault tolerance to slave failure. The single logical + In this mode only one child in the bond is active at any time, a different + child becomes active if, and only if, the primary active child fails, + thereby providing fault tolerance to child failure. The single logical bonded interface's MAC address is externally visible on only one NIC (port) to avoid confusing the network switch. @@ -73,10 +73,10 @@ Currently the Link Bonding PMD library supports following modes of operation: This mode provides transmit load balancing (based on the selected transmission policy) and fault tolerance. The default policy (layer2) uses a simple calculation based on the packet flow source and destination MAC - addresses as well as the number of active slaves available to the bonded - device to classify the packet to a specific slave to transmit on. Alternate + addresses as well as the number of active children available to the bonded + device to classify the packet to a specific child to transmit on. Alternate transmission policies supported are layer 2+3, this takes the IP source and - destination addresses into the calculation of the transmit slave port and + destination addresses into the calculation of the transmit child port and the final supported policy is layer 3+4, this uses IP source and destination addresses as well as the TCP/UDP source and destination port. @@ -92,7 +92,7 @@ Currently the Link Bonding PMD library supports following modes of operation: Broadcast (Mode 3) - This mode provides fault tolerance by transmission of packets on all slave + This mode provides fault tolerance by transmission of packets on all child ports. * **Link Aggregation 802.3AD (Mode 4):** @@ -114,7 +114,7 @@ Currently the Link Bonding PMD library supports following modes of operation: intervals period of less than 100ms. #. Calls to ``rte_eth_tx_burst`` must have a buffer size of at least 2xN, - where N is the number of slaves. This is a space required for LACP + where N is the number of children. This is a space required for LACP frames. Additionally LACP packets are included in the statistics, but they are not returned to the application. @@ -126,7 +126,7 @@ Currently the Link Bonding PMD library supports following modes of operation: This mode provides an adaptive transmit load balancing. It dynamically - changes the transmitting slave, according to the computed load. Statistics + changes the transmitting child, according to the computed load. Statistics are collected in 100ms intervals and scheduled every 10ms. @@ -140,74 +140,74 @@ The Link Bonding Library supports the creation of bonded devices at application startup time during EAL initialization using the ``--vdev`` option as well as programmatically via the C API ``rte_eth_bond_create`` function. -Bonded devices support the dynamical addition and removal of slave devices using -the ``rte_eth_bond_slave_add`` / ``rte_eth_bond_slave_remove`` APIs. +Bonded devices support the dynamical addition and removal of child devices using +the ``rte_eth_bond_child_add`` / ``rte_eth_bond_child_remove`` APIs. -After a slave device is added to a bonded device slave is stopped using +After a child device is added to a bonded device child is stopped using ``rte_eth_dev_stop`` and then reconfigured using ``rte_eth_dev_configure`` the RX and TX queues are also reconfigured using ``rte_eth_tx_queue_setup`` / ``rte_eth_rx_queue_setup`` with the parameters use to configure the bonding device. If RSS is enabled for bonding device, this mode is also enabled on new -slave and configured as well. +child and configured as well. Any flow which was configured to the bond device also is configured to the added -slave. +child. Setting up multi-queue mode for bonding device to RSS, makes it fully -RSS-capable, so all slaves are synchronized with its configuration. This mode is -intended to provide RSS configuration on slaves transparent for client +RSS-capable, so all children are synchronized with its configuration. This mode is +intended to provide RSS configuration on children transparent for client application implementation. Bonding device stores its own version of RSS settings i.e. RETA, RSS hash -function and RSS key, used to set up its slaves. That let to define the meaning +function and RSS key, used to set up its children. That let to define the meaning of RSS configuration of bonding device as desired configuration of whole bonding -(as one unit), without pointing any of slave inside. It is required to ensure +(as one unit), without pointing any of child inside. It is required to ensure consistency and made it more error-proof. RSS hash function set for bonding device, is a maximal set of RSS hash functions -supported by all bonded slaves. RETA size is a GCD of all its RETA's sizes, so -it can be easily used as a pattern providing expected behavior, even if slave +supported by all bonded children. RETA size is a GCD of all its RETA's sizes, so +it can be easily used as a pattern providing expected behavior, even if child RETAs' sizes are different. If RSS Key is not set for bonded device, it's not -changed on the slaves and default key for device is used. +changed on the children and default key for device is used. -As RSS configurations, there is flow consistency in the bonded slaves for the +As RSS configurations, there is flow consistency in the bonded children for the next rte flow operations: Validate: - - Validate flow for each slave, failure at least for one slave causes to + - Validate flow for each child, failure at least for one child causes to bond validation failure. Create: - - Create the flow in all slaves. - - Save all the slaves created flows objects in bonding internal flow + - Create the flow in all children. + - Save all the children created flows objects in bonding internal flow structure. - - Failure in flow creation for existed slave rejects the flow. - - Failure in flow creation for new slaves in slave adding time rejects - the slave. + - Failure in flow creation for existed child rejects the flow. + - Failure in flow creation for new children in child adding time rejects + the child. Destroy: - - Destroy the flow in all slaves and release the bond internal flow + - Destroy the flow in all children and release the bond internal flow memory. Flush: - - Destroy all the bonding PMD flows in all the slaves. + - Destroy all the bonding PMD flows in all the children. .. note:: - Don't call slaves flush directly, It destroys all the slave flows which + Don't call children flush directly, It destroys all the child flows which may include external flows or the bond internal LACP flow. Query: - - Summarize flow counters from all the slaves, relevant only for + - Summarize flow counters from all the children, relevant only for ``RTE_FLOW_ACTION_TYPE_COUNT``. Isolate: - - Call to flow isolate for all slaves. - - Failure in flow isolation for existed slave rejects the isolate mode. - - Failure in flow isolation for new slaves in slave adding time rejects - the slave. + - Call to flow isolate for all children. + - Failure in flow isolation for existed child rejects the isolate mode. + - Failure in flow isolation for new children in child adding time rejects + the child. All settings are managed through the bonding port API and always are propagated -in one direction (from bonding to slaves). +in one direction (from bonding to children). Link Status Change Interrupts / Polling ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -215,16 +215,16 @@ Link Status Change Interrupts / Polling Link bonding devices support the registration of a link status change callback, using the ``rte_eth_dev_callback_register`` API, this will be called when the status of the bonding device changes. For example in the case of a bonding -device which has 3 slaves, the link status will change to up when one slave -becomes active or change to down when all slaves become inactive. There is no -callback notification when a single slave changes state and the previous -conditions are not met. If a user wishes to monitor individual slaves then they -must register callbacks with that slave directly. +device which has 3 children, the link status will change to up when one child +becomes active or change to down when all children become inactive. There is no +callback notification when a single child changes state and the previous +conditions are not met. If a user wishes to monitor individual children then they +must register callbacks with that child directly. The link bonding library also supports devices which do not implement link status change interrupts, this is achieved by polling the devices link status at a defined period which is set using the ``rte_eth_bond_link_monitoring_set`` -API, the default polling interval is 10ms. When a device is added as a slave to +API, the default polling interval is 10ms. When a device is added as a child to a bonding device it is determined using the ``RTE_PCI_DRV_INTR_LSC`` flag whether the device supports interrupts or whether the link status should be monitored by polling it. @@ -233,30 +233,30 @@ Requirements / Limitations ~~~~~~~~~~~~~~~~~~~~~~~~~~ The current implementation only supports devices that support the same speed -and duplex to be added as a slaves to the same bonded device. The bonded device -inherits these attributes from the first active slave added to the bonded -device and then all further slaves added to the bonded device must support +and duplex to be added as a children to the same bonded device. The bonded device +inherits these attributes from the first active child added to the bonded +device and then all further children added to the bonded device must support these parameters. -A bonding device must have a minimum of one slave before the bonding device +A bonding device must have a minimum of one child before the bonding device itself can be started. To use a bonding device dynamic RSS configuration feature effectively, it is -also required, that all slaves should be RSS-capable and support, at least one +also required, that all children should be RSS-capable and support, at least one common hash function available for each of them. Changing RSS key is only -possible, when all slave devices support the same key size. +possible, when all child devices support the same key size. -To prevent inconsistency on how slaves process packets, once a device is added +To prevent inconsistency on how children process packets, once a device is added to a bonding device, RSS and rte flow configurations should be managed through -the bonding device API, and not directly on the slave. +the bonding device API, and not directly on the child. Like all other PMD, all functions exported by a PMD are lock-free functions that are assumed not to be invoked in parallel on different logical cores to work on the same target object. It should also be noted that the PMD receive function should not be invoked -directly on a slave devices after they have been to a bonded device since -packets read directly from the slave device will no longer be available to the +directly on a child devices after they have been to a bonded device since +packets read directly from the child device will no longer be available to the bonded device to read. Configuration @@ -265,25 +265,25 @@ Configuration Link bonding devices are created using the ``rte_eth_bond_create`` API which requires a unique device name, the bonding mode, and the socket Id to allocate the bonding device's resources on. -The other configurable parameters for a bonded device are its slave devices, -its primary slave, a user defined MAC address and transmission policy to use if +The other configurable parameters for a bonded device are its child devices, +its primary child, a user defined MAC address and transmission policy to use if the device is in balance XOR mode. -Slave Devices +Child Devices ^^^^^^^^^^^^^ -Bonding devices support up to a maximum of ``RTE_MAX_ETHPORTS`` slave devices -of the same speed and duplex. Ethernet devices can be added as a slave to a -maximum of one bonded device. Slave devices are reconfigured with the +Bonding devices support up to a maximum of ``RTE_MAX_ETHPORTS`` child devices +of the same speed and duplex. Ethernet devices can be added as a child to a +maximum of one bonded device. Child devices are reconfigured with the configuration of the bonded device on being added to a bonded device. -The bonded also guarantees to return the MAC address of the slave device to its -original value of removal of a slave from it. +The bonded also guarantees to return the MAC address of the child device to its +original value of removal of a child from it. -Primary Slave +Primary Child ^^^^^^^^^^^^^ -The primary slave is used to define the default port to use when a bonded +The primary child is used to define the default port to use when a bonded device is in active backup mode. A different port will only be used if, and only if, the current primary port goes down. If the user does not specify a primary port it will default to being the first port added to the bonded device. @@ -292,14 +292,14 @@ MAC Address ^^^^^^^^^^^ The bonded device can be configured with a user specified MAC address, this -address will be inherited by the some/all slave devices depending on the +address will be inherited by the some/all child devices depending on the operating mode. If the device is in active backup mode then only the primary -device will have the user specified MAC, all other slaves will retain their -original MAC address. In mode 0, 2, 3, 4 all slaves devices are configure with +device will have the user specified MAC, all other children will retain their +original MAC address. In mode 0, 2, 3, 4 all children devices are configure with the bonded devices MAC address. If a user defined MAC address is not defined then the bonded device will -default to using the primary slaves MAC address. +default to using the primary children MAC address. Balance XOR Transmit Policies ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -310,17 +310,17 @@ Balance XOR mode. Layer 2, Layer 2+3, Layer 3+4. * **Layer 2:** Ethernet MAC address based balancing is the default transmission policy for Balance XOR bonding mode. It uses a simple XOR calculation on the source MAC address and destination MAC address of the - packet and then calculate the modulus of this value to calculate the slave + packet and then calculate the modulus of this value to calculate the child device to transmit the packet on. * **Layer 2 + 3:** Ethernet MAC address & IP Address based balancing uses a combination of source/destination MAC addresses and the source/destination - IP addresses of the data packet to decide which slave port the packet will + IP addresses of the data packet to decide which child port the packet will be transmitted on. * **Layer 3 + 4:** IP Address & UDP Port based balancing uses a combination of source/destination IP Address and the source/destination UDP ports of - the packet of the data packet to decide which slave port the packet will be + the packet of the data packet to decide which child port the packet will be transmitted on. All these policies support 802.1Q VLAN Ethernet packets, as well as IPv4, IPv6 @@ -350,13 +350,13 @@ device configure API ``rte_eth_dev_configure`` and then the RX and TX queues which will be used must be setup using ``rte_eth_tx_queue_setup`` / ``rte_eth_rx_queue_setup``. -Slave devices can be dynamically added and removed from a link bonding device -using the ``rte_eth_bond_slave_add`` / ``rte_eth_bond_slave_remove`` -APIs but at least one slave device must be added to the link bonding device +Child devices can be dynamically added and removed from a link bonding device +using the ``rte_eth_bond_child_add`` / ``rte_eth_bond_child_remove`` +APIs but at least one child device must be added to the link bonding device before it can be started using ``rte_eth_dev_start``. -The link status of a bonded device is dictated by that of its slaves, if all -slave device link status are down or if all slaves are removed from the link +The link status of a bonded device is dictated by that of its children, if all +child device link status are down or if all children are removed from the link bonding device then the link status of the bonding device will go down. It is also possible to configure / query the configuration of the control @@ -390,7 +390,7 @@ long as the following two rules are respected: where X can be any combination of numbers and/or letters, and the name is no greater than 32 characters long. -* A least one slave device is provided with for each bonded device definition. +* A least one child device is provided with for each bonded device definition. * The operation mode of the bonded device being created is provided. @@ -404,20 +404,20 @@ The different options are: mode=2 -* slave: Defines the PMD device which will be added as slave to the bonded +* child: Defines the PMD device which will be added as child to the bonded device. This option can be selected multiple times, for each device to be - added as a slave. Physical devices should be specified using their PCI + added as a child. Physical devices should be specified using their PCI address, in the format domain:bus:devid.function .. code-block:: console - slave=0000:0a:00.0,slave=0000:0a:00.1 + child=0000:0a:00.0,child=0000:0a:00.1 -* primary: Optional parameter which defines the primary slave port, - is used in active backup mode to select the primary slave for data TX/RX if +* primary: Optional parameter which defines the primary child port, + is used in active backup mode to select the primary child for data TX/RX if it is available. The primary port also is used to select the MAC address to - use when it is not defined by the user. This defaults to the first slave - added to the device if it is specified. The primary device must be a slave + use when it is not defined by the user. This defaults to the first child + added to the device if it is specified. The primary device must be a child of the bonded device. .. code-block:: console @@ -432,7 +432,7 @@ The different options are: socket_id=0 * mac: Optional parameter to select a MAC address for link bonding device, - this overrides the value of the primary slave device. + this overrides the value of the primary child device. .. code-block:: console @@ -474,29 +474,29 @@ The different options are: Examples of Usage ^^^^^^^^^^^^^^^^^ -Create a bonded device in round robin mode with two slaves specified by their PCI address: +Create a bonded device in round robin mode with two children specified by their PCI address: .. code-block:: console - .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=0,slave=0000:0a:00.01,slave=0000:04:00.00' -- --port-topology=chained + .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=0,child=0000:0a:00.01,child=0000:04:00.00' -- --port-topology=chained -Create a bonded device in round robin mode with two slaves specified by their PCI address and an overriding MAC address: +Create a bonded device in round robin mode with two children specified by their PCI address and an overriding MAC address: .. code-block:: console - .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=0,slave=0000:0a:00.01,slave=0000:04:00.00,mac=00:1e:67:1d:fd:1d' -- --port-topology=chained + .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=0,child=0000:0a:00.01,child=0000:04:00.00,mac=00:1e:67:1d:fd:1d' -- --port-topology=chained -Create a bonded device in active backup mode with two slaves specified, and a primary slave specified by their PCI addresses: +Create a bonded device in active backup mode with two children specified, and a primary child specified by their PCI addresses: .. code-block:: console - .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=1,slave=0000:0a:00.01,slave=0000:04:00.00,primary=0000:0a:00.01' -- --port-topology=chained + .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=1,child=0000:0a:00.01,child=0000:04:00.00,primary=0000:0a:00.01' -- --port-topology=chained -Create a bonded device in balance mode with two slaves specified by their PCI addresses, and a transmission policy of layer 3 + 4 forwarding: +Create a bonded device in balance mode with two children specified by their PCI addresses, and a transmission policy of layer 3 + 4 forwarding: .. code-block:: console - .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=2,slave=0000:0a:00.01,slave=0000:04:00.00,xmit_policy=l34' -- --port-topology=chained + .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode=2,child=0000:0a:00.01,child=0000:04:00.00,xmit_policy=l34' -- --port-topology=chained .. _bonding_testpmd_commands: @@ -517,28 +517,28 @@ For example, to create a bonded device in mode 1 on socket 0:: testpmd> create bonded device 1 0 created new bonded device (port X) -add bonding slave +add bonding child ~~~~~~~~~~~~~~~~~ Adds Ethernet device to a Link Bonding device:: - testpmd> add bonding slave (slave id) (port id) + testpmd> add bonding child (child id) (port id) For example, to add Ethernet device (port 6) to a Link Bonding device (port 10):: - testpmd> add bonding slave 6 10 + testpmd> add bonding child 6 10 -remove bonding slave +remove bonding child ~~~~~~~~~~~~~~~~~~~~ -Removes an Ethernet slave device from a Link Bonding device:: +Removes an Ethernet child device from a Link Bonding device:: - testpmd> remove bonding slave (slave id) (port id) + testpmd> remove bonding child (child id) (port id) -For example, to remove Ethernet slave device (port 6) to a Link Bonding device (port 10):: +For example, to remove Ethernet child device (port 6) to a Link Bonding device (port 10):: - testpmd> remove bonding slave 6 10 + testpmd> remove bonding child 6 10 set bonding mode ~~~~~~~~~~~~~~~~ @@ -554,11 +554,11 @@ For example, to set the bonding mode of a Link Bonding device (port 10) to broad set bonding primary ~~~~~~~~~~~~~~~~~~~ -Set an Ethernet slave device as the primary device on a Link Bonding device:: +Set an Ethernet child device as the primary device on a Link Bonding device:: - testpmd> set bonding primary (slave id) (port id) + testpmd> set bonding primary (child id) (port id) -For example, to set the Ethernet slave device (port 6) as the primary port of a Link Bonding device (port 10):: +For example, to set the Ethernet child device (port 6) as the primary port of a Link Bonding device (port 10):: testpmd> set bonding primary 6 10 @@ -590,7 +590,7 @@ set bonding mon_period Set the link status monitoring polling period in milliseconds for a bonding device. -This adds support for PMD slave devices which do not support link status interrupts. +This adds support for PMD child devices which do not support link status interrupts. When the mon_period is set to a value greater than 0 then all PMD's which do not support link status ISR will be queried every polling interval to check if their link status has changed:: @@ -604,7 +604,7 @@ For example, to set the link status monitoring polling period of bonded device ( set bonding lacp dedicated_queue ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Enable dedicated tx/rx queues on bonding devices slaves to handle LACP control plane traffic +Enable dedicated tx/rx queues on bonding devices children to handle LACP control plane traffic when in mode 4 (link-aggregation-802.3ad):: testpmd> set bonding lacp dedicated_queues (port_id) (enable|disable) @@ -627,13 +627,13 @@ it also shows link-aggregation-802.3ad information if the link mode is mode 4:: testpmd> show bonding config (port id) For example, -to show the configuration a Link Bonding device (port 9) with 3 slave devices (1, 3, 4) +to show the configuration a Link Bonding device (port 9) with 3 child devices (1, 3, 4) in balance mode with a transmission policy of layer 2+3:: testpmd> show bonding config 9 - Dev basic: Bonding mode: BALANCE(2) Balance Xmit Policy: BALANCE_XMIT_POLICY_LAYER23 - Slaves (3): [1 3 4] - Active Slaves (3): [1 3 4] + Children (3): [1 3 4] + Active Children (3): [1 3 4] Primary: [3] diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 8f2384785930..3e3fb772fd62 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -1901,11 +1901,11 @@ In this case, identifier is ``net_pcap0``. This identifier format is the same as ``--vdev`` format of DPDK applications. For example, to re-attach a bonded port which has been previously detached, -the mode and slave parameters must be given. +the mode and child parameters must be given. .. code-block:: console - testpmd> port attach net_bond_0,mode=0,slave=1 + testpmd> port attach net_bond_0,mode=0,child=1 Attaching a new port... EAL: Initializing pmd_bond for net_bond_0 EAL: Create bonded device net_bond_0 on port 0 in mode 0 on socket 0. diff --git a/drivers/net/bonding/bonding_testpmd.c b/drivers/net/bonding/bonding_testpmd.c index b3c12cada078..c93a2d94883f 100644 --- a/drivers/net/bonding/bonding_testpmd.c +++ b/drivers/net/bonding/bonding_testpmd.c @@ -279,7 +279,7 @@ struct cmd_set_bonding_primary_result { cmdline_fixed_string_t set; cmdline_fixed_string_t bonding; cmdline_fixed_string_t primary; - portid_t slave_id; + portid_t child_id; portid_t port_id; }; @@ -287,13 +287,13 @@ static void cmd_set_bonding_primary_parsed(void *parsed_result, __rte_unused struct cmdline *cl, __rte_unused void *data) { struct cmd_set_bonding_primary_result *res = parsed_result; - portid_t master_port_id = res->port_id; - portid_t slave_port_id = res->slave_id; + portid_t parent_port_id = res->port_id; + portid_t child_port_id = res->child_id; - /* Set the primary slave for a bonded device. */ - if (rte_eth_bond_primary_set(master_port_id, slave_port_id) != 0) { - fprintf(stderr, "\t Failed to set primary slave for port = %d.\n", - master_port_id); + /* Set the primary child for a bonded device. */ + if (rte_eth_bond_primary_set(parent_port_id, child_port_id) != 0) { + fprintf(stderr, "\t Failed to set primary child for port = %d.\n", + parent_port_id); return; } init_port_config(); @@ -308,141 +308,141 @@ static cmdline_parse_token_string_t cmd_setbonding_primary_bonding = static cmdline_parse_token_string_t cmd_setbonding_primary_primary = TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_primary_result, primary, "primary"); -static cmdline_parse_token_num_t cmd_setbonding_primary_slave = +static cmdline_parse_token_num_t cmd_setbonding_primary_child = TOKEN_NUM_INITIALIZER(struct cmd_set_bonding_primary_result, - slave_id, RTE_UINT16); + child_id, RTE_UINT16); static cmdline_parse_token_num_t cmd_setbonding_primary_port = TOKEN_NUM_INITIALIZER(struct cmd_set_bonding_primary_result, port_id, RTE_UINT16); static cmdline_parse_inst_t cmd_set_bonding_primary = { .f = cmd_set_bonding_primary_parsed, - .help_str = "set bonding primary : " - "Set the primary slave for port_id", + .help_str = "set bonding primary : " + "Set the primary child for port_id", .data = NULL, .tokens = { (void *)&cmd_setbonding_primary_set, (void *)&cmd_setbonding_primary_bonding, (void *)&cmd_setbonding_primary_primary, - (void *)&cmd_setbonding_primary_slave, + (void *)&cmd_setbonding_primary_child, (void *)&cmd_setbonding_primary_port, NULL } }; -/* *** ADD SLAVE *** */ -struct cmd_add_bonding_slave_result { +/* *** ADD CHILD *** */ +struct cmd_add_bonding_child_result { cmdline_fixed_string_t add; cmdline_fixed_string_t bonding; - cmdline_fixed_string_t slave; - portid_t slave_id; + cmdline_fixed_string_t child; + portid_t child_id; portid_t port_id; }; -static void cmd_add_bonding_slave_parsed(void *parsed_result, +static void cmd_add_bonding_child_parsed(void *parsed_result, __rte_unused struct cmdline *cl, __rte_unused void *data) { - struct cmd_add_bonding_slave_result *res = parsed_result; - portid_t master_port_id = res->port_id; - portid_t slave_port_id = res->slave_id; + struct cmd_add_bonding_child_result *res = parsed_result; + portid_t parent_port_id = res->port_id; + portid_t child_port_id = res->child_id; - /* add the slave for a bonded device. */ - if (rte_eth_bond_slave_add(master_port_id, slave_port_id) != 0) { + /* add the child for a bonded device. */ + if (rte_eth_bond_child_add(parent_port_id, child_port_id) != 0) { fprintf(stderr, - "\t Failed to add slave %d to master port = %d.\n", - slave_port_id, master_port_id); + "\t Failed to add child %d to parent port = %d.\n", + child_port_id, parent_port_id); return; } - ports[master_port_id].update_conf = 1; + ports[parent_port_id].update_conf = 1; init_port_config(); - set_port_slave_flag(slave_port_id); + set_port_child_flag(child_port_id); } -static cmdline_parse_token_string_t cmd_addbonding_slave_add = - TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_slave_result, +static cmdline_parse_token_string_t cmd_addbonding_child_add = + TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_child_result, add, "add"); -static cmdline_parse_token_string_t cmd_addbonding_slave_bonding = - TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_slave_result, +static cmdline_parse_token_string_t cmd_addbonding_child_bonding = + TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_child_result, bonding, "bonding"); -static cmdline_parse_token_string_t cmd_addbonding_slave_slave = - TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_slave_result, - slave, "slave"); -static cmdline_parse_token_num_t cmd_addbonding_slave_slaveid = - TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_slave_result, - slave_id, RTE_UINT16); -static cmdline_parse_token_num_t cmd_addbonding_slave_port = - TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_slave_result, +static cmdline_parse_token_string_t cmd_addbonding_child_child = + TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_child_result, + child, "child"); +static cmdline_parse_token_num_t cmd_addbonding_child_childid = + TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_child_result, + child_id, RTE_UINT16); +static cmdline_parse_token_num_t cmd_addbonding_child_port = + TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_child_result, port_id, RTE_UINT16); -static cmdline_parse_inst_t cmd_add_bonding_slave = { - .f = cmd_add_bonding_slave_parsed, - .help_str = "add bonding slave : " - "Add a slave device to a bonded device", +static cmdline_parse_inst_t cmd_add_bonding_child = { + .f = cmd_add_bonding_child_parsed, + .help_str = "add bonding child : " + "Add a child device to a bonded device", .data = NULL, .tokens = { - (void *)&cmd_addbonding_slave_add, - (void *)&cmd_addbonding_slave_bonding, - (void *)&cmd_addbonding_slave_slave, - (void *)&cmd_addbonding_slave_slaveid, - (void *)&cmd_addbonding_slave_port, + (void *)&cmd_addbonding_child_add, + (void *)&cmd_addbonding_child_bonding, + (void *)&cmd_addbonding_child_child, + (void *)&cmd_addbonding_child_childid, + (void *)&cmd_addbonding_child_port, NULL } }; -/* *** REMOVE SLAVE *** */ -struct cmd_remove_bonding_slave_result { +/* *** REMOVE CHILD *** */ +struct cmd_remove_bonding_child_result { cmdline_fixed_string_t remove; cmdline_fixed_string_t bonding; - cmdline_fixed_string_t slave; - portid_t slave_id; + cmdline_fixed_string_t child; + portid_t child_id; portid_t port_id; }; -static void cmd_remove_bonding_slave_parsed(void *parsed_result, +static void cmd_remove_bonding_child_parsed(void *parsed_result, __rte_unused struct cmdline *cl, __rte_unused void *data) { - struct cmd_remove_bonding_slave_result *res = parsed_result; - portid_t master_port_id = res->port_id; - portid_t slave_port_id = res->slave_id; + struct cmd_remove_bonding_child_result *res = parsed_result; + portid_t parent_port_id = res->port_id; + portid_t child_port_id = res->child_id; - /* remove the slave from a bonded device. */ - if (rte_eth_bond_slave_remove(master_port_id, slave_port_id) != 0) { + /* remove the child from a bonded device. */ + if (rte_eth_bond_child_remove(parent_port_id, child_port_id) != 0) { fprintf(stderr, - "\t Failed to remove slave %d from master port = %d.\n", - slave_port_id, master_port_id); + "\t Failed to remove child %d from parent port = %d.\n", + child_port_id, parent_port_id); return; } init_port_config(); - clear_port_slave_flag(slave_port_id); + clear_port_child_flag(child_port_id); } -static cmdline_parse_token_string_t cmd_removebonding_slave_remove = - TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_slave_result, +static cmdline_parse_token_string_t cmd_removebonding_child_remove = + TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_child_result, remove, "remove"); -static cmdline_parse_token_string_t cmd_removebonding_slave_bonding = - TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_slave_result, +static cmdline_parse_token_string_t cmd_removebonding_child_bonding = + TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_child_result, bonding, "bonding"); -static cmdline_parse_token_string_t cmd_removebonding_slave_slave = - TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_slave_result, - slave, "slave"); -static cmdline_parse_token_num_t cmd_removebonding_slave_slaveid = - TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_slave_result, - slave_id, RTE_UINT16); -static cmdline_parse_token_num_t cmd_removebonding_slave_port = - TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_slave_result, +static cmdline_parse_token_string_t cmd_removebonding_child_child = + TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_child_result, + child, "child"); +static cmdline_parse_token_num_t cmd_removebonding_child_childid = + TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_child_result, + child_id, RTE_UINT16); +static cmdline_parse_token_num_t cmd_removebonding_child_port = + TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_child_result, port_id, RTE_UINT16); -static cmdline_parse_inst_t cmd_remove_bonding_slave = { - .f = cmd_remove_bonding_slave_parsed, - .help_str = "remove bonding slave : " - "Remove a slave device from a bonded device", +static cmdline_parse_inst_t cmd_remove_bonding_child = { + .f = cmd_remove_bonding_child_parsed, + .help_str = "remove bonding child : " + "Remove a child device from a bonded device", .data = NULL, .tokens = { - (void *)&cmd_removebonding_slave_remove, - (void *)&cmd_removebonding_slave_bonding, - (void *)&cmd_removebonding_slave_slave, - (void *)&cmd_removebonding_slave_slaveid, - (void *)&cmd_removebonding_slave_port, + (void *)&cmd_removebonding_child_remove, + (void *)&cmd_removebonding_child_bonding, + (void *)&cmd_removebonding_child_child, + (void *)&cmd_removebonding_child_childid, + (void *)&cmd_removebonding_child_port, NULL } }; @@ -706,18 +706,18 @@ static struct testpmd_driver_commands bonding_cmds = { }, { &cmd_set_bonding_primary, - "set bonding primary (slave_id) (port_id)\n" - " Set the primary slave for a bonded device.\n", + "set bonding primary (child_id) (port_id)\n" + " Set the primary child for a bonded device.\n", }, { - &cmd_add_bonding_slave, - "add bonding slave (slave_id) (port_id)\n" - " Add a slave device to a bonded device.\n", + &cmd_add_bonding_child, + "add bonding child (child_id) (port_id)\n" + " Add a child device to a bonded device.\n", }, { - &cmd_remove_bonding_slave, - "remove bonding slave (slave_id) (port_id)\n" - " Remove a slave device from a bonded device.\n", + &cmd_remove_bonding_child, + "remove bonding child (child_id) (port_id)\n" + " Remove a child device from a bonded device.\n", }, { &cmd_create_bonded_device, diff --git a/drivers/net/bonding/eth_bond_8023ad_private.h b/drivers/net/bonding/eth_bond_8023ad_private.h index a5e1fffea1d2..0e5ae90c2bbf 100644 --- a/drivers/net/bonding/eth_bond_8023ad_private.h +++ b/drivers/net/bonding/eth_bond_8023ad_private.h @@ -15,10 +15,10 @@ #include "rte_eth_bond_8023ad.h" #define BOND_MODE_8023AX_UPDATE_TIMEOUT_MS 100 -/** Maximum number of packets to one slave queued in TX ring. */ -#define BOND_MODE_8023AX_SLAVE_RX_PKTS 3 -/** Maximum number of LACP packets from one slave queued in TX ring. */ -#define BOND_MODE_8023AX_SLAVE_TX_PKTS 1 +/** Maximum number of packets to one child queued in TX ring. */ +#define BOND_MODE_8023AX_CHILD_RX_PKTS 3 +/** Maximum number of LACP packets from one child queued in TX ring. */ +#define BOND_MODE_8023AX_CHILD_TX_PKTS 1 /** * Timeouts definitions (5.4.4 in 802.1AX documentation). */ @@ -113,7 +113,7 @@ struct port { enum rte_bond_8023ad_selection selected; /** Indicates if either allmulti or promisc has been enforced on the - * slave so that we can receive lacp packets + * child so that we can receive lacp packets */ #define BOND_8023AD_FORCED_ALLMULTI (1 << 0) #define BOND_8023AD_FORCED_PROMISC (1 << 1) @@ -162,8 +162,8 @@ struct mode8023ad_private { uint8_t external_sm; struct rte_ether_addr mac_addr; - struct rte_eth_link slave_link; - /***< slave link properties */ + struct rte_eth_link child_link; + /***< child link properties */ /** * Configuration of dedicated hardware queues for control plane @@ -208,7 +208,7 @@ bond_mode_8023ad_setup(struct rte_eth_dev *dev, /** * @internal * - * Enables 802.1AX mode and all active slaves on bonded interface. + * Enables 802.1AX mode and all active children on bonded interface. * * @param dev Bonded interface * @return @@ -220,7 +220,7 @@ bond_mode_8023ad_enable(struct rte_eth_dev *dev); /** * @internal * - * Disables 802.1AX mode of the bonded interface and slaves. + * Disables 802.1AX mode of the bonded interface and children. * * @param dev Bonded interface * @return @@ -256,43 +256,43 @@ bond_mode_8023ad_stop(struct rte_eth_dev *dev); * * Passes given slow packet to state machines management logic. * @param internals Bonded device private data. - * @param slave_id Slave port id. + * @param child_id Child port id. * @param slot_pkt Slow packet. */ void bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, - uint16_t slave_id, struct rte_mbuf *pkt); + uint16_t child_id, struct rte_mbuf *pkt); /** * @internal * - * Appends given slave used slave + * Appends given child device * * @param dev Bonded interface. - * @param port_id Slave port ID to be added + * @param port_id Child port ID to be added * * @return * 0 on success, negative value otherwise. */ void -bond_mode_8023ad_activate_slave(struct rte_eth_dev *dev, uint16_t port_id); +bond_mode_8023ad_activate_child(struct rte_eth_dev *dev, uint16_t port_id); /** * @internal * - * Denitializes and removes given slave from 802.1AX mode. + * Denitializes and removes given child from 802.1AX mode. * * @param dev Bonded interface. - * @param slave_num Position of slave in active_slaves array + * @param child_num Position of child in active_children array * * @return * 0 on success, negative value otherwise. */ int -bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *dev, uint16_t slave_pos); +bond_mode_8023ad_deactivate_child(struct rte_eth_dev *dev, uint16_t child_pos); /** - * Updates state when MAC was changed on bonded device or one of its slaves. + * Updates state when MAC was changed on bonded device or one of its children. * @param bond_dev Bonded device */ void @@ -300,10 +300,10 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev); int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint16_t slave_port); + uint16_t child_port); int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port); +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t child_port); int bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id); diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h index d4f1fb27d4b3..d6cbf4293a45 100644 --- a/drivers/net/bonding/eth_bond_private.h +++ b/drivers/net/bonding/eth_bond_private.h @@ -18,13 +18,13 @@ #include "eth_bond_8023ad_private.h" #include "rte_eth_bond_alb.h" -#define PMD_BOND_SLAVE_PORT_KVARG ("slave") -#define PMD_BOND_PRIMARY_SLAVE_KVARG ("primary") -#define PMD_BOND_MODE_KVARG ("mode") -#define PMD_BOND_AGG_MODE_KVARG ("agg_mode") -#define PMD_BOND_XMIT_POLICY_KVARG ("xmit_policy") -#define PMD_BOND_SOCKET_ID_KVARG ("socket_id") -#define PMD_BOND_MAC_ADDR_KVARG ("mac") +#define PMD_BOND_CHILD_PORT_KVARG ("child") +#define PMD_BOND_PRIMARY_CHILD_KVARG ("primary") +#define PMD_BOND_MODE_KVARG ("mode") +#define PMD_BOND_AGG_MODE_KVARG ("agg_mode") +#define PMD_BOND_XMIT_POLICY_KVARG ("xmit_policy") +#define PMD_BOND_SOCKET_ID_KVARG ("socket_id") +#define PMD_BOND_MAC_ADDR_KVARG ("mac") #define PMD_BOND_LSC_POLL_PERIOD_KVARG ("lsc_poll_period_ms") #define PMD_BOND_LINK_UP_PROP_DELAY_KVARG ("up_delay") #define PMD_BOND_LINK_DOWN_PROP_DELAY_KVARG ("down_delay") @@ -50,8 +50,8 @@ extern const struct rte_flow_ops bond_flow_ops; /** Port Queue Mapping Structure */ struct bond_rx_queue { uint16_t queue_id; - /**< Next active_slave to poll */ - uint16_t active_slave; + /**< Next active_child to poll */ + uint16_t active_child; /**< Queue Id */ struct bond_dev_private *dev_private; /**< Reference to eth_dev private structure */ @@ -74,19 +74,19 @@ struct bond_tx_queue { /**< Copy of TX configuration structure for queue */ }; -/** Bonded slave devices structure */ -struct bond_ethdev_slave_ports { - uint16_t slaves[RTE_MAX_ETHPORTS]; /**< Slave port id array */ - uint16_t slave_count; /**< Number of slaves */ +/** Bonded child devices structure */ +struct bond_ethdev_child_ports { + uint16_t children[RTE_MAX_ETHPORTS]; /**< Child port id array */ + uint16_t child_count; /**< Number of children */ }; -struct bond_slave_details { +struct bond_child_details { uint16_t port_id; uint8_t link_status_poll_enabled; uint8_t link_status_wait_to_complete; uint8_t last_link_status; - /**< Port Id of slave eth_dev */ + /**< Port Id of child eth_dev */ struct rte_ether_addr persisted_mac_addr; uint16_t reta_size; @@ -94,7 +94,7 @@ struct bond_slave_details { struct rte_flow { TAILQ_ENTRY(rte_flow) next; - /* Slaves flows */ + /* Children flows */ struct rte_flow *flows[RTE_MAX_ETHPORTS]; /* Flow description for synchronization */ struct rte_flow_conv_rule rule; @@ -102,7 +102,7 @@ struct rte_flow { }; typedef void (*burst_xmit_hash_t)(struct rte_mbuf **buf, uint16_t nb_pkts, - uint16_t slave_count, uint16_t *slaves); + uint16_t child_count, uint16_t *children); /** Link Bonding PMD device private configuration Structure */ struct bond_dev_private { @@ -112,8 +112,8 @@ struct bond_dev_private { rte_spinlock_t lock; rte_spinlock_t lsc_lock; - uint16_t primary_port; /**< Primary Slave Port */ - uint16_t current_primary_port; /**< Primary Slave Port */ + uint16_t primary_port; /**< Primary Child Port */ + uint16_t current_primary_port; /**< Primary Child Port */ uint16_t user_defined_primary_port; /**< Flag for whether primary port is user defined or not */ @@ -137,16 +137,16 @@ struct bond_dev_private { uint16_t nb_rx_queues; /**< Total number of rx queues */ uint16_t nb_tx_queues; /**< Total number of tx queues*/ - uint16_t active_slave_count; /**< Number of active slaves */ - uint16_t active_slaves[RTE_MAX_ETHPORTS]; /**< Active slave list */ + uint16_t active_child_count; /**< Number of active children */ + uint16_t active_children[RTE_MAX_ETHPORTS]; /**< Active child list */ - uint16_t slave_count; /**< Number of bonded slaves */ - struct bond_slave_details slaves[RTE_MAX_ETHPORTS]; - /**< Array of bonded slaves details */ + uint16_t child_count; /**< Number of bonded children */ + struct bond_child_details children[RTE_MAX_ETHPORTS]; + /**< Array of bonded children details */ struct mode8023ad_private mode4; - uint16_t tlb_slaves_order[RTE_MAX_ETHPORTS]; - /**< TLB active slaves send order */ + uint16_t tlb_children_order[RTE_MAX_ETHPORTS]; + /**< TLB active children send order */ struct mode_alb_private mode6; uint64_t rx_offload_capa; /** Rx offload capability */ @@ -177,7 +177,7 @@ struct bond_dev_private { uint8_t rss_key_len; /**< hash key length in bytes. */ struct rte_kvargs *kvlist; - uint8_t slave_update_idx; + uint8_t child_update_idx; bool kvargs_processing_is_done; @@ -191,19 +191,19 @@ struct bond_dev_private { extern const struct eth_dev_ops default_dev_ops; int -check_for_master_bonded_ethdev(const struct rte_eth_dev *eth_dev); +check_for_parent_bonded_ethdev(const struct rte_eth_dev *eth_dev); int check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev); -/* Search given slave array to find position of given id. - * Return slave pos or slaves_count if not found. */ +/* Search given child array to find position of given id. + * Return child pos or children_count if not found. */ static inline uint16_t -find_slave_by_id(uint16_t *slaves, uint16_t slaves_count, uint16_t slave_id) { +find_child_by_id(uint16_t *children, uint16_t children_count, uint16_t child_id) { uint16_t pos; - for (pos = 0; pos < slaves_count; pos++) { - if (slave_id == slaves[pos]) + for (pos = 0; pos < children_count; pos++) { + if (child_id == children[pos]) break; } @@ -217,13 +217,13 @@ int valid_bonded_port_id(uint16_t port_id); int -valid_slave_port_id(struct bond_dev_private *internals, uint16_t port_id); +valid_child_port_id(struct bond_dev_private *internals, uint16_t port_id); void -deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); +deactivate_child(struct rte_eth_dev *eth_dev, uint16_t port_id); void -activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); +activate_child(struct rte_eth_dev *eth_dev, uint16_t port_id); int mac_address_set(struct rte_eth_dev *eth_dev, @@ -234,66 +234,66 @@ mac_address_get(struct rte_eth_dev *eth_dev, struct rte_ether_addr *dst_mac_addr); int -mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev); +mac_address_children_update(struct rte_eth_dev *bonded_eth_dev); int -slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, - uint16_t slave_port_id); +child_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, + uint16_t child_port_id); int -slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, - uint16_t slave_port_id); +child_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, + uint16_t child_port_id); int bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode); int -slave_configure(struct rte_eth_dev *bonded_eth_dev, - struct rte_eth_dev *slave_eth_dev); +child_configure(struct rte_eth_dev *bonded_eth_dev, + struct rte_eth_dev *child_eth_dev); int -slave_start(struct rte_eth_dev *bonded_eth_dev, - struct rte_eth_dev *slave_eth_dev); +child_start(struct rte_eth_dev *bonded_eth_dev, + struct rte_eth_dev *child_eth_dev); void -slave_remove(struct bond_dev_private *internals, - struct rte_eth_dev *slave_eth_dev); +child_remove(struct bond_dev_private *internals, + struct rte_eth_dev *child_eth_dev); void -slave_add(struct bond_dev_private *internals, - struct rte_eth_dev *slave_eth_dev); +child_add(struct bond_dev_private *internals, + struct rte_eth_dev *child_eth_dev); void burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint16_t slave_count, uint16_t *slaves); + uint16_t child_count, uint16_t *children); void burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint16_t slave_count, uint16_t *slaves); + uint16_t child_count, uint16_t *children); void burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint16_t slave_count, uint16_t *slaves); + uint16_t child_count, uint16_t *children); void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint16_t slave_port_id); + uint16_t child_port_id); int bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param, void *ret_param); int -bond_ethdev_parse_slave_port_kvarg(const char *key, +bond_ethdev_parse_child_port_kvarg(const char *key, const char *value, void *extra_args); int -bond_ethdev_parse_slave_mode_kvarg(const char *key, +bond_ethdev_parse_child_mode_kvarg(const char *key, const char *value, void *extra_args); int -bond_ethdev_parse_slave_agg_mode_kvarg(const char *key __rte_unused, +bond_ethdev_parse_child_agg_mode_kvarg(const char *key __rte_unused, const char *value, void *extra_args); int @@ -301,7 +301,7 @@ bond_ethdev_parse_socket_id_kvarg(const char *key, const char *value, void *extra_args); int -bond_ethdev_parse_primary_slave_port_id_kvarg(const char *key, +bond_ethdev_parse_primary_child_port_id_kvarg(const char *key, const char *value, void *extra_args); int @@ -323,7 +323,7 @@ void bond_tlb_enable(struct bond_dev_private *internals); void -bond_tlb_activate_slave(struct bond_dev_private *internals); +bond_tlb_activate_child(struct bond_dev_private *internals); int bond_ethdev_stop(struct rte_eth_dev *eth_dev); diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index 874aa91a5fe4..a74eab35dd08 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -10,7 +10,7 @@ * * RTE Link Bonding Ethernet Device * Link Bonding for 1GbE and 10GbE ports to allow the aggregation of multiple - * (slave) NICs into a single logical interface. The bonded device processes + * NICs into a single logical interface. The bonded device processes * these interfaces based on the mode of operation specified and supported. * This implementation supports 4 modes of operation round robin, active backup * balance and broadcast. Providing redundant links, fault tolerance and/or @@ -28,24 +28,24 @@ extern "C" { #define BONDING_MODE_ROUND_ROBIN (0) /**< Round Robin (Mode 0). * In this mode all transmitted packets will be balanced equally across all - * active slaves of the bonded in a round robin fashion. */ + * active devices of the bonded in a round robin fashion. */ #define BONDING_MODE_ACTIVE_BACKUP (1) /**< Active Backup (Mode 1). * In this mode all packets transmitted will be transmitted on the primary - * slave until such point as the primary slave is no longer available and then - * transmitted packets will be sent on the next available slaves. The primary - * slave can be defined by the user but defaults to the first active slave + * device until such point as the primary device is no longer available and then + * transmitted packets will be sent on the next available devices. The primary + * device can be defined by the user but defaults to the first active device * available if not specified. */ #define BONDING_MODE_BALANCE (2) /**< Balance (Mode 2). * In this mode all packets transmitted will be balanced across the available - * slaves using one of three available transmit policies - l2, l2+3 or l3+4. + * devices using one of three available transmit policies - l2, l2+3 or l3+4. * See BALANCE_XMIT_POLICY macros definitions for further details on transmit * policies. */ #define BONDING_MODE_BROADCAST (3) /**< Broadcast (Mode 3). * In this mode all transmitted packets will be transmitted on all available - * active slaves of the bonded. */ + * active devices of the bonded. */ #define BONDING_MODE_8023AD (4) /**< 802.3AD (Mode 4). * @@ -62,22 +62,22 @@ extern "C" { * be handled with the expected latency and this may cause the link status to be * incorrectly marked as down or failure to correctly negotiate with peers. * - For optimal performance during initial handshaking the array of mbufs provided - * to rx_burst should be at least 2 times the slave count size. + * to rx_burst should be at least 2 times the device count size. * */ #define BONDING_MODE_TLB (5) /**< Adaptive TLB (Mode 5) * This mode provides an adaptive transmit load balancing. It dynamically - * changes the transmitting slave, according to the computed load. Statistics + * changes the transmitting device, according to the computed load. Statistics * are collected in 100ms intervals and scheduled every 10ms */ #define BONDING_MODE_ALB (6) /**< Adaptive Load Balancing (Mode 6) * This mode includes adaptive TLB and receive load balancing (RLB). In RLB the * bonding driver intercepts ARP replies send by local system and overwrites its * source MAC address, so that different peers send data to the server on - * different slave interfaces. When local system sends ARP request, it saves IP + * different device interfaces. When local system sends ARP request, it saves IP * information from it. When ARP reply from that peer is received, its MAC is - * stored, one of slave MACs assigned and ARP reply send to that peer. + * stored, one of device MACs assigned and ARP reply send to that peer. */ /* Balance Mode Transmit Policies */ @@ -113,28 +113,42 @@ int rte_eth_bond_free(const char *name); /** - * Add a rte_eth_dev device as a slave to the bonded device + * Add a rte_eth_dev device as a child to the bonded device * * @param bonded_port_id Port ID of bonded device. - * @param slave_port_id Port ID of slave device. + * @param child_port_id Port ID of child device. * * @return * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id); +rte_eth_bond_child_add(uint16_t bonded_port_id, uint16_t child_port_id); + +__rte_deprecated +static inline int +rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t child_port_id) +{ + return rte_eth_bond_child_add(bonded_port_id, child_port_id); +} /** - * Remove a slave rte_eth_dev device from the bonded device + * Remove a child device from the bonded device * * @param bonded_port_id Port ID of bonded device. - * @param slave_port_id Port ID of slave device. + * @param child_port_id Port ID of child device. * * @return * 0 on success, negative value otherwise */ int -rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id); +rte_eth_bond_child_remove(uint16_t bonded_port_id, uint16_t child_port_id); + +__rte_deprecated +static inline int +rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t child_port_id) +{ + return rte_eth_bond_child_remove(bonded_port_id, child_port_id); +} /** * Set link bonding mode of bonded device @@ -160,65 +174,73 @@ int rte_eth_bond_mode_get(uint16_t bonded_port_id); /** - * Set slave rte_eth_dev as primary slave of bonded device + * Set child rte_eth_dev as primary of bonded device * * @param bonded_port_id Port ID of bonded device. - * @param slave_port_id Port ID of slave device. + * @param child_port_id Port ID of child device. * * @return * 0 on success, negative value otherwise */ int -rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id); +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t child_port_id); /** - * Get primary slave of bonded device + * Get primary child of bonded device * * @param bonded_port_id Port ID of bonded device. * * @return - * Port Id of primary slave on success, -1 on failure + * Port Id of primary child on success, -1 on failure */ int rte_eth_bond_primary_get(uint16_t bonded_port_id); /** - * Populate an array with list of the slaves port id's of the bonded device + * Populate an array with list of the children of the bonded device * * @param bonded_port_id Port ID of bonded eth_dev to interrogate - * @param slaves Array to be populated with the current active slaves - * @param len Length of slaves array + * @param children Array to be populated with the current active children + * @param len Length of children array * * @return - * Number of slaves associated with bonded device on success, + * Number of children associated with bonded device on success, * negative value otherwise */ int -rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], - uint16_t len); +rte_eth_bond_children_get(uint16_t bonded_port_id, uint16_t children[], + uint16_t len); + +__rte_deprecated +static inline int +rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t children[], + uint16_t len) +{ + return rte_eth_bond_children_get(bonded_port_id, children, len); +} /** - * Populate an array with list of the active slaves port id's of the bonded + * Populate an array with list of the active children port id's of the bonded * device. * * @param bonded_port_id Port ID of bonded eth_dev to interrogate - * @param slaves Array to be populated with the current active slaves - * @param len Length of slaves array + * @param children Array to be populated with the current active children + * @param len Length of children array * * @return - * Number of active slaves associated with bonded device on success, + * Number of active children associated with bonded device on success, * negative value otherwise */ int -rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], +rte_eth_bond_active_children_get(uint16_t bonded_port_id, uint16_t children[], uint16_t len); /** - * Set explicit MAC address to use on bonded device and it's slaves. + * Set explicit MAC address to use on bonded device and it's children. * * @param bonded_port_id Port ID of bonded device. - * @param mac_addr MAC Address to use on bonded device overriding - * slaves MAC addresses + * @param mac_addr MAC Address to use on bonded device overriding + * children MAC addresses * * @return * 0 on success, negative value otherwise @@ -228,8 +250,8 @@ rte_eth_bond_mac_address_set(uint16_t bonded_port_id, struct rte_ether_addr *mac_addr); /** - * Reset bonded device to use MAC from primary slave on bonded device and it's - * slaves. + * Reset bonded device to use MAC from primary child on bonded device and it's + * children. * * @param bonded_port_id Port ID of bonded device. * @@ -266,7 +288,7 @@ rte_eth_bond_xmit_policy_get(uint16_t bonded_port_id); /** * Set the link monitoring frequency (in ms) for monitoring the link status of - * slave devices + * child devices * * @param bonded_port_id Port ID of bonded device. * @param internal_ms Monitoring interval in milliseconds @@ -280,7 +302,7 @@ rte_eth_bond_link_monitoring_set(uint16_t bonded_port_id, uint32_t internal_ms); /** * Get the current link monitoring frequency (in ms) for monitoring of the link - * status of slave devices + * status of child devices * * @param bonded_port_id Port ID of bonded device. * diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 4a266bb2caf1..32ac1f47ee6e 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -19,7 +19,7 @@ static void bond_mode_8023ad_ext_periodic_cb(void *arg); #define MODE4_DEBUG(fmt, ...) \ rte_log(RTE_LOG_DEBUG, bond_logtype, \ "%6u [Port %u: %s] " fmt, \ - bond_dbg_get_time_diff_ms(), slave_id, \ + bond_dbg_get_time_diff_ms(), child_id, \ __func__, ##__VA_ARGS__) static uint64_t start_time; @@ -184,9 +184,9 @@ set_warning_flags(struct port *port, uint16_t flags) } static void -show_warnings(uint16_t slave_id) +show_warnings(uint16_t child_id) { - struct port *port = &bond_mode_8023ad_ports[slave_id]; + struct port *port = &bond_mode_8023ad_ports[child_id]; uint8_t warnings; do { @@ -205,36 +205,36 @@ show_warnings(uint16_t slave_id) if (warnings & WRN_RX_QUEUE_FULL) { RTE_BOND_LOG(DEBUG, - "Slave %u: failed to enqueue LACP packet into RX ring.\n" + "Child %u: failed to enqueue LACP packet into RX ring.\n" "Receive and transmit functions must be invoked on bonded" "interface at least 10 times per second or LACP will notwork correctly", - slave_id); + child_id); } if (warnings & WRN_TX_QUEUE_FULL) { RTE_BOND_LOG(DEBUG, - "Slave %u: failed to enqueue LACP packet into TX ring.\n" + "Child %u: failed to enqueue LACP packet into TX ring.\n" "Receive and transmit functions must be invoked on bonded" "interface at least 10 times per second or LACP will not work correctly", - slave_id); + child_id); } if (warnings & WRN_RX_MARKER_TO_FAST) - RTE_BOND_LOG(INFO, "Slave %u: marker to early - ignoring.", - slave_id); + RTE_BOND_LOG(INFO, "Child %u: marker to early - ignoring.", + child_id); if (warnings & WRN_UNKNOWN_SLOW_TYPE) { RTE_BOND_LOG(INFO, - "Slave %u: ignoring unknown slow protocol frame type", - slave_id); + "Child %u: ignoring unknown slow protocol frame type", + child_id); } if (warnings & WRN_UNKNOWN_MARKER_TYPE) - RTE_BOND_LOG(INFO, "Slave %u: ignoring unknown marker type", - slave_id); + RTE_BOND_LOG(INFO, "Child %u: ignoring unknown marker type", + child_id); if (warnings & WRN_NOT_LACP_CAPABLE) - MODE4_DEBUG("Port %u is not LACP capable!\n", slave_id); + MODE4_DEBUG("Port %u is not LACP capable!\n", child_id); } static void @@ -256,10 +256,10 @@ record_default(struct port *port) * @param port Port on which LACPDU was received. */ static void -rx_machine(struct bond_dev_private *internals, uint16_t slave_id, +rx_machine(struct bond_dev_private *internals, uint16_t child_id, struct lacpdu *lacp) { - struct port *agg, *port = &bond_mode_8023ad_ports[slave_id]; + struct port *agg, *port = &bond_mode_8023ad_ports[child_id]; uint64_t timeout; if (SM_FLAG(port, BEGIN)) { @@ -389,9 +389,9 @@ rx_machine(struct bond_dev_private *internals, uint16_t slave_id, * @param port Port to handle state machine. */ static void -periodic_machine(struct bond_dev_private *internals, uint16_t slave_id) +periodic_machine(struct bond_dev_private *internals, uint16_t child_id) { - struct port *port = &bond_mode_8023ad_ports[slave_id]; + struct port *port = &bond_mode_8023ad_ports[child_id]; /* Calculate if either site is LACP enabled */ uint64_t timeout; uint8_t active = ACTOR_STATE(port, LACP_ACTIVE) || @@ -451,9 +451,9 @@ periodic_machine(struct bond_dev_private *internals, uint16_t slave_id) * @param port Port to handle state machine. */ static void -mux_machine(struct bond_dev_private *internals, uint16_t slave_id) +mux_machine(struct bond_dev_private *internals, uint16_t child_id) { - struct port *port = &bond_mode_8023ad_ports[slave_id]; + struct port *port = &bond_mode_8023ad_ports[child_id]; /* Save current state for later use */ const uint8_t state_mask = STATE_SYNCHRONIZATION | STATE_DISTRIBUTING | @@ -527,8 +527,8 @@ mux_machine(struct bond_dev_private *internals, uint16_t slave_id) SM_FLAG_SET(port, NTT); MODE4_DEBUG("COLLECTING -> DISTRIBUTING\n"); RTE_BOND_LOG(INFO, - "Bond %u: slave id %u distributing started.", - internals->port_id, slave_id); + "Bond %u: child id %u distributing started.", + internals->port_id, child_id); } } else { if (!PARTNER_STATE(port, COLLECTING)) { @@ -538,8 +538,8 @@ mux_machine(struct bond_dev_private *internals, uint16_t slave_id) SM_FLAG_SET(port, NTT); MODE4_DEBUG("DISTRIBUTING -> COLLECTING\n"); RTE_BOND_LOG(INFO, - "Bond %u: slave id %u distributing stopped.", - internals->port_id, slave_id); + "Bond %u: child id %u distributing stopped.", + internals->port_id, child_id); } } } @@ -554,9 +554,9 @@ mux_machine(struct bond_dev_private *internals, uint16_t slave_id) * @param port */ static void -tx_machine(struct bond_dev_private *internals, uint16_t slave_id) +tx_machine(struct bond_dev_private *internals, uint16_t child_id) { - struct port *agg, *port = &bond_mode_8023ad_ports[slave_id]; + struct port *agg, *port = &bond_mode_8023ad_ports[child_id]; struct rte_mbuf *lacp_pkt = NULL; struct lacpdu_header *hdr; @@ -587,7 +587,7 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id) /* Source and destination MAC */ rte_ether_addr_copy(&lacp_mac_addr, &hdr->eth_hdr.dst_addr); - rte_eth_macaddr_get(slave_id, &hdr->eth_hdr.src_addr); + rte_eth_macaddr_get(child_id, &hdr->eth_hdr.src_addr); hdr->eth_hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW); lacpdu = &hdr->lacpdu; @@ -635,10 +635,10 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id) return; } } else { - uint16_t pkts_sent = rte_eth_tx_prepare(slave_id, + uint16_t pkts_sent = rte_eth_tx_prepare(child_id, internals->mode4.dedicated_queues.tx_qid, &lacp_pkt, 1); - pkts_sent = rte_eth_tx_burst(slave_id, + pkts_sent = rte_eth_tx_burst(child_id, internals->mode4.dedicated_queues.tx_qid, &lacp_pkt, pkts_sent); if (pkts_sent != 1) { @@ -679,40 +679,40 @@ max_index(uint64_t *a, int n) * @param port_pos Port to assign. */ static void -selection_logic(struct bond_dev_private *internals, uint16_t slave_id) +selection_logic(struct bond_dev_private *internals, uint16_t child_id) { struct port *agg, *port; - uint16_t slaves_count, new_agg_id, i, j = 0; - uint16_t *slaves; + uint16_t children_count, new_agg_id, i, j = 0; + uint16_t *children; uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] = {0}; uint64_t agg_count[RTE_MAX_ETHPORTS] = {0}; - uint16_t default_slave = 0; + uint16_t default_child = 0; struct rte_eth_link link_info; uint16_t agg_new_idx = 0; int ret; - slaves = internals->active_slaves; - slaves_count = internals->active_slave_count; - port = &bond_mode_8023ad_ports[slave_id]; + children = internals->active_children; + children_count = internals->active_child_count; + port = &bond_mode_8023ad_ports[child_id]; /* Search for aggregator suitable for this port */ - for (i = 0; i < slaves_count; ++i) { - agg = &bond_mode_8023ad_ports[slaves[i]]; + for (i = 0; i < children_count; ++i) { + agg = &bond_mode_8023ad_ports[children[i]]; /* Skip ports that are not aggregators */ - if (agg->aggregator_port_id != slaves[i]) + if (agg->aggregator_port_id != children[i]) continue; - ret = rte_eth_link_get_nowait(slaves[i], &link_info); + ret = rte_eth_link_get_nowait(children[i], &link_info); if (ret < 0) { RTE_BOND_LOG(ERR, - "Slave (port %u) link get failed: %s\n", - slaves[i], rte_strerror(-ret)); + "Child (port %u) link get failed: %s\n", + children[i], rte_strerror(-ret)); continue; } agg_count[i] += 1; agg_bandwidth[i] += link_info.link_speed; - /* Actors system ID is not checked since all slave device have the same + /* Actors system ID is not checked since all child device have the same * ID (MAC address). */ if ((agg->actor.key == port->actor.key && agg->partner.system_priority == port->partner.system_priority && @@ -724,31 +724,31 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id) rte_cpu_to_be_16(BOND_LINK_FULL_DUPLEX_KEY)) != 0) { if (j == 0) - default_slave = i; + default_child = i; j++; } } switch (internals->mode4.agg_selection) { case AGG_COUNT: - agg_new_idx = max_index(agg_count, slaves_count); - new_agg_id = slaves[agg_new_idx]; + agg_new_idx = max_index(agg_count, children_count); + new_agg_id = children[agg_new_idx]; break; case AGG_BANDWIDTH: - agg_new_idx = max_index(agg_bandwidth, slaves_count); - new_agg_id = slaves[agg_new_idx]; + agg_new_idx = max_index(agg_bandwidth, children_count); + new_agg_id = children[agg_new_idx]; break; case AGG_STABLE: - if (default_slave == slaves_count) - new_agg_id = slaves[slave_id]; + if (default_child == children_count) + new_agg_id = children[child_id]; else - new_agg_id = slaves[default_slave]; + new_agg_id = children[default_child]; break; default: - if (default_slave == slaves_count) - new_agg_id = slaves[slave_id]; + if (default_child == children_count) + new_agg_id = children[child_id]; else - new_agg_id = slaves[default_slave]; + new_agg_id = children[default_child]; break; } @@ -758,7 +758,7 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id) MODE4_DEBUG("-> SELECTED: ID=%3u\n" "\t%s aggregator ID=%3u\n", port->aggregator_port_id, - port->aggregator_port_id == slave_id ? + port->aggregator_port_id == child_id ? "aggregator not found, using default" : "aggregator found", port->aggregator_port_id); } @@ -802,7 +802,7 @@ link_speed_key(uint16_t speed) { } static void -rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id, +rx_machine_update(struct bond_dev_private *internals, uint16_t child_id, struct rte_mbuf *lacp_pkt) { struct lacpdu_header *lacp; struct lacpdu_actor_partner_params *partner; @@ -813,7 +813,7 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id, RTE_ASSERT(lacp->lacpdu.subtype == SLOW_SUBTYPE_LACP); partner = &lacp->lacpdu.partner; - port = &bond_mode_8023ad_ports[slave_id]; + port = &bond_mode_8023ad_ports[child_id]; agg = &bond_mode_8023ad_ports[port->aggregator_port_id]; if (rte_is_zero_ether_addr(&partner->port_params.system) || @@ -822,7 +822,7 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id, /* This LACP frame is sending to the bonding port * so pass it to rx_machine. */ - rx_machine(internals, slave_id, &lacp->lacpdu); + rx_machine(internals, child_id, &lacp->lacpdu); } else { char preferred_system_name[RTE_ETHER_ADDR_FMT_SIZE]; char self_system_name[RTE_ETHER_ADDR_FMT_SIZE]; @@ -837,16 +837,16 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id, } rte_pktmbuf_free(lacp_pkt); } else - rx_machine(internals, slave_id, NULL); + rx_machine(internals, child_id, NULL); } static void bond_mode_8023ad_dedicated_rxq_process(struct bond_dev_private *internals, - uint16_t slave_id) + uint16_t child_id) { #define DEDICATED_QUEUE_BURST_SIZE 32 struct rte_mbuf *lacp_pkt[DEDICATED_QUEUE_BURST_SIZE]; - uint16_t rx_count = rte_eth_rx_burst(slave_id, + uint16_t rx_count = rte_eth_rx_burst(child_id, internals->mode4.dedicated_queues.rx_qid, lacp_pkt, DEDICATED_QUEUE_BURST_SIZE); @@ -854,10 +854,10 @@ bond_mode_8023ad_dedicated_rxq_process(struct bond_dev_private *internals, uint16_t i; for (i = 0; i < rx_count; i++) - bond_mode_8023ad_handle_slow_pkt(internals, slave_id, + bond_mode_8023ad_handle_slow_pkt(internals, child_id, lacp_pkt[i]); } else { - rx_machine_update(internals, slave_id, NULL); + rx_machine_update(internals, child_id, NULL); } } @@ -868,23 +868,23 @@ bond_mode_8023ad_periodic_cb(void *arg) struct bond_dev_private *internals = bond_dev->data->dev_private; struct port *port; struct rte_eth_link link_info; - struct rte_ether_addr slave_addr; + struct rte_ether_addr child_addr; struct rte_mbuf *lacp_pkt = NULL; - uint16_t slave_id; + uint16_t child_id; uint16_t i; /* Update link status on each port */ - for (i = 0; i < internals->active_slave_count; i++) { + for (i = 0; i < internals->active_child_count; i++) { uint16_t key; int ret; - slave_id = internals->active_slaves[i]; - ret = rte_eth_link_get_nowait(slave_id, &link_info); + child_id = internals->active_children[i]; + ret = rte_eth_link_get_nowait(child_id, &link_info); if (ret < 0) { RTE_BOND_LOG(ERR, - "Slave (port %u) link get failed: %s\n", - slave_id, rte_strerror(-ret)); + "Child (port %u) link get failed: %s\n", + child_id, rte_strerror(-ret)); } if (ret >= 0 && link_info.link_status != 0) { @@ -895,8 +895,8 @@ bond_mode_8023ad_periodic_cb(void *arg) key = 0; } - rte_eth_macaddr_get(slave_id, &slave_addr); - port = &bond_mode_8023ad_ports[slave_id]; + rte_eth_macaddr_get(child_id, &child_addr); + port = &bond_mode_8023ad_ports[child_id]; key = rte_cpu_to_be_16(key); if (key != port->actor.key) { @@ -907,16 +907,16 @@ bond_mode_8023ad_periodic_cb(void *arg) SM_FLAG_SET(port, NTT); } - if (!rte_is_same_ether_addr(&port->actor.system, &slave_addr)) { - rte_ether_addr_copy(&slave_addr, &port->actor.system); - if (port->aggregator_port_id == slave_id) + if (!rte_is_same_ether_addr(&port->actor.system, &child_addr)) { + rte_ether_addr_copy(&child_addr, &port->actor.system); + if (port->aggregator_port_id == child_id) SM_FLAG_SET(port, NTT); } } - for (i = 0; i < internals->active_slave_count; i++) { - slave_id = internals->active_slaves[i]; - port = &bond_mode_8023ad_ports[slave_id]; + for (i = 0; i < internals->active_child_count; i++) { + child_id = internals->active_children[i]; + port = &bond_mode_8023ad_ports[child_id]; if ((port->actor.key & rte_cpu_to_be_16(BOND_LINK_FULL_DUPLEX_KEY)) == 0) { @@ -947,19 +947,19 @@ bond_mode_8023ad_periodic_cb(void *arg) if (retval != 0) lacp_pkt = NULL; - rx_machine_update(internals, slave_id, lacp_pkt); + rx_machine_update(internals, child_id, lacp_pkt); } else { bond_mode_8023ad_dedicated_rxq_process(internals, - slave_id); + child_id); } - periodic_machine(internals, slave_id); - mux_machine(internals, slave_id); - tx_machine(internals, slave_id); - selection_logic(internals, slave_id); + periodic_machine(internals, child_id); + mux_machine(internals, child_id); + tx_machine(internals, child_id); + selection_logic(internals, child_id); SM_FLAG_CLR(port, BEGIN); - show_warnings(slave_id); + show_warnings(child_id); } rte_eal_alarm_set(internals->mode4.update_timeout_us, @@ -967,34 +967,34 @@ bond_mode_8023ad_periodic_cb(void *arg) } static int -bond_mode_8023ad_register_lacp_mac(uint16_t slave_id) +bond_mode_8023ad_register_lacp_mac(uint16_t child_id) { int ret; - ret = rte_eth_allmulticast_enable(slave_id); + ret = rte_eth_allmulticast_enable(child_id); if (ret != 0) { RTE_BOND_LOG(ERR, "failed to enable allmulti mode for port %u: %s", - slave_id, rte_strerror(-ret)); + child_id, rte_strerror(-ret)); } - if (rte_eth_allmulticast_get(slave_id)) { + if (rte_eth_allmulticast_get(child_id)) { RTE_BOND_LOG(DEBUG, "forced allmulti for port %u", - slave_id); - bond_mode_8023ad_ports[slave_id].forced_rx_flags = + child_id); + bond_mode_8023ad_ports[child_id].forced_rx_flags = BOND_8023AD_FORCED_ALLMULTI; return 0; } - ret = rte_eth_promiscuous_enable(slave_id); + ret = rte_eth_promiscuous_enable(child_id); if (ret != 0) { RTE_BOND_LOG(ERR, "failed to enable promiscuous mode for port %u: %s", - slave_id, rte_strerror(-ret)); + child_id, rte_strerror(-ret)); } - if (rte_eth_promiscuous_get(slave_id)) { + if (rte_eth_promiscuous_get(child_id)) { RTE_BOND_LOG(DEBUG, "forced promiscuous for port %u", - slave_id); - bond_mode_8023ad_ports[slave_id].forced_rx_flags = + child_id); + bond_mode_8023ad_ports[child_id].forced_rx_flags = BOND_8023AD_FORCED_PROMISC; return 0; } @@ -1003,27 +1003,27 @@ bond_mode_8023ad_register_lacp_mac(uint16_t slave_id) } static void -bond_mode_8023ad_unregister_lacp_mac(uint16_t slave_id) +bond_mode_8023ad_unregister_lacp_mac(uint16_t child_id) { int ret; - switch (bond_mode_8023ad_ports[slave_id].forced_rx_flags) { + switch (bond_mode_8023ad_ports[child_id].forced_rx_flags) { case BOND_8023AD_FORCED_ALLMULTI: - RTE_BOND_LOG(DEBUG, "unset allmulti for port %u", slave_id); - ret = rte_eth_allmulticast_disable(slave_id); + RTE_BOND_LOG(DEBUG, "unset allmulti for port %u", child_id); + ret = rte_eth_allmulticast_disable(child_id); if (ret != 0) RTE_BOND_LOG(ERR, "failed to disable allmulti mode for port %u: %s", - slave_id, rte_strerror(-ret)); + child_id, rte_strerror(-ret)); break; case BOND_8023AD_FORCED_PROMISC: - RTE_BOND_LOG(DEBUG, "unset promisc for port %u", slave_id); - ret = rte_eth_promiscuous_disable(slave_id); + RTE_BOND_LOG(DEBUG, "unset promisc for port %u", child_id); + ret = rte_eth_promiscuous_disable(child_id); if (ret != 0) RTE_BOND_LOG(ERR, "failed to disable promiscuous mode for port %u: %s", - slave_id, rte_strerror(-ret)); + child_id, rte_strerror(-ret)); break; default: @@ -1032,12 +1032,12 @@ bond_mode_8023ad_unregister_lacp_mac(uint16_t slave_id) } void -bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, - uint16_t slave_id) +bond_mode_8023ad_activate_child(struct rte_eth_dev *bond_dev, + uint16_t child_id) { struct bond_dev_private *internals = bond_dev->data->dev_private; - struct port *port = &bond_mode_8023ad_ports[slave_id]; + struct port *port = &bond_mode_8023ad_ports[child_id]; struct port_params initial = { .system = { { 0 } }, .system_priority = rte_cpu_to_be_16(0xFFFF), @@ -1053,15 +1053,15 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, struct bond_tx_queue *bd_tx_q; uint16_t q_id; - /* Given slave mus not be in active list */ - RTE_ASSERT(find_slave_by_id(internals->active_slaves, - internals->active_slave_count, slave_id) == internals->active_slave_count); + /* Given child mus not be in active list */ + RTE_ASSERT(find_child_by_id(internals->active_children, + internals->active_child_count, child_id) == internals->active_child_count); RTE_SET_USED(internals); /* used only for assert when enabled */ memcpy(&port->actor, &initial, sizeof(struct port_params)); /* Standard requires that port ID must be grater than 0. * Add 1 do get corresponding port_number */ - port->actor.port_number = rte_cpu_to_be_16(slave_id + 1); + port->actor.port_number = rte_cpu_to_be_16(child_id + 1); memcpy(&port->partner, &initial, sizeof(struct port_params)); memcpy(&port->partner_admin, &initial, sizeof(struct port_params)); @@ -1072,11 +1072,11 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, port->sm_flags = SM_FLAGS_BEGIN; /* use this port as aggregator */ - port->aggregator_port_id = slave_id; + port->aggregator_port_id = child_id; - if (bond_mode_8023ad_register_lacp_mac(slave_id) < 0) { - RTE_BOND_LOG(WARNING, "slave %u is most likely broken and won't receive LACP packets", - slave_id); + if (bond_mode_8023ad_register_lacp_mac(child_id) < 0) { + RTE_BOND_LOG(WARNING, "child %u is most likely broken and won't receive LACP packets", + child_id); } timer_cancel(&port->warning_timer); @@ -1087,7 +1087,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, RTE_ASSERT(port->rx_ring == NULL); RTE_ASSERT(port->tx_ring == NULL); - socket_id = rte_eth_dev_socket_id(slave_id); + socket_id = rte_eth_dev_socket_id(child_id); if (socket_id == -1) socket_id = rte_socket_id(); @@ -1095,14 +1095,14 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, RTE_PKTMBUF_HEADROOM; /* The size of the mempool should be at least: - * the sum of the TX descriptors + BOND_MODE_8023AX_SLAVE_TX_PKTS */ - total_tx_desc = BOND_MODE_8023AX_SLAVE_TX_PKTS; + * the sum of the TX descriptors + BOND_MODE_8023AX_CHILD_TX_PKTS */ + total_tx_desc = BOND_MODE_8023AX_CHILD_TX_PKTS; for (q_id = 0; q_id < bond_dev->data->nb_tx_queues; q_id++) { bd_tx_q = (struct bond_tx_queue*)bond_dev->data->tx_queues[q_id]; total_tx_desc += bd_tx_q->nb_tx_desc; } - snprintf(mem_name, RTE_DIM(mem_name), "slave_port%u_pool", slave_id); + snprintf(mem_name, RTE_DIM(mem_name), "child_port%u_pool", child_id); port->mbuf_pool = rte_pktmbuf_pool_create(mem_name, total_tx_desc, RTE_MEMPOOL_CACHE_MAX_SIZE >= 32 ? 32 : RTE_MEMPOOL_CACHE_MAX_SIZE, @@ -1111,39 +1111,39 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev, /* Any memory allocation failure in initialization is critical because * resources can't be free, so reinitialization is impossible. */ if (port->mbuf_pool == NULL) { - rte_panic("Slave %u: Failed to create memory pool '%s': %s\n", - slave_id, mem_name, rte_strerror(rte_errno)); + rte_panic("Child %u: Failed to create memory pool '%s': %s\n", + child_id, mem_name, rte_strerror(rte_errno)); } - snprintf(mem_name, RTE_DIM(mem_name), "slave_%u_rx", slave_id); + snprintf(mem_name, RTE_DIM(mem_name), "child_%u_rx", child_id); port->rx_ring = rte_ring_create(mem_name, - rte_align32pow2(BOND_MODE_8023AX_SLAVE_RX_PKTS), socket_id, 0); + rte_align32pow2(BOND_MODE_8023AX_CHILD_RX_PKTS), socket_id, 0); if (port->rx_ring == NULL) { - rte_panic("Slave %u: Failed to create rx ring '%s': %s\n", slave_id, + rte_panic("Child %u: Failed to create rx ring '%s': %s\n", child_id, mem_name, rte_strerror(rte_errno)); } /* TX ring is at least one pkt longer to make room for marker packet. */ - snprintf(mem_name, RTE_DIM(mem_name), "slave_%u_tx", slave_id); + snprintf(mem_name, RTE_DIM(mem_name), "child_%u_tx", child_id); port->tx_ring = rte_ring_create(mem_name, - rte_align32pow2(BOND_MODE_8023AX_SLAVE_TX_PKTS + 1), socket_id, 0); + rte_align32pow2(BOND_MODE_8023AX_CHILD_TX_PKTS + 1), socket_id, 0); if (port->tx_ring == NULL) { - rte_panic("Slave %u: Failed to create tx ring '%s': %s\n", slave_id, + rte_panic("Child %u: Failed to create tx ring '%s': %s\n", child_id, mem_name, rte_strerror(rte_errno)); } } int -bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev __rte_unused, - uint16_t slave_id) +bond_mode_8023ad_deactivate_child(struct rte_eth_dev *bond_dev __rte_unused, + uint16_t child_id) { void *pkt = NULL; struct port *port = NULL; uint8_t old_partner_state; - port = &bond_mode_8023ad_ports[slave_id]; + port = &bond_mode_8023ad_ports[child_id]; ACTOR_STATE_CLR(port, AGGREGATION); port->selected = UNSELECTED; @@ -1151,7 +1151,7 @@ bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev __rte_unused, old_partner_state = port->partner_state; record_default(port); - bond_mode_8023ad_unregister_lacp_mac(slave_id); + bond_mode_8023ad_unregister_lacp_mac(child_id); /* If partner timeout state changes then disable timer */ if (!((old_partner_state ^ port->partner_state) & @@ -1174,30 +1174,30 @@ void bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev) { struct bond_dev_private *internals = bond_dev->data->dev_private; - struct rte_ether_addr slave_addr; - struct port *slave, *agg_slave; - uint16_t slave_id, i, j; + struct rte_ether_addr child_addr; + struct port *child, *agg_child; + uint16_t child_id, i, j; bond_mode_8023ad_stop(bond_dev); - for (i = 0; i < internals->active_slave_count; i++) { - slave_id = internals->active_slaves[i]; - slave = &bond_mode_8023ad_ports[slave_id]; - rte_eth_macaddr_get(slave_id, &slave_addr); + for (i = 0; i < internals->active_child_count; i++) { + child_id = internals->active_children[i]; + child = &bond_mode_8023ad_ports[child_id]; + rte_eth_macaddr_get(child_id, &child_addr); - if (rte_is_same_ether_addr(&slave_addr, &slave->actor.system)) + if (rte_is_same_ether_addr(&child_addr, &child->actor.system)) continue; - rte_ether_addr_copy(&slave_addr, &slave->actor.system); + rte_ether_addr_copy(&child_addr, &child->actor.system); /* Do nothing if this port is not an aggregator. In other case * Set NTT flag on every port that use this aggregator. */ - if (slave->aggregator_port_id != slave_id) + if (child->aggregator_port_id != child_id) continue; - for (j = 0; j < internals->active_slave_count; j++) { - agg_slave = &bond_mode_8023ad_ports[internals->active_slaves[j]]; - if (agg_slave->aggregator_port_id == slave_id) - SM_FLAG_SET(agg_slave, NTT); + for (j = 0; j < internals->active_child_count; j++) { + agg_child = &bond_mode_8023ad_ports[internals->active_children[j]]; + if (agg_child->aggregator_port_id == child_id) + SM_FLAG_SET(agg_child, NTT); } } @@ -1288,9 +1288,9 @@ bond_mode_8023ad_enable(struct rte_eth_dev *bond_dev) struct bond_dev_private *internals = bond_dev->data->dev_private; uint16_t i; - for (i = 0; i < internals->active_slave_count; i++) - bond_mode_8023ad_activate_slave(bond_dev, - internals->active_slaves[i]); + for (i = 0; i < internals->active_child_count; i++) + bond_mode_8023ad_activate_child(bond_dev, + internals->active_children[i]); return 0; } @@ -1326,10 +1326,10 @@ bond_mode_8023ad_stop(struct rte_eth_dev *bond_dev) void bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, - uint16_t slave_id, struct rte_mbuf *pkt) + uint16_t child_id, struct rte_mbuf *pkt) { struct mode8023ad_private *mode4 = &internals->mode4; - struct port *port = &bond_mode_8023ad_ports[slave_id]; + struct port *port = &bond_mode_8023ad_ports[child_id]; struct marker_header *m_hdr; uint64_t marker_timer, old_marker_timer; int retval; @@ -1362,7 +1362,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, } while (unlikely(retval == 0)); m_hdr->marker.tlv_type_marker = MARKER_TLV_TYPE_RESP; - rte_eth_macaddr_get(slave_id, &m_hdr->eth_hdr.src_addr); + rte_eth_macaddr_get(child_id, &m_hdr->eth_hdr.src_addr); if (internals->mode4.dedicated_queues.enabled == 0) { if (rte_ring_enqueue(port->tx_ring, pkt) != 0) { @@ -1373,10 +1373,10 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, } } else { /* Send packet directly to the slow queue */ - uint16_t tx_count = rte_eth_tx_prepare(slave_id, + uint16_t tx_count = rte_eth_tx_prepare(child_id, internals->mode4.dedicated_queues.tx_qid, &pkt, 1); - tx_count = rte_eth_tx_burst(slave_id, + tx_count = rte_eth_tx_burst(child_id, internals->mode4.dedicated_queues.tx_qid, &pkt, tx_count); if (tx_count != 1) { @@ -1394,7 +1394,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_private *internals, goto free_out; } } else - rx_machine_update(internals, slave_id, pkt); + rx_machine_update(internals, child_id, pkt); } else { wrn = WRN_UNKNOWN_SLOW_TYPE; goto free_out; @@ -1477,7 +1477,7 @@ bond_8023ad_setup_validate(uint16_t port_id, return -EINVAL; if (conf != NULL) { - /* Basic sanity check */ + /* Check configuration */ if (conf->slow_periodic_ms == 0 || conf->fast_periodic_ms >= conf->slow_periodic_ms || conf->long_timeout_ms == 0 || @@ -1517,8 +1517,8 @@ rte_eth_bond_8023ad_setup(uint16_t port_id, int -rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, - struct rte_eth_bond_8023ad_slave_info *info) +rte_eth_bond_8023ad_child_info(uint16_t port_id, uint16_t child_id, + struct rte_eth_bond_8023ad_child_info *info) { struct rte_eth_dev *bond_dev; struct bond_dev_private *internals; @@ -1531,12 +1531,12 @@ rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, bond_dev = &rte_eth_devices[port_id]; internals = bond_dev->data->dev_private; - if (find_slave_by_id(internals->active_slaves, - internals->active_slave_count, slave_id) == - internals->active_slave_count) + if (find_child_by_id(internals->active_children, + internals->active_child_count, child_id) == + internals->active_child_count) return -EINVAL; - port = &bond_mode_8023ad_ports[slave_id]; + port = &bond_mode_8023ad_ports[child_id]; info->selected = port->selected; info->actor_state = port->actor_state; @@ -1550,7 +1550,7 @@ rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, } static int -bond_8023ad_ext_validate(uint16_t port_id, uint16_t slave_id) +bond_8023ad_ext_validate(uint16_t port_id, uint16_t child_id) { struct rte_eth_dev *bond_dev; struct bond_dev_private *internals; @@ -1565,9 +1565,9 @@ bond_8023ad_ext_validate(uint16_t port_id, uint16_t slave_id) return -EINVAL; internals = bond_dev->data->dev_private; - if (find_slave_by_id(internals->active_slaves, - internals->active_slave_count, slave_id) == - internals->active_slave_count) + if (find_child_by_id(internals->active_children, + internals->active_child_count, child_id) == + internals->active_child_count) return -EINVAL; mode4 = &internals->mode4; @@ -1578,17 +1578,17 @@ bond_8023ad_ext_validate(uint16_t port_id, uint16_t slave_id) } int -rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id, +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t child_id, int enabled) { struct port *port; int res; - res = bond_8023ad_ext_validate(port_id, slave_id); + res = bond_8023ad_ext_validate(port_id, child_id); if (res != 0) return res; - port = &bond_mode_8023ad_ports[slave_id]; + port = &bond_mode_8023ad_ports[child_id]; if (enabled) ACTOR_STATE_SET(port, COLLECTING); @@ -1599,17 +1599,17 @@ rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id, } int -rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id, +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t child_id, int enabled) { struct port *port; int res; - res = bond_8023ad_ext_validate(port_id, slave_id); + res = bond_8023ad_ext_validate(port_id, child_id); if (res != 0) return res; - port = &bond_mode_8023ad_ports[slave_id]; + port = &bond_mode_8023ad_ports[child_id]; if (enabled) ACTOR_STATE_SET(port, DISTRIBUTING); @@ -1620,45 +1620,45 @@ rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id, } int -rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id) +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t child_id) { struct port *port; int err; - err = bond_8023ad_ext_validate(port_id, slave_id); + err = bond_8023ad_ext_validate(port_id, child_id); if (err != 0) return err; - port = &bond_mode_8023ad_ports[slave_id]; + port = &bond_mode_8023ad_ports[child_id]; return ACTOR_STATE(port, DISTRIBUTING); } int -rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id) +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t child_id) { struct port *port; int err; - err = bond_8023ad_ext_validate(port_id, slave_id); + err = bond_8023ad_ext_validate(port_id, child_id); if (err != 0) return err; - port = &bond_mode_8023ad_ports[slave_id]; + port = &bond_mode_8023ad_ports[child_id]; return ACTOR_STATE(port, COLLECTING); } int -rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id, +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t child_id, struct rte_mbuf *lacp_pkt) { struct port *port; int res; - res = bond_8023ad_ext_validate(port_id, slave_id); + res = bond_8023ad_ext_validate(port_id, child_id); if (res != 0) return res; - port = &bond_mode_8023ad_ports[slave_id]; + port = &bond_mode_8023ad_ports[child_id]; if (rte_pktmbuf_pkt_len(lacp_pkt) < sizeof(struct lacpdu_header)) return -EINVAL; @@ -1683,11 +1683,11 @@ bond_mode_8023ad_ext_periodic_cb(void *arg) struct mode8023ad_private *mode4 = &internals->mode4; struct port *port; void *pkt = NULL; - uint16_t i, slave_id; + uint16_t i, child_id; - for (i = 0; i < internals->active_slave_count; i++) { - slave_id = internals->active_slaves[i]; - port = &bond_mode_8023ad_ports[slave_id]; + for (i = 0; i < internals->active_child_count; i++) { + child_id = internals->active_children[i]; + port = &bond_mode_8023ad_ports[child_id]; if (rte_ring_dequeue(port->rx_ring, &pkt) == 0) { struct rte_mbuf *lacp_pkt = pkt; @@ -1700,7 +1700,7 @@ bond_mode_8023ad_ext_periodic_cb(void *arg) /* This is LACP frame so pass it to rx callback. * Callback is responsible for freeing mbuf. */ - mode4->slowrx_cb(slave_id, lacp_pkt); + mode4->slowrx_cb(child_id, lacp_pkt); } } diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index 7ad8d6d00bd5..d66817a199fe 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -35,7 +35,7 @@ extern "C" { #define MARKER_TLV_TYPE_INFO 0x01 #define MARKER_TLV_TYPE_RESP 0x02 -typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint16_t slave_id, +typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint16_t child_id, struct rte_mbuf *lacp_pkt); enum rte_bond_8023ad_selection { @@ -66,13 +66,13 @@ struct port_params { uint16_t system_priority; /**< System priority (unused in current implementation) */ struct rte_ether_addr system; - /**< System ID - Slave MAC address, same as bonding MAC address */ + /**< System ID - Child MAC address, same as bonding MAC address */ uint16_t key; /**< Speed information (implementation dependent) and duplex. */ uint16_t port_priority; /**< Priority of this (unused in current implementation) */ uint16_t port_number; - /**< Port number. It corresponds to slave port id. */ + /**< Port number. It corresponds to child port id. */ } __rte_packed __rte_aligned(2); struct lacpdu_actor_partner_params { @@ -141,7 +141,7 @@ struct rte_eth_bond_8023ad_conf { enum rte_bond_8023ad_agg_selection agg_selection; }; -struct rte_eth_bond_8023ad_slave_info { +struct rte_eth_bond_8023ad_child_info { enum rte_bond_8023ad_selection selected; uint8_t actor_state; struct port_params actor; @@ -184,104 +184,104 @@ rte_eth_bond_8023ad_setup(uint16_t port_id, /** * @internal * - * Function returns current state of given slave device. + * Function returns current state of given child device. * - * @param slave_id Port id of valid slave. + * @param child_id Port id of valid child. * @param conf buffer for configuration * @return * 0 - if ok - * -EINVAL if conf is NULL or slave id is invalid (not a slave of given + * -EINVAL if conf is NULL or child id is invalid (not a child of given * bonded device or is not inactive). */ int -rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint16_t slave_id, - struct rte_eth_bond_8023ad_slave_info *conf); +rte_eth_bond_8023ad_child_info(uint16_t port_id, uint16_t child_id, + struct rte_eth_bond_8023ad_child_info *conf); #ifdef __cplusplus } #endif /** - * Configure a slave port to start collecting. + * Configure a child port to start collecting. * * @param port_id Bonding device id - * @param slave_id Port id of valid slave. + * @param child_id Port id of valid child. * @param enabled Non-zero when collection enabled. * @return * 0 - if ok - * -EINVAL if slave is not valid. + * -EINVAL if child is not valid. */ int -rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t slave_id, +rte_eth_bond_8023ad_ext_collect(uint16_t port_id, uint16_t child_id, int enabled); /** - * Get COLLECTING flag from slave port actor state. + * Get COLLECTING flag from child port actor state. * * @param port_id Bonding device id - * @param slave_id Port id of valid slave. + * @param child_id Port id of valid child. * @return * 0 - if not set * 1 - if set - * -EINVAL if slave is not valid. + * -EINVAL if child is not valid. */ int -rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t slave_id); +rte_eth_bond_8023ad_ext_collect_get(uint16_t port_id, uint16_t child_id); /** - * Configure a slave port to start distributing. + * Configure a child port to start distributing. * * @param port_id Bonding device id - * @param slave_id Port id of valid slave. + * @param child_id Port id of valid child. * @param enabled Non-zero when distribution enabled. * @return * 0 - if ok - * -EINVAL if slave is not valid. + * -EINVAL if child is not valid. */ int -rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t slave_id, +rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, uint16_t child_id, int enabled); /** - * Get DISTRIBUTING flag from slave port actor state. + * Get DISTRIBUTING flag from child port actor state. * * @param port_id Bonding device id - * @param slave_id Port id of valid slave. + * @param child_id Port id of valid child. * @return * 0 - if not set * 1 - if set - * -EINVAL if slave is not valid. + * -EINVAL if child is not valid. */ int -rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t slave_id); +rte_eth_bond_8023ad_ext_distrib_get(uint16_t port_id, uint16_t child_id); /** * LACPDU transmit path for external 802.3ad state machine. Caller retains * ownership of the packet on failure. * * @param port_id Bonding device id - * @param slave_id Port ID of valid slave device. + * @param child_id Port ID of valid child device. * @param lacp_pkt mbuf containing LACPDU. * * @return * 0 on success, negative value otherwise. */ int -rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t slave_id, +rte_eth_bond_8023ad_ext_slowtx(uint16_t port_id, uint16_t child_id, struct rte_mbuf *lacp_pkt); /** - * Enable dedicated hw queues for 802.3ad control plane traffic on slaves + * Enable dedicated hw queues for 802.3ad control plane traffic on children * - * This function creates an additional tx and rx queue on each slave for + * This function creates an additional tx and rx queue on each child for * dedicated 802.3ad control plane traffic . A flow filtering rule is - * programmed on each slave to redirect all LACP slow packets to that rx queue + * programmed on each child to redirect all LACP slow packets to that rx queue * for processing in the LACP state machine, this removes the need to filter * these packets in the bonded devices data path. The additional tx queue is * used to enable the LACP state machine to enqueue LACP packets directly to - * slave hw independently of the bonded devices data path. + * child hw independently of the bonded devices data path. * - * To use this feature all slaves must support the programming of the flow + * To use this feature all children must support the programming of the flow * filter rule required for rx and have enough queues that one rx and tx queue * can be reserved for the LACP state machines control packets. * @@ -296,7 +296,7 @@ int rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port_id); /** - * Disable slow queue on slaves + * Disable slow queue on children * * This function disables hardware slow packet filter. * diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c index 86335a797135..0fcd1448c15b 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.c +++ b/drivers/net/bonding/rte_eth_bond_alb.c @@ -19,13 +19,13 @@ simple_hash(uint8_t *hash_start, int hash_size) } static uint16_t -calculate_slave(struct bond_dev_private *internals) +calculate_child(struct bond_dev_private *internals) { uint16_t idx; - idx = (internals->mode6.last_slave + 1) % internals->active_slave_count; - internals->mode6.last_slave = idx; - return internals->active_slaves[idx]; + idx = (internals->mode6.last_child + 1) % internals->active_child_count; + internals->mode6.last_child = idx; + return internals->active_children[idx]; } int @@ -41,7 +41,7 @@ bond_mode_alb_enable(struct rte_eth_dev *bond_dev) /* Fill hash table with initial values */ memset(hash_table, 0, sizeof(struct client_data) * ALB_HASH_TABLE_SIZE); rte_spinlock_init(&internals->mode6.lock); - internals->mode6.last_slave = ALB_NULL_INDEX; + internals->mode6.last_child = ALB_NULL_INDEX; internals->mode6.ntt = 0; /* Initialize memory pool for ARP packets to send */ @@ -96,7 +96,7 @@ void bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset, /* * We got reply for ARP Request send by the application. We need to * update client table when received data differ from what is stored - * in ALB table and issue sending update packet to that slave. + * in ALB table and issue sending update packet to that child. */ rte_spinlock_lock(&internals->mode6.lock); if (client_info->in_use == 0 || @@ -112,8 +112,8 @@ void bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset, client_info->cli_ip = arp->arp_data.arp_sip; rte_ether_addr_copy(&arp->arp_data.arp_sha, &client_info->cli_mac); - client_info->slave_idx = calculate_slave(internals); - rte_eth_macaddr_get(client_info->slave_idx, + client_info->child_idx = calculate_child(internals); + rte_eth_macaddr_get(client_info->child_idx, &client_info->app_mac); rte_ether_addr_copy(&client_info->app_mac, &arp->arp_data.arp_tha); @@ -166,33 +166,33 @@ bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset, &arp->arp_data.arp_tha, &client_info->cli_mac); } - rte_eth_macaddr_get(client_info->slave_idx, + rte_eth_macaddr_get(client_info->child_idx, &client_info->app_mac); rte_ether_addr_copy(&client_info->app_mac, &arp->arp_data.arp_sha); memcpy(client_info->vlan, eth_h + 1, offset); client_info->vlan_count = offset / sizeof(struct rte_vlan_hdr); rte_spinlock_unlock(&internals->mode6.lock); - return client_info->slave_idx; + return client_info->child_idx; } } - /* Assign new slave to this client and update src mac in ARP */ + /* Assign new child to this client and update src mac in ARP */ client_info->in_use = 1; client_info->ntt = 0; client_info->app_ip = arp->arp_data.arp_sip; rte_ether_addr_copy(&arp->arp_data.arp_tha, &client_info->cli_mac); client_info->cli_ip = arp->arp_data.arp_tip; - client_info->slave_idx = calculate_slave(internals); - rte_eth_macaddr_get(client_info->slave_idx, + client_info->child_idx = calculate_child(internals); + rte_eth_macaddr_get(client_info->child_idx, &client_info->app_mac); rte_ether_addr_copy(&client_info->app_mac, &arp->arp_data.arp_sha); memcpy(client_info->vlan, eth_h + 1, offset); client_info->vlan_count = offset / sizeof(struct rte_vlan_hdr); rte_spinlock_unlock(&internals->mode6.lock); - return client_info->slave_idx; + return client_info->child_idx; } /* If packet is not ARP Reply, send it on current primary port. */ @@ -208,7 +208,7 @@ bond_mode_alb_arp_upd(struct client_data *client_info, { struct rte_ether_hdr *eth_h; struct rte_arp_hdr *arp_h; - uint16_t slave_idx; + uint16_t child_idx; rte_spinlock_lock(&internals->mode6.lock); eth_h = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); @@ -238,10 +238,10 @@ bond_mode_alb_arp_upd(struct client_data *client_info, arp_h->arp_plen = sizeof(uint32_t); arp_h->arp_opcode = rte_cpu_to_be_16(RTE_ARP_OP_REPLY); - slave_idx = client_info->slave_idx; + child_idx = client_info->child_idx; rte_spinlock_unlock(&internals->mode6.lock); - return slave_idx; + return child_idx; } void @@ -252,18 +252,18 @@ bond_mode_alb_client_list_upd(struct rte_eth_dev *bond_dev) int i; - /* If active slave count is 0, it's pointless to refresh alb table */ - if (internals->active_slave_count <= 0) + /* If active child count is 0, it's pointless to refresh alb table */ + if (internals->active_child_count <= 0) return; rte_spinlock_lock(&internals->mode6.lock); - internals->mode6.last_slave = ALB_NULL_INDEX; + internals->mode6.last_child = ALB_NULL_INDEX; for (i = 0; i < ALB_HASH_TABLE_SIZE; i++) { client_info = &internals->mode6.client_table[i]; if (client_info->in_use) { - client_info->slave_idx = calculate_slave(internals); - rte_eth_macaddr_get(client_info->slave_idx, &client_info->app_mac); + client_info->child_idx = calculate_child(internals); + rte_eth_macaddr_get(client_info->child_idx, &client_info->app_mac); internals->mode6.ntt = 1; } } diff --git a/drivers/net/bonding/rte_eth_bond_alb.h b/drivers/net/bonding/rte_eth_bond_alb.h index 4e9aeda9bc86..dae3f84c5efb 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.h +++ b/drivers/net/bonding/rte_eth_bond_alb.h @@ -22,8 +22,8 @@ struct client_data { uint32_t cli_ip; /**< Client IP address */ - uint16_t slave_idx; - /**< Index of slave on which we connect with that client */ + uint16_t child_idx; + /**< Index of child on which we connect with that client */ uint8_t in_use; /**< Flag indicating if entry in client table is currently used */ uint8_t ntt; @@ -42,8 +42,8 @@ struct mode_alb_private { /**< Mempool for creating ARP update packets */ uint8_t ntt; /**< Flag indicating if we need to send update to any client on next tx */ - uint32_t last_slave; - /**< Index of last used slave in client table */ + uint32_t last_child; + /**< Index of last used child in client table */ rte_spinlock_t lock; }; @@ -72,9 +72,9 @@ bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals); /** - * Function handles ARP packet transmission. It also decides on which slave - * send that packet. If packet is ARP Request, it is send on primary slave. - * If it is ARP Reply, it is send on slave stored in client table for that + * Function handles ARP packet transmission. It also decides on which child + * send that packet. If packet is ARP Request, it is send on primary child. + * If it is ARP Reply, it is send on child stored in client table for that * connection. On Reply function also updates data in client table. * * @param eth_h ETH header of transmitted packet. @@ -82,7 +82,7 @@ bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset, * @param internals Bonding data. * * @return - * Index of slave on which packet should be sent. + * Index of child on which packet should be sent. */ uint16_t bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset, @@ -96,14 +96,14 @@ bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset, * @param internals Bonding data. * * @return - * Index of slave on which packet should be sent. + * Index of child on which packet should be sent. */ uint16_t bond_mode_alb_arp_upd(struct client_data *client_info, struct rte_mbuf *pkt, struct bond_dev_private *internals); /** - * Function updates slave indexes of active connections. + * Function updates child indexes of active connections. * * @param bond_dev Pointer to bonded device struct. */ diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index c0178369b464..231d117bc5ed 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -37,7 +37,7 @@ valid_bonded_port_id(uint16_t port_id) } int -check_for_master_bonded_ethdev(const struct rte_eth_dev *eth_dev) +check_for_parent_bonded_ethdev(const struct rte_eth_dev *eth_dev) { int i; struct bond_dev_private *internals; @@ -47,31 +47,31 @@ check_for_master_bonded_ethdev(const struct rte_eth_dev *eth_dev) internals = eth_dev->data->dev_private; - /* Check if any of slave devices is a bonded device */ - for (i = 0; i < internals->slave_count; i++) - if (valid_bonded_port_id(internals->slaves[i].port_id) == 0) + /* Check if any of child devices is a bonded device */ + for (i = 0; i < internals->child_count; i++) + if (valid_bonded_port_id(internals->children[i].port_id) == 0) return 1; return 0; } int -valid_slave_port_id(struct bond_dev_private *internals, uint16_t slave_port_id) +valid_child_port_id(struct bond_dev_private *internals, uint16_t child_port_id) { - RTE_ETH_VALID_PORTID_OR_ERR_RET(slave_port_id, -1); + RTE_ETH_VALID_PORTID_OR_ERR_RET(child_port_id, -1); - /* Verify that slave_port_id refers to a non bonded port */ - if (check_for_bonded_ethdev(&rte_eth_devices[slave_port_id]) == 0 && + /* Verify that child_port_id refers to a non bonded port */ + if (check_for_bonded_ethdev(&rte_eth_devices[child_port_id]) == 0 && internals->mode == BONDING_MODE_8023AD) { - RTE_BOND_LOG(ERR, "Cannot add slave to bonded device in 802.3ad" - " mode as slave is also a bonded device, only " + RTE_BOND_LOG(ERR, "Cannot add child to bonded device in 802.3ad" + " mode as child is also a bonded device, only " "physical devices can be support in this mode."); return -1; } - if (internals->port_id == slave_port_id) { + if (internals->port_id == child_port_id) { RTE_BOND_LOG(ERR, - "Cannot add the bonded device itself as its slave."); + "Cannot add the bonded device itself as its child."); return -1; } @@ -79,61 +79,61 @@ valid_slave_port_id(struct bond_dev_private *internals, uint16_t slave_port_id) } void -activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) +activate_child(struct rte_eth_dev *eth_dev, uint16_t port_id) { struct bond_dev_private *internals = eth_dev->data->dev_private; - uint16_t active_count = internals->active_slave_count; + uint16_t active_count = internals->active_child_count; if (internals->mode == BONDING_MODE_8023AD) - bond_mode_8023ad_activate_slave(eth_dev, port_id); + bond_mode_8023ad_activate_child(eth_dev, port_id); if (internals->mode == BONDING_MODE_TLB || internals->mode == BONDING_MODE_ALB) { - internals->tlb_slaves_order[active_count] = port_id; + internals->tlb_children_order[active_count] = port_id; } - RTE_ASSERT(internals->active_slave_count < - (RTE_DIM(internals->active_slaves) - 1)); + RTE_ASSERT(internals->active_child_count < + (RTE_DIM(internals->active_children) - 1)); - internals->active_slaves[internals->active_slave_count] = port_id; - internals->active_slave_count++; + internals->active_children[internals->active_child_count] = port_id; + internals->active_child_count++; if (internals->mode == BONDING_MODE_TLB) - bond_tlb_activate_slave(internals); + bond_tlb_activate_child(internals); if (internals->mode == BONDING_MODE_ALB) bond_mode_alb_client_list_upd(eth_dev); } void -deactivate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id) +deactivate_child(struct rte_eth_dev *eth_dev, uint16_t port_id) { - uint16_t slave_pos; + uint16_t child_pos; struct bond_dev_private *internals = eth_dev->data->dev_private; - uint16_t active_count = internals->active_slave_count; + uint16_t active_count = internals->active_child_count; if (internals->mode == BONDING_MODE_8023AD) { bond_mode_8023ad_stop(eth_dev); - bond_mode_8023ad_deactivate_slave(eth_dev, port_id); + bond_mode_8023ad_deactivate_child(eth_dev, port_id); } else if (internals->mode == BONDING_MODE_TLB || internals->mode == BONDING_MODE_ALB) bond_tlb_disable(internals); - slave_pos = find_slave_by_id(internals->active_slaves, active_count, + child_pos = find_child_by_id(internals->active_children, active_count, port_id); - /* If slave was not at the end of the list - * shift active slaves up active array list */ - if (slave_pos < active_count) { + /* If child was not at the end of the list + * shift active children up active array list */ + if (child_pos < active_count) { active_count--; - memmove(internals->active_slaves + slave_pos, - internals->active_slaves + slave_pos + 1, - (active_count - slave_pos) * - sizeof(internals->active_slaves[0])); + memmove(internals->active_children + child_pos, + internals->active_children + child_pos + 1, + (active_count - child_pos) * + sizeof(internals->active_children[0])); } - RTE_ASSERT(active_count < RTE_DIM(internals->active_slaves)); - internals->active_slave_count = active_count; + RTE_ASSERT(active_count < RTE_DIM(internals->active_children)); + internals->active_child_count = active_count; if (eth_dev->data->dev_started) { if (internals->mode == BONDING_MODE_8023AD) { @@ -192,7 +192,7 @@ rte_eth_bond_free(const char *name) } static int -slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id) +child_vlan_filter_set(uint16_t bonded_port_id, uint16_t child_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -224,7 +224,7 @@ slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id) if (unlikely(slab & mask)) { uint16_t vlan_id = pos + i; - res = rte_eth_dev_vlan_filter(slave_port_id, + res = rte_eth_dev_vlan_filter(child_port_id, vlan_id, 1); } } @@ -236,45 +236,45 @@ slave_vlan_filter_set(uint16_t bonded_port_id, uint16_t slave_port_id) } static int -slave_rte_flow_prepare(uint16_t slave_id, struct bond_dev_private *internals) +child_rte_flow_prepare(uint16_t child_id, struct bond_dev_private *internals) { struct rte_flow *flow; struct rte_flow_error ferror; - uint16_t slave_port_id = internals->slaves[slave_id].port_id; + uint16_t child_port_id = internals->children[child_id].port_id; if (internals->flow_isolated_valid != 0) { - if (rte_eth_dev_stop(slave_port_id) != 0) { + if (rte_eth_dev_stop(child_port_id) != 0) { RTE_BOND_LOG(ERR, "Failed to stop device on port %u", - slave_port_id); + child_port_id); return -1; } - if (rte_flow_isolate(slave_port_id, internals->flow_isolated, + if (rte_flow_isolate(child_port_id, internals->flow_isolated, &ferror)) { - RTE_BOND_LOG(ERR, "rte_flow_isolate failed for slave" - " %d: %s", slave_id, ferror.message ? + RTE_BOND_LOG(ERR, "rte_flow_isolate failed for child" + " %d: %s", child_id, ferror.message ? ferror.message : "(no stated reason)"); return -1; } } TAILQ_FOREACH(flow, &internals->flow_list, next) { - flow->flows[slave_id] = rte_flow_create(slave_port_id, + flow->flows[child_id] = rte_flow_create(child_port_id, flow->rule.attr, flow->rule.pattern, flow->rule.actions, &ferror); - if (flow->flows[slave_id] == NULL) { - RTE_BOND_LOG(ERR, "Cannot create flow for slave" - " %d: %s", slave_id, + if (flow->flows[child_id] == NULL) { + RTE_BOND_LOG(ERR, "Cannot create flow for child" + " %d: %s", child_id, ferror.message ? ferror.message : "(no stated reason)"); - /* Destroy successful bond flows from the slave */ + /* Destroy successful bond flows from the child */ TAILQ_FOREACH(flow, &internals->flow_list, next) { - if (flow->flows[slave_id] != NULL) { - rte_flow_destroy(slave_port_id, - flow->flows[slave_id], + if (flow->flows[child_id] != NULL) { + rte_flow_destroy(child_port_id, + flow->flows[child_id], &ferror); - flow->flows[slave_id] = NULL; + flow->flows[child_id] = NULL; } } return -1; @@ -284,7 +284,7 @@ slave_rte_flow_prepare(uint16_t slave_id, struct bond_dev_private *internals) } static void -eth_bond_slave_inherit_dev_info_rx_first(struct bond_dev_private *internals, +eth_bond_child_inherit_dev_info_rx_first(struct bond_dev_private *internals, const struct rte_eth_dev_info *di) { struct rte_eth_rxconf *rxconf_i = &internals->default_rxconf; @@ -292,20 +292,20 @@ eth_bond_slave_inherit_dev_info_rx_first(struct bond_dev_private *internals, internals->reta_size = di->reta_size; internals->rss_key_len = di->hash_key_size; - /* Inherit Rx offload capabilities from the first slave device */ + /* Inherit Rx offload capabilities from the first child device */ internals->rx_offload_capa = di->rx_offload_capa; internals->rx_queue_offload_capa = di->rx_queue_offload_capa; internals->flow_type_rss_offloads = di->flow_type_rss_offloads; - /* Inherit maximum Rx packet size from the first slave device */ + /* Inherit maximum Rx packet size from the first child device */ internals->candidate_max_rx_pktlen = di->max_rx_pktlen; - /* Inherit default Rx queue settings from the first slave device */ + /* Inherit default Rx queue settings from the first child device */ memcpy(rxconf_i, &di->default_rxconf, sizeof(*rxconf_i)); /* * Turn off descriptor prefetch and writeback by default for all - * slave devices. Applications may tweak this setting if need be. + * child devices. Applications may tweak this setting if need be. */ rxconf_i->rx_thresh.pthresh = 0; rxconf_i->rx_thresh.hthresh = 0; @@ -314,26 +314,26 @@ eth_bond_slave_inherit_dev_info_rx_first(struct bond_dev_private *internals, /* Setting this to zero should effectively enable default values */ rxconf_i->rx_free_thresh = 0; - /* Disable deferred start by default for all slave devices */ + /* Disable deferred start by default for all child devices */ rxconf_i->rx_deferred_start = 0; } static void -eth_bond_slave_inherit_dev_info_tx_first(struct bond_dev_private *internals, +eth_bond_child_inherit_dev_info_tx_first(struct bond_dev_private *internals, const struct rte_eth_dev_info *di) { struct rte_eth_txconf *txconf_i = &internals->default_txconf; - /* Inherit Tx offload capabilities from the first slave device */ + /* Inherit Tx offload capabilities from the first child device */ internals->tx_offload_capa = di->tx_offload_capa; internals->tx_queue_offload_capa = di->tx_queue_offload_capa; - /* Inherit default Tx queue settings from the first slave device */ + /* Inherit default Tx queue settings from the first child device */ memcpy(txconf_i, &di->default_txconf, sizeof(*txconf_i)); /* * Turn off descriptor prefetch and writeback by default for all - * slave devices. Applications may tweak this setting if need be. + * child devices. Applications may tweak this setting if need be. */ txconf_i->tx_thresh.pthresh = 0; txconf_i->tx_thresh.hthresh = 0; @@ -341,17 +341,17 @@ eth_bond_slave_inherit_dev_info_tx_first(struct bond_dev_private *internals, /* * Setting these parameters to zero assumes that default - * values will be configured implicitly by slave devices. + * values will be configured implicitly by child devices. */ txconf_i->tx_free_thresh = 0; txconf_i->tx_rs_thresh = 0; - /* Disable deferred start by default for all slave devices */ + /* Disable deferred start by default for all child devices */ txconf_i->tx_deferred_start = 0; } static void -eth_bond_slave_inherit_dev_info_rx_next(struct bond_dev_private *internals, +eth_bond_child_inherit_dev_info_rx_next(struct bond_dev_private *internals, const struct rte_eth_dev_info *di) { struct rte_eth_rxconf *rxconf_i = &internals->default_rxconf; @@ -362,32 +362,32 @@ eth_bond_slave_inherit_dev_info_rx_next(struct bond_dev_private *internals, internals->flow_type_rss_offloads &= di->flow_type_rss_offloads; /* - * If at least one slave device suggests enabling this - * setting by default, enable it for all slave devices + * If at least one child device suggests enabling this + * setting by default, enable it for all child devices * since disabling it may not be necessarily supported. */ if (rxconf->rx_drop_en == 1) rxconf_i->rx_drop_en = 1; /* - * Adding a new slave device may cause some of previously inherited + * Adding a new child device may cause some of previously inherited * offloads to be withdrawn from the internal rx_queue_offload_capa * value. Thus, the new internal value of default Rx queue offloads * has to be masked by rx_queue_offload_capa to make sure that only * commonly supported offloads are preserved from both the previous - * value and the value being inherited from the new slave device. + * value and the value being inherited from the new child device. */ rxconf_i->offloads = (rxconf_i->offloads | rxconf->offloads) & internals->rx_queue_offload_capa; /* - * RETA size is GCD of all slaves RETA sizes, so, if all sizes will be + * RETA size is GCD of all children RETA sizes, so, if all sizes will be * the power of 2, the lower one is GCD */ if (internals->reta_size > di->reta_size) internals->reta_size = di->reta_size; if (internals->rss_key_len > di->hash_key_size) { - RTE_BOND_LOG(WARNING, "slave has different rss key size, " + RTE_BOND_LOG(WARNING, "child has different rss key size, " "configuring rss may fail"); internals->rss_key_len = di->hash_key_size; } @@ -398,7 +398,7 @@ eth_bond_slave_inherit_dev_info_rx_next(struct bond_dev_private *internals, } static void -eth_bond_slave_inherit_dev_info_tx_next(struct bond_dev_private *internals, +eth_bond_child_inherit_dev_info_tx_next(struct bond_dev_private *internals, const struct rte_eth_dev_info *di) { struct rte_eth_txconf *txconf_i = &internals->default_txconf; @@ -408,34 +408,34 @@ eth_bond_slave_inherit_dev_info_tx_next(struct bond_dev_private *internals, internals->tx_queue_offload_capa &= di->tx_queue_offload_capa; /* - * Adding a new slave device may cause some of previously inherited + * Adding a new child device may cause some of previously inherited * offloads to be withdrawn from the internal tx_queue_offload_capa * value. Thus, the new internal value of default Tx queue offloads * has to be masked by tx_queue_offload_capa to make sure that only * commonly supported offloads are preserved from both the previous - * value and the value being inherited from the new slave device. + * value and the value being inherited from the new child device. */ txconf_i->offloads = (txconf_i->offloads | txconf->offloads) & internals->tx_queue_offload_capa; } static void -eth_bond_slave_inherit_desc_lim_first(struct rte_eth_desc_lim *bond_desc_lim, - const struct rte_eth_desc_lim *slave_desc_lim) +eth_bond_child_inherit_desc_lim_first(struct rte_eth_desc_lim *bond_desc_lim, + const struct rte_eth_desc_lim *child_desc_lim) { - memcpy(bond_desc_lim, slave_desc_lim, sizeof(*bond_desc_lim)); + memcpy(bond_desc_lim, child_desc_lim, sizeof(*bond_desc_lim)); } static int -eth_bond_slave_inherit_desc_lim_next(struct rte_eth_desc_lim *bond_desc_lim, - const struct rte_eth_desc_lim *slave_desc_lim) +eth_bond_child_inherit_desc_lim_next(struct rte_eth_desc_lim *bond_desc_lim, + const struct rte_eth_desc_lim *child_desc_lim) { bond_desc_lim->nb_max = RTE_MIN(bond_desc_lim->nb_max, - slave_desc_lim->nb_max); + child_desc_lim->nb_max); bond_desc_lim->nb_min = RTE_MAX(bond_desc_lim->nb_min, - slave_desc_lim->nb_min); + child_desc_lim->nb_min); bond_desc_lim->nb_align = RTE_MAX(bond_desc_lim->nb_align, - slave_desc_lim->nb_align); + child_desc_lim->nb_align); if (bond_desc_lim->nb_min > bond_desc_lim->nb_max || bond_desc_lim->nb_align > bond_desc_lim->nb_max) { @@ -444,22 +444,22 @@ eth_bond_slave_inherit_desc_lim_next(struct rte_eth_desc_lim *bond_desc_lim, } /* Treat maximum number of segments equal to 0 as unspecified */ - if (slave_desc_lim->nb_seg_max != 0 && + if (child_desc_lim->nb_seg_max != 0 && (bond_desc_lim->nb_seg_max == 0 || - slave_desc_lim->nb_seg_max < bond_desc_lim->nb_seg_max)) - bond_desc_lim->nb_seg_max = slave_desc_lim->nb_seg_max; - if (slave_desc_lim->nb_mtu_seg_max != 0 && + child_desc_lim->nb_seg_max < bond_desc_lim->nb_seg_max)) + bond_desc_lim->nb_seg_max = child_desc_lim->nb_seg_max; + if (child_desc_lim->nb_mtu_seg_max != 0 && (bond_desc_lim->nb_mtu_seg_max == 0 || - slave_desc_lim->nb_mtu_seg_max < bond_desc_lim->nb_mtu_seg_max)) - bond_desc_lim->nb_mtu_seg_max = slave_desc_lim->nb_mtu_seg_max; + child_desc_lim->nb_mtu_seg_max < bond_desc_lim->nb_mtu_seg_max)) + bond_desc_lim->nb_mtu_seg_max = child_desc_lim->nb_mtu_seg_max; return 0; } static int -__eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) +__eth_bond_child_add_lock_free(uint16_t bonded_port_id, uint16_t child_port_id) { - struct rte_eth_dev *bonded_eth_dev, *slave_eth_dev; + struct rte_eth_dev *bonded_eth_dev, *child_eth_dev; struct bond_dev_private *internals; struct rte_eth_link link_props; struct rte_eth_dev_info dev_info; @@ -468,77 +468,77 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) bonded_eth_dev = &rte_eth_devices[bonded_port_id]; internals = bonded_eth_dev->data->dev_private; - if (valid_slave_port_id(internals, slave_port_id) != 0) + if (valid_child_port_id(internals, child_port_id) != 0) return -1; - slave_eth_dev = &rte_eth_devices[slave_port_id]; - if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_BONDED_SLAVE) { - RTE_BOND_LOG(ERR, "Slave device is already a slave of a bonded device"); + child_eth_dev = &rte_eth_devices[child_port_id]; + if (child_eth_dev->data->dev_flags & RTE_ETH_DEV_BONDED_CHILD) { + RTE_BOND_LOG(ERR, "Child device is already a child of a bonded device"); return -1; } - ret = rte_eth_dev_info_get(slave_port_id, &dev_info); + ret = rte_eth_dev_info_get(child_port_id, &dev_info); if (ret != 0) { RTE_BOND_LOG(ERR, "%s: Error during getting device (port %u) info: %s\n", - __func__, slave_port_id, strerror(-ret)); + __func__, child_port_id, strerror(-ret)); return ret; } if (dev_info.max_rx_pktlen < internals->max_rx_pktlen) { - RTE_BOND_LOG(ERR, "Slave (port %u) max_rx_pktlen too small", - slave_port_id); + RTE_BOND_LOG(ERR, "Child (port %u) max_rx_pktlen too small", + child_port_id); return -1; } - slave_add(internals, slave_eth_dev); + child_add(internals, child_eth_dev); - /* We need to store slaves reta_size to be able to synchronize RETA for all - * slave devices even if its sizes are different. + /* We need to store children reta_size to be able to synchronize RETA for all + * child devices even if its sizes are different. */ - internals->slaves[internals->slave_count].reta_size = dev_info.reta_size; + internals->children[internals->child_count].reta_size = dev_info.reta_size; - if (internals->slave_count < 1) { - /* if MAC is not user defined then use MAC of first slave add to + if (internals->child_count < 1) { + /* if MAC is not user defined then use MAC of first child add to * bonded device */ if (!internals->user_defined_mac) { if (mac_address_set(bonded_eth_dev, - slave_eth_dev->data->mac_addrs)) { + child_eth_dev->data->mac_addrs)) { RTE_BOND_LOG(ERR, "Failed to set MAC address"); return -1; } } - /* Make primary slave */ - internals->primary_port = slave_port_id; - internals->current_primary_port = slave_port_id; + /* Make primary child */ + internals->primary_port = child_port_id; + internals->current_primary_port = child_port_id; internals->speed_capa = dev_info.speed_capa; - /* Inherit queues settings from first slave */ - internals->nb_rx_queues = slave_eth_dev->data->nb_rx_queues; - internals->nb_tx_queues = slave_eth_dev->data->nb_tx_queues; + /* Inherit queues settings from first child */ + internals->nb_rx_queues = child_eth_dev->data->nb_rx_queues; + internals->nb_tx_queues = child_eth_dev->data->nb_tx_queues; - eth_bond_slave_inherit_dev_info_rx_first(internals, &dev_info); - eth_bond_slave_inherit_dev_info_tx_first(internals, &dev_info); + eth_bond_child_inherit_dev_info_rx_first(internals, &dev_info); + eth_bond_child_inherit_dev_info_tx_first(internals, &dev_info); - eth_bond_slave_inherit_desc_lim_first(&internals->rx_desc_lim, + eth_bond_child_inherit_desc_lim_first(&internals->rx_desc_lim, &dev_info.rx_desc_lim); - eth_bond_slave_inherit_desc_lim_first(&internals->tx_desc_lim, + eth_bond_child_inherit_desc_lim_first(&internals->tx_desc_lim, &dev_info.tx_desc_lim); } else { int ret; internals->speed_capa &= dev_info.speed_capa; - eth_bond_slave_inherit_dev_info_rx_next(internals, &dev_info); - eth_bond_slave_inherit_dev_info_tx_next(internals, &dev_info); + eth_bond_child_inherit_dev_info_rx_next(internals, &dev_info); + eth_bond_child_inherit_dev_info_tx_next(internals, &dev_info); - ret = eth_bond_slave_inherit_desc_lim_next( + ret = eth_bond_child_inherit_desc_lim_next( &internals->rx_desc_lim, &dev_info.rx_desc_lim); if (ret != 0) return ret; - ret = eth_bond_slave_inherit_desc_lim_next( + ret = eth_bond_child_inherit_desc_lim_next( &internals->tx_desc_lim, &dev_info.tx_desc_lim); if (ret != 0) return ret; @@ -552,79 +552,79 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_port_id) bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &= internals->flow_type_rss_offloads; - if (slave_rte_flow_prepare(internals->slave_count, internals) != 0) { - RTE_BOND_LOG(ERR, "Failed to prepare new slave flows: port=%d", - slave_port_id); + if (child_rte_flow_prepare(internals->child_count, internals) != 0) { + RTE_BOND_LOG(ERR, "Failed to prepare new child flows: port=%d", + child_port_id); return -1; } - /* Add additional MAC addresses to the slave */ - if (slave_add_mac_addresses(bonded_eth_dev, slave_port_id) != 0) { - RTE_BOND_LOG(ERR, "Failed to add mac address(es) to slave %hu", - slave_port_id); + /* Add additional MAC addresses to the child */ + if (child_add_mac_addresses(bonded_eth_dev, child_port_id) != 0) { + RTE_BOND_LOG(ERR, "Failed to add mac address(es) to child %hu", + child_port_id); return -1; } - internals->slave_count++; + internals->child_count++; if (bonded_eth_dev->data->dev_started) { - if (slave_configure(bonded_eth_dev, slave_eth_dev) != 0) { - internals->slave_count--; - RTE_BOND_LOG(ERR, "rte_bond_slaves_configure: port=%d", - slave_port_id); + if (child_configure(bonded_eth_dev, child_eth_dev) != 0) { + internals->child_count--; + RTE_BOND_LOG(ERR, "rte_bond_children_configure: port=%d", + child_port_id); return -1; } - if (slave_start(bonded_eth_dev, slave_eth_dev) != 0) { - internals->slave_count--; - RTE_BOND_LOG(ERR, "rte_bond_slaves_start: port=%d", - slave_port_id); + if (child_start(bonded_eth_dev, child_eth_dev) != 0) { + internals->child_count--; + RTE_BOND_LOG(ERR, "rte_bond_children_start: port=%d", + child_port_id); return -1; } } - /* Update all slave devices MACs */ - mac_address_slaves_update(bonded_eth_dev); + /* Update all child devices MACs */ + mac_address_children_update(bonded_eth_dev); /* Register link status change callback with bonded device pointer as * argument*/ - rte_eth_dev_callback_register(slave_port_id, RTE_ETH_EVENT_INTR_LSC, + rte_eth_dev_callback_register(child_port_id, RTE_ETH_EVENT_INTR_LSC, bond_ethdev_lsc_event_callback, &bonded_eth_dev->data->port_id); - /* If bonded device is started then we can add the slave to our active - * slave array */ + /* If bonded device is started then we can add the child to our active + * child array */ if (bonded_eth_dev->data->dev_started) { - ret = rte_eth_link_get_nowait(slave_port_id, &link_props); + ret = rte_eth_link_get_nowait(child_port_id, &link_props); if (ret < 0) { - rte_eth_dev_callback_unregister(slave_port_id, + rte_eth_dev_callback_unregister(child_port_id, RTE_ETH_EVENT_INTR_LSC, bond_ethdev_lsc_event_callback, &bonded_eth_dev->data->port_id); - internals->slave_count--; + internals->child_count--; RTE_BOND_LOG(ERR, - "Slave (port %u) link get failed: %s\n", - slave_port_id, rte_strerror(-ret)); + "Child (port %u) link get failed: %s\n", + child_port_id, rte_strerror(-ret)); return -1; } if (link_props.link_status == RTE_ETH_LINK_UP) { - if (internals->active_slave_count == 0 && + if (internals->active_child_count == 0 && !internals->user_defined_primary_port) bond_ethdev_primary_set(internals, - slave_port_id); + child_port_id); } } - /* Add slave details to bonded device */ - slave_eth_dev->data->dev_flags |= RTE_ETH_DEV_BONDED_SLAVE; + /* Add child details to bonded device */ + child_eth_dev->data->dev_flags |= RTE_ETH_DEV_BONDED_CHILD; - slave_vlan_filter_set(bonded_port_id, slave_port_id); + child_vlan_filter_set(bonded_port_id, child_port_id); return 0; } int -rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id) +rte_eth_bond_child_add(uint16_t bonded_port_id, uint16_t child_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -637,12 +637,12 @@ rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id) bonded_eth_dev = &rte_eth_devices[bonded_port_id]; internals = bonded_eth_dev->data->dev_private; - if (valid_slave_port_id(internals, slave_port_id) != 0) + if (valid_child_port_id(internals, child_port_id) != 0) return -1; rte_spinlock_lock(&internals->lock); - retval = __eth_bond_slave_add_lock_free(bonded_port_id, slave_port_id); + retval = __eth_bond_child_add_lock_free(bonded_port_id, child_port_id); rte_spinlock_unlock(&internals->lock); @@ -650,93 +650,93 @@ rte_eth_bond_slave_add(uint16_t bonded_port_id, uint16_t slave_port_id) } static int -__eth_bond_slave_remove_lock_free(uint16_t bonded_port_id, - uint16_t slave_port_id) +__eth_bond_child_remove_lock_free(uint16_t bonded_port_id, + uint16_t child_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; - struct rte_eth_dev *slave_eth_dev; + struct rte_eth_dev *child_eth_dev; struct rte_flow_error flow_error; struct rte_flow *flow; - int i, slave_idx; + int i, child_idx; bonded_eth_dev = &rte_eth_devices[bonded_port_id]; internals = bonded_eth_dev->data->dev_private; - if (valid_slave_port_id(internals, slave_port_id) < 0) + if (valid_child_port_id(internals, child_port_id) < 0) return -1; - /* first remove from active slave list */ - slave_idx = find_slave_by_id(internals->active_slaves, - internals->active_slave_count, slave_port_id); + /* first remove from active child list */ + child_idx = find_child_by_id(internals->active_children, + internals->active_child_count, child_port_id); - if (slave_idx < internals->active_slave_count) - deactivate_slave(bonded_eth_dev, slave_port_id); + if (child_idx < internals->active_child_count) + deactivate_child(bonded_eth_dev, child_port_id); - slave_idx = -1; - /* now find in slave list */ - for (i = 0; i < internals->slave_count; i++) - if (internals->slaves[i].port_id == slave_port_id) { - slave_idx = i; + child_idx = -1; + /* now find in child list */ + for (i = 0; i < internals->child_count; i++) + if (internals->children[i].port_id == child_port_id) { + child_idx = i; break; } - if (slave_idx < 0) { - RTE_BOND_LOG(ERR, "Couldn't find slave in port list, slave count %u", - internals->slave_count); + if (child_idx < 0) { + RTE_BOND_LOG(ERR, "Couldn't find child in port list, child count %u", + internals->child_count); return -1; } /* Un-register link status change callback with bonded device pointer as * argument*/ - rte_eth_dev_callback_unregister(slave_port_id, RTE_ETH_EVENT_INTR_LSC, + rte_eth_dev_callback_unregister(child_port_id, RTE_ETH_EVENT_INTR_LSC, bond_ethdev_lsc_event_callback, &rte_eth_devices[bonded_port_id].data->port_id); - /* Restore original MAC address of slave device */ - rte_eth_dev_default_mac_addr_set(slave_port_id, - &(internals->slaves[slave_idx].persisted_mac_addr)); + /* Restore original MAC address of child device */ + rte_eth_dev_default_mac_addr_set(child_port_id, + &(internals->children[child_idx].persisted_mac_addr)); - /* remove additional MAC addresses from the slave */ - slave_remove_mac_addresses(bonded_eth_dev, slave_port_id); + /* remove additional MAC addresses from the child */ + child_remove_mac_addresses(bonded_eth_dev, child_port_id); /* - * Remove bond device flows from slave device. + * Remove bond device flows from child device. * Note: don't restore flow isolate mode. */ TAILQ_FOREACH(flow, &internals->flow_list, next) { - if (flow->flows[slave_idx] != NULL) { - rte_flow_destroy(slave_port_id, flow->flows[slave_idx], + if (flow->flows[child_idx] != NULL) { + rte_flow_destroy(child_port_id, flow->flows[child_idx], &flow_error); - flow->flows[slave_idx] = NULL; + flow->flows[child_idx] = NULL; } } - slave_eth_dev = &rte_eth_devices[slave_port_id]; - slave_remove(internals, slave_eth_dev); - slave_eth_dev->data->dev_flags &= (~RTE_ETH_DEV_BONDED_SLAVE); + child_eth_dev = &rte_eth_devices[child_port_id]; + child_remove(internals, child_eth_dev); + child_eth_dev->data->dev_flags &= (~RTE_ETH_DEV_BONDED_CHILD); - /* first slave in the active list will be the primary by default, + /* first child in the active list will be the primary by default, * otherwise use first device in list */ - if (internals->current_primary_port == slave_port_id) { - if (internals->active_slave_count > 0) - internals->current_primary_port = internals->active_slaves[0]; - else if (internals->slave_count > 0) - internals->current_primary_port = internals->slaves[0].port_id; + if (internals->current_primary_port == child_port_id) { + if (internals->active_child_count > 0) + internals->current_primary_port = internals->active_children[0]; + else if (internals->child_count > 0) + internals->current_primary_port = internals->children[0].port_id; else internals->primary_port = 0; - mac_address_slaves_update(bonded_eth_dev); + mac_address_children_update(bonded_eth_dev); } - if (internals->active_slave_count < 1) { - /* if no slaves are any longer attached to bonded device and MAC is not + if (internals->active_child_count < 1) { + /* if no children are any longer attached to bonded device and MAC is not * user defined then clear MAC of bonded device as it will be reset - * when a new slave is added */ - if (internals->slave_count < 1 && !internals->user_defined_mac) + * when a new child is added */ + if (internals->child_count < 1 && !internals->user_defined_mac) memset(rte_eth_devices[bonded_port_id].data->mac_addrs, 0, sizeof(*(rte_eth_devices[bonded_port_id].data->mac_addrs))); } - if (internals->slave_count == 0) { + if (internals->child_count == 0) { internals->rx_offload_capa = 0; internals->tx_offload_capa = 0; internals->rx_queue_offload_capa = 0; @@ -750,7 +750,7 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id, } int -rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id) +rte_eth_bond_child_remove(uint16_t bonded_port_id, uint16_t child_port_id) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; @@ -764,7 +764,7 @@ rte_eth_bond_slave_remove(uint16_t bonded_port_id, uint16_t slave_port_id) rte_spinlock_lock(&internals->lock); - retval = __eth_bond_slave_remove_lock_free(bonded_port_id, slave_port_id); + retval = __eth_bond_child_remove_lock_free(bonded_port_id, child_port_id); rte_spinlock_unlock(&internals->lock); @@ -781,7 +781,7 @@ rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t mode) bonded_eth_dev = &rte_eth_devices[bonded_port_id]; - if (check_for_master_bonded_ethdev(bonded_eth_dev) != 0 && + if (check_for_parent_bonded_ethdev(bonded_eth_dev) != 0 && mode == BONDING_MODE_8023AD) return -1; @@ -802,7 +802,7 @@ rte_eth_bond_mode_get(uint16_t bonded_port_id) } int -rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id) +rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t child_port_id) { struct bond_dev_private *internals; @@ -811,13 +811,13 @@ rte_eth_bond_primary_set(uint16_t bonded_port_id, uint16_t slave_port_id) internals = rte_eth_devices[bonded_port_id].data->dev_private; - if (valid_slave_port_id(internals, slave_port_id) != 0) + if (valid_child_port_id(internals, child_port_id) != 0) return -1; internals->user_defined_primary_port = 1; - internals->primary_port = slave_port_id; + internals->primary_port = child_port_id; - bond_ethdev_primary_set(internals, slave_port_id); + bond_ethdev_primary_set(internals, child_port_id); return 0; } @@ -832,14 +832,14 @@ rte_eth_bond_primary_get(uint16_t bonded_port_id) internals = rte_eth_devices[bonded_port_id].data->dev_private; - if (internals->slave_count < 1) + if (internals->child_count < 1) return -1; return internals->current_primary_port; } int -rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], +rte_eth_bond_children_get(uint16_t bonded_port_id, uint16_t children[], uint16_t len) { struct bond_dev_private *internals; @@ -848,22 +848,22 @@ rte_eth_bond_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], if (valid_bonded_port_id(bonded_port_id) != 0) return -1; - if (slaves == NULL) + if (children == NULL) return -1; internals = rte_eth_devices[bonded_port_id].data->dev_private; - if (internals->slave_count > len) + if (internals->child_count > len) return -1; - for (i = 0; i < internals->slave_count; i++) - slaves[i] = internals->slaves[i].port_id; + for (i = 0; i < internals->child_count; i++) + children[i] = internals->children[i].port_id; - return internals->slave_count; + return internals->child_count; } int -rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], +rte_eth_bond_active_children_get(uint16_t bonded_port_id, uint16_t children[], uint16_t len) { struct bond_dev_private *internals; @@ -871,18 +871,18 @@ rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], if (valid_bonded_port_id(bonded_port_id) != 0) return -1; - if (slaves == NULL) + if (children == NULL) return -1; internals = rte_eth_devices[bonded_port_id].data->dev_private; - if (internals->active_slave_count > len) + if (internals->active_child_count > len) return -1; - memcpy(slaves, internals->active_slaves, - internals->active_slave_count * sizeof(internals->active_slaves[0])); + memcpy(children, internals->active_children, + internals->active_child_count * sizeof(internals->active_children[0])); - return internals->active_slave_count; + return internals->active_child_count; } int @@ -904,9 +904,9 @@ rte_eth_bond_mac_address_set(uint16_t bonded_port_id, internals->user_defined_mac = 1; - /* Update all slave devices MACs*/ - if (internals->slave_count > 0) - return mac_address_slaves_update(bonded_eth_dev); + /* Update all child devices MACs*/ + if (internals->child_count > 0) + return mac_address_children_update(bonded_eth_dev); return 0; } @@ -925,30 +925,30 @@ rte_eth_bond_mac_address_reset(uint16_t bonded_port_id) internals->user_defined_mac = 0; - if (internals->slave_count > 0) { - int slave_port; - /* Get the primary slave location based on the primary port - * number as, while slave_add(), we will keep the primary - * slave based on slave_count,but not based on the primary port. + if (internals->child_count > 0) { + int child_port; + /* Get the primary child location based on the primary port + * number as, while child_add(), we will keep the primary + * child based on child_count,but not based on the primary port. */ - for (slave_port = 0; slave_port < internals->slave_count; - slave_port++) { - if (internals->slaves[slave_port].port_id == + for (child_port = 0; child_port < internals->child_count; + child_port++) { + if (internals->children[child_port].port_id == internals->primary_port) break; } /* Set MAC Address of Bonded Device */ if (mac_address_set(bonded_eth_dev, - &internals->slaves[slave_port].persisted_mac_addr) + &internals->children[child_port].persisted_mac_addr) != 0) { RTE_BOND_LOG(ERR, "Failed to set MAC address on bonded device"); return -1; } - /* Update all slave devices MAC addresses */ - return mac_address_slaves_update(bonded_eth_dev); + /* Update all child devices MAC addresses */ + return mac_address_children_update(bonded_eth_dev); } - /* No need to update anything as no slaves present */ + /* No need to update anything as no children present */ return 0; } diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index 6553166f5cb7..c4af24f119e7 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -12,8 +12,8 @@ #include "eth_bond_private.h" const char *pmd_bond_init_valid_arguments[] = { - PMD_BOND_SLAVE_PORT_KVARG, - PMD_BOND_PRIMARY_SLAVE_KVARG, + PMD_BOND_CHILD_PORT_KVARG, + PMD_BOND_PRIMARY_CHILD_KVARG, PMD_BOND_MODE_KVARG, PMD_BOND_XMIT_POLICY_KVARG, PMD_BOND_SOCKET_ID_KVARG, @@ -109,31 +109,31 @@ parse_port_id(const char *port_str) } int -bond_ethdev_parse_slave_port_kvarg(const char *key, +bond_ethdev_parse_child_port_kvarg(const char *key, const char *value, void *extra_args) { - struct bond_ethdev_slave_ports *slave_ports; + struct bond_ethdev_child_ports *child_ports; if (value == NULL || extra_args == NULL) return -1; - slave_ports = extra_args; + child_ports = extra_args; - if (strcmp(key, PMD_BOND_SLAVE_PORT_KVARG) == 0) { + if (strcmp(key, PMD_BOND_CHILD_PORT_KVARG) == 0) { int port_id = parse_port_id(value); if (port_id < 0) { - RTE_BOND_LOG(ERR, "Invalid slave port value (%s) specified", + RTE_BOND_LOG(ERR, "Invalid child port value (%s) specified", value); return -1; } else - slave_ports->slaves[slave_ports->slave_count++] = + child_ports->children[child_ports->child_count++] = port_id; } return 0; } int -bond_ethdev_parse_slave_mode_kvarg(const char *key __rte_unused, +bond_ethdev_parse_child_mode_kvarg(const char *key __rte_unused, const char *value, void *extra_args) { uint8_t *mode; @@ -160,13 +160,13 @@ bond_ethdev_parse_slave_mode_kvarg(const char *key __rte_unused, case BONDING_MODE_ALB: return 0; default: - RTE_BOND_LOG(ERR, "Invalid slave mode value (%s) specified", value); + RTE_BOND_LOG(ERR, "Invalid child mode value (%s) specified", value); return -1; } } int -bond_ethdev_parse_slave_agg_mode_kvarg(const char *key __rte_unused, +bond_ethdev_parse_child_agg_mode_kvarg(const char *key __rte_unused, const char *value, void *extra_args) { uint8_t *agg_mode; @@ -221,19 +221,19 @@ bond_ethdev_parse_socket_id_kvarg(const char *key __rte_unused, } int -bond_ethdev_parse_primary_slave_port_id_kvarg(const char *key __rte_unused, +bond_ethdev_parse_primary_child_port_id_kvarg(const char *key __rte_unused, const char *value, void *extra_args) { - int primary_slave_port_id; + int primary_child_port_id; if (value == NULL || extra_args == NULL) return -1; - primary_slave_port_id = parse_port_id(value); - if (primary_slave_port_id < 0) + primary_child_port_id = parse_port_id(value); + if (primary_child_port_id < 0) return -1; - *(uint16_t *)extra_args = (uint16_t)primary_slave_port_id; + *(uint16_t *)extra_args = (uint16_t)primary_child_port_id; return 0; } diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c index 65b77faae709..b2d5b171c712 100644 --- a/drivers/net/bonding/rte_eth_bond_flow.c +++ b/drivers/net/bonding/rte_eth_bond_flow.c @@ -69,12 +69,12 @@ bond_flow_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, int i; int ret; - for (i = 0; i < internals->slave_count; i++) { - ret = rte_flow_validate(internals->slaves[i].port_id, attr, + for (i = 0; i < internals->child_count; i++) { + ret = rte_flow_validate(internals->children[i].port_id, attr, patterns, actions, err); if (ret) { RTE_BOND_LOG(ERR, "Operation rte_flow_validate failed" - " for slave %d with error %d", i, ret); + " for child %d with error %d", i, ret); return ret; } } @@ -97,11 +97,11 @@ bond_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, NULL, rte_strerror(ENOMEM)); return NULL; } - for (i = 0; i < internals->slave_count; i++) { - flow->flows[i] = rte_flow_create(internals->slaves[i].port_id, + for (i = 0; i < internals->child_count; i++) { + flow->flows[i] = rte_flow_create(internals->children[i].port_id, attr, patterns, actions, err); if (unlikely(flow->flows[i] == NULL)) { - RTE_BOND_LOG(ERR, "Failed to create flow on slave %d", + RTE_BOND_LOG(ERR, "Failed to create flow on child %d", i); goto err; } @@ -109,10 +109,10 @@ bond_flow_create(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, TAILQ_INSERT_TAIL(&internals->flow_list, flow, next); return flow; err: - /* Destroy all slaves flows. */ - for (i = 0; i < internals->slave_count; i++) { + /* Destroy all children flows. */ + for (i = 0; i < internals->child_count; i++) { if (flow->flows[i] != NULL) - rte_flow_destroy(internals->slaves[i].port_id, + rte_flow_destroy(internals->children[i].port_id, flow->flows[i], err); } bond_flow_release(&flow); @@ -127,15 +127,15 @@ bond_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, int i; int ret = 0; - for (i = 0; i < internals->slave_count; i++) { + for (i = 0; i < internals->child_count; i++) { int lret; if (unlikely(flow->flows[i] == NULL)) continue; - lret = rte_flow_destroy(internals->slaves[i].port_id, + lret = rte_flow_destroy(internals->children[i].port_id, flow->flows[i], err); if (unlikely(lret != 0)) { - RTE_BOND_LOG(ERR, "Failed to destroy flow on slave %d:" + RTE_BOND_LOG(ERR, "Failed to destroy flow on child %d:" " %d", i, lret); ret = lret; } @@ -154,7 +154,7 @@ bond_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *err) int ret = 0; int lret; - /* Destroy all bond flows from its slaves instead of flushing them to + /* Destroy all bond flows from its children instead of flushing them to * keep the LACP flow or any other external flows. */ RTE_TAILQ_FOREACH_SAFE(flow, &internals->flow_list, next, tmp) { @@ -163,7 +163,7 @@ bond_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *err) ret = lret; } if (unlikely(ret != 0)) - RTE_BOND_LOG(ERR, "Failed to flush flow in all slaves"); + RTE_BOND_LOG(ERR, "Failed to flush flow in all children"); return ret; } @@ -174,26 +174,26 @@ bond_flow_query_count(struct rte_eth_dev *dev, struct rte_flow *flow, struct rte_flow_error *err) { struct bond_dev_private *internals = dev->data->dev_private; - struct rte_flow_query_count slave_count; + struct rte_flow_query_count child_count; int i; int ret; count->bytes = 0; count->hits = 0; - rte_memcpy(&slave_count, count, sizeof(slave_count)); - for (i = 0; i < internals->slave_count; i++) { - ret = rte_flow_query(internals->slaves[i].port_id, + rte_memcpy(&child_count, count, sizeof(child_count)); + for (i = 0; i < internals->child_count; i++) { + ret = rte_flow_query(internals->children[i].port_id, flow->flows[i], action, - &slave_count, err); + &child_count, err); if (unlikely(ret != 0)) { RTE_BOND_LOG(ERR, "Failed to query flow on" - " slave %d: %d", i, ret); + " child %d: %d", i, ret); return ret; } - count->bytes += slave_count.bytes; - count->hits += slave_count.hits; - slave_count.bytes = 0; - slave_count.hits = 0; + count->bytes += child_count.bytes; + count->hits += child_count.hits; + child_count.bytes = 0; + child_count.hits = 0; } return 0; } @@ -221,11 +221,11 @@ bond_flow_isolate(struct rte_eth_dev *dev, int set, int i; int ret; - for (i = 0; i < internals->slave_count; i++) { - ret = rte_flow_isolate(internals->slaves[i].port_id, set, err); + for (i = 0; i < internals->child_count; i++) { + ret = rte_flow_isolate(internals->children[i].port_id, set, err); if (unlikely(ret != 0)) { RTE_BOND_LOG(ERR, "Operation rte_flow_isolate failed" - " for slave %d with error %d", i, ret); + " for child %d with error %d", i, ret); internals->flow_isolated_valid = 0; return ret; } diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index f0c4f7d26b86..5c9da8d0d5f8 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -61,33 +61,33 @@ bond_ethdev_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct bond_dev_private *internals; uint16_t num_rx_total = 0; - uint16_t slave_count; - uint16_t active_slave; + uint16_t child_count; + uint16_t active_child; int i; /* Cast to structure, containing bonded device's port id and queue id */ struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue; internals = bd_rx_q->dev_private; - slave_count = internals->active_slave_count; - active_slave = bd_rx_q->active_slave; + child_count = internals->active_child_count; + active_child = bd_rx_q->active_child; - for (i = 0; i < slave_count && nb_pkts; i++) { - uint16_t num_rx_slave; + for (i = 0; i < child_count && nb_pkts; i++) { + uint16_t num_rx_child; /* Offset of pointer to *bufs increases as packets are received - * from other slaves */ - num_rx_slave = - rte_eth_rx_burst(internals->active_slaves[active_slave], + * from other children */ + num_rx_child = + rte_eth_rx_burst(internals->active_children[active_child], bd_rx_q->queue_id, bufs + num_rx_total, nb_pkts); - num_rx_total += num_rx_slave; - nb_pkts -= num_rx_slave; - if (++active_slave >= slave_count) - active_slave = 0; + num_rx_total += num_rx_child; + nb_pkts -= num_rx_child; + if (++active_child >= child_count) + active_child = 0; } - if (++bd_rx_q->active_slave >= slave_count) - bd_rx_q->active_slave = 0; + if (++bd_rx_q->active_child >= child_count) + bd_rx_q->active_child = 0; return num_rx_total; } @@ -158,8 +158,8 @@ const struct rte_flow_attr flow_attr_8023ad = { int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint16_t slave_port) { - struct rte_eth_dev_info slave_info; + uint16_t child_port) { + struct rte_eth_dev_info child_info; struct rte_flow_error error; struct bond_dev_private *internals = bond_dev->data->dev_private; @@ -177,29 +177,29 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, } }; - int ret = rte_flow_validate(slave_port, &flow_attr_8023ad, + int ret = rte_flow_validate(child_port, &flow_attr_8023ad, flow_item_8023ad, actions, &error); if (ret < 0) { - RTE_BOND_LOG(ERR, "%s: %s (slave_port=%d queue_id=%d)", - __func__, error.message, slave_port, + RTE_BOND_LOG(ERR, "%s: %s (child_port=%d queue_id=%d)", + __func__, error.message, child_port, internals->mode4.dedicated_queues.rx_qid); return -1; } - ret = rte_eth_dev_info_get(slave_port, &slave_info); + ret = rte_eth_dev_info_get(child_port, &child_info); if (ret != 0) { RTE_BOND_LOG(ERR, "%s: Error during getting device (port %u) info: %s\n", - __func__, slave_port, strerror(-ret)); + __func__, child_port, strerror(-ret)); return ret; } - if (slave_info.max_rx_queues < bond_dev->data->nb_rx_queues || - slave_info.max_tx_queues < bond_dev->data->nb_tx_queues) { + if (child_info.max_rx_queues < bond_dev->data->nb_rx_queues || + child_info.max_tx_queues < bond_dev->data->nb_tx_queues) { RTE_BOND_LOG(ERR, - "%s: Slave %d capabilities doesn't allow allocating additional queues", - __func__, slave_port); + "%s: Child %d capabilities doesn't allow allocating additional queues", + __func__, child_port); return -1; } @@ -214,8 +214,8 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) { uint16_t idx; int ret; - /* Verify if all slaves in bonding supports flow director and */ - if (internals->slave_count > 0) { + /* Verify if all children in bonding supports flow director and */ + if (internals->child_count > 0) { ret = rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info); if (ret != 0) { RTE_BOND_LOG(ERR, @@ -229,9 +229,9 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) { internals->mode4.dedicated_queues.rx_qid = bond_info.nb_rx_queues; internals->mode4.dedicated_queues.tx_qid = bond_info.nb_tx_queues; - for (idx = 0; idx < internals->slave_count; idx++) { + for (idx = 0; idx < internals->child_count; idx++) { if (bond_ethdev_8023ad_flow_verify(bond_dev, - internals->slaves[idx].port_id) != 0) + internals->children[idx].port_id) != 0) return -1; } } @@ -240,7 +240,7 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_id) { } int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) { +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t child_port) { struct rte_flow_error error; struct bond_dev_private *internals = bond_dev->data->dev_private; @@ -258,12 +258,12 @@ bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_port) { } }; - internals->mode4.dedicated_queues.flow[slave_port] = rte_flow_create(slave_port, + internals->mode4.dedicated_queues.flow[child_port] = rte_flow_create(child_port, &flow_attr_8023ad, flow_item_8023ad, actions, &error); - if (internals->mode4.dedicated_queues.flow[slave_port] == NULL) { + if (internals->mode4.dedicated_queues.flow[child_port] == NULL) { RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_set: %s " - "(slave_port=%d queue_id=%d)", - error.message, slave_port, + "(child_port=%d queue_id=%d)", + error.message, child_port, internals->mode4.dedicated_queues.rx_qid); return -1; } @@ -304,10 +304,10 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts, const uint16_t ether_type_slow_be = rte_be_to_cpu_16(RTE_ETHER_TYPE_SLOW); uint16_t num_rx_total = 0; /* Total number of received packets */ - uint16_t slaves[RTE_MAX_ETHPORTS]; - uint16_t slave_count, idx; + uint16_t children[RTE_MAX_ETHPORTS]; + uint16_t child_count, idx; - uint8_t collecting; /* current slave collecting status */ + uint8_t collecting; /* current child collecting status */ const uint8_t promisc = rte_eth_promiscuous_get(internals->port_id); const uint8_t allmulti = rte_eth_allmulticast_get(internals->port_id); uint8_t subtype; @@ -315,24 +315,24 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts, uint16_t j; uint16_t k; - /* Copy slave list to protect against slave up/down changes during tx + /* Copy child list to protect against child up/down changes during tx * bursting */ - slave_count = internals->active_slave_count; - memcpy(slaves, internals->active_slaves, - sizeof(internals->active_slaves[0]) * slave_count); + child_count = internals->active_child_count; + memcpy(children, internals->active_children, + sizeof(internals->active_children[0]) * child_count); - idx = bd_rx_q->active_slave; - if (idx >= slave_count) { - bd_rx_q->active_slave = 0; + idx = bd_rx_q->active_child; + if (idx >= child_count) { + bd_rx_q->active_child = 0; idx = 0; } - for (i = 0; i < slave_count && num_rx_total < nb_pkts; i++) { + for (i = 0; i < child_count && num_rx_total < nb_pkts; i++) { j = num_rx_total; - collecting = ACTOR_STATE(&bond_mode_8023ad_ports[slaves[idx]], + collecting = ACTOR_STATE(&bond_mode_8023ad_ports[children[idx]], COLLECTING); - /* Read packets from this slave */ - num_rx_total += rte_eth_rx_burst(slaves[idx], bd_rx_q->queue_id, + /* Read packets from this child */ + num_rx_total += rte_eth_rx_burst(children[idx], bd_rx_q->queue_id, &bufs[num_rx_total], nb_pkts - num_rx_total); for (k = j; k < 2 && k < num_rx_total; k++) @@ -348,7 +348,7 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts, /* Remove packet from array if: * - it is slow packet but no dedicated rxq is present, - * - slave is not in collecting state, + * - child is not in collecting state, * - bonding interface is not in promiscuous mode and * packet address isn't in mac_addrs array: * - packet is unicast, @@ -367,7 +367,7 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts, !allmulti)))) { if (hdr->ether_type == ether_type_slow_be) { bond_mode_8023ad_handle_slow_pkt( - internals, slaves[idx], bufs[j]); + internals, children[idx], bufs[j]); } else rte_pktmbuf_free(bufs[j]); @@ -380,12 +380,12 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts, } else j++; } - if (unlikely(++idx == slave_count)) + if (unlikely(++idx == child_count)) idx = 0; } - if (++bd_rx_q->active_slave >= slave_count) - bd_rx_q->active_slave = 0; + if (++bd_rx_q->active_child >= child_count) + bd_rx_q->active_child = 0; return num_rx_total; } @@ -583,59 +583,59 @@ bond_ethdev_tx_burst_round_robin(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_pkts]; - uint16_t slave_nb_pkts[RTE_MAX_ETHPORTS] = { 0 }; + struct rte_mbuf *child_bufs[RTE_MAX_ETHPORTS][nb_pkts]; + uint16_t child_nb_pkts[RTE_MAX_ETHPORTS] = { 0 }; - uint16_t num_of_slaves; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_children; + uint16_t children[RTE_MAX_ETHPORTS]; - uint16_t num_tx_total = 0, num_tx_slave; + uint16_t num_tx_total = 0, num_tx_child; - static int slave_idx = 0; - int i, cslave_idx = 0, tx_fail_total = 0; + static int child_idx = 0; + int i, cchild_idx = 0, tx_fail_total = 0; bd_tx_q = (struct bond_tx_queue *)queue; internals = bd_tx_q->dev_private; - /* Copy slave list to protect against slave up/down changes during tx + /* Copy child list to protect against child up/down changes during tx * bursting */ - num_of_slaves = internals->active_slave_count; - memcpy(slaves, internals->active_slaves, - sizeof(internals->active_slaves[0]) * num_of_slaves); + num_of_children = internals->active_child_count; + memcpy(children, internals->active_children, + sizeof(internals->active_children[0]) * num_of_children); - if (num_of_slaves < 1) + if (num_of_children < 1) return num_tx_total; - /* Populate slaves mbuf with which packets are to be sent on it */ + /* Populate children mbuf with which packets are to be sent on it */ for (i = 0; i < nb_pkts; i++) { - cslave_idx = (slave_idx + i) % num_of_slaves; - slave_bufs[cslave_idx][(slave_nb_pkts[cslave_idx])++] = bufs[i]; + cchild_idx = (child_idx + i) % num_of_children; + child_bufs[cchild_idx][(child_nb_pkts[cchild_idx])++] = bufs[i]; } - /* increment current slave index so the next call to tx burst starts on the - * next slave */ - slave_idx = ++cslave_idx; + /* increment current child index so the next call to tx burst starts on the + * next child */ + child_idx = ++cchild_idx; - /* Send packet burst on each slave device */ - for (i = 0; i < num_of_slaves; i++) { - if (slave_nb_pkts[i] > 0) { - num_tx_slave = rte_eth_tx_prepare(slaves[i], - bd_tx_q->queue_id, slave_bufs[i], - slave_nb_pkts[i]); - num_tx_slave = rte_eth_tx_burst(slaves[i], bd_tx_q->queue_id, - slave_bufs[i], num_tx_slave); + /* Send packet burst on each child device */ + for (i = 0; i < num_of_children; i++) { + if (child_nb_pkts[i] > 0) { + num_tx_child = rte_eth_tx_prepare(children[i], + bd_tx_q->queue_id, child_bufs[i], + child_nb_pkts[i]); + num_tx_child = rte_eth_tx_burst(children[i], bd_tx_q->queue_id, + child_bufs[i], num_tx_child); /* if tx burst fails move packets to end of bufs */ - if (unlikely(num_tx_slave < slave_nb_pkts[i])) { - int tx_fail_slave = slave_nb_pkts[i] - num_tx_slave; + if (unlikely(num_tx_child < child_nb_pkts[i])) { + int tx_fail_child = child_nb_pkts[i] - num_tx_child; - tx_fail_total += tx_fail_slave; + tx_fail_total += tx_fail_child; memcpy(&bufs[nb_pkts - tx_fail_total], - &slave_bufs[i][num_tx_slave], - tx_fail_slave * sizeof(bufs[0])); + &child_bufs[i][num_tx_child], + tx_fail_child * sizeof(bufs[0])); } - num_tx_total += num_tx_slave; + num_tx_total += num_tx_child; } } @@ -653,7 +653,7 @@ bond_ethdev_tx_burst_active_backup(void *queue, bd_tx_q = (struct bond_tx_queue *)queue; internals = bd_tx_q->dev_private; - if (internals->active_slave_count < 1) + if (internals->active_child_count < 1) return 0; nb_prep_pkts = rte_eth_tx_prepare(internals->current_primary_port, @@ -699,7 +699,7 @@ ipv6_hash(struct rte_ipv6_hdr *ipv6_hdr) void burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint16_t slave_count, uint16_t *slaves) + uint16_t child_count, uint16_t *children) { struct rte_ether_hdr *eth_hdr; uint32_t hash; @@ -710,13 +710,13 @@ burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts, hash = ether_hash(eth_hdr); - slaves[i] = (hash ^= hash >> 8) % slave_count; + children[i] = (hash ^= hash >> 8) % child_count; } } void burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint16_t slave_count, uint16_t *slaves) + uint16_t child_count, uint16_t *children) { uint16_t i; struct rte_ether_hdr *eth_hdr; @@ -748,13 +748,13 @@ burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts, hash ^= hash >> 16; hash ^= hash >> 8; - slaves[i] = hash % slave_count; + children[i] = hash % child_count; } } void burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, - uint16_t slave_count, uint16_t *slaves) + uint16_t child_count, uint16_t *children) { struct rte_ether_hdr *eth_hdr; uint16_t proto; @@ -822,30 +822,30 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, hash ^= hash >> 16; hash ^= hash >> 8; - slaves[i] = hash % slave_count; + children[i] = hash % child_count; } } -struct bwg_slave { +struct bwg_child { uint64_t bwg_left_int; uint64_t bwg_left_remainder; - uint16_t slave; + uint16_t child; }; void -bond_tlb_activate_slave(struct bond_dev_private *internals) { +bond_tlb_activate_child(struct bond_dev_private *internals) { int i; - for (i = 0; i < internals->active_slave_count; i++) { - tlb_last_obytets[internals->active_slaves[i]] = 0; + for (i = 0; i < internals->active_child_count; i++) { + tlb_last_obytets[internals->active_children[i]] = 0; } } static int bandwidth_cmp(const void *a, const void *b) { - const struct bwg_slave *bwg_a = a; - const struct bwg_slave *bwg_b = b; + const struct bwg_child *bwg_a = a; + const struct bwg_child *bwg_b = b; int64_t diff = (int64_t)bwg_b->bwg_left_int - (int64_t)bwg_a->bwg_left_int; int64_t diff2 = (int64_t)bwg_b->bwg_left_remainder - (int64_t)bwg_a->bwg_left_remainder; @@ -863,14 +863,14 @@ bandwidth_cmp(const void *a, const void *b) static void bandwidth_left(uint16_t port_id, uint64_t load, uint8_t update_idx, - struct bwg_slave *bwg_slave) + struct bwg_child *bwg_child) { struct rte_eth_link link_status; int ret; ret = rte_eth_link_get_nowait(port_id, &link_status); if (ret < 0) { - RTE_BOND_LOG(ERR, "Slave (port %u) link get failed: %s", + RTE_BOND_LOG(ERR, "Child (port %u) link get failed: %s", port_id, rte_strerror(-ret)); return; } @@ -878,51 +878,51 @@ bandwidth_left(uint16_t port_id, uint64_t load, uint8_t update_idx, if (link_bwg == 0) return; link_bwg = link_bwg * (update_idx+1) * REORDER_PERIOD_MS; - bwg_slave->bwg_left_int = (link_bwg - 1000*load) / link_bwg; - bwg_slave->bwg_left_remainder = (link_bwg - 1000*load) % link_bwg; + bwg_child->bwg_left_int = (link_bwg - 1000*load) / link_bwg; + bwg_child->bwg_left_remainder = (link_bwg - 1000*load) % link_bwg; } static void -bond_ethdev_update_tlb_slave_cb(void *arg) +bond_ethdev_update_tlb_child_cb(void *arg) { struct bond_dev_private *internals = arg; - struct rte_eth_stats slave_stats; - struct bwg_slave bwg_array[RTE_MAX_ETHPORTS]; - uint16_t slave_count; + struct rte_eth_stats child_stats; + struct bwg_child bwg_array[RTE_MAX_ETHPORTS]; + uint16_t child_count; uint64_t tx_bytes; uint8_t update_stats = 0; - uint16_t slave_id; + uint16_t child_id; uint16_t i; - internals->slave_update_idx++; + internals->child_update_idx++; - if (internals->slave_update_idx >= REORDER_PERIOD_MS) + if (internals->child_update_idx >= REORDER_PERIOD_MS) update_stats = 1; - for (i = 0; i < internals->active_slave_count; i++) { - slave_id = internals->active_slaves[i]; - rte_eth_stats_get(slave_id, &slave_stats); - tx_bytes = slave_stats.obytes - tlb_last_obytets[slave_id]; - bandwidth_left(slave_id, tx_bytes, - internals->slave_update_idx, &bwg_array[i]); - bwg_array[i].slave = slave_id; + for (i = 0; i < internals->active_child_count; i++) { + child_id = internals->active_children[i]; + rte_eth_stats_get(child_id, &child_stats); + tx_bytes = child_stats.obytes - tlb_last_obytets[child_id]; + bandwidth_left(child_id, tx_bytes, + internals->child_update_idx, &bwg_array[i]); + bwg_array[i].child = child_id; if (update_stats) { - tlb_last_obytets[slave_id] = slave_stats.obytes; + tlb_last_obytets[child_id] = child_stats.obytes; } } if (update_stats == 1) - internals->slave_update_idx = 0; + internals->child_update_idx = 0; - slave_count = i; - qsort(bwg_array, slave_count, sizeof(bwg_array[0]), bandwidth_cmp); - for (i = 0; i < slave_count; i++) - internals->tlb_slaves_order[i] = bwg_array[i].slave; + child_count = i; + qsort(bwg_array, child_count, sizeof(bwg_array[0]), bandwidth_cmp); + for (i = 0; i < child_count; i++) + internals->tlb_children_order[i] = bwg_array[i].child; - rte_eal_alarm_set(REORDER_PERIOD_MS * 1000, bond_ethdev_update_tlb_slave_cb, + rte_eal_alarm_set(REORDER_PERIOD_MS * 1000, bond_ethdev_update_tlb_child_cb, (struct bond_dev_private *)internals); } @@ -937,29 +937,29 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) uint16_t num_tx_total = 0, num_tx_prep; uint16_t i, j; - uint16_t num_of_slaves = internals->active_slave_count; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_children = internals->active_child_count; + uint16_t children[RTE_MAX_ETHPORTS]; struct rte_ether_hdr *ether_hdr; - struct rte_ether_addr primary_slave_addr; - struct rte_ether_addr active_slave_addr; + struct rte_ether_addr primary_child_addr; + struct rte_ether_addr active_child_addr; - if (num_of_slaves < 1) + if (num_of_children < 1) return num_tx_total; - memcpy(slaves, internals->tlb_slaves_order, - sizeof(internals->tlb_slaves_order[0]) * num_of_slaves); + memcpy(children, internals->tlb_children_order, + sizeof(internals->tlb_children_order[0]) * num_of_children); - rte_ether_addr_copy(primary_port->data->mac_addrs, &primary_slave_addr); + rte_ether_addr_copy(primary_port->data->mac_addrs, &primary_child_addr); if (nb_pkts > 3) { for (i = 0; i < 3; i++) rte_prefetch0(rte_pktmbuf_mtod(bufs[i], void*)); } - for (i = 0; i < num_of_slaves; i++) { - rte_eth_macaddr_get(slaves[i], &active_slave_addr); + for (i = 0; i < num_of_children; i++) { + rte_eth_macaddr_get(children[i], &active_child_addr); for (j = num_tx_total; j < nb_pkts; j++) { if (j + 3 < nb_pkts) rte_prefetch0(rte_pktmbuf_mtod(bufs[j+3], void*)); @@ -967,17 +967,17 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) ether_hdr = rte_pktmbuf_mtod(bufs[j], struct rte_ether_hdr *); if (rte_is_same_ether_addr(ðer_hdr->src_addr, - &primary_slave_addr)) - rte_ether_addr_copy(&active_slave_addr, + &primary_child_addr)) + rte_ether_addr_copy(&active_child_addr, ðer_hdr->src_addr); #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1) - mode6_debug("TX IPv4:", ether_hdr, slaves[i], &burstnumberTX); + mode6_debug("TX IPv4:", ether_hdr, children[i], &burstnumberTX); #endif } - num_tx_prep = rte_eth_tx_prepare(slaves[i], bd_tx_q->queue_id, + num_tx_prep = rte_eth_tx_prepare(children[i], bd_tx_q->queue_id, bufs + num_tx_total, nb_pkts - num_tx_total); - num_tx_total += rte_eth_tx_burst(slaves[i], bd_tx_q->queue_id, + num_tx_total += rte_eth_tx_burst(children[i], bd_tx_q->queue_id, bufs + num_tx_total, num_tx_prep); if (num_tx_total == nb_pkts) @@ -990,13 +990,13 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) void bond_tlb_disable(struct bond_dev_private *internals) { - rte_eal_alarm_cancel(bond_ethdev_update_tlb_slave_cb, internals); + rte_eal_alarm_cancel(bond_ethdev_update_tlb_child_cb, internals); } void bond_tlb_enable(struct bond_dev_private *internals) { - bond_ethdev_update_tlb_slave_cb(internals); + bond_ethdev_update_tlb_child_cb(internals); } static uint16_t @@ -1011,11 +1011,11 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct client_data *client_info; /* - * We create transmit buffers for every slave and one additional to send + * We create transmit buffers for every child and one additional to send * through tlb. In worst case every packet will be send on one port. */ - struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS + 1][nb_pkts]; - uint16_t slave_bufs_pkts[RTE_MAX_ETHPORTS + 1] = { 0 }; + struct rte_mbuf *child_bufs[RTE_MAX_ETHPORTS + 1][nb_pkts]; + uint16_t child_bufs_pkts[RTE_MAX_ETHPORTS + 1] = { 0 }; /* * We create separate transmit buffers for update packets as they won't @@ -1029,7 +1029,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) uint16_t num_send, num_not_send = 0; uint16_t num_tx_total = 0; - uint16_t slave_idx; + uint16_t child_idx; int i, j; @@ -1040,19 +1040,19 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) offset = get_vlan_offset(eth_h, ðer_type); if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_ARP)) { - slave_idx = bond_mode_alb_arp_xmit(eth_h, offset, internals); + child_idx = bond_mode_alb_arp_xmit(eth_h, offset, internals); /* Change src mac in eth header */ - rte_eth_macaddr_get(slave_idx, ð_h->src_addr); + rte_eth_macaddr_get(child_idx, ð_h->src_addr); - /* Add packet to slave tx buffer */ - slave_bufs[slave_idx][slave_bufs_pkts[slave_idx]] = bufs[i]; - slave_bufs_pkts[slave_idx]++; + /* Add packet to child tx buffer */ + child_bufs[child_idx][child_bufs_pkts[child_idx]] = bufs[i]; + child_bufs_pkts[child_idx]++; } else { /* If packet is not ARP, send it with TLB policy */ - slave_bufs[RTE_MAX_ETHPORTS][slave_bufs_pkts[RTE_MAX_ETHPORTS]] = + child_bufs[RTE_MAX_ETHPORTS][child_bufs_pkts[RTE_MAX_ETHPORTS]] = bufs[i]; - slave_bufs_pkts[RTE_MAX_ETHPORTS]++; + child_bufs_pkts[RTE_MAX_ETHPORTS]++; } } @@ -1062,7 +1062,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) client_info = &internals->mode6.client_table[i]; if (client_info->in_use) { - /* Allocate new packet to send ARP update on current slave */ + /* Allocate new packet to send ARP update on current child */ upd_pkt = rte_pktmbuf_alloc(internals->mode6.mempool); if (upd_pkt == NULL) { RTE_BOND_LOG(ERR, @@ -1076,36 +1076,36 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) upd_pkt->data_len = pkt_size; upd_pkt->pkt_len = pkt_size; - slave_idx = bond_mode_alb_arp_upd(client_info, upd_pkt, + child_idx = bond_mode_alb_arp_upd(client_info, upd_pkt, internals); /* Add packet to update tx buffer */ - update_bufs[slave_idx][update_bufs_pkts[slave_idx]] = upd_pkt; - update_bufs_pkts[slave_idx]++; + update_bufs[child_idx][update_bufs_pkts[child_idx]] = upd_pkt; + update_bufs_pkts[child_idx]++; } } internals->mode6.ntt = 0; } - /* Send ARP packets on proper slaves */ + /* Send ARP packets on proper children */ for (i = 0; i < RTE_MAX_ETHPORTS; i++) { - if (slave_bufs_pkts[i] > 0) { + if (child_bufs_pkts[i] > 0) { num_send = rte_eth_tx_prepare(i, bd_tx_q->queue_id, - slave_bufs[i], slave_bufs_pkts[i]); + child_bufs[i], child_bufs_pkts[i]); num_send = rte_eth_tx_burst(i, bd_tx_q->queue_id, - slave_bufs[i], num_send); - for (j = 0; j < slave_bufs_pkts[i] - num_send; j++) { + child_bufs[i], num_send); + for (j = 0; j < child_bufs_pkts[i] - num_send; j++) { bufs[nb_pkts - 1 - num_not_send - j] = - slave_bufs[i][nb_pkts - 1 - j]; + child_bufs[i][nb_pkts - 1 - j]; } num_tx_total += num_send; - num_not_send += slave_bufs_pkts[i] - num_send; + num_not_send += child_bufs_pkts[i] - num_send; #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1) /* Print TX stats including update packets */ - for (j = 0; j < slave_bufs_pkts[i]; j++) { - eth_h = rte_pktmbuf_mtod(slave_bufs[i][j], + for (j = 0; j < child_bufs_pkts[i]; j++) { + eth_h = rte_pktmbuf_mtod(child_bufs[i][j], struct rte_ether_hdr *); mode6_debug("TX ARP:", eth_h, i, &burstnumberTX); } @@ -1113,7 +1113,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } } - /* Send update packets on proper slaves */ + /* Send update packets on proper children */ for (i = 0; i < RTE_MAX_ETHPORTS; i++) { if (update_bufs_pkts[i] > 0) { num_send = rte_eth_tx_prepare(i, bd_tx_q->queue_id, @@ -1134,14 +1134,14 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } /* Send non-ARP packets using tlb policy */ - if (slave_bufs_pkts[RTE_MAX_ETHPORTS] > 0) { + if (child_bufs_pkts[RTE_MAX_ETHPORTS] > 0) { num_send = bond_ethdev_tx_burst_tlb(queue, - slave_bufs[RTE_MAX_ETHPORTS], - slave_bufs_pkts[RTE_MAX_ETHPORTS]); + child_bufs[RTE_MAX_ETHPORTS], + child_bufs_pkts[RTE_MAX_ETHPORTS]); - for (j = 0; j < slave_bufs_pkts[RTE_MAX_ETHPORTS]; j++) { + for (j = 0; j < child_bufs_pkts[RTE_MAX_ETHPORTS]; j++) { bufs[nb_pkts - 1 - num_not_send - j] = - slave_bufs[RTE_MAX_ETHPORTS][nb_pkts - 1 - j]; + child_bufs[RTE_MAX_ETHPORTS][nb_pkts - 1 - j]; } num_tx_total += num_send; @@ -1152,59 +1152,59 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) static inline uint16_t tx_burst_balance(void *queue, struct rte_mbuf **bufs, uint16_t nb_bufs, - uint16_t *slave_port_ids, uint16_t slave_count) + uint16_t *child_port_ids, uint16_t child_count) { struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue; struct bond_dev_private *internals = bd_tx_q->dev_private; - /* Array to sort mbufs for transmission on each slave into */ - struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_bufs]; - /* Number of mbufs for transmission on each slave */ - uint16_t slave_nb_bufs[RTE_MAX_ETHPORTS] = { 0 }; - /* Mapping array generated by hash function to map mbufs to slaves */ - uint16_t bufs_slave_port_idxs[nb_bufs]; + /* Array to sort mbufs for transmission on each child into */ + struct rte_mbuf *child_bufs[RTE_MAX_ETHPORTS][nb_bufs]; + /* Number of mbufs for transmission on each child */ + uint16_t child_nb_bufs[RTE_MAX_ETHPORTS] = { 0 }; + /* Mapping array generated by hash function to map mbufs to children */ + uint16_t bufs_child_port_idxs[nb_bufs]; - uint16_t slave_tx_count; + uint16_t child_tx_count; uint16_t total_tx_count = 0, total_tx_fail_count = 0; uint16_t i; /* - * Populate slaves mbuf with the packets which are to be sent on it - * selecting output slave using hash based on xmit policy + * Populate children mbuf with the packets which are to be sent on it + * selecting output child using hash based on xmit policy */ - internals->burst_xmit_hash(bufs, nb_bufs, slave_count, - bufs_slave_port_idxs); + internals->burst_xmit_hash(bufs, nb_bufs, child_count, + bufs_child_port_idxs); for (i = 0; i < nb_bufs; i++) { - /* Populate slave mbuf arrays with mbufs for that slave. */ - uint16_t slave_idx = bufs_slave_port_idxs[i]; + /* Populate child mbuf arrays with mbufs for that child. */ + uint16_t child_idx = bufs_child_port_idxs[i]; - slave_bufs[slave_idx][slave_nb_bufs[slave_idx]++] = bufs[i]; + child_bufs[child_idx][child_nb_bufs[child_idx]++] = bufs[i]; } - /* Send packet burst on each slave device */ - for (i = 0; i < slave_count; i++) { - if (slave_nb_bufs[i] == 0) + /* Send packet burst on each child device */ + for (i = 0; i < child_count; i++) { + if (child_nb_bufs[i] == 0) continue; - slave_tx_count = rte_eth_tx_prepare(slave_port_ids[i], - bd_tx_q->queue_id, slave_bufs[i], - slave_nb_bufs[i]); - slave_tx_count = rte_eth_tx_burst(slave_port_ids[i], - bd_tx_q->queue_id, slave_bufs[i], - slave_tx_count); + child_tx_count = rte_eth_tx_prepare(child_port_ids[i], + bd_tx_q->queue_id, child_bufs[i], + child_nb_bufs[i]); + child_tx_count = rte_eth_tx_burst(child_port_ids[i], + bd_tx_q->queue_id, child_bufs[i], + child_tx_count); - total_tx_count += slave_tx_count; + total_tx_count += child_tx_count; /* If tx burst fails move packets to end of bufs */ - if (unlikely(slave_tx_count < slave_nb_bufs[i])) { - int slave_tx_fail_count = slave_nb_bufs[i] - - slave_tx_count; - total_tx_fail_count += slave_tx_fail_count; + if (unlikely(child_tx_count < child_nb_bufs[i])) { + int child_tx_fail_count = child_nb_bufs[i] - + child_tx_count; + total_tx_fail_count += child_tx_fail_count; memcpy(&bufs[nb_bufs - total_tx_fail_count], - &slave_bufs[i][slave_tx_count], - slave_tx_fail_count * sizeof(bufs[0])); + &child_bufs[i][child_tx_count], + child_tx_fail_count * sizeof(bufs[0])); } } @@ -1218,23 +1218,23 @@ bond_ethdev_tx_burst_balance(void *queue, struct rte_mbuf **bufs, struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue; struct bond_dev_private *internals = bd_tx_q->dev_private; - uint16_t slave_port_ids[RTE_MAX_ETHPORTS]; - uint16_t slave_count; + uint16_t child_port_ids[RTE_MAX_ETHPORTS]; + uint16_t child_count; if (unlikely(nb_bufs == 0)) return 0; - /* Copy slave list to protect against slave up/down changes during tx + /* Copy child list to protect against child up/down changes during tx * bursting */ - slave_count = internals->active_slave_count; - if (unlikely(slave_count < 1)) + child_count = internals->active_child_count; + if (unlikely(child_count < 1)) return 0; - memcpy(slave_port_ids, internals->active_slaves, - sizeof(slave_port_ids[0]) * slave_count); - return tx_burst_balance(queue, bufs, nb_bufs, slave_port_ids, - slave_count); + memcpy(child_port_ids, internals->active_children, + sizeof(child_port_ids[0]) * child_count); + return tx_burst_balance(queue, bufs, nb_bufs, child_port_ids, + child_count); } static inline uint16_t @@ -1244,31 +1244,31 @@ tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_bufs, struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue; struct bond_dev_private *internals = bd_tx_q->dev_private; - uint16_t slave_port_ids[RTE_MAX_ETHPORTS]; - uint16_t slave_count; + uint16_t child_port_ids[RTE_MAX_ETHPORTS]; + uint16_t child_count; - uint16_t dist_slave_port_ids[RTE_MAX_ETHPORTS]; - uint16_t dist_slave_count; + uint16_t dist_child_port_ids[RTE_MAX_ETHPORTS]; + uint16_t dist_child_count; - uint16_t slave_tx_count; + uint16_t child_tx_count; uint16_t i; - /* Copy slave list to protect against slave up/down changes during tx + /* Copy child list to protect against child up/down changes during tx * bursting */ - slave_count = internals->active_slave_count; - if (unlikely(slave_count < 1)) + child_count = internals->active_child_count; + if (unlikely(child_count < 1)) return 0; - memcpy(slave_port_ids, internals->active_slaves, - sizeof(slave_port_ids[0]) * slave_count); + memcpy(child_port_ids, internals->active_children, + sizeof(child_port_ids[0]) * child_count); if (dedicated_txq) goto skip_tx_ring; /* Check for LACP control packets and send if available */ - for (i = 0; i < slave_count; i++) { - struct port *port = &bond_mode_8023ad_ports[slave_port_ids[i]]; + for (i = 0; i < child_count; i++) { + struct port *port = &bond_mode_8023ad_ports[child_port_ids[i]]; struct rte_mbuf *ctrl_pkt = NULL; if (likely(rte_ring_empty(port->tx_ring))) @@ -1276,15 +1276,15 @@ tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_bufs, if (rte_ring_dequeue(port->tx_ring, (void **)&ctrl_pkt) != -ENOENT) { - slave_tx_count = rte_eth_tx_prepare(slave_port_ids[i], + child_tx_count = rte_eth_tx_prepare(child_port_ids[i], bd_tx_q->queue_id, &ctrl_pkt, 1); - slave_tx_count = rte_eth_tx_burst(slave_port_ids[i], - bd_tx_q->queue_id, &ctrl_pkt, slave_tx_count); + child_tx_count = rte_eth_tx_burst(child_port_ids[i], + bd_tx_q->queue_id, &ctrl_pkt, child_tx_count); /* * re-enqueue LAG control plane packets to buffering * ring if transmission fails so the packet isn't lost. */ - if (slave_tx_count != 1) + if (child_tx_count != 1) rte_ring_enqueue(port->tx_ring, ctrl_pkt); } } @@ -1293,20 +1293,20 @@ tx_burst_8023ad(void *queue, struct rte_mbuf **bufs, uint16_t nb_bufs, if (unlikely(nb_bufs == 0)) return 0; - dist_slave_count = 0; - for (i = 0; i < slave_count; i++) { - struct port *port = &bond_mode_8023ad_ports[slave_port_ids[i]]; + dist_child_count = 0; + for (i = 0; i < child_count; i++) { + struct port *port = &bond_mode_8023ad_ports[child_port_ids[i]]; if (ACTOR_STATE(port, DISTRIBUTING)) - dist_slave_port_ids[dist_slave_count++] = - slave_port_ids[i]; + dist_child_port_ids[dist_child_count++] = + child_port_ids[i]; } - if (unlikely(dist_slave_count < 1)) + if (unlikely(dist_child_count < 1)) return 0; - return tx_burst_balance(queue, bufs, nb_bufs, dist_slave_port_ids, - dist_slave_count); + return tx_burst_balance(queue, bufs, nb_bufs, dist_child_port_ids, + dist_child_count); } static uint16_t @@ -1330,78 +1330,78 @@ bond_ethdev_tx_burst_broadcast(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals; struct bond_tx_queue *bd_tx_q; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; uint8_t tx_failed_flag = 0; - uint16_t num_of_slaves; + uint16_t num_of_children; uint16_t max_nb_of_tx_pkts = 0; - int slave_tx_total[RTE_MAX_ETHPORTS]; - int i, most_successful_tx_slave = -1; + int child_tx_total[RTE_MAX_ETHPORTS]; + int i, most_successful_tx_child = -1; bd_tx_q = (struct bond_tx_queue *)queue; internals = bd_tx_q->dev_private; - /* Copy slave list to protect against slave up/down changes during tx + /* Copy child list to protect against child up/down changes during tx * bursting */ - num_of_slaves = internals->active_slave_count; - memcpy(slaves, internals->active_slaves, - sizeof(internals->active_slaves[0]) * num_of_slaves); + num_of_children = internals->active_child_count; + memcpy(children, internals->active_children, + sizeof(internals->active_children[0]) * num_of_children); - if (num_of_slaves < 1) + if (num_of_children < 1) return 0; /* It is rare that bond different PMDs together, so just call tx-prepare once */ - nb_pkts = rte_eth_tx_prepare(slaves[0], bd_tx_q->queue_id, bufs, nb_pkts); + nb_pkts = rte_eth_tx_prepare(children[0], bd_tx_q->queue_id, bufs, nb_pkts); /* Increment reference count on mbufs */ for (i = 0; i < nb_pkts; i++) - rte_pktmbuf_refcnt_update(bufs[i], num_of_slaves - 1); + rte_pktmbuf_refcnt_update(bufs[i], num_of_children - 1); - /* Transmit burst on each active slave */ - for (i = 0; i < num_of_slaves; i++) { - slave_tx_total[i] = rte_eth_tx_burst(slaves[i], bd_tx_q->queue_id, + /* Transmit burst on each active child */ + for (i = 0; i < num_of_children; i++) { + child_tx_total[i] = rte_eth_tx_burst(children[i], bd_tx_q->queue_id, bufs, nb_pkts); - if (unlikely(slave_tx_total[i] < nb_pkts)) + if (unlikely(child_tx_total[i] < nb_pkts)) tx_failed_flag = 1; - /* record the value and slave index for the slave which transmits the + /* record the value and child index for the child which transmits the * maximum number of packets */ - if (slave_tx_total[i] > max_nb_of_tx_pkts) { - max_nb_of_tx_pkts = slave_tx_total[i]; - most_successful_tx_slave = i; + if (child_tx_total[i] > max_nb_of_tx_pkts) { + max_nb_of_tx_pkts = child_tx_total[i]; + most_successful_tx_child = i; } } - /* if slaves fail to transmit packets from burst, the calling application + /* if children fail to transmit packets from burst, the calling application * is not expected to know about multiple references to packets so we must - * handle failures of all packets except those of the most successful slave + * handle failures of all packets except those of the most successful child */ if (unlikely(tx_failed_flag)) - for (i = 0; i < num_of_slaves; i++) - if (i != most_successful_tx_slave) - while (slave_tx_total[i] < nb_pkts) - rte_pktmbuf_free(bufs[slave_tx_total[i]++]); + for (i = 0; i < num_of_children; i++) + if (i != most_successful_tx_child) + while (child_tx_total[i] < nb_pkts) + rte_pktmbuf_free(bufs[child_tx_total[i]++]); return max_nb_of_tx_pkts; } static void -link_properties_set(struct rte_eth_dev *ethdev, struct rte_eth_link *slave_link) +link_properties_set(struct rte_eth_dev *ethdev, struct rte_eth_link *child_link) { struct bond_dev_private *bond_ctx = ethdev->data->dev_private; if (bond_ctx->mode == BONDING_MODE_8023AD) { /** * If in mode 4 then save the link properties of the first - * slave, all subsequent slaves must match these properties + * child, all subsequent children must match these properties */ - struct rte_eth_link *bond_link = &bond_ctx->mode4.slave_link; + struct rte_eth_link *bond_link = &bond_ctx->mode4.child_link; - bond_link->link_autoneg = slave_link->link_autoneg; - bond_link->link_duplex = slave_link->link_duplex; - bond_link->link_speed = slave_link->link_speed; + bond_link->link_autoneg = child_link->link_autoneg; + bond_link->link_duplex = child_link->link_duplex; + bond_link->link_speed = child_link->link_speed; } else { /** * In any other mode the link properties are set to default @@ -1414,16 +1414,16 @@ link_properties_set(struct rte_eth_dev *ethdev, struct rte_eth_link *slave_link) static int link_properties_valid(struct rte_eth_dev *ethdev, - struct rte_eth_link *slave_link) + struct rte_eth_link *child_link) { struct bond_dev_private *bond_ctx = ethdev->data->dev_private; if (bond_ctx->mode == BONDING_MODE_8023AD) { - struct rte_eth_link *bond_link = &bond_ctx->mode4.slave_link; + struct rte_eth_link *bond_link = &bond_ctx->mode4.child_link; - if (bond_link->link_duplex != slave_link->link_duplex || - bond_link->link_autoneg != slave_link->link_autoneg || - bond_link->link_speed != slave_link->link_speed) + if (bond_link->link_duplex != child_link->link_duplex || + bond_link->link_autoneg != child_link->link_autoneg || + bond_link->link_speed != child_link->link_speed) return -1; } @@ -1480,11 +1480,11 @@ mac_address_set(struct rte_eth_dev *eth_dev, static const struct rte_ether_addr null_mac_addr; /* - * Add additional MAC addresses to the slave + * Add additional MAC addresses to the child */ int -slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, - uint16_t slave_port_id) +child_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, + uint16_t child_port_id) { int i, ret; struct rte_ether_addr *mac_addr; @@ -1494,11 +1494,11 @@ slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, if (rte_is_same_ether_addr(mac_addr, &null_mac_addr)) break; - ret = rte_eth_dev_mac_addr_add(slave_port_id, mac_addr, 0); + ret = rte_eth_dev_mac_addr_add(child_port_id, mac_addr, 0); if (ret < 0) { /* rollback */ for (i--; i > 0; i--) - rte_eth_dev_mac_addr_remove(slave_port_id, + rte_eth_dev_mac_addr_remove(child_port_id, &bonded_eth_dev->data->mac_addrs[i]); return ret; } @@ -1508,11 +1508,11 @@ slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, } /* - * Remove additional MAC addresses from the slave + * Remove additional MAC addresses from the child */ int -slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, - uint16_t slave_port_id) +child_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, + uint16_t child_port_id) { int i, rc, ret; struct rte_ether_addr *mac_addr; @@ -1523,7 +1523,7 @@ slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, if (rte_is_same_ether_addr(mac_addr, &null_mac_addr)) break; - ret = rte_eth_dev_mac_addr_remove(slave_port_id, mac_addr); + ret = rte_eth_dev_mac_addr_remove(child_port_id, mac_addr); /* save only the first error */ if (ret < 0 && rc == 0) rc = ret; @@ -1533,26 +1533,26 @@ slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, } int -mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev) +mac_address_children_update(struct rte_eth_dev *bonded_eth_dev) { struct bond_dev_private *internals = bonded_eth_dev->data->dev_private; bool set; int i; - /* Update slave devices MAC addresses */ - if (internals->slave_count < 1) + /* Update child devices MAC addresses */ + if (internals->child_count < 1) return -1; switch (internals->mode) { case BONDING_MODE_ROUND_ROBIN: case BONDING_MODE_BALANCE: case BONDING_MODE_BROADCAST: - for (i = 0; i < internals->slave_count; i++) { + for (i = 0; i < internals->child_count; i++) { if (rte_eth_dev_default_mac_addr_set( - internals->slaves[i].port_id, + internals->children[i].port_id, bonded_eth_dev->data->mac_addrs)) { RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address", - internals->slaves[i].port_id); + internals->children[i].port_id); return -1; } } @@ -1565,8 +1565,8 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev) case BONDING_MODE_ALB: default: set = true; - for (i = 0; i < internals->slave_count; i++) { - if (internals->slaves[i].port_id == + for (i = 0; i < internals->child_count; i++) { + if (internals->children[i].port_id == internals->current_primary_port) { if (rte_eth_dev_default_mac_addr_set( internals->current_primary_port, @@ -1577,10 +1577,10 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev) } } else { if (rte_eth_dev_default_mac_addr_set( - internals->slaves[i].port_id, - &internals->slaves[i].persisted_mac_addr)) { + internals->children[i].port_id, + &internals->children[i].persisted_mac_addr)) { RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address", - internals->slaves[i].port_id); + internals->children[i].port_id); } } } @@ -1655,55 +1655,55 @@ bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode) static int -slave_configure_slow_queue(struct rte_eth_dev *bonded_eth_dev, - struct rte_eth_dev *slave_eth_dev) +child_configure_slow_queue(struct rte_eth_dev *bonded_eth_dev, + struct rte_eth_dev *child_eth_dev) { int errval = 0; struct bond_dev_private *internals = bonded_eth_dev->data->dev_private; - struct port *port = &bond_mode_8023ad_ports[slave_eth_dev->data->port_id]; + struct port *port = &bond_mode_8023ad_ports[child_eth_dev->data->port_id]; if (port->slow_pool == NULL) { char mem_name[256]; - int slave_id = slave_eth_dev->data->port_id; + int child_id = child_eth_dev->data->port_id; - snprintf(mem_name, RTE_DIM(mem_name), "slave_port%u_slow_pool", - slave_id); + snprintf(mem_name, RTE_DIM(mem_name), "child_port%u_slow_pool", + child_id); port->slow_pool = rte_pktmbuf_pool_create(mem_name, 8191, 250, 0, RTE_MBUF_DEFAULT_BUF_SIZE, - slave_eth_dev->data->numa_node); + child_eth_dev->data->numa_node); /* Any memory allocation failure in initialization is critical because * resources can't be free, so reinitialization is impossible. */ if (port->slow_pool == NULL) { - rte_panic("Slave %u: Failed to create memory pool '%s': %s\n", - slave_id, mem_name, rte_strerror(rte_errno)); + rte_panic("Child %u: Failed to create memory pool '%s': %s\n", + child_id, mem_name, rte_strerror(rte_errno)); } } if (internals->mode4.dedicated_queues.enabled == 1) { /* Configure slow Rx queue */ - errval = rte_eth_rx_queue_setup(slave_eth_dev->data->port_id, + errval = rte_eth_rx_queue_setup(child_eth_dev->data->port_id, internals->mode4.dedicated_queues.rx_qid, 128, - rte_eth_dev_socket_id(slave_eth_dev->data->port_id), + rte_eth_dev_socket_id(child_eth_dev->data->port_id), NULL, port->slow_pool); if (errval != 0) { RTE_BOND_LOG(ERR, "rte_eth_rx_queue_setup: port=%d queue_id %d, err (%d)", - slave_eth_dev->data->port_id, + child_eth_dev->data->port_id, internals->mode4.dedicated_queues.rx_qid, errval); return errval; } - errval = rte_eth_tx_queue_setup(slave_eth_dev->data->port_id, + errval = rte_eth_tx_queue_setup(child_eth_dev->data->port_id, internals->mode4.dedicated_queues.tx_qid, 512, - rte_eth_dev_socket_id(slave_eth_dev->data->port_id), + rte_eth_dev_socket_id(child_eth_dev->data->port_id), NULL); if (errval != 0) { RTE_BOND_LOG(ERR, "rte_eth_tx_queue_setup: port=%d queue_id %d, err (%d)", - slave_eth_dev->data->port_id, + child_eth_dev->data->port_id, internals->mode4.dedicated_queues.tx_qid, errval); return errval; @@ -1713,8 +1713,8 @@ slave_configure_slow_queue(struct rte_eth_dev *bonded_eth_dev, } int -slave_configure(struct rte_eth_dev *bonded_eth_dev, - struct rte_eth_dev *slave_eth_dev) +child_configure(struct rte_eth_dev *bonded_eth_dev, + struct rte_eth_dev *child_eth_dev) { uint16_t nb_rx_queues; uint16_t nb_tx_queues; @@ -1723,45 +1723,45 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, struct bond_dev_private *internals = bonded_eth_dev->data->dev_private; - /* Stop slave */ - errval = rte_eth_dev_stop(slave_eth_dev->data->port_id); + /* Stop child */ + errval = rte_eth_dev_stop(child_eth_dev->data->port_id); if (errval != 0) RTE_BOND_LOG(ERR, "rte_eth_dev_stop: port %u, err (%d)", - slave_eth_dev->data->port_id, errval); + child_eth_dev->data->port_id, errval); - /* Enable interrupts on slave device if supported */ - if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) - slave_eth_dev->data->dev_conf.intr_conf.lsc = 1; + /* Enable interrupts on child device if supported */ + if (child_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) + child_eth_dev->data->dev_conf.intr_conf.lsc = 1; - /* If RSS is enabled for bonding, try to enable it for slaves */ + /* If RSS is enabled for bonding, try to enable it for children */ if (bonded_eth_dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) { /* rss_key won't be empty if RSS is configured in bonded dev */ - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = internals->rss_key_len; - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = internals->rss_key; - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; - slave_eth_dev->data->dev_conf.rxmode.mq_mode = + child_eth_dev->data->dev_conf.rxmode.mq_mode = bonded_eth_dev->data->dev_conf.rxmode.mq_mode; } else { - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = 0; - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = 0; - slave_eth_dev->data->dev_conf.rxmode.mq_mode = + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = 0; + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL; + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = 0; + child_eth_dev->data->dev_conf.rxmode.mq_mode = bonded_eth_dev->data->dev_conf.rxmode.mq_mode; } - slave_eth_dev->data->dev_conf.rxmode.mtu = + child_eth_dev->data->dev_conf.rxmode.mtu = bonded_eth_dev->data->dev_conf.rxmode.mtu; - slave_eth_dev->data->dev_conf.link_speeds = + child_eth_dev->data->dev_conf.link_speeds = bonded_eth_dev->data->dev_conf.link_speeds; - slave_eth_dev->data->dev_conf.txmode.offloads = + child_eth_dev->data->dev_conf.txmode.offloads = bonded_eth_dev->data->dev_conf.txmode.offloads; - slave_eth_dev->data->dev_conf.rxmode.offloads = + child_eth_dev->data->dev_conf.rxmode.offloads = bonded_eth_dev->data->dev_conf.rxmode.offloads; nb_rx_queues = bonded_eth_dev->data->nb_rx_queues; @@ -1775,28 +1775,28 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, } /* Configure device */ - errval = rte_eth_dev_configure(slave_eth_dev->data->port_id, + errval = rte_eth_dev_configure(child_eth_dev->data->port_id, nb_rx_queues, nb_tx_queues, - &(slave_eth_dev->data->dev_conf)); + &(child_eth_dev->data->dev_conf)); if (errval != 0) { - RTE_BOND_LOG(ERR, "Cannot configure slave device: port %u, err (%d)", - slave_eth_dev->data->port_id, errval); + RTE_BOND_LOG(ERR, "Cannot configure child device: port %u, err (%d)", + child_eth_dev->data->port_id, errval); return errval; } - errval = rte_eth_dev_set_mtu(slave_eth_dev->data->port_id, + errval = rte_eth_dev_set_mtu(child_eth_dev->data->port_id, bonded_eth_dev->data->mtu); if (errval != 0 && errval != -ENOTSUP) { RTE_BOND_LOG(ERR, "rte_eth_dev_set_mtu: port %u, err (%d)", - slave_eth_dev->data->port_id, errval); + child_eth_dev->data->port_id, errval); return errval; } return 0; } int -slave_start(struct rte_eth_dev *bonded_eth_dev, - struct rte_eth_dev *slave_eth_dev) +child_start(struct rte_eth_dev *bonded_eth_dev, + struct rte_eth_dev *child_eth_dev) { int errval = 0; struct bond_rx_queue *bd_rx_q; @@ -1809,14 +1809,14 @@ slave_start(struct rte_eth_dev *bonded_eth_dev, for (q_id = 0; q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) { bd_rx_q = (struct bond_rx_queue *)bonded_eth_dev->data->rx_queues[q_id]; - errval = rte_eth_rx_queue_setup(slave_eth_dev->data->port_id, q_id, + errval = rte_eth_rx_queue_setup(child_eth_dev->data->port_id, q_id, bd_rx_q->nb_rx_desc, - rte_eth_dev_socket_id(slave_eth_dev->data->port_id), + rte_eth_dev_socket_id(child_eth_dev->data->port_id), &(bd_rx_q->rx_conf), bd_rx_q->mb_pool); if (errval != 0) { RTE_BOND_LOG(ERR, "rte_eth_rx_queue_setup: port=%d queue_id %d, err (%d)", - slave_eth_dev->data->port_id, q_id, errval); + child_eth_dev->data->port_id, q_id, errval); return errval; } } @@ -1825,58 +1825,58 @@ slave_start(struct rte_eth_dev *bonded_eth_dev, for (q_id = 0; q_id < bonded_eth_dev->data->nb_tx_queues; q_id++) { bd_tx_q = (struct bond_tx_queue *)bonded_eth_dev->data->tx_queues[q_id]; - errval = rte_eth_tx_queue_setup(slave_eth_dev->data->port_id, q_id, + errval = rte_eth_tx_queue_setup(child_eth_dev->data->port_id, q_id, bd_tx_q->nb_tx_desc, - rte_eth_dev_socket_id(slave_eth_dev->data->port_id), + rte_eth_dev_socket_id(child_eth_dev->data->port_id), &bd_tx_q->tx_conf); if (errval != 0) { RTE_BOND_LOG(ERR, "rte_eth_tx_queue_setup: port=%d queue_id %d, err (%d)", - slave_eth_dev->data->port_id, q_id, errval); + child_eth_dev->data->port_id, q_id, errval); return errval; } } if (internals->mode == BONDING_MODE_8023AD && internals->mode4.dedicated_queues.enabled == 1) { - if (slave_configure_slow_queue(bonded_eth_dev, slave_eth_dev) + if (child_configure_slow_queue(bonded_eth_dev, child_eth_dev) != 0) return errval; errval = bond_ethdev_8023ad_flow_verify(bonded_eth_dev, - slave_eth_dev->data->port_id); + child_eth_dev->data->port_id); if (errval != 0) { RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_verify: port=%d, err (%d)", - slave_eth_dev->data->port_id, errval); + child_eth_dev->data->port_id, errval); return errval; } - if (internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id] != NULL) { - errval = rte_flow_destroy(slave_eth_dev->data->port_id, - internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id], + if (internals->mode4.dedicated_queues.flow[child_eth_dev->data->port_id] != NULL) { + errval = rte_flow_destroy(child_eth_dev->data->port_id, + internals->mode4.dedicated_queues.flow[child_eth_dev->data->port_id], &flow_error); RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_destroy: port=%d, err (%d)", - slave_eth_dev->data->port_id, errval); + child_eth_dev->data->port_id, errval); } } /* Start device */ - errval = rte_eth_dev_start(slave_eth_dev->data->port_id); + errval = rte_eth_dev_start(child_eth_dev->data->port_id); if (errval != 0) { RTE_BOND_LOG(ERR, "rte_eth_dev_start: port=%u, err (%d)", - slave_eth_dev->data->port_id, errval); + child_eth_dev->data->port_id, errval); return -1; } if (internals->mode == BONDING_MODE_8023AD && internals->mode4.dedicated_queues.enabled == 1) { errval = bond_ethdev_8023ad_flow_set(bonded_eth_dev, - slave_eth_dev->data->port_id); + child_eth_dev->data->port_id); if (errval != 0) { RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_set: port=%d, err (%d)", - slave_eth_dev->data->port_id, errval); + child_eth_dev->data->port_id, errval); return errval; } } @@ -1888,27 +1888,27 @@ slave_start(struct rte_eth_dev *bonded_eth_dev, internals = bonded_eth_dev->data->dev_private; - for (i = 0; i < internals->slave_count; i++) { - if (internals->slaves[i].port_id == slave_eth_dev->data->port_id) { + for (i = 0; i < internals->child_count; i++) { + if (internals->children[i].port_id == child_eth_dev->data->port_id) { errval = rte_eth_dev_rss_reta_update( - slave_eth_dev->data->port_id, + child_eth_dev->data->port_id, &internals->reta_conf[0], - internals->slaves[i].reta_size); + internals->children[i].reta_size); if (errval != 0) { RTE_BOND_LOG(WARNING, - "rte_eth_dev_rss_reta_update on slave port %d fails (err %d)." + "rte_eth_dev_rss_reta_update on child port %d fails (err %d)." " RSS Configuration for bonding may be inconsistent.", - slave_eth_dev->data->port_id, errval); + child_eth_dev->data->port_id, errval); } break; } } } - /* If lsc interrupt is set, check initial slave's link status */ - if (slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) { - slave_eth_dev->dev_ops->link_update(slave_eth_dev, 0); - bond_ethdev_lsc_event_callback(slave_eth_dev->data->port_id, + /* If lsc interrupt is set, check initial child's link status */ + if (child_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) { + child_eth_dev->dev_ops->link_update(child_eth_dev, 0); + bond_ethdev_lsc_event_callback(child_eth_dev->data->port_id, RTE_ETH_EVENT_INTR_LSC, &bonded_eth_dev->data->port_id, NULL); } @@ -1917,75 +1917,75 @@ slave_start(struct rte_eth_dev *bonded_eth_dev, } void -slave_remove(struct bond_dev_private *internals, - struct rte_eth_dev *slave_eth_dev) +child_remove(struct bond_dev_private *internals, + struct rte_eth_dev *child_eth_dev) { uint16_t i; - for (i = 0; i < internals->slave_count; i++) - if (internals->slaves[i].port_id == - slave_eth_dev->data->port_id) + for (i = 0; i < internals->child_count; i++) + if (internals->children[i].port_id == + child_eth_dev->data->port_id) break; - if (i < (internals->slave_count - 1)) { + if (i < (internals->child_count - 1)) { struct rte_flow *flow; - memmove(&internals->slaves[i], &internals->slaves[i + 1], - sizeof(internals->slaves[0]) * - (internals->slave_count - i - 1)); + memmove(&internals->children[i], &internals->children[i + 1], + sizeof(internals->children[0]) * + (internals->child_count - i - 1)); TAILQ_FOREACH(flow, &internals->flow_list, next) { memmove(&flow->flows[i], &flow->flows[i + 1], sizeof(flow->flows[0]) * - (internals->slave_count - i - 1)); - flow->flows[internals->slave_count - 1] = NULL; + (internals->child_count - i - 1)); + flow->flows[internals->child_count - 1] = NULL; } } - internals->slave_count--; + internals->child_count--; - /* force reconfiguration of slave interfaces */ - rte_eth_dev_internal_reset(slave_eth_dev); + /* force reconfiguration of child interfaces */ + rte_eth_dev_internal_reset(child_eth_dev); } static void -bond_ethdev_slave_link_status_change_monitor(void *cb_arg); +bond_ethdev_child_link_status_change_monitor(void *cb_arg); void -slave_add(struct bond_dev_private *internals, - struct rte_eth_dev *slave_eth_dev) +child_add(struct bond_dev_private *internals, + struct rte_eth_dev *child_eth_dev) { - struct bond_slave_details *slave_details = - &internals->slaves[internals->slave_count]; + struct bond_child_details *child_details = + &internals->children[internals->child_count]; - slave_details->port_id = slave_eth_dev->data->port_id; - slave_details->last_link_status = 0; + child_details->port_id = child_eth_dev->data->port_id; + child_details->last_link_status = 0; - /* Mark slave devices that don't support interrupts so we can + /* Mark child devices that don't support interrupts so we can * compensate when we start the bond */ - if (!(slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)) { - slave_details->link_status_poll_enabled = 1; + if (!(child_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)) { + child_details->link_status_poll_enabled = 1; } - slave_details->link_status_wait_to_complete = 0; + child_details->link_status_wait_to_complete = 0; /* clean tlb_last_obytes when adding port for bonding device */ - memcpy(&(slave_details->persisted_mac_addr), slave_eth_dev->data->mac_addrs, + memcpy(&(child_details->persisted_mac_addr), child_eth_dev->data->mac_addrs, sizeof(struct rte_ether_addr)); } void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint16_t slave_port_id) + uint16_t child_port_id) { int i; - if (internals->active_slave_count < 1) - internals->current_primary_port = slave_port_id; + if (internals->active_child_count < 1) + internals->current_primary_port = child_port_id; else - /* Search bonded device slave ports for new proposed primary port */ - for (i = 0; i < internals->active_slave_count; i++) { - if (internals->active_slaves[i] == slave_port_id) - internals->current_primary_port = slave_port_id; + /* Search bonded device child ports for new proposed primary port */ + for (i = 0; i < internals->active_child_count; i++) { + if (internals->active_children[i] == child_port_id) + internals->current_primary_port = child_port_id; } } @@ -1998,9 +1998,9 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) struct bond_dev_private *internals; int i; - /* slave eth dev will be started by bonded device */ + /* child eth dev will be started by bonded device */ if (check_for_bonded_ethdev(eth_dev)) { - RTE_BOND_LOG(ERR, "User tried to explicitly start a slave eth_dev (%d)", + RTE_BOND_LOG(ERR, "User tried to explicitly start a child eth_dev (%d)", eth_dev->data->port_id); return -1; } @@ -2010,17 +2010,17 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) internals = eth_dev->data->dev_private; - if (internals->slave_count == 0) { - RTE_BOND_LOG(ERR, "Cannot start port since there are no slave devices"); + if (internals->child_count == 0) { + RTE_BOND_LOG(ERR, "Cannot start port since there are no child devices"); goto out_err; } if (internals->user_defined_mac == 0) { struct rte_ether_addr *new_mac_addr = NULL; - for (i = 0; i < internals->slave_count; i++) - if (internals->slaves[i].port_id == internals->primary_port) - new_mac_addr = &internals->slaves[i].persisted_mac_addr; + for (i = 0; i < internals->child_count; i++) + if (internals->children[i].port_id == internals->primary_port) + new_mac_addr = &internals->children[i].persisted_mac_addr; if (new_mac_addr == NULL) goto out_err; @@ -2042,28 +2042,28 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) } - /* Reconfigure each slave device if starting bonded device */ - for (i = 0; i < internals->slave_count; i++) { - struct rte_eth_dev *slave_ethdev = - &(rte_eth_devices[internals->slaves[i].port_id]); - if (slave_configure(eth_dev, slave_ethdev) != 0) { + /* Reconfigure each child device if starting bonded device */ + for (i = 0; i < internals->child_count; i++) { + struct rte_eth_dev *child_ethdev = + &(rte_eth_devices[internals->children[i].port_id]); + if (child_configure(eth_dev, child_ethdev) != 0) { RTE_BOND_LOG(ERR, - "bonded port (%d) failed to reconfigure slave device (%d)", + "bonded port (%d) failed to reconfigure child device (%d)", eth_dev->data->port_id, - internals->slaves[i].port_id); + internals->children[i].port_id); goto out_err; } - if (slave_start(eth_dev, slave_ethdev) != 0) { + if (child_start(eth_dev, child_ethdev) != 0) { RTE_BOND_LOG(ERR, - "bonded port (%d) failed to start slave device (%d)", + "bonded port (%d) failed to start child device (%d)", eth_dev->data->port_id, - internals->slaves[i].port_id); + internals->children[i].port_id); goto out_err; } - /* We will need to poll for link status if any slave doesn't + /* We will need to poll for link status if any child doesn't * support interrupts */ - if (internals->slaves[i].link_status_poll_enabled) + if (internals->children[i].link_status_poll_enabled) internals->link_status_polling_enabled = 1; } @@ -2071,12 +2071,12 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) if (internals->link_status_polling_enabled) { rte_eal_alarm_set( internals->link_status_polling_interval_ms * 1000, - bond_ethdev_slave_link_status_change_monitor, + bond_ethdev_child_link_status_change_monitor, (void *)&rte_eth_devices[internals->port_id]); } - /* Update all slave devices MACs*/ - if (mac_address_slaves_update(eth_dev) != 0) + /* Update all child devices MACs*/ + if (mac_address_children_update(eth_dev) != 0) goto out_err; if (internals->user_defined_primary_port) @@ -2132,8 +2132,8 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) bond_mode_8023ad_stop(eth_dev); /* Discard all messages to/from mode 4 state machines */ - for (i = 0; i < internals->active_slave_count; i++) { - port = &bond_mode_8023ad_ports[internals->active_slaves[i]]; + for (i = 0; i < internals->active_child_count; i++) { + port = &bond_mode_8023ad_ports[internals->active_children[i]]; RTE_ASSERT(port->rx_ring != NULL); while (rte_ring_dequeue(port->rx_ring, &pkt) != -ENOENT) @@ -2148,30 +2148,30 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) if (internals->mode == BONDING_MODE_TLB || internals->mode == BONDING_MODE_ALB) { bond_tlb_disable(internals); - for (i = 0; i < internals->active_slave_count; i++) - tlb_last_obytets[internals->active_slaves[i]] = 0; + for (i = 0; i < internals->active_child_count; i++) + tlb_last_obytets[internals->active_children[i]] = 0; } eth_dev->data->dev_link.link_status = RTE_ETH_LINK_DOWN; eth_dev->data->dev_started = 0; internals->link_status_polling_enabled = 0; - for (i = 0; i < internals->slave_count; i++) { - uint16_t slave_id = internals->slaves[i].port_id; + for (i = 0; i < internals->child_count; i++) { + uint16_t child_id = internals->children[i].port_id; - internals->slaves[i].last_link_status = 0; - ret = rte_eth_dev_stop(slave_id); + internals->children[i].last_link_status = 0; + ret = rte_eth_dev_stop(child_id); if (ret != 0) { RTE_BOND_LOG(ERR, "Failed to stop device on port %u", - slave_id); + child_id); return ret; } - /* active slaves need to be deactivated. */ - if (find_slave_by_id(internals->active_slaves, - internals->active_slave_count, slave_id) != - internals->active_slave_count) - deactivate_slave(eth_dev, slave_id); + /* active children need to be deactivated. */ + if (find_child_by_id(internals->active_children, + internals->active_child_count, child_id) != + internals->active_child_count) + deactivate_child(eth_dev, child_id); } return 0; @@ -2188,8 +2188,8 @@ bond_ethdev_cfg_cleanup(struct rte_eth_dev *dev, bool remove) /* Flush flows in all back-end devices before removing them */ bond_flow_ops.flush(dev, &ferror); - while (internals->slave_count != skipped) { - uint16_t port_id = internals->slaves[skipped].port_id; + while (internals->child_count != skipped) { + uint16_t port_id = internals->children[skipped].port_id; int ret; ret = rte_eth_dev_stop(port_id); @@ -2203,7 +2203,7 @@ bond_ethdev_cfg_cleanup(struct rte_eth_dev *dev, bool remove) continue; } - if (rte_eth_bond_slave_remove(bond_port_id, port_id) != 0) { + if (rte_eth_bond_child_remove(bond_port_id, port_id) != 0) { RTE_BOND_LOG(ERR, "Failed to remove port %d from bonded device %s", port_id, dev->device->name); @@ -2246,7 +2246,7 @@ static int bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { struct bond_dev_private *internals = dev->data->dev_private; - struct bond_slave_details slave; + struct bond_child_details child; int ret; uint16_t max_nb_rx_queues = UINT16_MAX; @@ -2259,31 +2259,31 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) RTE_ETHER_MAX_JUMBO_FRAME_LEN; /* Max number of tx/rx queues that the bonded device can support is the - * minimum values of the bonded slaves, as all slaves must be capable + * minimum values of the bonded children, as all children must be capable * of supporting the same number of tx/rx queues. */ - if (internals->slave_count > 0) { - struct rte_eth_dev_info slave_info; + if (internals->child_count > 0) { + struct rte_eth_dev_info child_info; uint16_t idx; - for (idx = 0; idx < internals->slave_count; idx++) { - slave = internals->slaves[idx]; - ret = rte_eth_dev_info_get(slave.port_id, &slave_info); + for (idx = 0; idx < internals->child_count; idx++) { + child = internals->children[idx]; + ret = rte_eth_dev_info_get(child.port_id, &child_info); if (ret != 0) { RTE_BOND_LOG(ERR, "%s: Error during getting device (port %u) info: %s\n", __func__, - slave.port_id, + child.port_id, strerror(-ret)); return ret; } - if (slave_info.max_rx_queues < max_nb_rx_queues) - max_nb_rx_queues = slave_info.max_rx_queues; + if (child_info.max_rx_queues < max_nb_rx_queues) + max_nb_rx_queues = child_info.max_rx_queues; - if (slave_info.max_tx_queues < max_nb_tx_queues) - max_nb_tx_queues = slave_info.max_tx_queues; + if (child_info.max_tx_queues < max_nb_tx_queues) + max_nb_tx_queues = child_info.max_tx_queues; } } @@ -2332,7 +2332,7 @@ bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) uint16_t i; struct bond_dev_private *internals = dev->data->dev_private; - /* don't do this while a slave is being added */ + /* don't do this while a child is being added */ rte_spinlock_lock(&internals->lock); if (on) @@ -2340,13 +2340,13 @@ bond_ethdev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) else rte_bitmap_clear(internals->vlan_filter_bmp, vlan_id); - for (i = 0; i < internals->slave_count; i++) { - uint16_t port_id = internals->slaves[i].port_id; + for (i = 0; i < internals->child_count; i++) { + uint16_t port_id = internals->children[i].port_id; res = rte_eth_dev_vlan_filter(port_id, vlan_id, on); if (res == ENOTSUP) RTE_BOND_LOG(WARNING, - "Setting VLAN filter on slave port %u not supported.", + "Setting VLAN filter on child port %u not supported.", port_id); } @@ -2424,14 +2424,14 @@ bond_ethdev_tx_queue_release(struct rte_eth_dev *dev, uint16_t queue_id) } static void -bond_ethdev_slave_link_status_change_monitor(void *cb_arg) +bond_ethdev_child_link_status_change_monitor(void *cb_arg) { - struct rte_eth_dev *bonded_ethdev, *slave_ethdev; + struct rte_eth_dev *bonded_ethdev, *child_ethdev; struct bond_dev_private *internals; - /* Default value for polling slave found is true as we don't want to + /* Default value for polling child found is true as we don't want to * disable the polling thread if we cannot get the lock */ - int i, polling_slave_found = 1; + int i, polling_child_found = 1; if (cb_arg == NULL) return; @@ -2443,28 +2443,28 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg) !internals->link_status_polling_enabled) return; - /* If device is currently being configured then don't check slaves link + /* If device is currently being configured then don't check children link * status, wait until next period */ if (rte_spinlock_trylock(&internals->lock)) { - if (internals->slave_count > 0) - polling_slave_found = 0; + if (internals->child_count > 0) + polling_child_found = 0; - for (i = 0; i < internals->slave_count; i++) { - if (!internals->slaves[i].link_status_poll_enabled) + for (i = 0; i < internals->child_count; i++) { + if (!internals->children[i].link_status_poll_enabled) continue; - slave_ethdev = &rte_eth_devices[internals->slaves[i].port_id]; - polling_slave_found = 1; + child_ethdev = &rte_eth_devices[internals->children[i].port_id]; + polling_child_found = 1; - /* Update slave link status */ - (*slave_ethdev->dev_ops->link_update)(slave_ethdev, - internals->slaves[i].link_status_wait_to_complete); + /* Update child link status */ + (*child_ethdev->dev_ops->link_update)(child_ethdev, + internals->children[i].link_status_wait_to_complete); /* if link status has changed since last checked then call lsc * event callback */ - if (slave_ethdev->data->dev_link.link_status != - internals->slaves[i].last_link_status) { - bond_ethdev_lsc_event_callback(internals->slaves[i].port_id, + if (child_ethdev->data->dev_link.link_status != + internals->children[i].last_link_status) { + bond_ethdev_lsc_event_callback(internals->children[i].port_id, RTE_ETH_EVENT_INTR_LSC, &bonded_ethdev->data->port_id, NULL); @@ -2473,10 +2473,10 @@ bond_ethdev_slave_link_status_change_monitor(void *cb_arg) rte_spinlock_unlock(&internals->lock); } - if (polling_slave_found) - /* Set alarm to continue monitoring link status of slave ethdev's */ + if (polling_child_found) + /* Set alarm to continue monitoring link status of child ethdev's */ rte_eal_alarm_set(internals->link_status_polling_interval_ms * 1000, - bond_ethdev_slave_link_status_change_monitor, cb_arg); + bond_ethdev_child_link_status_change_monitor, cb_arg); } static int @@ -2485,7 +2485,7 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete) int (*link_update)(uint16_t port_id, struct rte_eth_link *eth_link); struct bond_dev_private *bond_ctx; - struct rte_eth_link slave_link; + struct rte_eth_link child_link; bool one_link_update_succeeded; uint32_t idx; @@ -2496,7 +2496,7 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete) ethdev->data->dev_link.link_speed = RTE_ETH_SPEED_NUM_NONE; if (ethdev->data->dev_started == 0 || - bond_ctx->active_slave_count == 0) { + bond_ctx->active_child_count == 0) { ethdev->data->dev_link.link_status = RTE_ETH_LINK_DOWN; return 0; } @@ -2512,51 +2512,51 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete) case BONDING_MODE_BROADCAST: /** * Setting link speed to UINT32_MAX to ensure we pick up the - * value of the first active slave + * value of the first active child */ ethdev->data->dev_link.link_speed = UINT32_MAX; /** - * link speed is minimum value of all the slaves link speed as - * packet loss will occur on this slave if transmission at rates + * link speed is minimum value of all the children link speed as + * packet loss will occur on this child if transmission at rates * greater than this are attempted */ - for (idx = 0; idx < bond_ctx->active_slave_count; idx++) { - ret = link_update(bond_ctx->active_slaves[idx], - &slave_link); + for (idx = 0; idx < bond_ctx->active_child_count; idx++) { + ret = link_update(bond_ctx->active_children[idx], + &child_link); if (ret < 0) { ethdev->data->dev_link.link_speed = RTE_ETH_SPEED_NUM_NONE; RTE_BOND_LOG(ERR, - "Slave (port %u) link get failed: %s", - bond_ctx->active_slaves[idx], + "Child (port %u) link get failed: %s", + bond_ctx->active_children[idx], rte_strerror(-ret)); return 0; } - if (slave_link.link_speed < + if (child_link.link_speed < ethdev->data->dev_link.link_speed) ethdev->data->dev_link.link_speed = - slave_link.link_speed; + child_link.link_speed; } break; case BONDING_MODE_ACTIVE_BACKUP: - /* Current primary slave */ - ret = link_update(bond_ctx->current_primary_port, &slave_link); + /* Current primary child */ + ret = link_update(bond_ctx->current_primary_port, &child_link); if (ret < 0) { - RTE_BOND_LOG(ERR, "Slave (port %u) link get failed: %s", + RTE_BOND_LOG(ERR, "Child (port %u) link get failed: %s", bond_ctx->current_primary_port, rte_strerror(-ret)); return 0; } - ethdev->data->dev_link.link_speed = slave_link.link_speed; + ethdev->data->dev_link.link_speed = child_link.link_speed; break; case BONDING_MODE_8023AD: ethdev->data->dev_link.link_autoneg = - bond_ctx->mode4.slave_link.link_autoneg; + bond_ctx->mode4.child_link.link_autoneg; ethdev->data->dev_link.link_duplex = - bond_ctx->mode4.slave_link.link_duplex; + bond_ctx->mode4.child_link.link_duplex; /* fall through */ /* to update link speed */ case BONDING_MODE_ROUND_ROBIN: @@ -2566,29 +2566,29 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, int wait_to_complete) default: /** * In theses mode the maximum theoretical link speed is the sum - * of all the slaves + * of all the children */ ethdev->data->dev_link.link_speed = RTE_ETH_SPEED_NUM_NONE; one_link_update_succeeded = false; - for (idx = 0; idx < bond_ctx->active_slave_count; idx++) { - ret = link_update(bond_ctx->active_slaves[idx], - &slave_link); + for (idx = 0; idx < bond_ctx->active_child_count; idx++) { + ret = link_update(bond_ctx->active_children[idx], + &child_link); if (ret < 0) { RTE_BOND_LOG(ERR, - "Slave (port %u) link get failed: %s", - bond_ctx->active_slaves[idx], + "Child (port %u) link get failed: %s", + bond_ctx->active_children[idx], rte_strerror(-ret)); continue; } one_link_update_succeeded = true; ethdev->data->dev_link.link_speed += - slave_link.link_speed; + child_link.link_speed; } if (!one_link_update_succeeded) { - RTE_BOND_LOG(ERR, "All slaves link get failed"); + RTE_BOND_LOG(ERR, "All children link get failed"); return 0; } } @@ -2602,27 +2602,27 @@ static int bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) { struct bond_dev_private *internals = dev->data->dev_private; - struct rte_eth_stats slave_stats; + struct rte_eth_stats child_stats; int i, j; - for (i = 0; i < internals->slave_count; i++) { - rte_eth_stats_get(internals->slaves[i].port_id, &slave_stats); + for (i = 0; i < internals->child_count; i++) { + rte_eth_stats_get(internals->children[i].port_id, &child_stats); - stats->ipackets += slave_stats.ipackets; - stats->opackets += slave_stats.opackets; - stats->ibytes += slave_stats.ibytes; - stats->obytes += slave_stats.obytes; - stats->imissed += slave_stats.imissed; - stats->ierrors += slave_stats.ierrors; - stats->oerrors += slave_stats.oerrors; - stats->rx_nombuf += slave_stats.rx_nombuf; + stats->ipackets += child_stats.ipackets; + stats->opackets += child_stats.opackets; + stats->ibytes += child_stats.ibytes; + stats->obytes += child_stats.obytes; + stats->imissed += child_stats.imissed; + stats->ierrors += child_stats.ierrors; + stats->oerrors += child_stats.oerrors; + stats->rx_nombuf += child_stats.rx_nombuf; for (j = 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) { - stats->q_ipackets[j] += slave_stats.q_ipackets[j]; - stats->q_opackets[j] += slave_stats.q_opackets[j]; - stats->q_ibytes[j] += slave_stats.q_ibytes[j]; - stats->q_obytes[j] += slave_stats.q_obytes[j]; - stats->q_errors[j] += slave_stats.q_errors[j]; + stats->q_ipackets[j] += child_stats.q_ipackets[j]; + stats->q_opackets[j] += child_stats.q_opackets[j]; + stats->q_ibytes[j] += child_stats.q_ibytes[j]; + stats->q_obytes[j] += child_stats.q_obytes[j]; + stats->q_errors[j] += child_stats.q_errors[j]; } } @@ -2638,8 +2638,8 @@ bond_ethdev_stats_reset(struct rte_eth_dev *dev) int err; int ret; - for (i = 0, err = 0; i < internals->slave_count; i++) { - ret = rte_eth_stats_reset(internals->slaves[i].port_id); + for (i = 0, err = 0; i < internals->child_count; i++) { + ret = rte_eth_stats_reset(internals->children[i].port_id); if (ret != 0) err = ret; } @@ -2656,15 +2656,15 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev) uint16_t port_id; switch (internals->mode) { - /* Promiscuous mode is propagated to all slaves */ + /* Promiscuous mode is propagated to all children */ case BONDING_MODE_ROUND_ROBIN: case BONDING_MODE_BALANCE: case BONDING_MODE_BROADCAST: case BONDING_MODE_8023AD: { - unsigned int slave_ok = 0; + unsigned int child_ok = 0; - for (i = 0; i < internals->slave_count; i++) { - port_id = internals->slaves[i].port_id; + for (i = 0; i < internals->child_count; i++) { + port_id = internals->children[i].port_id; ret = rte_eth_promiscuous_enable(port_id); if (ret != 0) @@ -2672,23 +2672,23 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *eth_dev) "Failed to enable promiscuous mode for port %u: %s", port_id, rte_strerror(-ret)); else - slave_ok++; + child_ok++; } /* * Report success if operation is successful on at least - * on one slave. Otherwise return last error code. + * on one child. Otherwise return last error code. */ - if (slave_ok > 0) + if (child_ok > 0) ret = 0; break; } - /* Promiscuous mode is propagated only to primary slave */ + /* Promiscuous mode is propagated only to primary child */ case BONDING_MODE_ACTIVE_BACKUP: case BONDING_MODE_TLB: case BONDING_MODE_ALB: default: /* Do not touch promisc when there cannot be primary ports */ - if (internals->slave_count == 0) + if (internals->child_count == 0) break; port_id = internals->current_primary_port; ret = rte_eth_promiscuous_enable(port_id); @@ -2710,20 +2710,20 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev) uint16_t port_id; switch (internals->mode) { - /* Promiscuous mode is propagated to all slaves */ + /* Promiscuous mode is propagated to all children */ case BONDING_MODE_ROUND_ROBIN: case BONDING_MODE_BALANCE: case BONDING_MODE_BROADCAST: case BONDING_MODE_8023AD: { - unsigned int slave_ok = 0; + unsigned int child_ok = 0; - for (i = 0; i < internals->slave_count; i++) { - port_id = internals->slaves[i].port_id; + for (i = 0; i < internals->child_count; i++) { + port_id = internals->children[i].port_id; if (internals->mode == BONDING_MODE_8023AD && bond_mode_8023ad_ports[port_id].forced_rx_flags == BOND_8023AD_FORCED_PROMISC) { - slave_ok++; + child_ok++; continue; } ret = rte_eth_promiscuous_disable(port_id); @@ -2732,23 +2732,23 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev) "Failed to disable promiscuous mode for port %u: %s", port_id, rte_strerror(-ret)); else - slave_ok++; + child_ok++; } /* * Report success if operation is successful on at least - * on one slave. Otherwise return last error code. + * on one child. Otherwise return last error code. */ - if (slave_ok > 0) + if (child_ok > 0) ret = 0; break; } - /* Promiscuous mode is propagated only to primary slave */ + /* Promiscuous mode is propagated only to primary child */ case BONDING_MODE_ACTIVE_BACKUP: case BONDING_MODE_TLB: case BONDING_MODE_ALB: default: /* Do not touch promisc when there cannot be primary ports */ - if (internals->slave_count == 0) + if (internals->child_count == 0) break; port_id = internals->current_primary_port; ret = rte_eth_promiscuous_disable(port_id); @@ -2772,7 +2772,7 @@ bond_ethdev_promiscuous_update(struct rte_eth_dev *dev) case BONDING_MODE_BALANCE: case BONDING_MODE_BROADCAST: case BONDING_MODE_8023AD: - /* As promiscuous mode is propagated to all slaves for these + /* As promiscuous mode is propagated to all children for these * mode, no need to update for bonding device. */ break; @@ -2780,9 +2780,9 @@ bond_ethdev_promiscuous_update(struct rte_eth_dev *dev) case BONDING_MODE_TLB: case BONDING_MODE_ALB: default: - /* As promiscuous mode is propagated only to primary slave + /* As promiscuous mode is propagated only to primary child * for these mode. When active/standby switchover, promiscuous - * mode should be set to new primary slave according to bonding + * mode should be set to new primary child according to bonding * device. */ if (rte_eth_promiscuous_get(internals->port_id) == 1) @@ -2803,15 +2803,15 @@ bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev) uint16_t port_id; switch (internals->mode) { - /* allmulti mode is propagated to all slaves */ + /* allmulti mode is propagated to all children */ case BONDING_MODE_ROUND_ROBIN: case BONDING_MODE_BALANCE: case BONDING_MODE_BROADCAST: case BONDING_MODE_8023AD: { - unsigned int slave_ok = 0; + unsigned int child_ok = 0; - for (i = 0; i < internals->slave_count; i++) { - port_id = internals->slaves[i].port_id; + for (i = 0; i < internals->child_count; i++) { + port_id = internals->children[i].port_id; ret = rte_eth_allmulticast_enable(port_id); if (ret != 0) @@ -2819,23 +2819,23 @@ bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev) "Failed to enable allmulti mode for port %u: %s", port_id, rte_strerror(-ret)); else - slave_ok++; + child_ok++; } /* * Report success if operation is successful on at least - * on one slave. Otherwise return last error code. + * on one child. Otherwise return last error code. */ - if (slave_ok > 0) + if (child_ok > 0) ret = 0; break; } - /* allmulti mode is propagated only to primary slave */ + /* allmulti mode is propagated only to primary child */ case BONDING_MODE_ACTIVE_BACKUP: case BONDING_MODE_TLB: case BONDING_MODE_ALB: default: /* Do not touch allmulti when there cannot be primary ports */ - if (internals->slave_count == 0) + if (internals->child_count == 0) break; port_id = internals->current_primary_port; ret = rte_eth_allmulticast_enable(port_id); @@ -2857,15 +2857,15 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev) uint16_t port_id; switch (internals->mode) { - /* allmulti mode is propagated to all slaves */ + /* allmulti mode is propagated to all children */ case BONDING_MODE_ROUND_ROBIN: case BONDING_MODE_BALANCE: case BONDING_MODE_BROADCAST: case BONDING_MODE_8023AD: { - unsigned int slave_ok = 0; + unsigned int child_ok = 0; - for (i = 0; i < internals->slave_count; i++) { - uint16_t port_id = internals->slaves[i].port_id; + for (i = 0; i < internals->child_count; i++) { + uint16_t port_id = internals->children[i].port_id; if (internals->mode == BONDING_MODE_8023AD && bond_mode_8023ad_ports[port_id].forced_rx_flags == @@ -2878,23 +2878,23 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev) "Failed to disable allmulti mode for port %u: %s", port_id, rte_strerror(-ret)); else - slave_ok++; + child_ok++; } /* * Report success if operation is successful on at least - * on one slave. Otherwise return last error code. + * on one child. Otherwise return last error code. */ - if (slave_ok > 0) + if (child_ok > 0) ret = 0; break; } - /* allmulti mode is propagated only to primary slave */ + /* allmulti mode is propagated only to primary child */ case BONDING_MODE_ACTIVE_BACKUP: case BONDING_MODE_TLB: case BONDING_MODE_ALB: default: /* Do not touch allmulti when there cannot be primary ports */ - if (internals->slave_count == 0) + if (internals->child_count == 0) break; port_id = internals->current_primary_port; ret = rte_eth_allmulticast_disable(port_id); @@ -2918,7 +2918,7 @@ bond_ethdev_allmulticast_update(struct rte_eth_dev *dev) case BONDING_MODE_BALANCE: case BONDING_MODE_BROADCAST: case BONDING_MODE_8023AD: - /* As allmulticast mode is propagated to all slaves for these + /* As allmulticast mode is propagated to all children for these * mode, no need to update for bonding device. */ break; @@ -2926,9 +2926,9 @@ bond_ethdev_allmulticast_update(struct rte_eth_dev *dev) case BONDING_MODE_TLB: case BONDING_MODE_ALB: default: - /* As allmulticast mode is propagated only to primary slave + /* As allmulticast mode is propagated only to primary child * for these mode. When active/standby switchover, allmulticast - * mode should be set to new primary slave according to bonding + * mode should be set to new primary child according to bonding * device. */ if (rte_eth_allmulticast_get(internals->port_id) == 1) @@ -2961,8 +2961,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, int ret; uint8_t lsc_flag = 0; - int valid_slave = 0; - uint16_t active_pos, slave_idx; + int valid_child = 0; + uint16_t active_pos, child_idx; uint16_t i; if (type != RTE_ETH_EVENT_INTR_LSC || param == NULL) @@ -2979,62 +2979,62 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, if (!bonded_eth_dev->data->dev_started) return rc; - /* verify that port_id is a valid slave of bonded port */ - for (i = 0; i < internals->slave_count; i++) { - if (internals->slaves[i].port_id == port_id) { - valid_slave = 1; - slave_idx = i; + /* verify that port_id is a valid child of bonded port */ + for (i = 0; i < internals->child_count; i++) { + if (internals->children[i].port_id == port_id) { + valid_child = 1; + child_idx = i; break; } } - if (!valid_slave) + if (!valid_child) return rc; /* Synchronize lsc callback parallel calls either by real link event - * from the slaves PMDs or by the bonding PMD itself. + * from the children PMDs or by the bonding PMD itself. */ rte_spinlock_lock(&internals->lsc_lock); /* Search for port in active port list */ - active_pos = find_slave_by_id(internals->active_slaves, - internals->active_slave_count, port_id); + active_pos = find_child_by_id(internals->active_children, + internals->active_child_count, port_id); ret = rte_eth_link_get_nowait(port_id, &link); if (ret < 0) - RTE_BOND_LOG(ERR, "Slave (port %u) link get failed", port_id); + RTE_BOND_LOG(ERR, "Child (port %u) link get failed", port_id); if (ret == 0 && link.link_status) { - if (active_pos < internals->active_slave_count) + if (active_pos < internals->active_child_count) goto link_update; /* check link state properties if bonded link is up*/ if (bonded_eth_dev->data->dev_link.link_status == RTE_ETH_LINK_UP) { if (link_properties_valid(bonded_eth_dev, &link) != 0) RTE_BOND_LOG(ERR, "Invalid link properties " - "for slave %d in bonding mode %d", + "for child %d in bonding mode %d", port_id, internals->mode); } else { - /* inherit slave link properties */ + /* inherit child link properties */ link_properties_set(bonded_eth_dev, &link); } - /* If no active slave ports then set this port to be + /* If no active child ports then set this port to be * the primary port. */ - if (internals->active_slave_count < 1) { - /* If first active slave, then change link status */ + if (internals->active_child_count < 1) { + /* If first active child, then change link status */ bonded_eth_dev->data->dev_link.link_status = RTE_ETH_LINK_UP; internals->current_primary_port = port_id; lsc_flag = 1; - mac_address_slaves_update(bonded_eth_dev); + mac_address_children_update(bonded_eth_dev); bond_ethdev_promiscuous_update(bonded_eth_dev); bond_ethdev_allmulticast_update(bonded_eth_dev); } - activate_slave(bonded_eth_dev, port_id); + activate_child(bonded_eth_dev, port_id); /* If the user has defined the primary port then default to * using it. @@ -3043,24 +3043,24 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, internals->primary_port == port_id) bond_ethdev_primary_set(internals, port_id); } else { - if (active_pos == internals->active_slave_count) + if (active_pos == internals->active_child_count) goto link_update; - /* Remove from active slave list */ - deactivate_slave(bonded_eth_dev, port_id); + /* Remove from active child list */ + deactivate_child(bonded_eth_dev, port_id); - if (internals->active_slave_count < 1) + if (internals->active_child_count < 1) lsc_flag = 1; - /* Update primary id, take first active slave from list or if none + /* Update primary id, take first active child from list or if none * available set to -1 */ if (port_id == internals->current_primary_port) { - if (internals->active_slave_count > 0) + if (internals->active_child_count > 0) bond_ethdev_primary_set(internals, - internals->active_slaves[0]); + internals->active_children[0]); else internals->current_primary_port = internals->primary_port; - mac_address_slaves_update(bonded_eth_dev); + mac_address_children_update(bonded_eth_dev); bond_ethdev_promiscuous_update(bonded_eth_dev); bond_ethdev_allmulticast_update(bonded_eth_dev); } @@ -3069,10 +3069,10 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, link_update: /** * Update bonded device link properties after any change to active - * slaves + * children */ bond_ethdev_link_update(bonded_eth_dev, 0); - internals->slaves[slave_idx].last_link_status = link.link_status; + internals->children[child_idx].last_link_status = link.link_status; if (lsc_flag) { /* Cancel any possible outstanding interrupts if delays are enabled */ @@ -3114,7 +3114,7 @@ bond_ethdev_rss_reta_update(struct rte_eth_dev *dev, { unsigned i, j; int result = 0; - int slave_reta_size; + int child_reta_size; unsigned reta_count; struct bond_dev_private *internals = dev->data->dev_private; @@ -3137,11 +3137,11 @@ bond_ethdev_rss_reta_update(struct rte_eth_dev *dev, memcpy(&internals->reta_conf[i], &internals->reta_conf[0], sizeof(internals->reta_conf[0]) * reta_count); - /* Propagate RETA over slaves */ - for (i = 0; i < internals->slave_count; i++) { - slave_reta_size = internals->slaves[i].reta_size; - result = rte_eth_dev_rss_reta_update(internals->slaves[i].port_id, - &internals->reta_conf[0], slave_reta_size); + /* Propagate RETA over children */ + for (i = 0; i < internals->child_count; i++) { + child_reta_size = internals->children[i].reta_size; + result = rte_eth_dev_rss_reta_update(internals->children[i].port_id, + &internals->reta_conf[0], child_reta_size); if (result < 0) return result; } @@ -3194,8 +3194,8 @@ bond_ethdev_rss_hash_update(struct rte_eth_dev *dev, bond_rss_conf.rss_key_len = internals->rss_key_len; } - for (i = 0; i < internals->slave_count; i++) { - result = rte_eth_dev_rss_hash_update(internals->slaves[i].port_id, + for (i = 0; i < internals->child_count; i++) { + result = rte_eth_dev_rss_hash_update(internals->children[i].port_id, &bond_rss_conf); if (result < 0) return result; @@ -3221,21 +3221,21 @@ bond_ethdev_rss_hash_conf_get(struct rte_eth_dev *dev, static int bond_ethdev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { - struct rte_eth_dev *slave_eth_dev; + struct rte_eth_dev *child_eth_dev; struct bond_dev_private *internals = dev->data->dev_private; int ret, i; rte_spinlock_lock(&internals->lock); - for (i = 0; i < internals->slave_count; i++) { - slave_eth_dev = &rte_eth_devices[internals->slaves[i].port_id]; - if (*slave_eth_dev->dev_ops->mtu_set == NULL) { + for (i = 0; i < internals->child_count; i++) { + child_eth_dev = &rte_eth_devices[internals->children[i].port_id]; + if (*child_eth_dev->dev_ops->mtu_set == NULL) { rte_spinlock_unlock(&internals->lock); return -ENOTSUP; } } - for (i = 0; i < internals->slave_count; i++) { - ret = rte_eth_dev_set_mtu(internals->slaves[i].port_id, mtu); + for (i = 0; i < internals->child_count; i++) { + ret = rte_eth_dev_set_mtu(internals->children[i].port_id, mtu); if (ret < 0) { rte_spinlock_unlock(&internals->lock); return ret; @@ -3271,29 +3271,29 @@ bond_ethdev_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, __rte_unused uint32_t index, uint32_t vmdq) { - struct rte_eth_dev *slave_eth_dev; + struct rte_eth_dev *child_eth_dev; struct bond_dev_private *internals = dev->data->dev_private; int ret, i; rte_spinlock_lock(&internals->lock); - for (i = 0; i < internals->slave_count; i++) { - slave_eth_dev = &rte_eth_devices[internals->slaves[i].port_id]; - if (*slave_eth_dev->dev_ops->mac_addr_add == NULL || - *slave_eth_dev->dev_ops->mac_addr_remove == NULL) { + for (i = 0; i < internals->child_count; i++) { + child_eth_dev = &rte_eth_devices[internals->children[i].port_id]; + if (*child_eth_dev->dev_ops->mac_addr_add == NULL || + *child_eth_dev->dev_ops->mac_addr_remove == NULL) { ret = -ENOTSUP; goto end; } } - for (i = 0; i < internals->slave_count; i++) { - ret = rte_eth_dev_mac_addr_add(internals->slaves[i].port_id, + for (i = 0; i < internals->child_count; i++) { + ret = rte_eth_dev_mac_addr_add(internals->children[i].port_id, mac_addr, vmdq); if (ret < 0) { /* rollback */ for (i--; i >= 0; i--) rte_eth_dev_mac_addr_remove( - internals->slaves[i].port_id, mac_addr); + internals->children[i].port_id, mac_addr); goto end; } } @@ -3307,22 +3307,22 @@ bond_ethdev_mac_addr_add(struct rte_eth_dev *dev, static void bond_ethdev_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) { - struct rte_eth_dev *slave_eth_dev; + struct rte_eth_dev *child_eth_dev; struct bond_dev_private *internals = dev->data->dev_private; int i; rte_spinlock_lock(&internals->lock); - for (i = 0; i < internals->slave_count; i++) { - slave_eth_dev = &rte_eth_devices[internals->slaves[i].port_id]; - if (*slave_eth_dev->dev_ops->mac_addr_remove == NULL) + for (i = 0; i < internals->child_count; i++) { + child_eth_dev = &rte_eth_devices[internals->children[i].port_id]; + if (*child_eth_dev->dev_ops->mac_addr_remove == NULL) goto end; } struct rte_ether_addr *mac_addr = &dev->data->mac_addrs[index]; - for (i = 0; i < internals->slave_count; i++) - rte_eth_dev_mac_addr_remove(internals->slaves[i].port_id, + for (i = 0; i < internals->child_count; i++) + rte_eth_dev_mac_addr_remove(internals->children[i].port_id, mac_addr); end: @@ -3402,30 +3402,30 @@ dump_basic(const struct rte_eth_dev *dev, FILE *f) fprintf(f, "\n"); } - if (internals->slave_count > 0) { - fprintf(f, "\tSlaves (%u): [", internals->slave_count); - for (i = 0; i < internals->slave_count - 1; i++) - fprintf(f, "%u ", internals->slaves[i].port_id); + if (internals->child_count > 0) { + fprintf(f, "\tChilds (%u): [", internals->child_count); + for (i = 0; i < internals->child_count - 1; i++) + fprintf(f, "%u ", internals->children[i].port_id); - fprintf(f, "%u]\n", internals->slaves[internals->slave_count - 1].port_id); + fprintf(f, "%u]\n", internals->children[internals->child_count - 1].port_id); } else { - fprintf(f, "\tSlaves: []\n"); + fprintf(f, "\tChilds: []\n"); } - if (internals->active_slave_count > 0) { - fprintf(f, "\tActive Slaves (%u): [", internals->active_slave_count); - for (i = 0; i < internals->active_slave_count - 1; i++) - fprintf(f, "%u ", internals->active_slaves[i]); + if (internals->active_child_count > 0) { + fprintf(f, "\tActive Childs (%u): [", internals->active_child_count); + for (i = 0; i < internals->active_child_count - 1; i++) + fprintf(f, "%u ", internals->active_children[i]); - fprintf(f, "%u]\n", internals->active_slaves[internals->active_slave_count - 1]); + fprintf(f, "%u]\n", internals->active_children[internals->active_child_count - 1]); } else { - fprintf(f, "\tActive Slaves: []\n"); + fprintf(f, "\tActive Childs: []\n"); } if (internals->user_defined_primary_port) fprintf(f, "\tUser Defined Primary: [%u]\n", internals->primary_port); - if (internals->slave_count > 0) + if (internals->child_count > 0) fprintf(f, "\tCurrent Primary: [%u]\n", internals->current_primary_port); } @@ -3471,7 +3471,7 @@ dump_lacp_port_param(const struct port_params *params, FILE *f) } static void -dump_lacp_slave(const struct rte_eth_bond_8023ad_slave_info *info, FILE *f) +dump_lacp_child(const struct rte_eth_bond_8023ad_child_info *info, FILE *f) { char a_state[256] = { 0 }; char p_state[256] = { 0 }; @@ -3520,18 +3520,18 @@ dump_lacp_slave(const struct rte_eth_bond_8023ad_slave_info *info, FILE *f) static void dump_lacp(uint16_t port_id, FILE *f) { - struct rte_eth_bond_8023ad_slave_info slave_info; + struct rte_eth_bond_8023ad_child_info child_info; struct rte_eth_bond_8023ad_conf port_conf; - uint16_t slaves[RTE_MAX_ETHPORTS]; - int num_active_slaves; + uint16_t children[RTE_MAX_ETHPORTS]; + int num_active_children; int i, ret; fprintf(f, " - Lacp info:\n"); - num_active_slaves = rte_eth_bond_active_slaves_get(port_id, slaves, + num_active_children = rte_eth_bond_active_children_get(port_id, children, RTE_MAX_ETHPORTS); - if (num_active_slaves < 0) { - fprintf(f, "\tFailed to get active slave list for port %u\n", + if (num_active_children < 0) { + fprintf(f, "\tFailed to get active child list for port %u\n", port_id); return; } @@ -3545,16 +3545,16 @@ dump_lacp(uint16_t port_id, FILE *f) } dump_lacp_conf(&port_conf, f); - for (i = 0; i < num_active_slaves; i++) { - ret = rte_eth_bond_8023ad_slave_info(port_id, slaves[i], - &slave_info); + for (i = 0; i < num_active_children; i++) { + ret = rte_eth_bond_8023ad_child_info(port_id, children[i], + &child_info); if (ret) { - fprintf(f, "\tGet slave device %u 8023ad info failed\n", - slaves[i]); + fprintf(f, "\tGet child device %u 8023ad info failed\n", + children[i]); return; } - fprintf(f, "\tSlave Port: %u\n", slaves[i]); - dump_lacp_slave(&slave_info, f); + fprintf(f, "\tChild Port: %u\n", children[i]); + dump_lacp_child(&child_info, f); } } @@ -3655,8 +3655,8 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) internals->link_down_delay_ms = 0; internals->link_up_delay_ms = 0; - internals->slave_count = 0; - internals->active_slave_count = 0; + internals->child_count = 0; + internals->active_child_count = 0; internals->rx_offload_capa = 0; internals->tx_offload_capa = 0; internals->rx_queue_offload_capa = 0; @@ -3684,8 +3684,8 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) internals->rx_desc_lim.nb_align = 1; internals->tx_desc_lim.nb_align = 1; - memset(internals->active_slaves, 0, sizeof(internals->active_slaves)); - memset(internals->slaves, 0, sizeof(internals->slaves)); + memset(internals->active_children, 0, sizeof(internals->active_children)); + memset(internals->children, 0, sizeof(internals->children)); TAILQ_INIT(&internals->flow_list); internals->flow_isolated_valid = 0; @@ -3770,7 +3770,7 @@ bond_probe(struct rte_vdev_device *dev) /* Parse link bonding mode */ if (rte_kvargs_count(kvlist, PMD_BOND_MODE_KVARG) == 1) { if (rte_kvargs_process(kvlist, PMD_BOND_MODE_KVARG, - &bond_ethdev_parse_slave_mode_kvarg, + &bond_ethdev_parse_child_mode_kvarg, &bonding_mode) != 0) { RTE_BOND_LOG(ERR, "Invalid mode for bonded device %s", name); @@ -3815,7 +3815,7 @@ bond_probe(struct rte_vdev_device *dev) if (rte_kvargs_count(kvlist, PMD_BOND_AGG_MODE_KVARG) == 1) { if (rte_kvargs_process(kvlist, PMD_BOND_AGG_MODE_KVARG, - &bond_ethdev_parse_slave_agg_mode_kvarg, + &bond_ethdev_parse_child_agg_mode_kvarg, &agg_mode) != 0) { RTE_BOND_LOG(ERR, "Failed to parse agg selection mode for bonded device %s", @@ -3865,7 +3865,7 @@ bond_remove(struct rte_vdev_device *dev) RTE_ASSERT(eth_dev->device == &dev->device); internals = eth_dev->data->dev_private; - if (internals->slave_count != 0) + if (internals->child_count != 0) return -EBUSY; if (eth_dev->data->dev_started == 1) { @@ -3877,7 +3877,7 @@ bond_remove(struct rte_vdev_device *dev) return ret; } -/* this part will resolve the slave portids after all the other pdev and vdev +/* this part will resolve the child portids after all the other pdev and vdev * have been allocated */ static int bond_ethdev_configure(struct rte_eth_dev *dev) @@ -3959,7 +3959,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) if (link_speeds & RTE_ETH_LINK_SPEED_FIXED) { if ((link_speeds & (internals->speed_capa & ~RTE_ETH_LINK_SPEED_FIXED)) == 0) { - RTE_BOND_LOG(ERR, "the fixed speed is not supported by all slave devices."); + RTE_BOND_LOG(ERR, "the fixed speed is not supported by all child devices."); return -EINVAL; } /* @@ -4041,7 +4041,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) if (rte_kvargs_count(kvlist, PMD_BOND_AGG_MODE_KVARG) == 1) { if (rte_kvargs_process(kvlist, PMD_BOND_AGG_MODE_KVARG, - &bond_ethdev_parse_slave_agg_mode_kvarg, + &bond_ethdev_parse_child_agg_mode_kvarg, &agg_mode) != 0) { RTE_BOND_LOG(ERR, "Failed to parse agg selection mode for bonded device %s", @@ -4059,60 +4059,60 @@ bond_ethdev_configure(struct rte_eth_dev *dev) } } - /* Parse/add slave ports to bonded device */ - if (rte_kvargs_count(kvlist, PMD_BOND_SLAVE_PORT_KVARG) > 0) { - struct bond_ethdev_slave_ports slave_ports; + /* Parse/add child ports to bonded device */ + if (rte_kvargs_count(kvlist, PMD_BOND_CHILD_PORT_KVARG) > 0) { + struct bond_ethdev_child_ports child_ports; unsigned i; - memset(&slave_ports, 0, sizeof(slave_ports)); + memset(&child_ports, 0, sizeof(child_ports)); - if (rte_kvargs_process(kvlist, PMD_BOND_SLAVE_PORT_KVARG, - &bond_ethdev_parse_slave_port_kvarg, &slave_ports) != 0) { + if (rte_kvargs_process(kvlist, PMD_BOND_CHILD_PORT_KVARG, + &bond_ethdev_parse_child_port_kvarg, &child_ports) != 0) { RTE_BOND_LOG(ERR, - "Failed to parse slave ports for bonded device %s", + "Failed to parse child ports for bonded device %s", name); return -1; } - for (i = 0; i < slave_ports.slave_count; i++) { - if (rte_eth_bond_slave_add(port_id, slave_ports.slaves[i]) != 0) { + for (i = 0; i < child_ports.child_count; i++) { + if (rte_eth_bond_child_add(port_id, child_ports.children[i]) != 0) { RTE_BOND_LOG(ERR, - "Failed to add port %d as slave to bonded device %s", - slave_ports.slaves[i], name); + "Failed to add port %d as child to bonded device %s", + child_ports.children[i], name); } } } else { - RTE_BOND_LOG(INFO, "No slaves specified for bonded device %s", name); + RTE_BOND_LOG(INFO, "No children specified for bonded device %s", name); return -1; } - /* Parse/set primary slave port id*/ - arg_count = rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG); + /* Parse/set primary child port id*/ + arg_count = rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_CHILD_KVARG); if (arg_count == 1) { - uint16_t primary_slave_port_id; + uint16_t primary_child_port_id; if (rte_kvargs_process(kvlist, - PMD_BOND_PRIMARY_SLAVE_KVARG, - &bond_ethdev_parse_primary_slave_port_id_kvarg, - &primary_slave_port_id) < 0) { + PMD_BOND_PRIMARY_CHILD_KVARG, + &bond_ethdev_parse_primary_child_port_id_kvarg, + &primary_child_port_id) < 0) { RTE_BOND_LOG(INFO, - "Invalid primary slave port id specified for bonded device %s", + "Invalid primary child port id specified for bonded device %s", name); return -1; } /* Set balance mode transmit policy*/ - if (rte_eth_bond_primary_set(port_id, primary_slave_port_id) + if (rte_eth_bond_primary_set(port_id, primary_child_port_id) != 0) { RTE_BOND_LOG(ERR, - "Failed to set primary slave port %d on bonded device %s", - primary_slave_port_id, name); + "Failed to set primary child port %d on bonded device %s", + primary_child_port_id, name); return -1; } } else if (arg_count > 1) { RTE_BOND_LOG(INFO, - "Primary slave can be specified only once for bonded device %s", + "Primary child can be specified only once for bonded device %s", name); return -1; } @@ -4206,15 +4206,15 @@ bond_ethdev_configure(struct rte_eth_dev *dev) return -1; } - /* configure slaves so we can pass mtu setting */ - for (i = 0; i < internals->slave_count; i++) { - struct rte_eth_dev *slave_ethdev = - &(rte_eth_devices[internals->slaves[i].port_id]); - if (slave_configure(dev, slave_ethdev) != 0) { + /* configure children so we can pass mtu setting */ + for (i = 0; i < internals->child_count; i++) { + struct rte_eth_dev *child_ethdev = + &(rte_eth_devices[internals->children[i].port_id]); + if (child_configure(dev, child_ethdev) != 0) { RTE_BOND_LOG(ERR, - "bonded port (%d) failed to configure slave device (%d)", + "bonded port (%d) failed to configure child device (%d)", dev->data->port_id, - internals->slaves[i].port_id); + internals->children[i].port_id); return -1; } } @@ -4230,7 +4230,7 @@ RTE_PMD_REGISTER_VDEV(net_bonding, pmd_bond_drv); RTE_PMD_REGISTER_ALIAS(net_bonding, eth_bond); RTE_PMD_REGISTER_PARAM_STRING(net_bonding, - "slave= " + "child= " "primary= " "mode=[0-6] " "xmit_policy=[l2 | l23 | l34] " diff --git a/drivers/net/bonding/version.map b/drivers/net/bonding/version.map index 9333923b4e62..b31ed8d49689 100644 --- a/drivers/net/bonding/version.map +++ b/drivers/net/bonding/version.map @@ -3,6 +3,7 @@ DPDK_23 { rte_eth_bond_8023ad_agg_selection_get; rte_eth_bond_8023ad_agg_selection_set; + rte_eth_bond_8023ad_child_info; rte_eth_bond_8023ad_conf_get; rte_eth_bond_8023ad_dedicated_queues_disable; rte_eth_bond_8023ad_dedicated_queues_enable; @@ -12,8 +13,10 @@ DPDK_23 { rte_eth_bond_8023ad_ext_distrib_get; rte_eth_bond_8023ad_ext_slowtx; rte_eth_bond_8023ad_setup; - rte_eth_bond_8023ad_slave_info; - rte_eth_bond_active_slaves_get; + rte_eth_bond_active_children_get; + rte_eth_bond_child_add; + rte_eth_bond_child_remove; + rte_eth_bond_children_get; rte_eth_bond_create; rte_eth_bond_free; rte_eth_bond_link_monitoring_set; @@ -23,9 +26,6 @@ DPDK_23 { rte_eth_bond_mode_set; rte_eth_bond_primary_get; rte_eth_bond_primary_set; - rte_eth_bond_slave_add; - rte_eth_bond_slave_remove; - rte_eth_bond_slaves_get; rte_eth_bond_xmit_policy_get; rte_eth_bond_xmit_policy_set; diff --git a/examples/bond/main.c b/examples/bond/main.c index 9b076bb39fa3..12de9c1f2901 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -105,8 +105,8 @@ ":%02"PRIx8":%02"PRIx8":%02"PRIx8, \ RTE_ETHER_ADDR_BYTES(&addr)) -uint16_t slaves[RTE_MAX_ETHPORTS]; -uint16_t slaves_count; +uint16_t children[RTE_MAX_ETHPORTS]; +uint16_t children_count; static uint16_t BOND_PORT = 0xffff; @@ -128,7 +128,7 @@ static struct rte_eth_conf port_conf = { }; static void -slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool) +child_port_init(uint16_t portid, struct rte_mempool *mbuf_pool) { int retval; uint16_t nb_rxd = RTE_RX_DESC_DEFAULT; @@ -252,10 +252,10 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_exit(EXIT_FAILURE, "port %u: rte_eth_dev_adjust_nb_rx_tx_desc " "failed (res=%d)\n", BOND_PORT, retval); - for (i = 0; i < slaves_count; i++) { - if (rte_eth_bond_slave_add(BOND_PORT, slaves[i]) == -1) - rte_exit(-1, "Oooops! adding slave (%u) to bond (%u) failed!\n", - slaves[i], BOND_PORT); + for (i = 0; i < children_count; i++) { + if (rte_eth_bond_child_add(BOND_PORT, children[i]) == -1) + rte_exit(-1, "Oooops! adding child (%u) to bond (%u) failed!\n", + children[i], BOND_PORT); } @@ -283,18 +283,18 @@ bond_port_init(struct rte_mempool *mbuf_pool) if (retval < 0) rte_exit(retval, "Start port %d failed (res=%d)", BOND_PORT, retval); - printf("Waiting for slaves to become active..."); + printf("Waiting for children to become active..."); while (wait_counter) { - uint16_t act_slaves[16] = {0}; - if (rte_eth_bond_active_slaves_get(BOND_PORT, act_slaves, 16) == - slaves_count) { + uint16_t act_children[16] = {0}; + if (rte_eth_bond_active_children_get(BOND_PORT, act_children, 16) == + children_count) { printf("\n"); break; } sleep(1); printf("..."); if (--wait_counter == 0) - rte_exit(-1, "\nFailed to activate slaves\n"); + rte_exit(-1, "\nFailed to activate children\n"); } retval = rte_eth_promiscuous_enable(BOND_PORT); @@ -631,7 +631,7 @@ static void cmd_help_parsed(__rte_unused void *parsed_result, "send IP - sends one ARPrequest through bonding for IP.\n" "start - starts listening ARPs.\n" "stop - stops lcore_main.\n" - "show - shows some bond info: ex. active slaves etc.\n" + "show - shows some bond info: ex. active children etc.\n" "help - prints help.\n" "quit - terminate all threads and quit.\n" ); @@ -742,13 +742,13 @@ static void cmd_show_parsed(__rte_unused void *parsed_result, struct cmdline *cl, __rte_unused void *data) { - uint16_t slaves[16] = {0}; + uint16_t children[16] = {0}; uint8_t len = 16; struct rte_ether_addr addr; uint16_t i; int ret; - for (i = 0; i < slaves_count; i++) { + for (i = 0; i < children_count; i++) { ret = rte_eth_macaddr_get(i, &addr); if (ret != 0) { cmdline_printf(cl, @@ -763,9 +763,9 @@ static void cmd_show_parsed(__rte_unused void *parsed_result, rte_spinlock_lock(&global_flag_stru_p->lock); cmdline_printf(cl, - "Active_slaves:%d " + "Active_children:%d " "packets received:Tot:%d Arp:%d IPv4:%d\n", - rte_eth_bond_active_slaves_get(BOND_PORT, slaves, len), + rte_eth_bond_active_children_get(BOND_PORT, children, len), global_flag_stru_p->port_packets[0], global_flag_stru_p->port_packets[1], global_flag_stru_p->port_packets[2]); @@ -836,10 +836,10 @@ main(int argc, char *argv[]) rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n"); /* initialize all ports */ - slaves_count = nb_ports; + children_count = nb_ports; RTE_ETH_FOREACH_DEV(i) { - slave_port_init(i, mbuf_pool); - slaves[i] = i; + child_port_init(i, mbuf_pool); + children[i] = i; } bond_port_init(mbuf_pool); diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 99fe9e238b20..c717a463c905 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -2035,8 +2035,10 @@ struct rte_eth_dev_owner { #define RTE_ETH_DEV_FLOW_OPS_THREAD_SAFE RTE_BIT32(0) /** Device supports link state interrupt */ #define RTE_ETH_DEV_INTR_LSC RTE_BIT32(1) -/** Device is a bonded slave */ -#define RTE_ETH_DEV_BONDED_SLAVE RTE_BIT32(2) +/** Device is a bonded */ +#define RTE_ETH_DEV_BONDED_CHILD RTE_BIT32(2) +#define RTE_ETH_DEV_BONDED_SLAVE \ + RTE_DEPRECATED(RTE_ETH_DEV_BONDED_SLAVE) RTE_ETH_DEV_BONDED_CHILD /** Device supports device removal interrupt */ #define RTE_ETH_DEV_INTR_RMV RTE_BIT32(3) /** Device is port representor */ -- 2.39.2