From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6A2F142B2C; Wed, 17 May 2023 16:52:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 368E2406B7; Wed, 17 May 2023 16:52:47 +0200 (CEST) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mails.dpdk.org (Postfix) with ESMTP id 9398740041 for ; Wed, 17 May 2023 16:52:44 +0200 (CEST) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6439e6f5a33so611215b3a.2 for ; Wed, 17 May 2023 07:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1684335164; x=1686927164; h=mime-version:references:in-reply-to:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=6+MU+GI+gQJKXfCqW3kr4wcbPh/BpfeoJjKTfarQkAk=; b=zegriUyK3Az6Od6U+GjIJDpm+mEuJ16HmYm4I54Kmm2DzPC9w5TXgQUzm2tG5jub4J K3JA/SlBToxZ8KHfxdPT24LqOpLUi+bRWojvg/A5ctfIHhvdyXhwAH73KuMVUjjTmmdc vykP1C0boSwOEnHCWuinL0JoO2Kk+jlu7x6K4nb1dYaXJOQ/Hcr9R0mXRx2jJHsKmyjq 7xTZs8COVm4wzfGW0WAjGdDyft58S4hPBqrUUxn5LiJy7GZOldsHVCMuqzfqVrOEcGny LPZzk5vk4vqYKGIF0imuDVm1tpMpzSgG+OkDjOSv1/JusdqxjE3SSPYQEAPTo9yIoE0k 2zig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684335164; x=1686927164; h=mime-version:references:in-reply-to:message-id:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6+MU+GI+gQJKXfCqW3kr4wcbPh/BpfeoJjKTfarQkAk=; b=FJjCHmIplrZYxtwlWHPfo9WP60HYROVcfRAFOtxb8WnT2Y4T25hWlg2Xa+zcbmwpXK 17zzPO5AVAGgLANIv6DdgEHUNtqkeh8HAsAHzrVecxFPsBm0DajAJUYMD5ApcYKtoiy8 RHvLyxD9j5oBpv+Nk++n0/7ZSiAnJ6rwHqXugPz05IHfno/lXxyyXlS3icoVELiafvGJ x7ZEzTM5zvw6hmG/cTKCknWAfAaAIQfz1wHsb/BWHM0xxNFVDLfpJCAzLEee4RfjpOtt irkAC3MooeCshXWtLU0bI7fSHtMv2MR/z6+iuA1UlgiWHpxBNCbP6VkFvGk2plUXU9Ma EzwA== X-Gm-Message-State: AC+VfDyqVzYud4rzhoCNvng+Bp05F3ILjQO/tbK1PYed9/r8r0FoX7so Zn+ZIbXwQLu7dhqsDljGmwTFBQ== X-Google-Smtp-Source: ACHHUZ72Tctgq753CZSGSw3iu3pay7km2defrbWcb8IrSqmcyS5m/OHYYXOZmuzEMYfCtZGmJZ/UJg== X-Received: by 2002:a05:6a00:2313:b0:646:3162:31a2 with SMTP id h19-20020a056a00231300b00646316231a2mr1401220pfh.17.1684335163104; Wed, 17 May 2023 07:52:43 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id s22-20020a62e716000000b0063f3aac78b9sm15350234pfh.79.2023.05.17.07.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 07:52:42 -0700 (PDT) Date: Wed, 17 May 2023 07:52:38 -0700 From: Stephen Hemminger To: Chaoyong He Cc: dev@dpdk.org, oss-drivers@corigine.com, niklas.soderlund@corigine.com, Long Wu , James Hershaw Subject: Re: [PATCH] net/bonding: replace master/slave to main/member Message-ID: <20230517075238.6ff09c8b@hermes.local> In-Reply-To: <20230517065905.1310752-1-chaoyong.he@corigine.com> References: <20230517065905.1310752-1-chaoyong.he@corigine.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/U=9tSJT/TL8p.c.S3uxGZmH" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --MP_/U=9tSJT/TL8p.c.S3uxGZmH Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wed, 17 May 2023 14:59:05 +0800 Chaoyong He wrote: > This patch replaces the usage of the word 'master/slave' with more > appropriate word 'main/member' in bonding PMD as well as in its docs > and examples. Also the test app and testpmd were modified to use the > new wording. >=20 > The bonding PMD's public API was modified according to the changes > in word: > rte_eth_bond_8023ad_slave_info is now called > rte_eth_bond_8023ad_member_info, > rte_eth_bond_active_slaves_get is now called > rte_eth_bond_active_members_get, > rte_eth_bond_slave_add is now called > rte_eth_bond_member_add, > rte_eth_bond_slave_remove is now called > rte_eth_bond_member_remove, > rte_eth_bond_slaves_get is now called > rte_eth_bond_members_get. >=20 > Also the macro RTE_ETH_DEV_BONDED_SLAVE was renamed to > RTE_ETH_DEV_BONDED_MEMBER. >=20 > Signed-off-by: Long Wu > Acked-by: Niklas S=C3=B6derlund > Reviewed-by: James Hershaw > Reviewed-by: Chaoyong He > --- This looks great. I had started on this and chose the new names as parent and child, but that choice was arbitrary. Did some background research and =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Origin Feature Name Aggregate Name Device Name =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D IEEE 802.1AX Link Aggregation aggregator port Linux Bonding master slave FreeBSD Link Aggregate lagg laggport Windows Teaming team OpenVswitch Bonding bond members Solaris Link Aggregate aggregation datalink Cisco EtherChannel group channel Juniper Aggregate Ethernet lag interface lag link Arista Port Channel group channel SONiC LAG portchannel member =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D You also need to modify how this is done since it ends up being an API change. My version of the patch had some of that, if you want here it is. --MP_/U=9tSJT/TL8p.c.S3uxGZmH Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0005-bonding-replace-use-of-slave-device-with-child-devic.patch =46rom 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 devi= ce 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, } =20 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 =20 - 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; =20 - num_slaves =3D rte_eth_bond_slaves_get(bond_pid, slave_pids, + num_children =3D 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 =3D %u\n", + if (num_children < 0) { + fprintf(stderr, "Failed to get child list for port =3D %u\n", bond_pid); - return num_slaves; + return num_children; } =20 - for (i =3D 0; i < num_slaves; i++) { - slave_pid =3D slave_pids[i]; - port =3D &ports[slave_pid]; + for (i =3D 0; i < num_children; i++) { + child_pid =3D child_pids[i]; + port =3D &ports[child_pid]; port->port_status =3D is_stop ? RTE_PORT_STOPPED : RTE_PORT_STARTED; } @@ -632,12 +632,12 @@ eth_dev_start_mp(uint16_t port_id) struct rte_port *port =3D &ports[port_id]; =20 /* - * 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 =3D=3D 1) - return change_bonding_slave_port_status(port_id, false); + return change_bonding_child_port_status(port_id, false); } =20 return 0; @@ -656,12 +656,12 @@ eth_dev_stop_mp(uint16_t port_id) struct rte_port *port =3D &ports[port_id]; =20 /* - * 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 =3D=3D 1) - return change_bonding_slave_port_status(port_id, true); + return change_bonding_child_port_status(port_id, true); } =20 return 0; @@ -2610,7 +2610,7 @@ all_ports_started(void) port =3D &ports[pi]; /* Check if there is a port which is not started */ if ((port->port_status !=3D RTE_PORT_STARTED) && - (port->slave_flag =3D=3D 0)) + (port->child_flag =3D=3D 0)) return 0; } =20 @@ -2624,7 +2624,7 @@ port_is_stopped(portid_t port_id) struct rte_port *port =3D &ports[port_id]; =20 if ((port->port_status !=3D RTE_PORT_STOPPED) && - (port->slave_flag =3D=3D 0)) + (port->child_flag =3D=3D 0)) return 0; return 1; } @@ -2970,8 +2970,8 @@ fill_xstats_display_info(void) =20 /* * 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 n= eed + * 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 n= eed * to update the port configurations of bonding device. */ static void @@ -3028,7 +3028,7 @@ start_port(portid_t pid) if (pid !=3D pi && pid !=3D (portid_t)RTE_PORT_ALL) continue; =20 - 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; } =20 - 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) } =20 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; =20 - for (i =3D 0; i < num_slaves; i++) { - slave_pid =3D slave_pids[i]; - if (port_is_started(slave_pid) =3D=3D 1) { - if (rte_eth_dev_stop(slave_pid) !=3D 0) + for (i =3D 0; i < num_children; i++) { + child_pid =3D child_pids[i]; + if (port_is_started(child_pid) =3D=3D 1) { + if (rte_eth_dev_stop(child_pid) !=3D 0) fprintf(stderr, "rte_eth_dev_stop failed for port %u\n", - slave_pid); + child_pid); =20 - port =3D &ports[slave_pid]; + port =3D &ports[child_pid]; port->port_status =3D RTE_PORT_STOPPED; } =20 - clear_port_slave_flag(slave_pid); + clear_port_child_flag(child_pid); =20 - /* Close slave device when testpmd quit or is killed. */ + /* Close child device when testpmd quit or is killed. */ if (cl_quit =3D=3D 1 || f_quit =3D=3D 1) - rte_eth_dev_close(slave_pid); + rte_eth_dev_close(child_pid); } } =20 @@ -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 =3D 0; + portid_t child_pids[RTE_MAX_ETHPORTS]; + int num_children =3D 0; =20 if (port_id_is_invalid(pid, ENABLED_WARN)) return; @@ -3488,7 +3488,7 @@ close_port(portid_t pid) continue; } =20 - 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 =3D=3D 1) - num_slaves =3D rte_eth_bond_slaves_get(pi, - slave_pids, RTE_MAX_ETHPORTS); + num_children =3D 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 =3D=3D 1 && num_slaves > 0) - clear_bonding_slave_device(slave_pids, - num_slaves); + if (port->bond_flag =3D=3D 1 && num_children > 0) + clear_bonding_child_device(child_pids, + num_children); } =20 free_xstats_display_info(pi); @@ -3555,7 +3555,7 @@ reset_port(portid_t pid) continue; } =20 - 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) } } =20 -void set_port_slave_flag(portid_t slave_pid) +void set_port_child_flag(portid_t child_pid) { struct rte_port *port; =20 - port =3D &ports[slave_pid]; - port->slave_flag =3D 1; + port =3D &ports[child_pid]; + port->child_flag =3D 1; } =20 -void clear_port_slave_flag(portid_t slave_pid) +void clear_port_child_flag(portid_t child_pid) { struct rte_port *port; =20 - port =3D &ports[slave_pid]; - port->slave_flag =3D 0; + port =3D &ports[child_pid]; + port->child_flag =3D 0; } =20 -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; =20 - port =3D &ports[slave_pid]; - ret =3D eth_dev_info_get_print_err(slave_pid, &dev_info); + port =3D &ports[child_pid]; + ret =3D eth_dev_info_get_print_err(child_pid, &dev_info); if (ret !=3D 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= =3D=3D 1)) + if ((*dev_info.dev_flags & RTE_ETH_DEV_BONDED_CHILD) || (port->child_flag= =3D=3D 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); =20 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) =20 =20 -uint8_t slave_mac[] =3D {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 }; +uint8_t child_mac[] =3D {0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 }; uint8_t bonded_mac[] =3D {0xAA, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF }; =20 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; =20 uint16_t nb_rx_q; @@ -73,7 +73,7 @@ struct link_bonding_unittest_params { =20 struct rte_mempool *mbuf_pool; =20 - struct rte_ether_addr *default_slave_mac; + struct rte_ether_addr *default_child_mac; struct rte_ether_addr *default_bonded_mac; =20 /* Packet Headers */ @@ -90,8 +90,8 @@ static struct rte_udp_hdr pkt_udp_hdr; =20 static struct link_bonding_unittest_params default_params =3D { .bonded_port_id =3D -1, - .slave_port_ids =3D { -1 }, - .bonded_slave_count =3D 0, + .child_port_ids =3D { -1 }, + .bonded_child_count =3D 0, .bonding_mode =3D BONDING_MODE_ROUND_ROBIN, =20 .nb_rx_q =3D 1, @@ -99,7 +99,7 @@ static struct link_bonding_unittest_params default_params= =3D { =20 .mbuf_pool =3D NULL, =20 - .default_slave_mac =3D (struct rte_ether_addr *)slave_mac, + .default_child_mac =3D (struct rte_ether_addr *)child_mac, .default_bonded_mac =3D (struct rte_ether_addr *)bonded_mac, =20 .pkt_eth_hdr =3D NULL, @@ -202,8 +202,8 @@ configure_ethdev(uint16_t port_id, uint8_t start, uint8= _t en_isr) return 0; } =20 -static int slaves_initialized; -static int mac_slaves_initialized; +static int children_initialized; +static int mac_children_initialized; =20 static pthread_mutex_t mutex =3D PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cvar =3D PTHREAD_COND_INITIALIZER; @@ -213,7 +213,7 @@ static int test_setup(void) { int i, nb_mbuf_per_pool; - struct rte_ether_addr *mac_addr =3D (struct rte_ether_addr *)slave_mac; + struct rte_ether_addr *mac_addr =3D (struct rte_ether_addr *)child_mac; =20 /* Allocate ethernet packet header with space for VLAN header */ if (test_params->pkt_eth_hdr =3D=3D NULL) { @@ -235,7 +235,7 @@ test_setup(void) } =20 /* Create / Initialize virtual eth devs */ - if (!slaves_initialized) { + if (!children_initialized) { for (i =3D 0; i < TEST_MAX_NUMBER_OF_PORTS; i++) { char pmd_name[RTE_ETH_NAME_MAX_LEN]; =20 @@ -243,16 +243,16 @@ test_setup(void) =20 snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "eth_virt_%d", i); =20 - test_params->slave_port_ids[i] =3D virtual_ethdev_create(pmd_name, + test_params->child_port_ids[i] =3D virtual_ethdev_create(pmd_name, mac_addr, rte_socket_id(), 1); - TEST_ASSERT(test_params->slave_port_ids[i] >=3D 0, + TEST_ASSERT(test_params->child_port_ids[i] >=3D 0, "Failed to create virtual virtual ethdev %s", pmd_name); =20 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 =3D 1; + children_initialized =3D 1; } =20 return 0; @@ -261,9 +261,9 @@ test_setup(void) static int test_create_bonded_device(void) { - int current_slave_count; + int current_child_count; =20 - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; =20 /* Don't try to recreate bonded device if re-running test suite*/ if (test_params->bonded_port_id =3D=3D -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); =20 - current_slave_count =3D rte_eth_bond_slaves_get(test_params->bonded_port_= id, - slaves, RTE_MAX_ETHPORTS); + current_child_count =3D rte_eth_bond_children_get(test_params->bonded_por= t_id, + children, RTE_MAX_ETHPORTS); =20 - 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); =20 - current_slave_count =3D rte_eth_bond_active_slaves_get( - test_params->bonded_port_id, slaves, RTE_MAX_ETHPORTS); + current_child_count =3D rte_eth_bond_active_children_get( + test_params->bonded_port_id, children, RTE_MAX_ETHPORTS); =20 - 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); =20 return 0; } @@ -329,46 +329,46 @@ test_create_bonded_device_with_invalid_params(void) } =20 static int -test_add_slave_to_bonded_device(void) +test_add_child_to_bonded_device(void) { - int current_slave_count; + int current_child_count; =20 - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; =20 - 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); =20 - current_slave_count =3D 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 =3D rte_eth_bond_children_get(test_params->bonded_por= t_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); =20 - current_slave_count =3D 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 =3D 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); =20 - test_params->bonded_slave_count++; + test_params->bonded_child_count++; =20 return 0; } =20 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."); =20 /* 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."); =20 return 0; @@ -376,63 +376,63 @@ test_add_slave_to_invalid_bonded_device(void) =20 =20 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]; =20 - 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); =20 =20 - current_slave_count =3D rte_eth_bond_slaves_get(test_params->bonded_port_= id, - slaves, RTE_MAX_ETHPORTS); + current_child_count =3D rte_eth_bond_children_get(test_params->bonded_por= t_id, + children, RTE_MAX_ETHPORTS); =20 - 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); =20 =20 - mac_addr =3D (struct rte_ether_addr *)slave_mac; + mac_addr =3D (struct rte_ether_addr *)child_mac; mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] =3D - test_params->bonded_slave_count-1; + test_params->bonded_child_count-1; =20 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"); =20 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]); =20 virtual_ethdev_simulate_link_status_interrupt(test_params->bonded_port_id, 0); =20 - test_params->bonded_slave_count--; + test_params->bonded_child_count--; =20 return 0; } =20 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."); =20 /* 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."); =20 return 0; @@ -441,19 +441,19 @@ test_remove_slave_from_invalid_bonded_device(void) static int bonded_id =3D 2; =20 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]; =20 - test_add_slave_to_bonded_device(); + test_add_child_to_bonded_device(); =20 - current_slave_count =3D 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 =3D rte_eth_bond_children_get(test_params->bonded_por= t_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); =20 snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "%s_%d", BONDED_DEV_NAME, ++bond= ed_id); =20 @@ -461,93 +461,93 @@ test_add_already_bonded_slave_to_bonded_device(void) rte_socket_id()); TEST_ASSERT(port_id >=3D 0, "Failed to create bonded device."); =20 - 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); =20 - return test_remove_slave_from_bonded_device(); + return test_remove_child_from_bonded_device(); } =20 =20 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]; =20 - 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"); =20 /* Invalid port id */ - current_slave_count =3D rte_eth_bond_slaves_get(INVALID_PORT_ID, slaves, + current_child_count =3D rte_eth_bond_children_get(INVALID_PORT_ID, childr= en, RTE_MAX_ETHPORTS); - TEST_ASSERT(current_slave_count < 0, + TEST_ASSERT(current_child_count < 0, "Invalid port id unexpectedly succeeded"); =20 - current_slave_count =3D rte_eth_bond_active_slaves_get(INVALID_PORT_ID, - slaves, RTE_MAX_ETHPORTS); - TEST_ASSERT(current_slave_count < 0, + current_child_count =3D rte_eth_bond_active_children_get(INVALID_PORT_ID, + children, RTE_MAX_ETHPORTS); + TEST_ASSERT(current_child_count < 0, "Invalid port id unexpectedly succeeded"); =20 - /* Invalid slaves pointer */ - current_slave_count =3D rte_eth_bond_slaves_get(test_params->bonded_port_= id, + /* Invalid children pointer */ + current_child_count =3D rte_eth_bond_children_get(test_params->bonded_por= t_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"); =20 - current_slave_count =3D rte_eth_bond_active_slaves_get( + current_child_count =3D 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"); =20 /* non bonded device*/ - current_slave_count =3D rte_eth_bond_slaves_get( - test_params->slave_port_ids[0], NULL, RTE_MAX_ETHPORTS); - TEST_ASSERT(current_slave_count < 0, + current_child_count =3D 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"); =20 - current_slave_count =3D 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 =3D 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"); =20 - 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"); =20 return 0; } =20 =20 static int -test_add_remove_multiple_slaves_to_from_bonded_device(void) +test_add_remove_multiple_children_to_from_bonded_device(void) { int i; =20 for (i =3D 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"); =20 for (i =3D 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"); =20 return 0; } =20 static void -enable_bonded_slaves(void) +enable_bonded_children(void) { int i; =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { - virtual_ethdev_tx_burst_fn_set_success(test_params->slave_port_ids[i], + for (i =3D 0; i < test_params->bonded_child_count; i++) { + virtual_ethdev_tx_burst_fn_set_success(test_params->child_port_ids[i], 1); =20 virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 1); + test_params->child_port_ids[i], 1); } } =20 @@ -556,34 +556,34 @@ test_start_bonded_device(void) { struct rte_eth_link link_status; =20 - 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; =20 - /* 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"); =20 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); =20 /* 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); =20 - current_slave_count =3D 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 =3D rte_eth_bond_children_get(test_params->bonded_por= t_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); =20 - current_slave_count =3D 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 =3D 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); =20 current_bonding_mode =3D rte_eth_bond_mode_get(test_params->bonded_port_i= d); 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); =20 primary_port =3D 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]); =20 retval =3D rte_eth_link_get(test_params->bonded_port_id, &link_status); TEST_ASSERT(retval >=3D 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]; =20 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); =20 - current_slave_count =3D 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 =3D rte_eth_bond_children_get(test_params->bonded_por= t_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); =20 - current_slave_count =3D 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 =3D 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); =20 return 0; } =20 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"); =20 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); =20 /* 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]); =20 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); =20 /* Non bonded device */ - bonding_mode =3D rte_eth_bond_mode_get(test_params->slave_port_ids[0]); + bonding_mode =3D 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]); } =20 - return remove_slaves_and_stop_bonded_device(); + return remove_children_and_stop_bonded_device(); } =20 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; =20 - /* Add 4 slaves to bonded device */ - for (i =3D 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 =3D test_params->bonded_child_count; i < 4; i++) + TEST_ASSERT_SUCCESS(test_add_child_to_bonded_device(), + "Failed to add child to bonded device."); =20 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) =20 /* 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."); =20 /* 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."); =20 - /* 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 chi= ld */ for (i =3D 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]); =20 retval =3D rte_eth_bond_primary_get(test_params->bonded_port_id); TEST_ASSERT(retval >=3D 0, "Failed to read primary port from bonded port (%d)\n", test_params->bonded_port_id); =20 - 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]); =20 /* 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); =20 - expected_mac_addr =3D (struct rte_ether_addr *)&slave_mac; + expected_mac_addr =3D (struct rte_ether_addr *)&child_mac; expected_mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] =3D i; =20 - /* 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"); =20 - /* Check other slaves MACs */ + /* Check other children MACs */ for (j =3D 0; j < 4; j++) { if (j !=3D 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 + 1= 0), "read primary port from expectedly"); =20 - /* 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"); =20 - 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"); =20 - /* No slaves */ + /* No children */ TEST_ASSERT(rte_eth_bond_primary_get(test_params->bonded_port_id) < 0, "read primary port from expectedly\n"); =20 @@ -840,7 +840,7 @@ test_set_explicit_bonded_mac(void) =20 /* 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."); =20 /* 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); =20 - /* Add 4 slaves to bonded device */ - for (i =3D 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 =3D 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"); } =20 /* 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"); =20 - /* Check other slaves MACs */ + /* Check other children MACs */ for (i =3D 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"); } =20 /* test resetting mac address on bonded device */ @@ -883,13 +883,13 @@ test_set_explicit_bonded_mac(void) test_params->bonded_port_id); =20 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]); =20 - /* 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"); =20 TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_reset(test_params->bonded_po= rt_id), "Failed to reset MAC address on bonded port (%d)", @@ -898,25 +898,25 @@ test_set_explicit_bonded_mac(void) return 0; } =20 -#define BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT (3) +#define BONDED_INIT_MAC_ASSIGNMENT_CHILD_COUNT (3) =20 static int test_set_bonded_port_initialization_mac_assignment(void) { - int i, slave_count; + int i, child_count; =20 - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; static int bonded_port_id =3D -1; - static int slave_port_ids[BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT]; + static int child_port_ids[BONDED_INIT_MAC_ASSIGNMENT_CHILD_COUNT]; =20 - 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; =20 /* 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)); =20 /* - * 1. a - Create / configure bonded / slave ethdevs + * 1. a - Create / configure bonded / child ethdevs */ if (bonded_port_id =3D=3D -1) { bonded_port_id =3D rte_eth_bond_create("net_bonding_mac_ass_test", @@ -927,46 +927,46 @@ test_set_bonded_port_initialization_mac_assignment(vo= id) "Failed to configure bonded ethdev"); } =20 - if (!mac_slaves_initialized) { - for (i =3D 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) { + if (!mac_children_initialized) { + for (i =3D 0; i < BONDED_INIT_MAC_ASSIGNMENT_CHILD_COUNT; i++) { char pmd_name[RTE_ETH_NAME_MAX_LEN]; =20 - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =3D + child_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =3D i + 100; =20 snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, - "eth_slave_%d", i); + "eth_child_%d", i); =20 - slave_port_ids[i] =3D virtual_ethdev_create(pmd_name, - &slave_mac_addr, rte_socket_id(), 1); + child_port_ids[i] =3D virtual_ethdev_create(pmd_name, + &child_mac_addr, rte_socket_id(), 1); =20 - TEST_ASSERT(slave_port_ids[i] >=3D 0, - "Failed to create slave ethdev %s", + TEST_ASSERT(child_port_ids[i] >=3D 0, + "Failed to create child ethdev %s", pmd_name); =20 - 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 =3D 1; + mac_children_initialized =3D 1; } =20 =20 /* - * 2. Add slave ethdevs to bonded device + * 2. Add child ethdevs to bonded device */ - for (i =3D 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 =3D 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); } =20 - slave_count =3D rte_eth_bond_slaves_get(bonded_port_id, slaves, + child_count =3D 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); =20 =20 /* @@ -982,16 +982,16 @@ test_set_bonded_port_initialization_mac_assignment(vo= id) =20 =20 /* 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); =20 - for (i =3D 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) { + for (i =3D 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); } =20 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"); =20 - 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"); =20 - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] =3D 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] =3D 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"); =20 - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] =3D 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] =3D 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"); =20 =20 /* 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."); =20 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"); =20 - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] =3D 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] =3D 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"); =20 - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] =3D 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] =3D 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"); =20 - 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"); =20 /* 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); =20 - for (i =3D 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 =3D 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); } =20 - slave_count =3D rte_eth_bond_slaves_get(bonded_port_id, slaves, + child_count =3D rte_eth_bond_children_get(bonded_port_id, children, RTE_MAX_ETHPORTS); =20 - 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); =20 - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] =3D 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] =3D 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"); =20 - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] =3D 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] =3D 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"); =20 - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] =3D 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] =3D 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"); =20 return 0; } =20 =20 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); =20 /* Set link bonding mode */ @@ -1148,40 +1148,40 @@ initialize_bonded_device_with_slaves(uint8_t bondin= g_mode, uint8_t bond_en_isr, "Failed to start bonded pmd eth device %d.", test_params->bonded_port_id); =20 - if (enable_slave) - enable_bonded_slaves(); + if (enable_child) + enable_bonded_children(); =20 return 0; } =20 static int -test_adding_slave_after_bonded_device_started(void) +test_adding_child_after_bonded_device_started(void) { int i; =20 - 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"); =20 - /* Enabled slave devices */ - for (i =3D 0; i < test_params->bonded_slave_count + 1; i++) { + /* Enabled child devices */ + for (i =3D 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); } =20 - 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"); =20 rte_eth_stats_reset( - test_params->slave_port_ids[test_params->bonded_slave_count]); + test_params->child_port_ids[test_params->bonded_child_count]); =20 - test_params->bonded_slave_count++; + test_params->bonded_child_count++; =20 - return remove_slaves_and_stop_bonded_device(); + return remove_children_and_stop_bonded_device(); } =20 -#define TEST_STATUS_INTERRUPT_SLAVE_COUNT 4 +#define TEST_STATUS_INTERRUPT_CHILD_COUNT 4 #define TEST_LSC_WAIT_TIMEOUT_US 500000 =20 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]; =20 - /* 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"); =20 test_lsc_interrupt_count =3D 0; @@ -1253,27 +1253,27 @@ test_status_interrupt(void) RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback, &test_params->bonded_port_id); =20 - slave_count =3D rte_eth_bond_active_slaves_get(test_params->bonded_port_i= d, - slaves, RTE_MAX_ETHPORTS); + child_count =3D rte_eth_bond_active_children_get(test_params->bonded_port= _id, + children, RTE_MAX_ETHPORTS); =20 - 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); =20 - /* 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 receive= d 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); =20 TEST_ASSERT_EQUAL(test_lsc_interrupt_count, 0, "Received a link status change interrupt unexpectedly"); =20 virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[3], 0); + test_params->child_port_ids[3], 0); =20 TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) =3D=3D 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"); =20 - slave_count =3D rte_eth_bond_active_slaves_get(test_params->bonded_port_i= d, - slaves, RTE_MAX_ETHPORTS); + child_count =3D rte_eth_bond_active_children_get(test_params->bonded_port= _id, + children, RTE_MAX_ETHPORTS); =20 - 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); =20 - /* bring one slave port up so link status will change */ + /* bring one child port up so link status will change */ test_lsc_interrupt_count =3D 0; =20 virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[0], 1); + test_params->child_port_ids[0], 1); =20 TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) =3D=3D 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"); =20 - /* 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 =3D 0; =20 virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[0], 1); + test_params->child_port_ids[0], 1); =20 TEST_ASSERT(lsc_timeout(TEST_LSC_WAIT_TIMEOUT_US) !=3D 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); =20 - /* 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(); } =20 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; =20 - 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"); =20 - burst_size =3D 20 * test_params->bonded_slave_count; + burst_size =3D 20 * test_params->bonded_child_count; =20 TEST_ASSERT(burst_size <=3D 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); =20 - /* Verify slave ports tx stats */ - for (i =3D 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 =3D 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); } =20 - /* Put all slaves down and try and transmit */ - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i =3D 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); } =20 /* Send burst on bonded port */ @@ -1444,8 +1444,8 @@ test_roundrobin_tx_burst(void) pkt_burst, burst_size), 0, "tx burst return unexpected value"); =20 - /* 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(); } =20 static int @@ -1471,13 +1471,13 @@ free_mbufs(struct rte_mbuf **mbufs, int nb_mbufs) rte_pktmbuf_free(mbufs[i]); } =20 -#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) =20 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) =20 int i, first_fail_idx, tx_count; =20 - 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"); =20 /* 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"); =20 /* Copy references to packets which we expect not to be transmitted */ - first_fail_idx =3D (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 =3D (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; =20 - for (i =3D 0; i < TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT; i++) { + for (i =3D 0; i < TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT; i++) { expected_tx_fail_pkts[i] =3D pkt_burst[first_fail_idx + - (i * TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT)]; + (i * TEST_RR_CHILD_TX_FAIL_CHILD_COUNT)]; } =20 - /* 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); =20 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); =20 tx_count =3D 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); =20 - 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); =20 /* Verify that failed packet are expected failed packets */ - for (i =3D 0; i < TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT; i++) { + for (i =3D 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); =20 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); =20 - /* Verify slave ports tx stats */ - for (i =3D 0; i < test_params->bonded_slave_count; i++) { - int slave_expected_tx_count; + /* Verify child ports tx stats */ + for (i =3D 0; i < test_params->bonded_child_count; i++) { + int child_expected_tx_count; =20 - rte_eth_stats_get(test_params->slave_port_ids[i], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[i], &port_stats); =20 - slave_expected_tx_count =3D TEST_RR_SLAVE_TX_FAIL_BURST_SIZE / - test_params->bonded_slave_count; + child_expected_tx_count =3D TEST_RR_CHILD_TX_FAIL_BURST_SIZE / + test_params->bonded_child_count; =20 - if (i =3D=3D TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX) - slave_expected_tx_count =3D slave_expected_tx_count - - TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT; + if (i =3D=3D TEST_RR_CHILD_TX_FAIL_FAILING_CHILD_IDX) + child_expected_tx_count =3D child_expected_tx_count - + TEST_RR_CHILD_TX_FAIL_PACKETS_COUNT; =20 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); } =20 /* 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); =20 - /* 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(); } =20 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] =3D { NULL }; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] =3D { NULL }; @@ -1585,19 +1585,19 @@ test_roundrobin_rx_burst_on_single_slave(void) =20 int i, j, burst_size =3D 25; =20 - /* 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"); =20 /* 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"); =20 - for (i =3D 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 =3D 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); =20 /* Call rx burst on bonded device */ @@ -1616,25 +1616,25 @@ test_roundrobin_rx_burst_on_single_slave(void) =20 =20 =20 - /* Verify bonded slave devices rx count */ - /* Verify slave ports tx stats */ - for (j =3D 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 =3D 0; j < test_params->bonded_child_count; j++) { + rte_eth_stats_get(test_params->child_port_ids[j], &port_stats); =20 if (i =3D=3D 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); } =20 - /* 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) } =20 =20 - /* 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(); } =20 -#define TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT (3) +#define TEST_ROUNDROBIN_TX_BURST_CHILD_COUNT (3) =20 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]; =20 struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] =3D { NULL }; struct rte_eth_stats port_stats; =20 - int burst_size[TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT] =3D { 15, 13, 36 }; + int burst_size[TEST_ROUNDROBIN_TX_BURST_CHILD_COUNT] =3D { 15, 13, 36 }; int i, nb_rx; =20 - /* 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"); =20 /* Generate test bursts of packets to transmit */ - for (i =3D 0; i < TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT; i++) { + for (i =3D 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"); } =20 - /* Add rx data to slaves */ - for (i =3D 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 =3D 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]); } =20 @@ -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]); =20 - /* 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]); =20 - 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]); =20 - 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]); =20 - 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); =20 /* free mbufs */ @@ -1727,8 +1727,8 @@ test_roundrobin_rx_burst_on_multiple_slaves(void) rte_pktmbuf_free(rx_pkt_burst[i]); } =20 - /* 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(); } =20 static int @@ -1739,48 +1739,48 @@ test_roundrobin_verify_mac_assignment(void) =20 int i; =20 - 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]); =20 - /* 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"); =20 - /* Verify that all MACs are the same as first slave added to bonded dev */ - for (i =3D 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 =3D 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]); } =20 /* 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]); =20 - for (i =3D 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 =3D 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]); } =20 /* 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]); =20 - for (i =3D 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 =3D 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]); } =20 /* 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]); =20 - for (i =3D 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 =3D 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]); } =20 - /* 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(); } =20 static int @@ -1839,10 +1839,10 @@ test_roundrobin_verify_promiscuous_enable_disable(v= oid) int i, promiscuous_en; int ret; =20 - /* 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"); =20 ret =3D rte_eth_promiscuous_enable(test_params->bonded_port_id); TEST_ASSERT_SUCCESS(ret, @@ -1854,12 +1854,12 @@ test_roundrobin_verify_promiscuous_enable_disable(v= oid) "Port (%d) promiscuous mode not enabled", test_params->bonded_port_id); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 0; i < test_params->bonded_child_count; i++) { promiscuous_en =3D 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]); } =20 ret =3D rte_eth_promiscuous_disable(test_params->bonded_port_id); @@ -1872,76 +1872,76 @@ test_roundrobin_verify_promiscuous_enable_disable(v= oid) "Port (%d) promiscuous mode not disabled\n", test_params->bonded_port_id); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 0; i < test_params->bonded_child_count; i++) { promiscuous_en =3D 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]); } =20 - /* 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(); } =20 -#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) =20 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] =3D { NULL }; - struct rte_mbuf *gen_pkt_burst[TEST_RR_LINK_STATUS_SLAVE_COUNT][MAX_PKT_B= URST]; + struct rte_mbuf *gen_pkt_burst[TEST_RR_LINK_STATUS_CHILD_COUNT][MAX_PKT_B= URST]; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] =3D { NULL }; =20 struct rte_eth_stats port_stats; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; =20 - int i, burst_size, slave_count; + int i, burst_size, child_count; =20 /* NULL all pointers in array to simplify cleanup */ memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst)); =20 - /* 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"); =20 - /* Verify Current Slaves Count /Active Slave Count is */ - slave_count =3D rte_eth_bond_slaves_get(test_params->bonded_port_id, slav= es, + /* Verify Current Childs Count /Active Child Count is */ + child_count =3D rte_eth_bond_children_get(test_params->bonded_port_id, ch= ildren, 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); =20 - slave_count =3D rte_eth_bond_active_slaves_get(test_params->bonded_port_i= d, - 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 =3D 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); =20 - /* 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); =20 - slave_count =3D rte_eth_bond_active_slaves_get(test_params->bonded_port_i= d, - 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 =3D 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); =20 burst_size =3D 20; =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 =3D burst_size) - * 4. Verify stats for slave eth_devs (s0 =3D 10, s1 =3D 0, s2 =3D 10, s3= =3D 0) + * 4. Verify stats for child eth_devs (s0 =3D 10, s1 =3D 0, s2 =3D 10, s3= =3D 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_beh= aviour(void) test_params->bonded_port_id, (int)port_stats.opackets, burst_size); =20 - 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); =20 - 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); =20 - 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); =20 - 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); =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 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 =3D 10, s1 =3D 0, s2 =3D 10, s3= =3D 0) + * 6. Verify stats for child eth_devs (s0 =3D 10, s1 =3D 0, s2 =3D 10, s3= =3D 0) */ - for (i =3D 0; i < TEST_RR_LINK_STATUS_SLAVE_COUNT; i++) { + for (i =3D 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"); =20 - 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); } =20 @@ -2014,49 +2014,49 @@ test_roundrobin_verify_slave_link_status_change_beh= aviour(void) rte_pktmbuf_free(rx_pkt_burst[i]); } =20 - /* 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(); } =20 -#define TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT (2) +#define TEST_RR_POLLING_LINK_STATUS_CHILD_COUNT (2) =20 -uint8_t polling_slave_mac[] =3D {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00 }; +uint8_t polling_child_mac[] =3D {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x00 }; =20 =20 -int polling_test_slaves[TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT] =3D { -1,= -1 }; +int polling_test_children[TEST_RR_POLLING_LINK_STATUS_CHILD_COUNT] =3D { -= 1, -1 }; =20 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 =3D - (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]; =20 int i; =20 - for (i =3D 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 =3D 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] =3D i; =20 - /* Create slave devices with no ISR Support */ - if (polling_test_slaves[i] =3D=3D -1) { - polling_test_slaves[i] =3D virtual_ethdev_create(slave_name, mac_addr, + /* Create child devices with no ISR Support */ + if (polling_test_children[i] =3D=3D -1) { + polling_test_children[i] =3D virtual_ethdev_create(child_name, mac_addr, rte_socket_id(), 0); - TEST_ASSERT(polling_test_slaves[i] >=3D 0, - "Failed to create virtual virtual ethdev %s\n", slave_name); + TEST_ASSERT(polling_test_children[i] >=3D 0, + "Failed to create virtual virtual ethdev %s\n", child_name); =20 - /* 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]); } =20 - /* 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); } =20 @@ -2071,26 +2071,26 @@ test_roundrobin_verfiy_polling_slave_link_status_ch= ange(void) RTE_ETH_EVENT_INTR_LSC, test_bonding_lsc_event_callback, &test_params->bonded_port_id); =20 - /* link status change callback for first slave link up */ + /* link status change callback for first child link up */ test_lsc_interrupt_count =3D 0; =20 - virtual_ethdev_set_link_status(polling_test_slaves[0], 1); + virtual_ethdev_set_link_status(polling_test_children[0], 1); =20 TEST_ASSERT_SUCCESS(lsc_timeout(15000), "timed out waiting for interrupt"= ); =20 =20 - /* no link status change callback for second slave link up */ + /* no link status change callback for second child link up */ test_lsc_interrupt_count =3D 0; =20 - virtual_ethdev_set_link_status(polling_test_slaves[1], 1); + virtual_ethdev_set_link_status(polling_test_children[1], 1); =20 TEST_ASSERT_FAIL(lsc_timeout(15000), "unexpectedly succeeded"); =20 - /* link status change callback for both slave links down */ + /* link status change callback for both child links down */ test_lsc_interrupt_count =3D 0; =20 - 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); =20 TEST_ASSERT_SUCCESS(lsc_timeout(20000), "timed out waiting for interrupt"= ); =20 @@ -2100,17 +2100,17 @@ test_roundrobin_verfiy_polling_slave_link_status_ch= ange(void) &test_params->bonded_port_id); =20 =20 - /* Clean up and remove slaves from bonded device */ - for (i =3D 0; i < TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT; i++) { + /* Clean up and remove children from bonded device */ + for (i =3D 0; i < TEST_RR_POLLING_LINK_STATUS_CHILD_COUNT; i++) { =20 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); } =20 - return remove_slaves_and_stop_bonded_device(); + return remove_children_and_stop_bonded_device(); } =20 =20 @@ -2123,9 +2123,9 @@ test_activebackup_tx_burst(void) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_eth_stats port_stats; =20 - 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"); =20 initialize_eth_header(test_params->pkt_eth_hdr, (struct rte_ether_addr *)src_mac, @@ -2136,7 +2136,7 @@ test_activebackup_tx_burst(void) pktlen =3D initialize_ipv4_header(test_params->pkt_ipv4_hdr, src_addr, dst_addr_0, pktlen); =20 - burst_size =3D 20 * test_params->bonded_slave_count; + burst_size =3D 20 * test_params->bonded_child_count; =20 TEST_ASSERT(burst_size < MAX_PKT_BURST, "Burst size specified is greater than supported."); @@ -2160,38 +2160,38 @@ test_activebackup_tx_burst(void) =20 primary_port =3D rte_eth_bond_primary_get(test_params->bonded_port_id); =20 - /* Verify slave ports tx stats */ - for (i =3D 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] =3D=3D primary_port) { + /* Verify child ports tx stats */ + for (i =3D 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] =3D=3D 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); } } =20 - /* Put all slaves down and try and transmit */ - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i =3D 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); } =20 /* 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"); =20 - /* 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(); } =20 -#define TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT (4) +#define TEST_ACTIVE_BACKUP_RX_BURST_CHILD_COUNT (4) =20 static int test_activebackup_rx_burst(void) @@ -2205,24 +2205,24 @@ test_activebackup_rx_burst(void) =20 int i, j, burst_size =3D 17; =20 - 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"); =20 primary_port =3D rte_eth_bond_primary_get(test_params->bonded_port_id); TEST_ASSERT(primary_port >=3D 0, - "failed to get primary slave for bonded port (%d)", + "failed to get primary child for bonded port (%d)", test_params->bonded_port_id); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 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"); =20 - /* 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); =20 /* 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"); =20 - if (test_params->slave_port_ids[i] =3D=3D primary_port) { + if (test_params->child_port_ids[i] =3D=3D 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); =20 - /* Verify bonded slave devices rx count */ - for (j =3D 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 =3D 0; j < test_params->bonded_child_count; j++) { + rte_eth_stats_get(test_params->child_port_ids[j], &port_stats); if (i =3D=3D 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 =3D 0; j < test_params->bonded_slave_count; j++) { - rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats); + for (j =3D 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); } =20 - /* 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(); } =20 static int @@ -2285,14 +2285,14 @@ test_activebackup_verify_promiscuous_enable_disable= (void) int i, primary_port, promiscuous_en; int ret; =20 - /* 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"); =20 primary_port =3D rte_eth_bond_primary_get(test_params->bonded_port_id); TEST_ASSERT(primary_port >=3D 0, - "failed to get primary slave for bonded port (%d)", + "failed to get primary child for bonded port (%d)", test_params->bonded_port_id); =20 ret =3D 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); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 0; i < test_params->bonded_child_count; i++) { promiscuous_en =3D rte_eth_promiscuous_get( - test_params->slave_port_ids[i]); - if (primary_port =3D=3D test_params->slave_port_ids[i]) { + test_params->child_port_ids[i]); + if (primary_port =3D=3D 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]); } =20 } @@ -2328,16 +2328,16 @@ test_activebackup_verify_promiscuous_enable_disable= (void) "Port (%d) promiscuous mode not disabled\n", test_params->bonded_port_id); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 0; i < test_params->bonded_child_count; i++) { promiscuous_en =3D 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]); } =20 - /* 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(); } =20 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; =20 - 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]); =20 - /* 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"); =20 - /* 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, &rea= d_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); =20 - 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]); =20 - 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]); =20 /* 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]); =20 TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &rea= d_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); =20 - 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]); =20 - 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]); =20 /* stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and slaves */ + * propagated to bonded device and children */ =20 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); =20 - 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]); =20 - 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]); =20 /* 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); =20 - 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]); =20 - 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]); =20 - /* 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(); } =20 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_P= KT_BURST]; + struct rte_mbuf *pkt_burst[TEST_ACTIVE_BACKUP_RX_BURST_CHILD_COUNT][MAX_P= KT_BURST]; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] =3D { NULL }; struct rte_eth_stats port_stats; =20 - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; =20 - int i, burst_size, slave_count, primary_port; + int i, burst_size, child_count, primary_port; =20 burst_size =3D 21; =20 @@ -2502,96 +2502,96 @@ test_activebackup_verify_slave_link_status_change_f= ailover(void) &pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0), burst_size, "generate_test_burst failed"); =20 - /* 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"); =20 - /* Verify Current Slaves Count /Active Slave Count is */ - slave_count =3D rte_eth_bond_slaves_get(test_params->bonded_port_id, slav= es, + /* Verify Current Childs Count /Active Child Count is */ + child_count =3D rte_eth_bond_children_get(test_params->bonded_port_id, ch= ildren, 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); =20 - slave_count =3D rte_eth_bond_active_slaves_get(test_params->bonded_port_i= d, - 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 =3D 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); =20 primary_port =3D 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"); =20 - /* 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); =20 - 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); =20 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); =20 =20 - /* Bring primary port down, verify that active slave count is 3 and prima= ry + /* Bring primary port down, verify that active child count is 3 and prima= ry * has changed */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[0], 0); + test_params->child_port_ids[0], 0); =20 - 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); =20 primary_port =3D 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"); =20 - /* Verify that pkts are sent on new primary slave */ + /* Verify that pkts are sent on new primary child */ =20 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"); =20 - 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]); =20 - 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]); =20 - 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]); =20 - 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]); =20 /* Generate packet burst for testing */ =20 - for (i =3D 0; i < TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT; i++) { + for (i =3D 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"); =20 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); } =20 TEST_ASSERT_EQUAL(rte_eth_rx_burst( @@ -2604,28 +2604,28 @@ test_activebackup_verify_slave_link_status_change_f= ailover(void) "(%d) port_stats.ipackets not as expected", test_params->bonded_port_id); =20 - 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]); =20 - 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]); =20 - 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]); =20 - 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]); =20 - /* 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(); } =20 /** Balance Mode Tests */ @@ -2633,9 +2633,9 @@ test_activebackup_verify_slave_link_status_change_fai= lover(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."); =20 /* Invalid port id */ TEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_set( @@ -2644,7 +2644,7 @@ test_balance_xmit_policy_configuration(void) =20 /* 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."); =20 =20 @@ -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."); =20 - /* 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(); } =20 -#define TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT (2) +#define TEST_BALANCE_L2_TX_BURST_CHILD_COUNT (2) =20 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] =3D { 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] =3D { 10, 15 }; =20 uint16_t pktlen; int i; struct rte_eth_stats port_stats; =20 - 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."); =20 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"); =20 /* Send burst 1 on bonded port */ - for (i =3D 0; i < TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT; i++) { + for (i =3D 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]); =20 =20 - /* 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]); =20 - 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]); =20 - /* Put all slaves down and try and transmit */ - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i =3D 0; i < test_params->bonded_child_count; i++) { =20 virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 0); + test_params->child_port_ids[i], 0); } =20 /* 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"); =20 - /* 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(); } =20 static int @@ -2785,9 +2785,9 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ip= v4, =20 struct rte_eth_stats port_stats; =20 - 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."); =20 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); =20 - /* 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); =20 - 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); =20 - /* Put all slaves down and try and transmit */ - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i =3D 0; i < test_params->bonded_child_count; i++) { =20 virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 0); + test_params->child_port_ids[i], 0); } =20 /* Send burst on bonded port */ @@ -2851,8 +2851,8 @@ balance_l23_tx_burst(uint8_t vlan_enabled, uint8_t ip= v4, burst_size_1), 0, "Expected zero packet"); =20 =20 - /* 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(); } =20 static int @@ -2897,9 +2897,9 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ip= v4, =20 struct rte_eth_stats port_stats; =20 - 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."); =20 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); =20 - /* 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); =20 - 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); =20 - /* Put all slaves down and try and transmit */ - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i =3D 0; i < test_params->bonded_child_count; i++) { =20 virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 0); + test_params->child_port_ids[i], 0); } =20 /* Send burst on bonded port */ @@ -2963,8 +2963,8 @@ balance_l34_tx_burst(uint8_t vlan_enabled, uint8_t ip= v4, test_params->bonded_port_id, 0, pkts_burst_1, burst_size_1), 0, "Expected zero packet"); =20 - /* 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(); } =20 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); } =20 -#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) =20 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]; =20 - 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]; =20 struct rte_eth_stats port_stats; =20 int i, first_tx_fail_idx, tx_count_1, tx_count_2; =20 - 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"); =20 TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( @@ -3033,46 +3033,46 @@ test_balance_tx_burst_slave_tx_fail(void) =20 /* 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"); =20 - first_tx_fail_idx =3D TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1 - - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT; + first_tx_fail_idx =3D TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1 - + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT; =20 /* copy mbuf references for expected transmission failures */ - for (i =3D 0; i < TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT; i++) + for (i =3D 0; i < TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT; i++) expected_fail_pkts[i] =3D pkts_burst_1[i + first_tx_fail_idx]; =20 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"); =20 =20 - /* 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); =20 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); =20 =20 /* Transmit burst 1 */ tx_count_1 =3D rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burs= t_1, - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_1); + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_1); =20 - 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); =20 /* Verify that failed packet are expected failed packets */ - for (i =3D 0; i < TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT; i++) { + for (i =3D 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) =20 /* Transmit burst 2 */ tx_count_2 =3D rte_eth_tx_burst(test_params->bonded_port_id, 0, pkts_burs= t_2, - TEST_BAL_SLAVE_TX_FAIL_BURST_SIZE_2); + TEST_BAL_CHILD_TX_FAIL_BURST_SIZE_2); =20 - 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); =20 =20 /* Verify bonded port tx stats */ rte_eth_stats_get(test_params->bonded_port_id, &port_stats); =20 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); =20 - /* Verify slave ports tx stats */ + /* Verify child ports tx stats */ =20 - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); =20 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); =20 =20 =20 =20 - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); =20 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); =20 /* 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"); =20 free_mbufs(&pkts_burst_1[tx_count_1], - TEST_BAL_SLAVE_TX_FAIL_PACKETS_COUNT); + TEST_BAL_CHILD_TX_FAIL_PACKETS_COUNT); =20 - /* 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(); } =20 -#define TEST_BALANCE_RX_BURST_SLAVE_COUNT (3) +#define TEST_BALANCE_RX_BURST_CHILD_COUNT (3) =20 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]; =20 struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] =3D { NULL }; struct rte_eth_stats port_stats; =20 - int burst_size[TEST_BALANCE_RX_BURST_SLAVE_COUNT] =3D { 10, 5, 30 }; + int burst_size[TEST_BALANCE_RX_BURST_CHILD_COUNT] =3D { 10, 5, 30 }; int i, j; =20 memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst)); =20 - /* 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"); =20 /* Generate test bursts of packets to transmit */ - for (i =3D 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) { + for (i =3D 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"); } =20 - /* Add rx data to slaves */ - for (i =3D 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 =3D 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]); } =20 @@ -3187,33 +3187,33 @@ test_balance_rx_burst(void) burst_size[0] + burst_size[1] + burst_size[2]); =20 =20 - /* 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]); =20 - 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]); =20 - 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]); =20 - 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); =20 /* free mbufs */ - for (i =3D 0; i < TEST_BALANCE_RX_BURST_SLAVE_COUNT; i++) { + for (i =3D 0; i < TEST_BALANCE_RX_BURST_CHILD_COUNT; i++) { for (j =3D 0; j < MAX_PKT_BURST; j++) { if (gen_pkt_burst[i][j] !=3D NULL) { rte_pktmbuf_free(gen_pkt_burst[i][j]); @@ -3222,8 +3222,8 @@ test_balance_rx_burst(void) } } =20 - /* 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(); } =20 static int @@ -3232,8 +3232,8 @@ test_balance_verify_promiscuous_enable_disable(void) int i; int ret; =20 - /* 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"); =20 @@ -3246,11 +3246,11 @@ test_balance_verify_promiscuous_enable_disable(void) "Port (%d) promiscuous mode not enabled", test_params->bonded_port_id); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 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]); } =20 ret =3D 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); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 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]); } =20 - /* 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(); } =20 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; =20 - 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]); =20 - /* 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"); =20 - /* 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, &rea= d_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); =20 - 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]); =20 - 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]); =20 /* 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]); =20 TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &rea= d_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); =20 - 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]); =20 - 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]); =20 /* stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and slaves */ + * propagated to bonded device and children */ =20 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); =20 - 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]); =20 - 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]); =20 /* 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); =20 - 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]); =20 - 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]); =20 - /* 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(); } =20 -#define TEST_BALANCE_LINK_STATUS_SLAVE_COUNT (4) +#define TEST_BALANCE_LINK_STATUS_CHILD_COUNT (4) =20 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] =3D { NULL }; struct rte_eth_stats port_stats; =20 - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; =20 - int i, burst_size, slave_count; + int i, burst_size, child_count; =20 memset(pkt_burst, 0, sizeof(pkt_burst)); =20 - /* 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"); =20 TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( @@ -3440,32 +3440,32 @@ test_balance_verify_slave_link_status_change_behavi= our(void) "Failed to set balance xmit policy."); =20 =20 - /* Verify Current Slaves Count /Active Slave Count is */ - slave_count =3D rte_eth_bond_slaves_get(test_params->bonded_port_id, slav= es, + /* Verify Current Childs Count /Active Child Count is */ + child_count =3D rte_eth_bond_children_get(test_params->bonded_port_id, ch= ildren, 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); =20 - slave_count =3D rte_eth_bond_active_slaves_get(test_params->bonded_port_i= d, - 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 =3D 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); =20 - /* 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); =20 - 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); =20 /* Send to sets of packet burst and verify that they are balanced across - * slaves */ + * children */ burst_size =3D 21; =20 TEST_ASSERT_EQUAL(generate_test_burst( @@ -3491,27 +3491,27 @@ test_balance_verify_slave_link_status_change_behavi= our(void) test_params->bonded_port_id, (int)port_stats.opackets, burst_size + burst_size); =20 - 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); =20 - 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); =20 - /* 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 childr= en * are available */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[2], 0); + test_params->child_port_ids[2], 0); =20 - 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); =20 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_behavi= our(void) test_params->bonded_port_id, (int)port_stats.opackets, burst_size + burst_size + burst_size); =20 - 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); =20 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); =20 - for (i =3D 0; i < TEST_BALANCE_LINK_STATUS_SLAVE_COUNT; i++) { + for (i =3D 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"); =20 - 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); } =20 - /* Verify that pkts are not received on slaves with link status down */ + /* Verify that pkts are not received on children with link status down */ =20 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_behaviou= r(void) test_params->bonded_port_id, (int)port_stats.ipackets, burst_size * 3); =20 - /* 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(); } =20 static int @@ -3576,7 +3576,7 @@ test_broadcast_tx_burst(void) =20 struct rte_eth_stats port_stats; =20 - 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"); =20 @@ -3590,7 +3590,7 @@ test_broadcast_tx_burst(void) pktlen =3D initialize_ipv4_header(test_params->pkt_ipv4_hdr, src_addr, dst_addr_0, pktlen); =20 - burst_size =3D 20 * test_params->bonded_slave_count; + burst_size =3D 20 * test_params->bonded_child_count; =20 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); =20 - /* Verify slave ports tx stats */ - for (i =3D 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 =3D 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); } =20 - /* Put all slaves down and try and transmit */ - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i =3D 0; i < test_params->bonded_child_count; i++) { =20 virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[i], 0); + test_params->child_port_ids[i], 0); } =20 /* 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"); =20 - /* 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(); } =20 =20 -#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) =20 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]; =20 struct rte_eth_stats port_stats; =20 int i, tx_count; =20 - 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"); =20 /* 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"); =20 - for (i =3D 0; i < TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT; i++) { - expected_fail_pkts[i] =3D pkts_burst[TEST_BCAST_SLAVE_TX_FAIL_BURST_SIZE= - - TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT + i]; + for (i =3D 0; i < TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT; i++) { + expected_fail_pkts[i] =3D pkts_burst[TEST_BCAST_CHILD_TX_FAIL_BURST_SIZE= - + TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT + i]; } =20 - /* 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); =20 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); =20 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); =20 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); =20 /* Transmit burst */ tx_count =3D 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); =20 - 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); =20 /* Verify that failed packet are expected failed packets */ - for (i =3D 0; i < TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT; i++) { + for (i =3D 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]); } =20 - /* Verify slave ports tx stats */ + /* Verify child ports tx stats */ =20 - rte_eth_stats_get(test_params->slave_port_ids[0], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[0], &port_stats); =20 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); =20 =20 - rte_eth_stats_get(test_params->slave_port_ids[1], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[1], &port_stats); =20 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); =20 - rte_eth_stats_get(test_params->slave_port_ids[2], &port_stats); + rte_eth_stats_get(test_params->child_port_ids[2], &port_stats); =20 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); =20 =20 /* 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"); =20 free_mbufs(&pkts_burst[tx_count], - TEST_BCAST_SLAVE_TX_FAIL_MIN_PACKETS_COUNT); + TEST_BCAST_CHILD_TX_FAIL_MIN_PACKETS_COUNT); =20 - /* 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(); } =20 -#define BROADCAST_RX_BURST_NUM_OF_SLAVES (3) +#define BROADCAST_RX_BURST_NUM_OF_CHILDS (3) =20 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]; =20 struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] =3D { NULL }; struct rte_eth_stats port_stats; =20 - int burst_size[BROADCAST_RX_BURST_NUM_OF_SLAVES] =3D { 10, 5, 30 }; + int burst_size[BROADCAST_RX_BURST_NUM_OF_CHILDS] =3D { 10, 5, 30 }; int i, j; =20 memset(gen_pkt_burst, 0, sizeof(gen_pkt_burst)); =20 - /* 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"); =20 /* Generate test bursts of packets to transmit */ - for (i =3D 0; i < BROADCAST_RX_BURST_NUM_OF_SLAVES; i++) { + for (i =3D 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"); } =20 - /* Add rx data to slave 0 */ - for (i =3D 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 =3D 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]); } =20 @@ -3810,33 +3810,33 @@ test_broadcast_rx_burst(void) burst_size[0] + burst_size[1] + burst_size[2]); =20 =20 - /* 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]); =20 - 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]); =20 - 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]); =20 - 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); =20 /* free mbufs allocate for rx testing */ - for (i =3D 0; i < BROADCAST_RX_BURST_NUM_OF_SLAVES; i++) { + for (i =3D 0; i < BROADCAST_RX_BURST_NUM_OF_CHILDS; i++) { for (j =3D 0; j < MAX_PKT_BURST; j++) { if (gen_pkt_burst[i][j] !=3D NULL) { rte_pktmbuf_free(gen_pkt_burst[i][j]); @@ -3845,8 +3845,8 @@ test_broadcast_rx_burst(void) } } =20 - /* 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(); } =20 static int @@ -3855,8 +3855,8 @@ test_broadcast_verify_promiscuous_enable_disable(void) int i; int ret; =20 - /* 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"); =20 @@ -3870,11 +3870,11 @@ test_broadcast_verify_promiscuous_enable_disable(vo= id) "Port (%d) promiscuous mode not enabled", test_params->bonded_port_id); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 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]); } =20 ret =3D rte_eth_promiscuous_disable(test_params->bonded_port_id); @@ -3886,15 +3886,15 @@ test_broadcast_verify_promiscuous_enable_disable(vo= id) "Port (%d) promiscuous mode not disabled", test_params->bonded_port_id); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 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]); } =20 - /* 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(); } =20 static int @@ -3905,49 +3905,49 @@ test_broadcast_verify_mac_assignment(void) =20 int i; =20 - 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]); =20 - /* 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"); =20 - /* 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 =3D 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 =3D 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]); } =20 /* 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]); =20 - for (i =3D 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 =3D 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]); } =20 /* stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and slaves */ + * propagated to bonded device and children */ =20 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]); =20 - for (i =3D 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 =3D 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]); } =20 /* 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]); =20 =20 - for (i =3D 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 =3D 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]); } =20 - /* 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(); } =20 -#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_B= URST]; + struct rte_mbuf *pkt_burst[BROADCAST_LINK_STATUS_NUM_OF_CHILDS][MAX_PKT_B= URST]; struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST] =3D { NULL }; struct rte_eth_stats port_stats; =20 - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; =20 - int i, burst_size, slave_count; + int i, burst_size, child_count; =20 memset(pkt_burst, 0, sizeof(pkt_burst)); =20 - /* 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"); =20 - /* Verify Current Slaves Count /Active Slave Count is */ - slave_count =3D rte_eth_bond_slaves_get(test_params->bonded_port_id, slav= es, + /* Verify Current Childs Count /Active Child Count is */ + child_count =3D rte_eth_bond_children_get(test_params->bonded_port_id, ch= ildren, 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); =20 - slave_count =3D rte_eth_bond_active_slaves_get(test_params->bonded_port_i= d, - 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 =3D 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); =20 - /* 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); =20 - slave_count =3D rte_eth_bond_active_slaves_get(test_params->bonded_port_i= d, - 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 =3D 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); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) - rte_eth_stats_reset(test_params->slave_port_ids[i]); + for (i =3D 0; i < test_params->bonded_child_count; i++) + rte_eth_stats_reset(test_params->child_port_ids[i]); =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 */ burst_size =3D 21; =20 TEST_ASSERT_EQUAL(generate_test_burst( @@ -4062,43 +4062,43 @@ test_broadcast_verify_slave_link_status_change_beha= viour(void) "rte_eth_tx_burst failed\n"); =20 rte_eth_stats_get(test_params->bonded_port_id, &port_stats); - TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size * slave_coun= t), + TEST_ASSERT_EQUAL(port_stats.opackets, (uint64_t)(burst_size * child_coun= t), "(%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); =20 - 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]); =20 - 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]); =20 - 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]); =20 =20 - 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]); =20 =20 - for (i =3D 0; i < BROADCAST_LINK_STATUS_NUM_OF_SLAVES; i++) { + for (i =3D 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"); =20 - 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); } =20 - /* 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_behavi= our(void) "(%d) port_stats.ipackets not as expected\n", test_params->bonded_port_id); =20 - /* 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(); } =20 static int @@ -4146,21 +4146,21 @@ testsuite_teardown(void) free(test_params->pkt_eth_hdr); test_params->pkt_eth_hdr =3D NULL; =20 - /* 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(); } =20 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]; =20 /* Free tx queue of virtual pmd */ - for (slave_port =3D 0; slave_port < test_params->bonded_slave_count; - slave_port++) { + for (child_port =3D 0; child_port < test_params->bonded_child_count; + child_port++) { to_free_cnt =3D 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 =3D 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 =3D 0, all_bond_opackets =3D 0, all_bond_obyt= es =3D 0; uint16_t pktlen; =20 - 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"); =20 - burst_size =3D 20 * test_params->bonded_slave_count; + burst_size =3D 20 * test_params->bonded_child_count; =20 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); =20 =20 - /* Verify slave ports tx stats */ - for (i =3D 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 =3D 0; i < test_params->bonded_child_count; i++) { + rte_eth_stats_get(test_params->child_port_ids[i], &port_stats[i]); sum_ports_opackets +=3D port_stats[i].opackets; } =20 TEST_ASSERT_EQUAL(sum_ports_opackets, (uint64_t)all_bond_opackets, - "Total packets sent by slaves is not equal to packets sent by bond inte= rface"); + "Total packets sent by children is not equal to packets sent by bond in= terface"); =20 - /* checking if distribution of packets is balanced over slaves */ - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + /* checking if distribution of packets is balanced over children */ + for (i =3D 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"); } =20 - /* Put all slaves down and try and transmit */ - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + /* Put all children down and try and transmit */ + for (i =3D 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); } =20 /* 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"); =20 - /* 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(); } =20 -#define TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_COUNT (4) +#define TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_CHILD_COUNT (4) =20 static int test_tlb_rx_burst(void) @@ -4279,26 +4279,26 @@ test_tlb_rx_burst(void) =20 uint16_t i, j, nb_rx, burst_size =3D 17; =20 - /* 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 mo= de */ + 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"); =20 =20 primary_port =3D rte_eth_bond_primary_get(test_params->bonded_port_id); TEST_ASSERT(primary_port >=3D 0, - "failed to get primary slave for bonded port (%d)", + "failed to get primary child for bonded port (%d)", test_params->bonded_port_id); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 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"); =20 - /* 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); =20 /* Call rx burst on bonded device */ @@ -4307,7 +4307,7 @@ test_tlb_rx_burst(void) =20 TEST_ASSERT_EQUAL(nb_rx, burst_size, "rte_eth_rx_burst failed\n"); =20 - if (test_params->slave_port_ids[i] =3D=3D primary_port) { + if (test_params->child_port_ids[i] =3D=3D 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); =20 - /* Verify bonded slave devices rx count */ - for (j =3D 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 =3D 0; j < test_params->bonded_child_count; j++) { + rte_eth_stats_get(test_params->child_port_ids[j], &port_stats); if (i =3D=3D 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 =3D 0; j < test_params->bonded_slave_count; j++) { - rte_eth_stats_get(test_params->slave_port_ids[j], &port_stats); + for (j =3D 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); } =20 - /* 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(); } =20 static int @@ -4358,14 +4358,14 @@ test_tlb_verify_promiscuous_enable_disable(void) int i, primary_port, promiscuous_en; int ret; =20 - /* 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 mo= de */ + TEST_ASSERT_SUCCESS( initialize_bonded_device_with_children( BONDING_MODE_TLB, 0, 4, 1), "Failed to initialize bonded device"); =20 primary_port =3D rte_eth_bond_primary_get(test_params->bonded_port_id); TEST_ASSERT(primary_port >=3D 0, - "failed to get primary slave for bonded port (%d)", + "failed to get primary child for bonded port (%d)", test_params->bonded_port_id); =20 ret =3D 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 =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 0; i < test_params->bonded_child_count; i++) { promiscuous_en =3D rte_eth_promiscuous_get( - test_params->slave_port_ids[i]); - if (primary_port =3D=3D test_params->slave_port_ids[i]) { + test_params->child_port_ids[i]); + if (primary_port =3D=3D 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); =20 - for (i =3D 0; i < test_params->bonded_slave_count; i++) { + for (i =3D 0; i < test_params->bonded_child_count; i++) { promiscuous_en =3D 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]); } =20 - /* 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(); } =20 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; =20 - 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]); =20 - /* 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"); =20 - /* 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, &rea= d_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); =20 - 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]); =20 - 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]); =20 /* 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]); =20 TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &rea= d_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); =20 - 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]); =20 - 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]); =20 /* stop / start bonded device and verify that primary MAC address is - * propagated to bonded device and slaves */ + * propagated to bonded device and children */ =20 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); =20 - 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]); =20 - 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]); =20 =20 /* 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); =20 - 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]); =20 - 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]); =20 - /* 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(); } =20 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] =3D { NULL }; struct rte_eth_stats port_stats; =20 - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; =20 - int i, burst_size, slave_count, primary_port; + int i, burst_size, child_count, primary_port; =20 burst_size =3D 21; =20 @@ -4574,61 +4574,61 @@ test_tlb_verify_slave_link_status_change_failover(v= oid) =20 =20 =20 - /* 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"); =20 - /* Verify Current Slaves Count /Active Slave Count is */ - slave_count =3D rte_eth_bond_slaves_get(test_params->bonded_port_id, slav= es, + /* Verify Current Childs Count /Active Child Count is */ + child_count =3D rte_eth_bond_children_get(test_params->bonded_port_id, ch= ildren, 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); =20 - slave_count =3D rte_eth_bond_active_slaves_get(test_params->bonded_port_i= d, - 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 =3D 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); =20 primary_port =3D 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"); =20 - /* 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); =20 - 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); =20 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); =20 =20 - /* Bring primary port down, verify that active slave count is 3 and prima= ry + /* Bring primary port down, verify that active child count is 3 and prima= ry * has changed */ virtual_ethdev_simulate_link_status_interrupt( - test_params->slave_port_ids[0], 0); + test_params->child_port_ids[0], 0); =20 - 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); =20 primary_port =3D 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 =3D 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(v= oid) rte_delay_us(11000); } =20 - 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]); =20 - 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]); =20 - 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]); =20 - 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]); =20 =20 /* Generate packet burst for testing */ =20 - for (i =3D 0; i < TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_SLAVE_CO= UNT; i++) { + for (i =3D 0; i < TEST_ADAPTIVE_TRANSMIT_LOAD_BALANCING_RX_BURST_CHILD_CO= UNT; i++) { if (generate_test_burst(&pkt_burst[i][0], burst_size, 0, 1, 0, 0, 0) !=3D burst_size) return -1; =20 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); } =20 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(v= oid) "(%d) port_stats.ipackets not as expected\n", test_params->bonded_port_id); =20 - /* 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(); } =20 -#define TEST_ALB_SLAVE_COUNT 2 +#define TEST_ALB_CHILD_COUNT 2 =20 static uint8_t mac_client1[] =3D {0x00, 0xAA, 0x55, 0xFF, 0xCC, 1}; static uint8_t mac_client2[] =3D {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; =20 - int slave_idx, nb_pkts, pkt_idx; + int child_idx, nb_pkts, pkt_idx; int retval =3D 0; =20 struct rte_ether_addr bond_mac, client_mac; - struct rte_ether_addr *slave_mac1, *slave_mac2; + struct rte_ether_addr *child_mac1, *child_mac2; =20 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."); =20 /* Flush tx queue */ rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); - for (slave_idx =3D 0; slave_idx < test_params->bonded_slave_count; - slave_idx++) { + for (child_idx =3D 0; child_idx < test_params->bonded_child_count; + child_idx++) { nb_pkts =3D 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); } =20 @@ -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); =20 - slave_mac1 =3D - rte_eth_devices[test_params->slave_port_ids[0]].data->mac_addrs; - slave_mac2 =3D - rte_eth_devices[test_params->slave_port_ids[1]].data->mac_addrs; + child_mac1 =3D + rte_eth_devices[test_params->child_port_ids[0]].data->mac_addrs; + child_mac2 =3D + rte_eth_devices[test_params->child_port_ids[1]].data->mac_addrs; =20 /* * 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 =3D 0; slave_idx < test_params->bonded_slave_count; slave_= idx++) { + for (child_idx =3D 0; child_idx < test_params->bonded_child_count; child_= idx++) { nb_pkts =3D 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); =20 for (pkt_idx =3D 0; pkt_idx < nb_pkts; pkt_idx++) { @@ -4802,14 +4802,14 @@ test_alb_change_mac_in_reply_sent(void) arp_pkt =3D (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct rte_ether_hdr)); =20 - if (slave_idx%2 =3D=3D 0) { - if (!rte_is_same_ether_addr(slave_mac1, + if (child_idx%2 =3D=3D 0) { + if (!rte_is_same_ether_addr(child_mac1, &arp_pkt->arp_data.arp_sha)) { retval =3D -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 =3D -1; goto test_end; @@ -4819,7 +4819,7 @@ test_alb_change_mac_in_reply_sent(void) } =20 test_end: - retval +=3D remove_slaves_and_stop_bonded_device(); + retval +=3D remove_children_and_stop_bonded_device(); return retval; } =20 @@ -4832,22 +4832,22 @@ test_alb_reply_from_client(void) struct rte_mbuf *pkt; struct rte_mbuf *pkts_sent[MAX_PKT_BURST]; =20 - int slave_idx, nb_pkts, pkt_idx, nb_pkts_sum =3D 0; + int child_idx, nb_pkts, pkt_idx, nb_pkts_sum =3D 0; int retval =3D 0; =20 struct rte_ether_addr bond_mac, client_mac; - struct rte_ether_addr *slave_mac1, *slave_mac2; + struct rte_ether_addr *child_mac1, *child_mac2; =20 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."); =20 /* Flush tx queue */ rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); - for (slave_idx =3D 0; slave_idx < test_params->bonded_slave_count; slave_= idx++) { + for (child_idx =3D 0; child_idx < test_params->bonded_child_count; child_= idx++) { nb_pkts =3D 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); } =20 @@ -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_hos= t, 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); =20 pkt =3D 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_hos= t, 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); =20 pkt =3D 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_hos= t, 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); =20 pkt =3D 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_hos= t, 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); =20 /* @@ -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); =20 - slave_mac1 =3D rte_eth_devices[test_params->slave_port_ids[0]].data->mac_= addrs; - slave_mac2 =3D rte_eth_devices[test_params->slave_port_ids[1]].data->mac_= addrs; + child_mac1 =3D rte_eth_devices[test_params->child_port_ids[0]].data->mac_= addrs; + child_mac2 =3D rte_eth_devices[test_params->child_port_ids[1]].data->mac_= addrs; =20 /* - * 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 =3D 0; slave_idx < test_params->bonded_slave_count; slave_= idx++) { + for (child_idx =3D 0; child_idx < test_params->bonded_child_count; child_= idx++) { nb_pkts =3D 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 +=3D nb_pkts; =20 for (pkt_idx =3D 0; pkt_idx < nb_pkts; pkt_idx++) { @@ -4931,14 +4931,14 @@ test_alb_reply_from_client(void) arp_pkt =3D (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct rte_ether_hdr)); =20 - if (slave_idx%2 =3D=3D 0) { - if (!rte_is_same_ether_addr(slave_mac1, + if (child_idx%2 =3D=3D 0) { + if (!rte_is_same_ether_addr(child_mac1, &arp_pkt->arp_data.arp_sha)) { retval =3D -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 =3D -1; goto test_end; @@ -4954,7 +4954,7 @@ test_alb_reply_from_client(void) } =20 test_end: - retval +=3D remove_slaves_and_stop_bonded_device(); + retval +=3D remove_children_and_stop_bonded_device(); return retval; } =20 @@ -4968,21 +4968,21 @@ test_alb_receive_vlan_reply(void) struct rte_mbuf *pkt; struct rte_mbuf *pkts_sent[MAX_PKT_BURST]; =20 - int slave_idx, nb_pkts, pkt_idx; + int child_idx, nb_pkts, pkt_idx; int retval =3D 0; =20 struct rte_ether_addr bond_mac, client_mac; =20 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."); =20 /* Flush tx queue */ rte_eth_tx_burst(test_params->bonded_port_id, 0, NULL, 0); - for (slave_idx =3D 0; slave_idx < test_params->bonded_slave_count; slave_= idx++) { + for (child_idx =3D 0; child_idx < test_params->bonded_child_count; child_= idx++) { nb_pkts =3D 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); } =20 @@ -5007,7 +5007,7 @@ test_alb_receive_vlan_reply(void) arp_pkt =3D (struct rte_arp_hdr *)((char *)(vlan_pkt + 1)); initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_hos= t, 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); =20 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 =3D 0; slave_idx < test_params->bonded_slave_count; slave_= idx++) { + for (child_idx =3D 0; child_idx < test_params->bonded_child_count; child_= idx++) { nb_pkts =3D 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); =20 for (pkt_idx =3D 0; pkt_idx < nb_pkts; pkt_idx++) { @@ -5049,7 +5049,7 @@ test_alb_receive_vlan_reply(void) } =20 test_end: - retval +=3D remove_slaves_and_stop_bonded_device(); + retval +=3D remove_children_and_stop_bonded_device(); return retval; } =20 @@ -5062,9 +5062,9 @@ test_alb_ipv4_tx(void) retval =3D 0; =20 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."); =20 burst_size =3D 32; =20 @@ -5085,7 +5085,7 @@ test_alb_ipv4_tx(void) } =20 test_end: - retval +=3D remove_slaves_and_stop_bonded_device(); + retval +=3D remove_children_and_stop_bonded_device(); return retval; } =20 @@ -5096,34 +5096,34 @@ static struct unit_test_suite link_bonding_test_sui= te =3D { .unit_test_cases =3D { 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_sui= te =3D { 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), =20 diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bondin= g_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 @@ =20 #include "test.h" =20 -#define SLAVE_COUNT (4) +#define CHILD_COUNT (4) =20 #define RX_RING_SIZE 1024 #define TX_RING_SIZE 1024 @@ -46,15 +46,15 @@ =20 #define BONDED_DEV_NAME ("net_bonding_m4_bond_dev") =20 -#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") =20 #define INVALID_SOCKET_ID (-1) #define INVALID_PORT_ID (0xFF) #define INVALID_BONDING_MODE (-1) =20 -static const struct rte_ether_addr slave_mac_default =3D { +static const struct rte_ether_addr child_mac_default =3D { { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } }; =20 @@ -70,7 +70,7 @@ static const struct rte_ether_addr slow_protocol_mac_addr= =3D { { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x02 } }; =20 -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 { =20 struct link_bonding_unittest_params { uint8_t bonded_port_id; - struct slave_conf slave_ports[SLAVE_COUNT]; + struct child_conf child_ports[CHILD_COUNT]; =20 struct rte_mempool *mbuf_pool; }; =20 -#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 =20 static struct link_bonding_unittest_params test_params =3D { .bonded_port_id =3D INVALID_PORT_ID, - .slave_ports =3D { [0 ... SLAVE_COUNT - 1] =3D { .port_id =3D INVALID_POR= T_ID} }, + .child_ports =3D { [0 ... CHILD_COUNT - 1] =3D { .port_id =3D INVALID_POR= T_ID} }, =20 .mbuf_pool =3D NULL, }; @@ -120,58 +120,58 @@ static uint8_t lacpdu_rx_count[RTE_MAX_ETHPORTS] =3D = {0, }; #define FOR_EACH(_i, _item, _array, _size) \ for (_i =3D 0, _item =3D &_array[0]; _i < _size && (_item =3D &_array[_i]= ); _i++) =20 -/* 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)) =20 -/* 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)) =20 -/* Macro for iterating over every port that is currently a slave of a bond= ed +/* Macro for iterating over every port that is currently a child of a bond= ed * 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 !=3D 0) +#define FOR_EACH_CHILD(_i, _child) \ + FOR_EACH_PORT_IF(_i, _child, (_child)->bonded !=3D 0) =20 /* - * 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 s= ize) +child_get_pkts(struct child_conf *child, struct rte_mbuf **buf, uint16_t s= ize) { - return rte_ring_dequeue_burst(slave->tx_queue, (void **)buf, + return rte_ring_dequeue_burst(child->tx_queue, (void **)buf, size, NULL); } =20 /* - * 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 s= ize) +child_put_pkts(struct child_conf *child, struct rte_mbuf **buf, uint16_t s= ize) { - return rte_ring_enqueue_burst(slave->rx_queue, (void **)buf, + return rte_ring_enqueue_burst(child->rx_queue, (void **)buf, size, NULL); } =20 @@ -219,79 +219,79 @@ configure_ethdev(uint16_t port_id, uint8_t start) } =20 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; =20 /* Some sanity check */ - RTE_VERIFY(test_params.slave_ports <=3D slave && - slave - test_params.slave_ports < (int)RTE_DIM(test_params.slave_ports)); - RTE_VERIFY(slave->bonded =3D=3D 0); - RTE_VERIFY(slave->port_id !=3D INVALID_PORT_ID); + RTE_VERIFY(test_params.child_ports <=3D child && + child - test_params.child_ports < (int)RTE_DIM(test_params.child_ports)); + RTE_VERIFY(child->bonded =3D=3D 0); + RTE_VERIFY(child->port_id !=3D INVALID_PORT_ID); =20 - rte_ether_addr_copy(&slave_mac_default, &addr); - addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =3D slave->port_id; + rte_ether_addr_copy(&child_mac_default, &addr); + addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =3D child->port_id; =20 - rte_eth_dev_mac_addr_remove(slave->port_id, &addr); + rte_eth_dev_mac_addr_remove(child->port_id, &addr); =20 - 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"); =20 - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_add(test_params.bonded_port_id, - slave->port_id), - "Failed to add slave (idx=3D%u, id=3D%u) to bonding (id=3D%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=3D%u, id=3D%u) to bonding (id=3D%u)", + (uint8_t)(child - test_params.child_ports), child->port_id, test_params.bonded_port_id); =20 - slave->bonded =3D 1; + child->bonded =3D 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); } =20 - retval =3D rte_eth_macaddr_get(slave->port_id, &addr_check); - TEST_ASSERT_SUCCESS(retval, "Failed to get slave mac address: %s", + retval =3D 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"); =20 - RTE_VERIFY(slave->lacp_parnter_state =3D=3D 0); + RTE_VERIFY(child->lacp_parnter_state =3D=3D 0); return 0; } =20 static int -remove_slave(struct slave_conf *slave) +remove_child(struct child_conf *child) { - ptrdiff_t slave_idx =3D slave - test_params.slave_ports; + ptrdiff_t child_idx =3D child - test_params.child_ports; =20 - RTE_VERIFY(test_params.slave_ports <=3D slave && - slave_idx < (ptrdiff_t)RTE_DIM(test_params.slave_ports)); + RTE_VERIFY(test_params.child_ports <=3D child && + child_idx < (ptrdiff_t)RTE_DIM(test_params.child_ports)); =20 - RTE_VERIFY(slave->bonded =3D=3D 1); - RTE_VERIFY(slave->port_id !=3D INVALID_PORT_ID); + RTE_VERIFY(child->bonded =3D=3D 1); + RTE_VERIFY(child->port_id !=3D INVALID_PORT_ID); =20 - 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); =20 - 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); =20 - TEST_ASSERT_EQUAL(rte_eth_bond_slave_remove(test_params.bonded_port_id, - slave->port_id), 0, - "Failed to remove slave (idx=3D%u, id=3D%u) from bonding (id=3D%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=3D%u, id=3D%u) from bonding (id=3D%u)", + (uint8_t)child_idx, child->port_id, test_params.bonded_port_id); =20 - slave->bonded =3D 0; - slave->lacp_parnter_state =3D 0; + child->bonded =3D 0; + child->lacp_parnter_state =3D 0; return 0; } =20 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 =3D rte_pktmbuf_mtod(lacp_pkt, struct slow_protocol_frame *); RTE_VERIFY(slow_hdr->slow_protocol.subtype =3D=3D SLOW_SUBTYPE_LACP); =20 - lacpdu_rx_count[slave_id]++; + lacpdu_rx_count[child_id]++; rte_pktmbuf_free(lacp_pkt); } =20 static int -initialize_bonded_device_with_slaves(uint16_t slave_count, uint8_t externa= l_sm) +initialize_bonded_device_with_children(uint16_t child_count, uint8_t exter= nal_sm) { uint8_t i; int ret; =20 RTE_VERIFY(test_params.bonded_port_id !=3D INVALID_PORT_ID); =20 - for (i =3D 0; i < slave_count; i++) { - TEST_ASSERT_SUCCESS(add_slave(&test_params.slave_ports[i], 1), + for (i =3D 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); } =20 /* Reset mode 4 configuration */ @@ -345,34 +345,34 @@ initialize_bonded_device_with_slaves(uint16_t slave_c= ount, uint8_t external_sm) } =20 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; =20 TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params.bonded_port_id), "Failed to stop bonded port %u", test_params.bonded_port_id); =20 - FOR_EACH_SLAVE(i, slave) - remove_slave(slave); + FOR_EACH_CHILD(i, child) + remove_child(child); =20 - retval =3D rte_eth_bond_slaves_get(test_params.bonded_port_id, slaves, - RTE_DIM(slaves)); + retval =3D rte_eth_bond_children_get(test_params.bonded_port_id, children, + RTE_DIM(children)); =20 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); =20 - 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); =20 - TEST_ASSERT(slave->bonded =3D=3D 0, - "Port id=3D%u is still marked as enslaved.", slave->port_id); + TEST_ASSERT(child->bonded =3D=3D 0, + "Port id=3D%u is still marked as enchildd.", child->port_id); } =20 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 =3D rte_socket_id(); uint16_t i; =20 @@ -400,10 +400,10 @@ test_setup(void) =20 /* Create / initialize ring eth devs. */ FOR_EACH_PORT(i, port) { - port =3D &test_params.slave_ports[i]; + port =3D &test_params.child_ports[i]; =20 if (port->rx_queue =3D=3D NULL) { - retval =3D snprintf(name, RTE_DIM(name), SLAVE_RX_QUEUE_FMT, i); + retval =3D snprintf(name, RTE_DIM(name), CHILD_RX_QUEUE_FMT, i); TEST_ASSERT(retval <=3D (int)RTE_DIM(name) - 1, "Name too long"); port->rx_queue =3D rte_ring_create(name, RX_RING_SIZE, socket_id, 0); TEST_ASSERT(port->rx_queue !=3D NULL, @@ -412,7 +412,7 @@ test_setup(void) } =20 if (port->tx_queue =3D=3D NULL) { - retval =3D snprintf(name, RTE_DIM(name), SLAVE_TX_QUEUE_FMT, i); + retval =3D snprintf(name, RTE_DIM(name), CHILD_TX_QUEUE_FMT, i); TEST_ASSERT(retval <=3D (int)RTE_DIM(name) - 1, "Name too long"); port->tx_queue =3D rte_ring_create(name, TX_RING_SIZE, socket_id, 0); TEST_ASSERT_NOT_NULL(port->tx_queue, @@ -421,7 +421,7 @@ test_setup(void) } =20 if (port->port_id =3D=3D INVALID_PORT_ID) { - retval =3D snprintf(name, RTE_DIM(name), SLAVE_DEV_NAME_FMT, i); + retval =3D snprintf(name, RTE_DIM(name), CHILD_DEV_NAME_FMT, i); TEST_ASSERT(retval < (int)RTE_DIM(name) - 1, "Name too long"); retval =3D 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; =20 /* 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] =3D - slave->port_id; + child->port_id; =20 lacp =3D (struct lacpdu *) &slow_hdr->slow_protocol; /* Save last received state */ - slave->lacp_parnter_state =3D lacp->actor.state; + child->lacp_parnter_state =3D 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) } =20 /* - * 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 =3D 0, i; =20 - retval =3D slave_get_pkts(slave, rx_buf, RTE_DIM(rx_buf)); - TEST_ASSERT(retval >=3D 0, "Getting slave %u packets failed.", - slave->port_id); + retval =3D child_get_pkts(child, rx_buf, RTE_DIM(rx_buf)); + TEST_ASSERT(retval >=3D 0, "Getting child %u packets failed.", + child->port_id); =20 for (i =3D 0; i < (uint16_t)retval; i++) { - if (make_lacp_reply(slave, rx_buf[i]) =3D=3D 0) { + if (make_lacp_reply(child, rx_buf[i]) =3D=3D 0) { /* reply with actor's LACP */ lacp_tx_buf[lacp_tx_buf_cnt++] =3D rx_buf[i]; } else @@ -553,7 +553,7 @@ bond_handshake_reply(struct slave_conf *slave) if (lacp_tx_buf_cnt =3D=3D 0) return 0; =20 - retval =3D slave_put_pkts(slave, lacp_tx_buf, lacp_tx_buf_cnt); + retval =3D child_put_pkts(child, lacp_tx_buf, lacp_tx_buf_cnt); if (retval <=3D lacp_tx_buf_cnt) { /* retval might be negative */ for (i =3D RTE_MAX(0, retval); retval < lacp_tx_buf_cnt; retval++) @@ -561,24 +561,24 @@ bond_handshake_reply(struct slave_conf *slave) } =20 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); =20 return lacp_tx_buf_cnt; } =20 /* - * 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 =3D STATE_LACP_ACTIVE | STATE_SYNCHRONIZATIO= N | STATE_AGGREGATION | STATE_COLLECTING | STATE_DISTRIBUTING; =20 - return slave->lacp_parnter_state =3D=3D expected_state; + return child->lacp_parnter_state =3D=3D expected_state; } =20 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)] =3D { 0 }; + uint8_t all_children_done, i, j; + uint8_t status[RTE_DIM(test_params.child_ports)] =3D { 0 }; const unsigned delay =3D bond_get_update_timeout_ms(); =20 /* Exchange LACP frames */ - all_slaves_done =3D 0; - for (i =3D 0; i < 30 && all_slaves_done =3D=3D 0; ++i) { + all_children_done =3D 0; + for (i =3D 0; i < 30 && all_children_done =3D=3D 0; ++i) { rte_delay_ms(delay); =20 - all_slaves_done =3D 1; - FOR_EACH_SLAVE(j, slave) { - /* If response already send, skip slave */ + all_children_done =3D 1; + FOR_EACH_CHILD(j, child) { + /* If response already send, skip child */ if (status[j] !=3D 0) continue; =20 - if (bond_handshake_reply(slave) < 0) { - all_slaves_done =3D 0; + if (bond_handshake_reply(child) < 0) { + all_children_done =3D 0; break; } =20 - status[j] =3D bond_handshake_done(slave); + status[j] =3D bond_handshake_done(child); if (status[j] =3D=3D 0) - all_slaves_done =3D 0; + all_children_done =3D 0; } =20 nb_pkts =3D 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"); =20 /* If flags doesn't match - report failure */ - return all_slaves_done =3D=3D 1 ? TEST_SUCCESS : TEST_FAILED; + return all_children_done =3D=3D 1 ? TEST_SUCCESS : TEST_FAILED; } =20 -#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; =20 - retval =3D initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0); + retval =3D initialize_bonded_device_with_children(TEST_LACP_CHILD_COUT, 0= ); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); =20 /* Test LACP handshake function */ retval =3D bond_handshake(); TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); =20 - retval =3D remove_slaves_and_stop_bonded_device(); + retval =3D remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); =20 return TEST_SUCCESS; @@ -668,7 +668,7 @@ test_mode4_agg_mode_selection(void) { int retval; /* Test and verify for Stable mode */ - retval =3D initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0); + retval =3D initialize_bonded_device_with_children(TEST_LACP_CHILD_COUT, 0= ); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); =20 =20 @@ -684,12 +684,12 @@ test_mode4_agg_mode_selection(void) TEST_ASSERT_EQUAL(retval, AGG_STABLE, "Wrong agg mode received from bonding device"); =20 - retval =3D remove_slaves_and_stop_bonded_device(); + retval =3D remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); =20 =20 /* test and verify for Bandwidth mode */ - retval =3D initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0); + retval =3D initialize_bonded_device_with_children(TEST_LACP_CHILD_COUT, 0= ); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); =20 =20 @@ -706,11 +706,11 @@ test_mode4_agg_mode_selection(void) TEST_ASSERT_EQUAL(retval, AGG_BANDWIDTH, "Wrong agg mode received from bonding device"); =20 - retval =3D remove_slaves_and_stop_bonded_device(); + retval =3D remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); =20 /* test and verify selection for count mode */ - retval =3D initialize_bonded_device_with_slaves(TEST_LACP_SLAVE_COUT, 0); + retval =3D initialize_bonded_device_with_children(TEST_LACP_CHILD_COUT, 0= ); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); =20 =20 @@ -726,7 +726,7 @@ test_mode4_agg_mode_selection(void) TEST_ASSERT_EQUAL(retval, AGG_COUNT, "Wrong agg mode received from bonding device"); =20 - retval =3D remove_slaves_and_stop_bonded_device(); + retval =3D remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); =20 return TEST_SUCCESS; @@ -780,7 +780,7 @@ generate_packets(struct rte_ether_addr *src_mac, } =20 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 !=3D (int)count) return retval; =20 - retval =3D slave_put_pkts(slave, pkts, count); + retval =3D child_put_pkts(child, pkts, count); if (retval > 0 && retval !=3D count) free_pkts(&pkts[retval], count - retval); =20 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); =20 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; =20 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; =20 - retval =3D initialize_bonded_device_with_slaves(TEST_PROMISC_SLAVE_COUNT, + retval =3D initialize_bonded_device_with_children(TEST_PROMISC_CHILD_COUN= T, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); =20 @@ -838,7 +838,7 @@ test_mode4_rx(void) dst_mac.addr_bytes[0] +=3D 2; =20 /* First try with promiscuous mode enabled. - * Add 2 packets to each slave. First with bonding MAC address, second wi= th + * Add 2 packets to each child. First with bonding MAC address, second wi= th * different. Check if we received all of them. */ retval =3D 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)); =20 expected_pkts_cnt =3D 0; - FOR_EACH_SLAVE(i, slave) { - retval =3D 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 =3D generate_and_put_packets(child, &src_mac, &bonded_mac, 1); + TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to child %u", + child->port_id); =20 - retval =3D 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 =3D generate_and_put_packets(child, &src_mac, &dst_mac, 1); + TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to child %u", + child->port_id); =20 - /* Expect 2 packets per slave */ + /* Expect 2 packets per child */ expected_pkts_cnt +=3D 2; } =20 @@ -894,16 +894,16 @@ test_mode4_rx(void) test_params.bonded_port_id, rte_strerror(-retval)); =20 expected_pkts_cnt =3D 0; - FOR_EACH_SLAVE(i, slave) { - retval =3D 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 =3D generate_and_put_packets(child, &src_mac, &bonded_mac, 1); + TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to child %u", + child->port_id); =20 - retval =3D 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 =3D generate_and_put_packets(child, &src_mac, &dst_mac, 1); + TEST_ASSERT_SUCCESS(retval, "Failed to enqueue packets to child %u", + child->port_id); =20 - /* Expect only one packet per slave */ + /* Expect only one packet per child */ expected_pkts_cnt +=3D 1; } =20 @@ -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); =20 - /* Link down test: simulate link down for first slave. */ + /* Link down test: simulate link down for first child. */ delay =3D bond_get_update_timeout_ms(); =20 - uint8_t slave_down_id =3D INVALID_PORT_ID; + uint8_t child_down_id =3D INVALID_PORT_ID; =20 - /* 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 =3D 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 =3D child->port_id; break; } =20 - RTE_VERIFY(slave_down_id !=3D INVALID_PORT_ID); + RTE_VERIFY(child_down_id !=3D INVALID_PORT_ID); =20 /* Give some time to rearrange bonding */ for (i =3D 0; i < 3; i++) { @@ -949,16 +949,16 @@ test_mode4_rx(void) =20 TEST_ASSERT_SUCCESS(bond_handshake(), "Handshake after link down failed"); =20 - /* Put packet to each slave */ - FOR_EACH_SLAVE(i, slave) { + /* Put packet to each child */ + FOR_EACH_CHILD(i, child) { void *pkt =3D NULL; =20 - dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =3D slave->port_id; - retval =3D generate_and_put_packets(slave, &src_mac, &dst_mac, 1); + dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =3D child->port_id; + retval =3D generate_and_put_packets(child, &src_mac, &dst_mac, 1); TEST_ASSERT_SUCCESS(retval, "Failed to generate test packet burst."); =20 - src_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =3D slave->port_id; - retval =3D generate_and_put_packets(slave, &src_mac, &bonded_mac, 1); + src_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =3D child->port_id; + retval =3D generate_and_put_packets(child, &src_mac, &bonded_mac, 1); TEST_ASSERT_SUCCESS(retval, "Failed to generate test packet burst."); =20 retval =3D bond_rx(pkts, RTE_DIM(pkts)); @@ -967,36 +967,36 @@ test_mode4_rx(void) if (retval > 0) free_pkts(pkts, retval); =20 - while (rte_ring_dequeue(slave->rx_queue, (void **)&pkt) =3D=3D 0) + while (rte_ring_dequeue(child->rx_queue, (void **)&pkt) =3D=3D 0) rte_pktmbuf_free(pkt); =20 - if (slave_down_id =3D=3D slave->port_id) + if (child_down_id =3D=3D 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); =20 for (j =3D 0; j < 5; j++) { - TEST_ASSERT(bond_handshake_reply(slave) >=3D 0, + TEST_ASSERT(bond_handshake_reply(child) >=3D 0, "Handshake after link up"); =20 - if (bond_handshake_done(slave) =3D=3D 1) + if (bond_handshake_done(child) =3D=3D 1) break; } =20 - TEST_ASSERT(j < 5, "Failed to aggregate slave after link up"); + TEST_ASSERT(j < 5, "Failed to aggregate child after link up"); } =20 - remove_slaves_and_stop_bonded_device(); + remove_children_and_stop_bonded_device(); return TEST_SUCCESS; } =20 static int test_mode4_tx_burst(void) { - struct slave_conf *slave; + struct child_conf *child; uint16_t i, j; =20 uint16_t exp_pkts_cnt, pkts_cnt =3D 0; @@ -1008,7 +1008,7 @@ test_mode4_tx_burst(void) { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } }; struct rte_ether_addr bonded_mac; =20 - retval =3D initialize_bonded_device_with_slaves(TEST_TX_SLAVE_COUNT, 0); + retval =3D initialize_bonded_device_with_children(TEST_TX_CHILD_COUNT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); =20 retval =3D bond_handshake(); @@ -1036,19 +1036,19 @@ test_mode4_tx_burst(void) =20 TEST_ASSERT_EQUAL(retval, pkts_cnt, "TX on bonded device failed"); =20 - /* 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 =3D 0; - FOR_EACH_SLAVE(i, slave) { + FOR_EACH_CHILD(i, child) { uint16_t normal_cnt, slow_cnt; =20 - retval =3D slave_get_pkts(slave, pkts, RTE_DIM(pkts)); + retval =3D child_get_pkts(child, pkts, RTE_DIM(pkts)); normal_cnt =3D 0; slow_cnt =3D 0; =20 for (j =3D 0; j < retval; j++) { - if (make_lacp_reply(slave, pkts[j]) =3D=3D 1) + if (make_lacp_reply(child, pkts[j]) =3D=3D 1) normal_cnt++; else slow_cnt++; @@ -1056,11 +1056,11 @@ test_mode4_tx_burst(void) =20 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); =20 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); =20 pkts_cnt +=3D normal_cnt; } @@ -1069,18 +1069,18 @@ test_mode4_tx_burst(void) "Expected %u packets but transmitted only %d", exp_pkts_cnt, pkts_cnt); =20 /* Link down test: - * simulate link down for first slave. */ + * simulate link down for first child. */ delay =3D bond_get_update_timeout_ms(); =20 - uint8_t slave_down_id =3D INVALID_PORT_ID; + uint8_t child_down_id =3D INVALID_PORT_ID; =20 - FOR_EACH_SLAVE(i, slave) { - rte_eth_dev_set_link_down(slave->port_id); - slave_down_id =3D slave->port_id; + FOR_EACH_CHILD(i, child) { + rte_eth_dev_set_link_down(child->port_id); + child_down_id =3D child->port_id; break; } =20 - RTE_VERIFY(slave_down_id !=3D INVALID_PORT_ID); + RTE_VERIFY(child_down_id !=3D INVALID_PORT_ID); =20 /* Give some time to rearrange bonding. */ for (i =3D 0; i < 3; i++) { @@ -1110,19 +1110,19 @@ test_mode4_tx_burst(void) =20 TEST_ASSERT_EQUAL(retval, pkts_cnt, "TX on bonded device failed"); =20 - /* 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 =3D 0; - FOR_EACH_SLAVE(i, slave) { + FOR_EACH_CHILD(i, child) { uint16_t normal_cnt, slow_cnt; =20 - retval =3D slave_get_pkts(slave, pkts, RTE_DIM(pkts)); + retval =3D child_get_pkts(child, pkts, RTE_DIM(pkts)); normal_cnt =3D 0; slow_cnt =3D 0; =20 for (j =3D 0; j < retval; j++) { - if (make_lacp_reply(slave, pkts[j]) =3D=3D 1) + if (make_lacp_reply(child, pkts[j]) =3D=3D 1) normal_cnt++; else slow_cnt++; @@ -1130,17 +1130,17 @@ test_mode4_tx_burst(void) =20 free_pkts(pkts, normal_cnt + slow_cnt); =20 - if (slave_down_id =3D=3D slave->port_id) { + if (child_down_id =3D=3D 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); =20 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); } =20 pkts_cnt +=3D 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); =20 - return remove_slaves_and_stop_bonded_device(); + return remove_children_and_stop_bonded_device(); } =20 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 =3D 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] =3D - slave->port_id; + child->port_id; =20 marker_hdr->eth_hdr.ether_type =3D rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW); =20 @@ -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 =3D=3D 16); - marker_hdr->marker.requester_port =3D slave->port_id + 1; + marker_hdr->marker.requester_port =3D child->port_id + 1; marker_hdr->marker.tlv_type_terminator =3D TLV_TYPE_TERMINATOR_INFORMATIO= N; marker_hdr->marker.terminator_length =3D 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 =3D rte_be_to_cpu_16(RTE_ETHER_TYPE_SLOW); =20 - retval =3D initialize_bonded_device_with_slaves(TEST_MARKER_SLAVE_COUT, + retval =3D initialize_bonded_device_with_children(TEST_MARKER_CHILD_COUT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); =20 @@ -1205,17 +1205,17 @@ test_mode4_marker(void) TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); =20 delay =3D bond_get_update_timeout_ms(); - FOR_EACH_SLAVE(i, slave) { + FOR_EACH_CHILD(i, child) { marker_pkt =3D 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); =20 - retval =3D slave_put_pkts(slave, &marker_pkt, 1); + retval =3D child_put_pkts(child, &marker_pkt, 1); if (retval !=3D 1) rte_pktmbuf_free(marker_pkt); =20 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); =20 for (j =3D 0; j < 20; ++j) { rte_delay_ms(delay); @@ -1233,13 +1233,13 @@ test_mode4_marker(void) =20 /* Check if LACP packet was send by state machines First and only packet must be a maker response */ - retval =3D slave_get_pkts(slave, pkts, MAX_PKT_BURST); + retval =3D child_get_pkts(child, pkts, MAX_PKT_BURST); if (retval =3D=3D 0) continue; if (retval > 1) free_pkts(pkts, retval); =20 - TEST_ASSERT_EQUAL(retval, 1, "failed to get slave packets"); + TEST_ASSERT_EQUAL(retval, 1, "failed to get child packets"); nb_pkts =3D retval; =20 marker_hdr =3D rte_pktmbuf_mtod(pkts[0], struct marker_header *); @@ -1263,7 +1263,7 @@ test_mode4_marker(void) TEST_ASSERT(j < 20, "Marker response not found"); } =20 - retval =3D remove_slaves_and_stop_bonded_device(); + retval =3D remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); =20 return TEST_SUCCESS; @@ -1272,7 +1272,7 @@ test_mode4_marker(void) static int test_mode4_expired(void) { - struct slave_conf *slave, *exp_slave =3D NULL; + struct child_conf *child, *exp_child =3D NULL; struct rte_mbuf *pkts[MAX_PKT_BURST]; int retval; uint32_t old_delay; @@ -1282,7 +1282,7 @@ test_mode4_expired(void) =20 struct rte_eth_bond_8023ad_conf conf; =20 - retval =3D initialize_bonded_device_with_slaves(TEST_EXPIRED_SLAVE_COUNT, + retval =3D initialize_bonded_device_with_children(TEST_EXPIRED_CHILD_COUN= T, 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) =20 /* Wait for new settings to be applied. */ for (i =3D 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); =20 rte_delay_ms(conf.update_timeout_ms); } @@ -1307,13 +1307,13 @@ test_mode4_expired(void) retval =3D bond_handshake(); TEST_ASSERT_SUCCESS(retval, "Initial handshake failed"); =20 - /* Find first slave */ - FOR_EACH_SLAVE(i, slave) { - exp_slave =3D slave; + /* Find first child */ + FOR_EACH_CHILD(i, child) { + exp_child =3D child; break; } =20 - RTE_VERIFY(exp_slave !=3D NULL); + RTE_VERIFY(exp_child !=3D NULL); =20 /* 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); =20 - FOR_EACH_SLAVE(i, slave) { - retval =3D bond_handshake_reply(slave); + FOR_EACH_CHILD(i, child) { + retval =3D bond_handshake_reply(child); TEST_ASSERT(retval >=3D 0, "Handshake failed"); =20 - /* Remove replay for slave that suppose to be expired. */ - if (slave =3D=3D exp_slave) { - while (rte_ring_count(slave->rx_queue) > 0) { + /* Remove replay for child that suppose to be expired. */ + if (child =3D=3D exp_child) { + while (rte_ring_count(child->rx_queue) > 0) { void *pkt =3D NULL; =20 - 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); } =20 - /* After test only expected slave should be in EXPIRED state */ - FOR_EACH_SLAVE(i, slave) { - if (slave =3D=3D 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 =3D=3D 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); } =20 - retval =3D remove_slaves_and_stop_bonded_device(); + retval =3D remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); =20 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 */ =20 int retval; - struct slave_conf *slave =3D NULL; + struct child_conf *child =3D NULL; uint8_t i; =20 - 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 =3D { .lacpdu =3D { @@ -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); =20 - for (i =3D 0; i < SLAVE_COUNT; i++) { + for (i =3D 0; i < CHILD_COUNT; i++) { lacp_tx_buf[i] =3D 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]) =3D sizeof(lacpdu); } =20 - retval =3D initialize_bonded_device_with_slaves(TEST_TX_SLAVE_COUNT, 0); + retval =3D initialize_bonded_device_with_children(TEST_TX_CHILD_COUNT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); =20 - 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"); } =20 free_pkts(lacp_tx_buf, RTE_DIM(lacp_tx_buf)); =20 - retval =3D remove_slaves_and_stop_bonded_device(); + retval =3D remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Bonded device cleanup failed."); =20 return TEST_SUCCESS; @@ -1430,13 +1430,13 @@ static int test_mode4_ext_lacp(void) { int retval; - struct slave_conf *slave =3D NULL; - uint8_t all_slaves_done =3D 0, i; + struct child_conf *child =3D NULL; + uint8_t all_children_done =3D 0, i; uint16_t nb_pkts; const unsigned int delay =3D bond_get_update_timeout_ms(); =20 - 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 =3D { .lacpdu =3D { @@ -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); =20 - for (i =3D 0; i < SLAVE_COUNT; i++) { + for (i =3D 0; i < CHILD_COUNT; i++) { lacp_tx_buf[i] =3D 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]) =3D sizeof(lacpdu); } =20 - retval =3D initialize_bonded_device_with_slaves(TEST_TX_SLAVE_COUNT, 1); + retval =3D initialize_bonded_device_with_children(TEST_TX_CHILD_COUNT, 1); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); =20 memset(lacpdu_rx_count, 0, sizeof(lacpdu_rx_count)); @@ -1466,22 +1466,22 @@ test_mode4_ext_lacp(void) for (i =3D 0; i < 30; ++i) rte_delay_ms(delay); =20 - FOR_EACH_SLAVE(i, slave) { + FOR_EACH_CHILD(i, child) { retval =3D 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"); } =20 nb_pkts =3D bond_tx(NULL, 0); TEST_ASSERT_EQUAL(nb_pkts, 0, "Packets transmitted unexpectedly"); =20 - FOR_EACH_SLAVE(i, slave) { - nb_pkts =3D 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 =3D 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); } =20 nb_pkts =3D bond_rx(buf, RTE_DIM(buf)); @@ -1489,26 +1489,26 @@ test_mode4_ext_lacp(void) TEST_ASSERT_EQUAL(nb_pkts, 0, "Packets received unexpectedly"); =20 /* wait for the periodic callback to run */ - for (i =3D 0; i < 30 && all_slaves_done =3D=3D 0; ++i) { + for (i =3D 0; i < 30 && all_children_done =3D=3D 0; ++i) { uint8_t s, total =3D 0; =20 rte_delay_ms(delay); - FOR_EACH_SLAVE(s, slave) { - total +=3D lacpdu_rx_count[slave->port_id]; + FOR_EACH_CHILD(s, child) { + total +=3D lacpdu_rx_count[child->port_id]; } =20 - if (total >=3D SLAVE_COUNT) - all_slaves_done =3D 1; + if (total >=3D CHILD_COUNT) + all_children_done =3D 1; } =20 - FOR_EACH_SLAVE(i, slave) { - TEST_ASSERT_EQUAL(lacpdu_rx_count[slave->port_id], 1, - "Slave port %u should have received 1 lacpdu (count=3D%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=3D%u)", + child->port_id, + lacpdu_rx_count[child->port_id]); } =20 - retval =3D remove_slaves_and_stop_bonded_device(); + retval =3D remove_children_and_stop_bonded_device(); TEST_ASSERT_SUCCESS(retval, "Test cleanup failed."); =20 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; =20 env_state =3D 0; FOR_EACH_PORT(i, port) { @@ -1540,20 +1540,20 @@ check_environment(void) break; } =20 - slaves_count =3D rte_eth_bond_slaves_get(test_params.bonded_port_id, - slaves, RTE_DIM(slaves)); + children_count =3D rte_eth_bond_children_get(test_params.bonded_port_id, + children, RTE_DIM(children)); =20 - if (slaves_count !=3D 0) + if (children_count !=3D 0) env_state |=3D 0x10; =20 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" : "."); =20 =20 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)) =20 /* Reset environment in case test failed to do that. */ if (test_result !=3D 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"); =20 FOR_EACH_PORT(i, port) { diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bond= ing_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 @@ =20 #include "test.h" =20 -#define SLAVE_COUNT (4) +#define CHILD_COUNT (4) =20 #define RXTX_RING_SIZE 1024 #define RXTX_QUEUE_COUNT 4 =20 #define BONDED_DEV_NAME ("net_bonding_rss") =20 -#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") =20 #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) =20 -struct slave_conf { +struct child_conf { uint16_t port_id; struct rte_eth_dev_info dev_info; =20 @@ -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]; =20 - uint8_t is_slave; + uint8_t is_child; struct rte_ring *rxtx_queue[RXTX_QUEUE_COUNT]; }; =20 @@ -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_S= IZE]; - struct slave_conf slave_ports[SLAVE_COUNT]; + struct child_conf child_ports[CHILD_COUNT]; =20 struct rte_mempool *mbuf_pool; }; =20 static struct link_bonding_rssconf_unittest_params test_params =3D { .bond_port_id =3D INVALID_PORT_ID, - .slave_ports =3D { - [0 ... SLAVE_COUNT - 1] =3D { .port_id =3D INVALID_PORT_ID, .is_slave = =3D 0} + .child_ports =3D { + [0 ... CHILD_COUNT - 1] =3D { .port_id =3D INVALID_PORT_ID, .is_child = =3D 0} }, .mbuf_pool =3D NULL, }; @@ -107,14 +107,14 @@ static struct rte_eth_conf rss_pmd_conf =3D { #define FOR_EACH(_i, _item, _array, _size) \ for (_i =3D 0, _item =3D &_array[0]; _i < _size && (_item =3D &_array[_i]= ); _i++) =20 -/* 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)) =20 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_con= f *eth_conf, } =20 /** - * 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; =20 FOR_EACH_PORT(n, port) { - port =3D &test_params.slave_ports[n]; - if (port->is_slave) { - TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove( + port =3D &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 =3D 0; + "Cannot remove child %d from bonding", port->port_id); + port->is_child =3D 0; } } =20 @@ -173,30 +173,30 @@ remove_slaves(void) } =20 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; } =20 /** - * 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; =20 FOR_EACH_PORT(n, port) { - port =3D &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 =3D &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 =3D 1; + port->is_child =3D 1; } } =20 @@ -223,11 +223,11 @@ reta_set(uint16_t port_id, uint8_t value, int reta_si= ze) } =20 /** - * Check if slaves RETA is synchronized with bonding port. Returns 1 if sl= ave + * 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; =20 @@ -264,10 +264,10 @@ bond_reta_fetch(void) { } =20 /** - * Fetch slaves RETA + * Fetch children RETA */ static int -slave_reta_fetch(struct slave_conf *port) { +child_reta_fetch(struct child_conf *port) { unsigned j; =20 for (j =3D 0; j < port->dev_info.reta_size / RTE_ETH_RETA_GROUP_SIZE; j++) @@ -280,49 +280,49 @@ slave_reta_fetch(struct slave_conf *port) { } =20 /** - * 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 =3D &(test_params.slave_ports[0]); + struct child_conf *port =3D &(test_params.child_ports[0]); =20 - /* 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"); =20 - /* 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(); =20 reta_set(port->port_id, 2, port->dev_info.reta_size); - slave_reta_fetch(port); + child_reta_fetch(port); =20 TEST_ASSERT(reta_check_synced(port) =3D=3D 0, - "Removed slave didn't should be synchronized with bonding port"); + "Removed child didn't should be synchronized with bonding port"); =20 - /* 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"); =20 bond_reta_fetch(); - slave_reta_fetch(port); + child_reta_fetch(port); =20 return reta_check_synced(port); } =20 /** - * 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; =20 @@ -349,18 +349,18 @@ test_propagate(void) =20 retval =3D 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"); =20 FOR_EACH_PORT(n, port) { - port =3D &test_params.slave_ports[n]; + port =3D &test_params.child_ports[n]; =20 retval =3D 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"); =20 TEST_ASSERT(port->rss_conf.rss_hf =3D=3D rss_hf, - "Hash function not propagated for slave %d", + "Hash function not propagated for child %d", port->port_id); } =20 @@ -376,11 +376,11 @@ test_propagate(void) =20 /* Set all keys to zero */ FOR_EACH_PORT(n, port) { - port =3D &test_params.slave_ports[n]; + port =3D &test_params.child_ports[n]; memset(port->rss_conf.rss_key, 0, 40); retval =3D 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"); } =20 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"); =20 FOR_EACH_PORT(n, port) { - port =3D &test_params.slave_ports[n]; + port =3D &test_params.child_ports[n]; =20 retval =3D rte_eth_dev_rss_hash_conf_get(port->port_id, &(port->rss_conf)); =20 TEST_ASSERT_SUCCESS(retval, - "Cannot take slaves RSS configuration"); + "Cannot take children RSS configuration"); =20 /* compare keys */ retval =3D memcmp(port->rss_conf.rss_key, bond_rss_key, sizeof(bond_rss_key)); - TEST_ASSERT(retval =3D=3D 0, "Key value not propagated for slave %d", + TEST_ASSERT(retval =3D=3D 0, "Key value not propagated for child %d", port->port_id); } } @@ -416,10 +416,10 @@ test_propagate(void) =20 /* Set all keys to zero */ FOR_EACH_PORT(n, port) { - port =3D &test_params.slave_ports[n]; + port =3D &test_params.child_ports[n]; retval =3D 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"); } =20 TEST_ASSERT_SUCCESS(reta_set(test_params.bond_port_id, @@ -429,9 +429,9 @@ test_propagate(void) bond_reta_fetch(); =20 FOR_EACH_PORT(n, port) { - port =3D &test_params.slave_ports[n]; + port =3D &test_params.child_ports[n]; =20 - slave_reta_fetch(port); + child_reta_fetch(port); TEST_ASSERT(reta_check_synced(port) =3D=3D 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)); =20 - TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed"); + TEST_ASSERT_SUCCESS(bond_children(), "Bonding children failed"); =20 TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params.bond_port_id), "Failed to start bonding port (%d).", test_params.bond_port_id); =20 TEST_ASSERT_SUCCESS(test_propagate(), "Propagation test failed"); =20 - TEST_ASSERT(slave_remove_and_add() =3D=3D 1, "remove and add slaves succe= ss."); + TEST_ASSERT(child_remove_and_add() =3D=3D 1, "remove and add children suc= cess."); =20 - remove_slaves_and_stop_bonded_device(); + remove_children_and_stop_bonded_device(); =20 return TEST_SUCCESS; } =20 =20 /** - * 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 =3D {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 !=3D 0, "Succeeded in setting bonded port hash functi= on"); } =20 - /* Set all keys to zero for all slaves */ + /* Set all keys to zero for all children */ FOR_EACH_PORT(n, port) { - port =3D &test_params.slave_ports[n]; + port =3D &test_params.child_ports[n]; retval =3D 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 =3D port->rss_key; port->rss_conf.rss_key_len =3D sizeof(port->rss_key); retval =3D rte_eth_dev_rss_hash_update(port->port_id, &port->rss_conf); - TEST_ASSERT(retval !=3D 0, "Succeeded in setting slaves RSS keys"); + TEST_ASSERT(retval !=3D 0, "Succeeded in setting children RSS keys"); } =20 /* Set RSS keys for bonded port */ @@ -529,10 +529,10 @@ test_rss_config_lazy(void) /* Test RETA propagation */ for (i =3D 0; i < RXTX_QUEUE_COUNT; i++) { FOR_EACH_PORT(n, port) { - port =3D &test_params.slave_ports[n]; + port =3D &test_params.child_ports[n]; retval =3D reta_set(port->port_id, (i + 1) % RXTX_QUEUE_COUNT, port->dev_info.reta_size); - TEST_ASSERT(retval !=3D 0, "Succeeded in setting slaves RETA"); + TEST_ASSERT(retval !=3D 0, "Succeeded in setting children RETA"); } =20 retval =3D 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)); =20 - TEST_ASSERT_SUCCESS(bond_slaves(), "Bonding slaves failed"); + TEST_ASSERT_SUCCESS(bond_children(), "Bonding children failed"); =20 TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params.bond_port_id), "Failed to start bonding port (%d).", test_params.bond_port_id); =20 TEST_ASSERT_SUCCESS(test_rss_config_lazy(), "Succeeded in setting RSS has= h when RX_RSS mq_mode is turned off"); =20 - remove_slaves_and_stop_bonded_device(); + remove_children_and_stop_bonded_device(); =20 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 =3D { .addr_bytes =3D {0} }; =20 if (test_params.mbuf_pool =3D=3D NULL) { =20 test_params.mbuf_pool =3D 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()); =20 TEST_ASSERT(test_params.mbuf_pool !=3D NULL, @@ -594,10 +594,10 @@ test_setup(void) =20 /* Create / initialize ring eth devs. */ FOR_EACH_PORT(n, port) { - port =3D &test_params.slave_ports[n]; + port =3D &test_params.child_ports[n]; =20 port_id =3D 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); =20 retval =3D rte_vdev_init(name, "size=3D64,copy=3D0"); 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; =20 /* Only stop ports. @@ -685,7 +685,7 @@ test_rssconf_executor(int (*test_func)(void)) =20 /* Reset environment in case test failed to do that. */ if (test_result !=3D 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"); } =20 diff --git a/doc/guides/howto/lm_bond_virtio_sriov.rst b/doc/guides/howto/l= m_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 ---------- =20 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. =20 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). =20 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 =20 The syntax of the ``testpmd`` command is: =20 -set bonding primary (slave id) (port id) +set bonding primary (child id) (port id) =20 Set primary to P1 before starting bonding port. =20 @@ -139,7 +139,7 @@ Set primary to P1 before starting bonding port. =20 testpmd> show bonding config 2 =20 -Primary is now P1. There are 2 active slaves. +Primary is now P1. There are 2 active children. =20 Use P2 only for forwarding. =20 @@ -151,7 +151,7 @@ Use P2 only for forwarding. testpmd> start testpmd> show bonding config 2 =20 -Primary is now P1. There are 2 active slaves. +Primary is now P1. There are 2 active children. =20 .. code-block:: console =20 @@ -163,10 +163,10 @@ VF traffic is seen at P1 and P2. =20 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 =20 -Primary is now P0. There is 1 active slave. +Primary is now P0. There is 1 active child. =20 .. code-block:: console =20 @@ -210,7 +210,7 @@ On host_server_1: Terminal 1 =20 testpmd> show bonding config 2 =20 -Primary is now P0. There is 1 active slave. +Primary is now P0. There is 1 active child. =20 .. code-block:: console =20 @@ -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). =20 .. code-block:: console =20 - 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 =20 .. code-block:: console =20 - =C2=A0 dpdk-testpmd -l 0-3 -n4 --vdev 'net_bonding0,mode=3D0,slave=3D,slave=3D,mac=3DXX:XX:XX:XX:XX:XX=E2= =80=99 =E2=80=93 --socket_num=3D1 =E2=80=93 -i --port-topology=3Dchained - (ex) dpdk-testpmd -l 1,3,5,7,9 -n4 --vdev 'net_bonding0,mode=3D0,slave= =3D0000:82:00.0,slave=3D0000:82:00.1,mac=3D00:1e:67:1d:fd:1d' =E2=80=93 --s= ocket-num=3D1 =E2=80=93 -i --port-topology=3Dchained + =C2=A0 dpdk-testpmd -l 0-3 -n4 --vdev 'net_bonding0,mode=3D0,child=3D,child=3D,mac=3DXX:XX:XX:XX:XX:XX=E2= =80=99 =E2=80=93 --socket_num=3D1 =E2=80=93 -i --port-topology=3Dchained + (ex) dpdk-testpmd -l 1,3,5,7,9 -n4 --vdev 'net_bonding0,mode=3D0,child= =3D0000:82:00.0,child=3D0000:82:00.1,mac=3D00:1e:67:1d:fd:1d' =E2=80=93 --s= ocket-num=3D1 =E2=80=93 -i --port-topology=3Dchained =20 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. =20 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. =20 .. note:: =20 @@ -45,7 +45,7 @@ Currently the Link Bonding PMD library supports following= modes of operation: =20 =20 This mode provides load balancing and fault tolerance by transmission = of - packets in sequential order from the first available slave device thro= ugh + packets in sequential order from the first available child device thro= ugh 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) =20 =20 - In this mode only one slave in the bond is active at any time, a diffe= rent - 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 diffe= rent + 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. =20 @@ -73,10 +73,10 @@ Currently the Link Bonding PMD library supports followi= ng 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 M= AC - addresses as well as the number of active slaves available to the bond= ed - device to classify the packet to a specific slave to transmit on. Alte= rnate + addresses as well as the number of active children available to the bo= nded + device to classify the packet to a specific child to transmit on. Alte= rnate transmission policies supported are layer 2+3, this takes the IP sourc= e 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 po= rt. =20 @@ -92,7 +92,7 @@ Currently the Link Bonding PMD library supports following= modes of operation: Broadcast (Mode 3) =20 =20 - This mode provides fault tolerance by transmission of packets on all s= lave + This mode provides fault tolerance by transmission of packets on all c= hild ports. =20 * **Link Aggregation 802.3AD (Mode 4):** @@ -114,7 +114,7 @@ Currently the Link Bonding PMD library supports followi= ng modes of operation: intervals period of less than 100ms. =20 #. Calls to ``rte_eth_tx_burst`` must have a buffer size of at least 2= xN, - 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, b= ut they are not returned to the application. =20 @@ -126,7 +126,7 @@ Currently the Link Bonding PMD library supports followi= ng modes of operation: =20 =20 This mode provides an adaptive transmit load balancing. It dynamically - changes the transmitting slave, according to the computed load. Statis= tics + changes the transmitting child, according to the computed load. Statis= tics are collected in 100ms intervals and scheduled every 10ms. =20 =20 @@ -140,74 +140,74 @@ The Link Bonding Library supports the creation of bon= ded 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. =20 -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. =20 -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. =20 Setting up multi-queue mode for bonding device to RSS, makes it fully -RSS-capable, so all slaves are synchronized with its configuration. This m= ode 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. =20 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 me= aning +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 b= onding -(as one unit), without pointing any of slave inside. It is required to ens= ure +(as one unit), without pointing any of child inside. It is required to ens= ure consistency and made it more error-proof. =20 RSS hash function set for bonding device, is a maximal set of RSS hash fun= ctions -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 sl= ave +supported by all bonded children. RETA size is a GCD of all its RETA's siz= es, so +it can be easily used as a pattern providing expected behavior, even if ch= ild 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. =20 -As RSS configurations, there is flow consistency in the bonded slaves for = the +As RSS configurations, there is flow consistency in the bonded children fo= r the next rte flow operations: =20 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. =20 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. =20 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. =20 Flush: - - Destroy all the bonding PMD flows in all the slaves. + - Destroy all the bonding PMD flows in all the children. =20 .. note:: =20 - 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 wh= ich may include external flows or the bond internal LACP flow. =20 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``. =20 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. =20 All settings are managed through the bonding port API and always are propa= gated -in one direction (from bonding to slaves). +in one direction (from bonding to children). =20 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 call= back, 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 ch= ild +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 th= en they +must register callbacks with that child directly. =20 The link bonding library also supports devices which do not implement link status change interrupts, this is achieved by polling the devices link sta= tus 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 sla= ve to +API, the default polling interval is 10ms. When a device is added as a chi= ld 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 The current implementation only supports devices that support the same spe= ed -and duplex to be added as a slaves to the same bonded device. The bonded d= evice -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 suppo= rt these parameters. =20 -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. =20 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 lea= st 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. =20 -To prevent inconsistency on how slaves process packets, once a device is a= dded +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 thr= ough -the bonding device API, and not directly on the slave. +the bonding device API, and not directly on the child. =20 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. =20 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. =20 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 device= s, -its primary slave, a user defined MAC address and transmission policy to u= se if +The other configurable parameters for a bonded device are its child device= s, +its primary child, a user defined MAC address and transmission policy to u= se if the device is in balance XOR mode. =20 -Slave Devices +Child Devices ^^^^^^^^^^^^^ =20 -Bonding devices support up to a maximum of ``RTE_MAX_ETHPORTS`` slave devi= ces -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 devi= ces +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. =20 -The bonded also guarantees to return the MAC address of the slave device t= o its -original value of removal of a slave from it. +The bonded also guarantees to return the MAC address of the child device t= o its +original value of removal of a child from it. =20 -Primary Slave +Primary Child ^^^^^^^^^^^^^ =20 -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 d= evice. @@ -292,14 +292,14 @@ MAC Address ^^^^^^^^^^^ =20 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 prima= ry -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 th= eir +original MAC address. In mode 0, 2, 3, 4 all children devices are configur= e with the bonded devices MAC address. =20 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. =20 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 t= he - packet and then calculate the modulus of this value to calculate the s= lave + packet and then calculate the modulus of this value to calculate the c= hild device to transmit the packet on. =20 * **Layer 2 + 3:** Ethernet MAC address & IP Address based balancing use= s a combination of source/destination MAC addresses and the source/destina= tion - 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. =20 * **Layer 3 + 4:** IP Address & UDP Port based balancing uses a combin= ation 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 wi= ll be + the packet of the data packet to decide which child port the packet wi= ll be transmitted on. =20 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 th= en the RX and TX queues which will be used must be setup using ``rte_eth_tx_queue_setup`` / ``rte_eth_rx_queue_setup``. =20 -Slave devices can be dynamically added and removed from a link bonding dev= ice -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 dev= ice +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``. =20 -The link status of a bonded device is dictated by that of its slaves, if a= ll -slave device link status are down or if all slaves are removed from the li= nk +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. =20 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. =20 -* A least one slave device is provided with for each bonded device defin= ition. +* A least one child device is provided with for each bonded device defin= ition. =20 * The operation mode of the bonded device being created is provided. =20 @@ -404,20 +404,20 @@ The different options are: =20 mode=3D2 =20 -* slave: Defines the PMD device which will be added as slave to the bond= ed +* child: Defines the PMD device which will be added as child to the bond= ed 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 =20 .. code-block:: console =20 - slave=3D0000:0a:00.0,slave=3D0000:0a:00.1 + child=3D0000:0a:00.0,child=3D0000:0a:00.1 =20 -* 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 addre= ss to - use when it is not defined by the user. This defaults to the first sla= ve - added to the device if it is specified. The primary device must be a s= lave + use when it is not defined by the user. This defaults to the first chi= ld + added to the device if it is specified. The primary device must be a c= hild of the bonded device. =20 .. code-block:: console @@ -432,7 +432,7 @@ The different options are: socket_id=3D0 =20 * mac: Optional parameter to select a MAC address for link bonding devic= e, - this overrides the value of the primary slave device. + this overrides the value of the primary child device. =20 .. code-block:: console =20 @@ -474,29 +474,29 @@ The different options are: Examples of Usage ^^^^^^^^^^^^^^^^^ =20 -Create a bonded device in round robin mode with two slaves specified by th= eir PCI address: +Create a bonded device in round robin mode with two children specified by = their PCI address: =20 .. code-block:: console =20 - .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode= =3D0,slave=3D0000:0a:00.01,slave=3D0000:04:00.00' -- --port-topology=3Dchai= ned + .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode= =3D0,child=3D0000:0a:00.01,child=3D0000:04:00.00' -- --port-topology=3Dchai= ned =20 -Create a bonded device in round robin mode with two slaves specified by th= eir 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: =20 .. code-block:: console =20 - .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode= =3D0,slave=3D0000:0a:00.01,slave=3D0000:04:00.00,mac=3D00:1e:67:1d:fd:1d' -= - --port-topology=3Dchained + .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode= =3D0,child=3D0000:0a:00.01,child=3D0000:04:00.00,mac=3D00:1e:67:1d:fd:1d' -= - --port-topology=3Dchained =20 -Create a bonded device in active backup mode with two slaves specified, an= d 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: =20 .. code-block:: console =20 - .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode= =3D1,slave=3D0000:0a:00.01,slave=3D0000:04:00.00,primary=3D0000:0a:00.01' -= - --port-topology=3Dchained + .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode= =3D1,child=3D0000:0a:00.01,child=3D0000:04:00.00,primary=3D0000:0a:00.01' -= - --port-topology=3Dchained =20 -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 thei= r PCI addresses, and a transmission policy of layer 3 + 4 forwarding: =20 .. code-block:: console =20 - .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode= =3D2,slave=3D0000:0a:00.01,slave=3D0000:04:00.00,xmit_policy=3Dl34' -- --po= rt-topology=3Dchained + .//app/dpdk-testpmd -l 0-3 -n 4 --vdev 'net_bonding0,mode= =3D2,child=3D0000:0a:00.01,child=3D0000:04:00.00,xmit_policy=3Dl34' -- --po= rt-topology=3Dchained =20 .. _bonding_testpmd_commands: =20 @@ -517,28 +517,28 @@ For example, to create a bonded device in mode 1 on s= ocket 0:: testpmd> create bonded device 1 0 created new bonded device (port X) =20 -add bonding slave +add bonding child ~~~~~~~~~~~~~~~~~ =20 Adds Ethernet device to a Link Bonding device:: =20 - testpmd> add bonding slave (slave id) (port id) + testpmd> add bonding child (child id) (port id) =20 For example, to add Ethernet device (port 6) to a Link Bonding device (por= t 10):: =20 - testpmd> add bonding slave 6 10 + testpmd> add bonding child 6 10 =20 =20 -remove bonding slave +remove bonding child ~~~~~~~~~~~~~~~~~~~~ =20 -Removes an Ethernet slave device from a Link Bonding device:: +Removes an Ethernet child device from a Link Bonding device:: =20 - testpmd> remove bonding slave (slave id) (port id) + testpmd> remove bonding child (child id) (port id) =20 -For example, to remove Ethernet slave device (port 6) to a Link Bonding de= vice (port 10):: +For example, to remove Ethernet child device (port 6) to a Link Bonding de= vice (port 10):: =20 - testpmd> remove bonding slave 6 10 + testpmd> remove bonding child 6 10 =20 set bonding mode ~~~~~~~~~~~~~~~~ @@ -554,11 +554,11 @@ For example, to set the bonding mode of a Link Bondin= g device (port 10) to broad set bonding primary ~~~~~~~~~~~~~~~~~~~ =20 -Set an Ethernet slave device as the primary device on a Link Bonding devic= e:: +Set an Ethernet child device as the primary device on a Link Bonding devic= e:: =20 - testpmd> set bonding primary (slave id) (port id) + testpmd> set bonding primary (child id) (port id) =20 -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):: =20 testpmd> set bonding primary 6 10 =20 @@ -590,7 +590,7 @@ set bonding mon_period =20 Set the link status monitoring polling period in milliseconds for a bondin= g device. =20 -This adds support for PMD slave devices which do not support link status i= nterrupts. +This adds support for PMD child devices which do not support link status i= nterrupts. 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 l= ink status has changed:: =20 @@ -604,7 +604,7 @@ For example, to set the link status monitoring polling = period of bonded device ( set bonding lacp dedicated_queue ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =20 -Enable dedicated tx/rx queues on bonding devices slaves to handle LACP con= trol plane traffic +Enable dedicated tx/rx queues on bonding devices children to handle LACP c= ontrol plane traffic when in mode 4 (link-aggregation-802.3ad):: =20 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) =20 For example, -to show the configuration a Link Bonding device (port 9) with 3 slave devi= ces (1, 3, 4) +to show the configuration a Link Bonding device (port 9) with 3 child devi= ces (1, 3, 4) in balance mode with a transmission policy of layer 2+3:: =20 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/testp= md_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 applicatio= ns. =20 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. =20 .. code-block:: console =20 - testpmd> port attach net_bond_0,mode=3D0,slave=3D1 + testpmd> port attach net_bond_0,mode=3D0,child=3D1 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/bo= nding_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; }; =20 @@ -287,13 +287,13 @@ static void cmd_set_bonding_primary_parsed(void *pars= ed_result, __rte_unused struct cmdline *cl, __rte_unused void *data) { struct cmd_set_bonding_primary_result *res =3D parsed_result; - portid_t master_port_id =3D res->port_id; - portid_t slave_port_id =3D res->slave_id; + portid_t parent_port_id =3D res->port_id; + portid_t child_port_id =3D res->child_id; =20 - /* Set the primary slave for a bonded device. */ - if (rte_eth_bond_primary_set(master_port_id, slave_port_id) !=3D 0) { - fprintf(stderr, "\t Failed to set primary slave for port =3D %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) !=3D 0) { + fprintf(stderr, "\t Failed to set primary child for port =3D %d.\n", + parent_port_id); return; } init_port_config(); @@ -308,141 +308,141 @@ static cmdline_parse_token_string_t cmd_setbonding_= primary_bonding =3D static cmdline_parse_token_string_t cmd_setbonding_primary_primary =3D TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_primary_result, primary, "primary"); -static cmdline_parse_token_num_t cmd_setbonding_primary_slave =3D +static cmdline_parse_token_num_t cmd_setbonding_primary_child =3D 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 =3D TOKEN_NUM_INITIALIZER(struct cmd_set_bonding_primary_result, port_id, RTE_UINT16); =20 static cmdline_parse_inst_t cmd_set_bonding_primary =3D { .f =3D cmd_set_bonding_primary_parsed, - .help_str =3D "set bonding primary : " - "Set the primary slave for port_id", + .help_str =3D "set bonding primary : " + "Set the primary child for port_id", .data =3D NULL, .tokens =3D { (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 } }; =20 -/* *** 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; }; =20 -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 =3D parsed_result; - portid_t master_port_id =3D res->port_id; - portid_t slave_port_id =3D res->slave_id; + struct cmd_add_bonding_child_result *res =3D parsed_result; + portid_t parent_port_id =3D res->port_id; + portid_t child_port_id =3D res->child_id; =20 - /* add the slave for a bonded device. */ - if (rte_eth_bond_slave_add(master_port_id, slave_port_id) !=3D 0) { + /* add the child for a bonded device. */ + if (rte_eth_bond_child_add(parent_port_id, child_port_id) !=3D 0) { fprintf(stderr, - "\t Failed to add slave %d to master port =3D %d.\n", - slave_port_id, master_port_id); + "\t Failed to add child %d to parent port =3D %d.\n", + child_port_id, parent_port_id); return; } - ports[master_port_id].update_conf =3D 1; + ports[parent_port_id].update_conf =3D 1; init_port_config(); - set_port_slave_flag(slave_port_id); + set_port_child_flag(child_port_id); } =20 -static cmdline_parse_token_string_t cmd_addbonding_slave_add =3D - TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_slave_result, +static cmdline_parse_token_string_t cmd_addbonding_child_add =3D + TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_child_result, add, "add"); -static cmdline_parse_token_string_t cmd_addbonding_slave_bonding =3D - TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_slave_result, +static cmdline_parse_token_string_t cmd_addbonding_child_bonding =3D + TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_child_result, bonding, "bonding"); -static cmdline_parse_token_string_t cmd_addbonding_slave_slave =3D - TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_slave_result, - slave, "slave"); -static cmdline_parse_token_num_t cmd_addbonding_slave_slaveid =3D - TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_slave_result, - slave_id, RTE_UINT16); -static cmdline_parse_token_num_t cmd_addbonding_slave_port =3D - TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_slave_result, +static cmdline_parse_token_string_t cmd_addbonding_child_child =3D + TOKEN_STRING_INITIALIZER(struct cmd_add_bonding_child_result, + child, "child"); +static cmdline_parse_token_num_t cmd_addbonding_child_childid =3D + TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_child_result, + child_id, RTE_UINT16); +static cmdline_parse_token_num_t cmd_addbonding_child_port =3D + TOKEN_NUM_INITIALIZER(struct cmd_add_bonding_child_result, port_id, RTE_UINT16); =20 -static cmdline_parse_inst_t cmd_add_bonding_slave =3D { - .f =3D cmd_add_bonding_slave_parsed, - .help_str =3D "add bonding slave : " - "Add a slave device to a bonded device", +static cmdline_parse_inst_t cmd_add_bonding_child =3D { + .f =3D cmd_add_bonding_child_parsed, + .help_str =3D "add bonding child : " + "Add a child device to a bonded device", .data =3D NULL, .tokens =3D { - (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 } }; =20 -/* *** 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; }; =20 -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 =3D parsed_result; - portid_t master_port_id =3D res->port_id; - portid_t slave_port_id =3D res->slave_id; + struct cmd_remove_bonding_child_result *res =3D parsed_result; + portid_t parent_port_id =3D res->port_id; + portid_t child_port_id =3D res->child_id; =20 - /* remove the slave from a bonded device. */ - if (rte_eth_bond_slave_remove(master_port_id, slave_port_id) !=3D 0) { + /* remove the child from a bonded device. */ + if (rte_eth_bond_child_remove(parent_port_id, child_port_id) !=3D 0) { fprintf(stderr, - "\t Failed to remove slave %d from master port =3D %d.\n", - slave_port_id, master_port_id); + "\t Failed to remove child %d from parent port =3D %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); } =20 -static cmdline_parse_token_string_t cmd_removebonding_slave_remove =3D - TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_slave_result, +static cmdline_parse_token_string_t cmd_removebonding_child_remove =3D + TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_child_result, remove, "remove"); -static cmdline_parse_token_string_t cmd_removebonding_slave_bonding =3D - TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_slave_result, +static cmdline_parse_token_string_t cmd_removebonding_child_bonding =3D + TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_child_result, bonding, "bonding"); -static cmdline_parse_token_string_t cmd_removebonding_slave_slave =3D - TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_slave_result, - slave, "slave"); -static cmdline_parse_token_num_t cmd_removebonding_slave_slaveid =3D - TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_slave_result, - slave_id, RTE_UINT16); -static cmdline_parse_token_num_t cmd_removebonding_slave_port =3D - TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_slave_result, +static cmdline_parse_token_string_t cmd_removebonding_child_child =3D + TOKEN_STRING_INITIALIZER(struct cmd_remove_bonding_child_result, + child, "child"); +static cmdline_parse_token_num_t cmd_removebonding_child_childid =3D + TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_child_result, + child_id, RTE_UINT16); +static cmdline_parse_token_num_t cmd_removebonding_child_port =3D + TOKEN_NUM_INITIALIZER(struct cmd_remove_bonding_child_result, port_id, RTE_UINT16); =20 -static cmdline_parse_inst_t cmd_remove_bonding_slave =3D { - .f =3D cmd_remove_bonding_slave_parsed, - .help_str =3D "remove bonding slave : " - "Remove a slave device from a bonded device", +static cmdline_parse_inst_t cmd_remove_bonding_child =3D { + .f =3D cmd_remove_bonding_child_parsed, + .help_str =3D "remove bonding child : " + "Remove a child device from a bonded device", .data =3D NULL, .tokens =3D { - (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 = =3D { }, { &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/bo= nding/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" =20 #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; =20 /** 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; =20 - struct rte_eth_link slave_link; - /***< slave link properties */ + struct rte_eth_link child_link; + /***< child link properties */ =20 /** * 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); =20 /** * @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); =20 /** * @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); =20 /** - * Updates state when MAC was changed on bonded device or one of its slave= s. + * Updates state when MAC was changed on bonded device or one of its child= ren. * @param bond_dev Bonded device */ void @@ -300,10 +300,10 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_de= v *bond_dev); =20 int bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bond_dev, - uint16_t slave_port); + uint16_t child_port); =20 int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_p= ort); +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t child_p= ort); =20 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/e= th_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" =20 -#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 */ }; =20 -/** 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 */ }; =20 -struct bond_slave_details { +struct bond_child_details { uint16_t port_id; =20 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; =20 uint16_t reta_size; @@ -94,7 +94,7 @@ struct bond_slave_details { =20 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 { }; =20 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); =20 /** 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; =20 - 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 */ =20 @@ -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*/ =20 - 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 */ =20 - 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 */ =20 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; =20 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. */ =20 struct rte_kvargs *kvlist; - uint8_t slave_update_idx; + uint8_t child_update_idx; =20 bool kvargs_processing_is_done; =20 @@ -191,19 +191,19 @@ struct bond_dev_private { extern const struct eth_dev_ops default_dev_ops; =20 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); =20 int check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev); =20 -/* 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_i= d) { +find_child_by_id(uint16_t *children, uint16_t children_count, uint16_t chi= ld_id) { =20 uint16_t pos; - for (pos =3D 0; pos < slaves_count; pos++) { - if (slave_id =3D=3D slaves[pos]) + for (pos =3D 0; pos < children_count; pos++) { + if (child_id =3D=3D children[pos]) break; } =20 @@ -217,13 +217,13 @@ int valid_bonded_port_id(uint16_t port_id); =20 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); =20 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); =20 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); =20 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); =20 int -mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev); +mac_address_children_update(struct rte_eth_dev *bonded_eth_dev); =20 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); =20 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); =20 int bond_ethdev_mode_set(struct rte_eth_dev *eth_dev, uint8_t mode); =20 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); =20 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); =20 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); =20 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); =20 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); =20 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); =20 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); =20 =20 void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint16_t slave_port_id); + uint16_t child_port_id); =20 int bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type t= ype, void *param, void *ret_param); =20 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); =20 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); =20 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); =20 int @@ -301,7 +301,7 @@ bond_ethdev_parse_socket_id_kvarg(const char *key, const char *value, void *extra_args); =20 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); =20 int @@ -323,7 +323,7 @@ void bond_tlb_enable(struct bond_dev_private *internals); =20 void -bond_tlb_activate_slave(struct bond_dev_private *internals); +bond_tlb_activate_child(struct bond_dev_private *internals); =20 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_e= th_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 multi= ple - * (slave) NICs into a single logical interface. The bonded device process= es + * 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 b= ackup * 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 prim= ary - * 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 an= d then + * transmitted packets will be sent on the next available devices. The pri= mary + * device can be defined by the user but defaults to the first active devi= ce * available if not specified. */ #define BONDING_MODE_BALANCE (2) /**< Balance (Mode 2). * In this mode all packets transmitted will be balanced across the availa= ble - * 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 trans= mit * policies. */ #define BONDING_MODE_BROADCAST (3) /**< Broadcast (Mode 3). * In this mode all transmitted packets will be transmitted on all availab= le - * 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. Statist= ics + * changes the transmitting device, according to the computed load. Statis= tics * 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 RL= B the * bonding driver intercepts ARP replies send by local system and overwrit= es its * source MAC address, so that different peers send data to the server on - * different slave interfaces. When local system sends ARP request, it sav= es IP + * different device interfaces. When local system sends ARP request, it sa= ves 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. */ =20 /* Balance Mode Transmit Policies */ @@ -113,28 +113,42 @@ int rte_eth_bond_free(const char *name); =20 /** - * 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); +} =20 /** - * 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); +} =20 /** * Set link bonding mode of bonded device @@ -160,65 +174,73 @@ int rte_eth_bond_mode_get(uint16_t bonded_port_id); =20 /** - * 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); =20 /** - * 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); =20 /** - * 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); +} =20 /** - * 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 bon= ded * 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 childre= n[], uint16_t len); =20 /** - * 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); =20 /** - * 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); =20 /** * Set the link monitoring frequency (in ms) for monitoring the link statu= s 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_i= d, uint32_t internal_ms); =20 /** * 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/bondin= g/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__) =20 static uint64_t start_time; @@ -184,9 +184,9 @@ set_warning_flags(struct port *port, uint16_t flags) } =20 static void -show_warnings(uint16_t slave_id) +show_warnings(uint16_t child_id) { - struct port *port =3D &bond_mode_8023ad_ports[slave_id]; + struct port *port =3D &bond_mode_8023ad_ports[child_id]; uint8_t warnings; =20 do { @@ -205,36 +205,36 @@ show_warnings(uint16_t slave_id) =20 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 corre= ctly", - slave_id); + child_id); } =20 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 corr= ectly", - slave_id); + child_id); } =20 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); =20 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); } =20 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); =20 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); } =20 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 =3D &bond_mode_8023ad_ports[slave_id]; + struct port *agg, *port =3D &bond_mode_8023ad_ports[child_id]; uint64_t timeout; =20 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 =3D &bond_mode_8023ad_ports[slave_id]; + struct port *port =3D &bond_mode_8023ad_ports[child_id]; /* Calculate if either site is LACP enabled */ uint64_t timeout; uint8_t active =3D ACTOR_STATE(port, LACP_ACTIVE) || @@ -451,9 +451,9 @@ periodic_machine(struct bond_dev_private *internals, ui= nt16_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 =3D &bond_mode_8023ad_ports[slave_id]; + struct port *port =3D &bond_mode_8023ad_ports[child_id]; =20 /* Save current state for later use */ const uint8_t state_mask =3D 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 =3D &bond_mode_8023ad_ports[slave_id]; + struct port *agg, *port =3D &bond_mode_8023ad_ports[child_id]; =20 struct rte_mbuf *lacp_pkt =3D NULL; struct lacpdu_header *hdr; @@ -587,7 +587,7 @@ tx_machine(struct bond_dev_private *internals, uint16_t= slave_id) =20 /* 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 =3D rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW); =20 lacpdu =3D &hdr->lacpdu; @@ -635,10 +635,10 @@ tx_machine(struct bond_dev_private *internals, uint16= _t slave_id) return; } } else { - uint16_t pkts_sent =3D rte_eth_tx_prepare(slave_id, + uint16_t pkts_sent =3D rte_eth_tx_prepare(child_id, internals->mode4.dedicated_queues.tx_qid, &lacp_pkt, 1); - pkts_sent =3D rte_eth_tx_burst(slave_id, + pkts_sent =3D rte_eth_tx_burst(child_id, internals->mode4.dedicated_queues.tx_qid, &lacp_pkt, pkts_sent); if (pkts_sent !=3D 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 =3D 0; - uint16_t *slaves; + uint16_t children_count, new_agg_id, i, j =3D 0; + uint16_t *children; uint64_t agg_bandwidth[RTE_MAX_ETHPORTS] =3D {0}; uint64_t agg_count[RTE_MAX_ETHPORTS] =3D {0}; - uint16_t default_slave =3D 0; + uint16_t default_child =3D 0; struct rte_eth_link link_info; uint16_t agg_new_idx =3D 0; int ret; =20 - slaves =3D internals->active_slaves; - slaves_count =3D internals->active_slave_count; - port =3D &bond_mode_8023ad_ports[slave_id]; + children =3D internals->active_children; + children_count =3D internals->active_child_count; + port =3D &bond_mode_8023ad_ports[child_id]; =20 /* Search for aggregator suitable for this port */ - for (i =3D 0; i < slaves_count; ++i) { - agg =3D &bond_mode_8023ad_ports[slaves[i]]; + for (i =3D 0; i < children_count; ++i) { + agg =3D &bond_mode_8023ad_ports[children[i]]; /* Skip ports that are not aggregators */ - if (agg->aggregator_port_id !=3D slaves[i]) + if (agg->aggregator_port_id !=3D children[i]) continue; =20 - ret =3D rte_eth_link_get_nowait(slaves[i], &link_info); + ret =3D 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] +=3D 1; agg_bandwidth[i] +=3D link_info.link_speed; =20 - /* 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 =3D=3D port->actor.key && agg->partner.system_priority =3D=3D port->partner.system_priority && @@ -724,31 +724,31 @@ selection_logic(struct bond_dev_private *internals, u= int16_t slave_id) rte_cpu_to_be_16(BOND_LINK_FULL_DUPLEX_KEY)) !=3D 0) { =20 if (j =3D=3D 0) - default_slave =3D i; + default_child =3D i; j++; } } =20 switch (internals->mode4.agg_selection) { case AGG_COUNT: - agg_new_idx =3D max_index(agg_count, slaves_count); - new_agg_id =3D slaves[agg_new_idx]; + agg_new_idx =3D max_index(agg_count, children_count); + new_agg_id =3D children[agg_new_idx]; break; case AGG_BANDWIDTH: - agg_new_idx =3D max_index(agg_bandwidth, slaves_count); - new_agg_id =3D slaves[agg_new_idx]; + agg_new_idx =3D max_index(agg_bandwidth, children_count); + new_agg_id =3D children[agg_new_idx]; break; case AGG_STABLE: - if (default_slave =3D=3D slaves_count) - new_agg_id =3D slaves[slave_id]; + if (default_child =3D=3D children_count) + new_agg_id =3D children[child_id]; else - new_agg_id =3D slaves[default_slave]; + new_agg_id =3D children[default_child]; break; default: - if (default_slave =3D=3D slaves_count) - new_agg_id =3D slaves[slave_id]; + if (default_child =3D=3D children_count) + new_agg_id =3D children[child_id]; else - new_agg_id =3D slaves[default_slave]; + new_agg_id =3D children[default_child]; break; } =20 @@ -758,7 +758,7 @@ selection_logic(struct bond_dev_private *internals, uin= t16_t slave_id) MODE4_DEBUG("-> SELECTED: ID=3D%3u\n" "\t%s aggregator ID=3D%3u\n", port->aggregator_port_id, - port->aggregator_port_id =3D=3D slave_id ? + port->aggregator_port_id =3D=3D child_id ? "aggregator not found, using default" : "aggregator found", port->aggregator_port_id); } @@ -802,7 +802,7 @@ link_speed_key(uint16_t speed) { } =20 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, u= int16_t slave_id, RTE_ASSERT(lacp->lacpdu.subtype =3D=3D SLOW_SUBTYPE_LACP); =20 partner =3D &lacp->lacpdu.partner; - port =3D &bond_mode_8023ad_ports[slave_id]; + port =3D &bond_mode_8023ad_ports[child_id]; agg =3D &bond_mode_8023ad_ports[port->aggregator_port_id]; =20 if (rte_is_zero_ether_addr(&partner->port_params.system) || @@ -822,7 +822,7 @@ rx_machine_update(struct bond_dev_private *internals, u= int16_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); } =20 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 =3D rte_eth_rx_burst(slave_id, + uint16_t rx_count =3D rte_eth_rx_burst(child_id, internals->mode4.dedicated_queues.rx_qid, lacp_pkt, DEDICATED_QUEUE_BURST_SIZE); =20 @@ -854,10 +854,10 @@ bond_mode_8023ad_dedicated_rxq_process(struct bond_de= v_private *internals, uint16_t i; =20 for (i =3D 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); } } =20 @@ -868,23 +868,23 @@ bond_mode_8023ad_periodic_cb(void *arg) struct bond_dev_private *internals =3D 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 =3D NULL; - uint16_t slave_id; + uint16_t child_id; uint16_t i; =20 =20 /* Update link status on each port */ - for (i =3D 0; i < internals->active_slave_count; i++) { + for (i =3D 0; i < internals->active_child_count; i++) { uint16_t key; int ret; =20 - slave_id =3D internals->active_slaves[i]; - ret =3D rte_eth_link_get_nowait(slave_id, &link_info); + child_id =3D internals->active_children[i]; + ret =3D 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)); } =20 if (ret >=3D 0 && link_info.link_status !=3D 0) { @@ -895,8 +895,8 @@ bond_mode_8023ad_periodic_cb(void *arg) key =3D 0; } =20 - rte_eth_macaddr_get(slave_id, &slave_addr); - port =3D &bond_mode_8023ad_ports[slave_id]; + rte_eth_macaddr_get(child_id, &child_addr); + port =3D &bond_mode_8023ad_ports[child_id]; =20 key =3D rte_cpu_to_be_16(key); if (key !=3D port->actor.key) { @@ -907,16 +907,16 @@ bond_mode_8023ad_periodic_cb(void *arg) SM_FLAG_SET(port, NTT); } =20 - 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 =3D=3D 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 =3D=3D child_id) SM_FLAG_SET(port, NTT); } } =20 - for (i =3D 0; i < internals->active_slave_count; i++) { - slave_id =3D internals->active_slaves[i]; - port =3D &bond_mode_8023ad_ports[slave_id]; + for (i =3D 0; i < internals->active_child_count; i++) { + child_id =3D internals->active_children[i]; + port =3D &bond_mode_8023ad_ports[child_id]; =20 if ((port->actor.key & rte_cpu_to_be_16(BOND_LINK_FULL_DUPLEX_KEY)) =3D=3D 0) { @@ -947,19 +947,19 @@ bond_mode_8023ad_periodic_cb(void *arg) if (retval !=3D 0) lacp_pkt =3D NULL; =20 - 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); } =20 - 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); =20 SM_FLAG_CLR(port, BEGIN); - show_warnings(slave_id); + show_warnings(child_id); } =20 rte_eal_alarm_set(internals->mode4.update_timeout_us, @@ -967,34 +967,34 @@ bond_mode_8023ad_periodic_cb(void *arg) } =20 static int -bond_mode_8023ad_register_lacp_mac(uint16_t slave_id) +bond_mode_8023ad_register_lacp_mac(uint16_t child_id) { int ret; =20 - ret =3D rte_eth_allmulticast_enable(slave_id); + ret =3D rte_eth_allmulticast_enable(child_id); if (ret !=3D 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 =3D + child_id); + bond_mode_8023ad_ports[child_id].forced_rx_flags =3D BOND_8023AD_FORCED_ALLMULTI; return 0; } =20 - ret =3D rte_eth_promiscuous_enable(slave_id); + ret =3D rte_eth_promiscuous_enable(child_id); if (ret !=3D 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 =3D + child_id); + bond_mode_8023ad_ports[child_id].forced_rx_flags =3D BOND_8023AD_FORCED_PROMISC; return 0; } @@ -1003,27 +1003,27 @@ bond_mode_8023ad_register_lacp_mac(uint16_t slave_i= d) } =20 static void -bond_mode_8023ad_unregister_lacp_mac(uint16_t slave_id) +bond_mode_8023ad_unregister_lacp_mac(uint16_t child_id) { int ret; =20 - 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 =3D rte_eth_allmulticast_disable(slave_id); + RTE_BOND_LOG(DEBUG, "unset allmulti for port %u", child_id); + ret =3D rte_eth_allmulticast_disable(child_id); if (ret !=3D 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; =20 case BOND_8023AD_FORCED_PROMISC: - RTE_BOND_LOG(DEBUG, "unset promisc for port %u", slave_id); - ret =3D rte_eth_promiscuous_disable(slave_id); + RTE_BOND_LOG(DEBUG, "unset promisc for port %u", child_id); + ret =3D rte_eth_promiscuous_disable(child_id); if (ret !=3D 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; =20 default: @@ -1032,12 +1032,12 @@ bond_mode_8023ad_unregister_lacp_mac(uint16_t slave= _id) } =20 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 =3D bond_dev->data->dev_private; =20 - struct port *port =3D &bond_mode_8023ad_ports[slave_id]; + struct port *port =3D &bond_mode_8023ad_ports[child_id]; struct port_params initial =3D { .system =3D { { 0 } }, .system_priority =3D 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; =20 - /* Given slave mus not be in active list */ - RTE_ASSERT(find_slave_by_id(internals->active_slaves, - internals->active_slave_count, slave_id) =3D=3D internals->active_slave_c= ount); + /* Given child mus not be in active list */ + RTE_ASSERT(find_child_by_id(internals->active_children, + internals->active_child_count, child_id) =3D=3D internals->active_child_c= ount); RTE_SET_USED(internals); /* used only for assert when enabled */ =20 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 =3D rte_cpu_to_be_16(slave_id + 1); + port->actor.port_number =3D rte_cpu_to_be_16(child_id + 1); =20 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 =3D SM_FLAGS_BEGIN; =20 /* use this port as aggregator */ - port->aggregator_port_id =3D slave_id; + port->aggregator_port_id =3D child_id; =20 - 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); } =20 timer_cancel(&port->warning_timer); @@ -1087,7 +1087,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *b= ond_dev, RTE_ASSERT(port->rx_ring =3D=3D NULL); RTE_ASSERT(port->tx_ring =3D=3D NULL); =20 - socket_id =3D rte_eth_dev_socket_id(slave_id); + socket_id =3D rte_eth_dev_socket_id(child_id); if (socket_id =3D=3D -1) socket_id =3D rte_socket_id(); =20 @@ -1095,14 +1095,14 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev = *bond_dev, RTE_PKTMBUF_HEADROOM; =20 /* The size of the mempool should be at least: - * the sum of the TX descriptors + BOND_MODE_8023AX_SLAVE_TX_PKTS */ - total_tx_desc =3D BOND_MODE_8023AX_SLAVE_TX_PKTS; + * the sum of the TX descriptors + BOND_MODE_8023AX_CHILD_TX_PKTS */ + total_tx_desc =3D BOND_MODE_8023AX_CHILD_TX_PKTS; for (q_id =3D 0; q_id < bond_dev->data->nb_tx_queues; q_id++) { bd_tx_q =3D (struct bond_tx_queue*)bond_dev->data->tx_queues[q_id]; total_tx_desc +=3D bd_tx_q->nb_tx_desc; } =20 - 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 =3D rte_pktmbuf_pool_create(mem_name, total_tx_desc, RTE_MEMPOOL_CACHE_MAX_SIZE >=3D 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 =3D=3D 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)); } =20 - 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 =3D 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); =20 if (port->rx_ring =3D=3D 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)); } =20 /* 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 =3D 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); =20 if (port->tx_ring =3D=3D 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)); } } =20 int -bond_mode_8023ad_deactivate_slave(struct rte_eth_dev *bond_dev __rte_unuse= d, - uint16_t slave_id) +bond_mode_8023ad_deactivate_child(struct rte_eth_dev *bond_dev __rte_unuse= d, + uint16_t child_id) { void *pkt =3D NULL; struct port *port =3D NULL; uint8_t old_partner_state; =20 - port =3D &bond_mode_8023ad_ports[slave_id]; + port =3D &bond_mode_8023ad_ports[child_id]; =20 ACTOR_STATE_CLR(port, AGGREGATION); port->selected =3D UNSELECTED; @@ -1151,7 +1151,7 @@ bond_mode_8023ad_deactivate_slave(struct rte_eth_dev = *bond_dev __rte_unused, old_partner_state =3D port->partner_state; record_default(port); =20 - bond_mode_8023ad_unregister_lacp_mac(slave_id); + bond_mode_8023ad_unregister_lacp_mac(child_id); =20 /* 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 =3D 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; =20 bond_mode_8023ad_stop(bond_dev); =20 - for (i =3D 0; i < internals->active_slave_count; i++) { - slave_id =3D internals->active_slaves[i]; - slave =3D &bond_mode_8023ad_ports[slave_id]; - rte_eth_macaddr_get(slave_id, &slave_addr); + for (i =3D 0; i < internals->active_child_count; i++) { + child_id =3D internals->active_children[i]; + child =3D &bond_mode_8023ad_ports[child_id]; + rte_eth_macaddr_get(child_id, &child_addr); =20 - if (rte_is_same_ether_addr(&slave_addr, &slave->actor.system)) + if (rte_is_same_ether_addr(&child_addr, &child->actor.system)) continue; =20 - 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 !=3D slave_id) + if (child->aggregator_port_id !=3D child_id) continue; =20 - for (j =3D 0; j < internals->active_slave_count; j++) { - agg_slave =3D &bond_mode_8023ad_ports[internals->active_slaves[j]]; - if (agg_slave->aggregator_port_id =3D=3D slave_id) - SM_FLAG_SET(agg_slave, NTT); + for (j =3D 0; j < internals->active_child_count; j++) { + agg_child =3D &bond_mode_8023ad_ports[internals->active_children[j]]; + if (agg_child->aggregator_port_id =3D=3D child_id) + SM_FLAG_SET(agg_child, NTT); } } =20 @@ -1288,9 +1288,9 @@ bond_mode_8023ad_enable(struct rte_eth_dev *bond_dev) struct bond_dev_private *internals =3D bond_dev->data->dev_private; uint16_t i; =20 - for (i =3D 0; i < internals->active_slave_count; i++) - bond_mode_8023ad_activate_slave(bond_dev, - internals->active_slaves[i]); + for (i =3D 0; i < internals->active_child_count; i++) + bond_mode_8023ad_activate_child(bond_dev, + internals->active_children[i]); =20 return 0; } @@ -1326,10 +1326,10 @@ bond_mode_8023ad_stop(struct rte_eth_dev *bond_dev) =20 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 =3D &internals->mode4; - struct port *port =3D &bond_mode_8023ad_ports[slave_id]; + struct port *port =3D &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_priv= ate *internals, } while (unlikely(retval =3D=3D 0)); =20 m_hdr->marker.tlv_type_marker =3D 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); =20 if (internals->mode4.dedicated_queues.enabled =3D=3D 0) { if (rte_ring_enqueue(port->tx_ring, pkt) !=3D 0) { @@ -1373,10 +1373,10 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_pr= ivate *internals, } } else { /* Send packet directly to the slow queue */ - uint16_t tx_count =3D rte_eth_tx_prepare(slave_id, + uint16_t tx_count =3D rte_eth_tx_prepare(child_id, internals->mode4.dedicated_queues.tx_qid, &pkt, 1); - tx_count =3D rte_eth_tx_burst(slave_id, + tx_count =3D rte_eth_tx_burst(child_id, internals->mode4.dedicated_queues.tx_qid, &pkt, tx_count); if (tx_count !=3D 1) { @@ -1394,7 +1394,7 @@ bond_mode_8023ad_handle_slow_pkt(struct bond_dev_priv= ate *internals, goto free_out; } } else - rx_machine_update(internals, slave_id, pkt); + rx_machine_update(internals, child_id, pkt); } else { wrn =3D WRN_UNKNOWN_SLOW_TYPE; goto free_out; @@ -1477,7 +1477,7 @@ bond_8023ad_setup_validate(uint16_t port_id, return -EINVAL; =20 if (conf !=3D NULL) { - /* Basic sanity check */ + /* Check configuration */ if (conf->slow_periodic_ms =3D=3D 0 || conf->fast_periodic_ms >=3D conf->slow_periodic_ms || conf->long_timeout_ms =3D=3D 0 || @@ -1517,8 +1517,8 @@ rte_eth_bond_8023ad_setup(uint16_t port_id, =20 =20 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, ui= nt16_t slave_id, bond_dev =3D &rte_eth_devices[port_id]; =20 internals =3D bond_dev->data->dev_private; - if (find_slave_by_id(internals->active_slaves, - internals->active_slave_count, slave_id) =3D=3D - internals->active_slave_count) + if (find_child_by_id(internals->active_children, + internals->active_child_count, child_id) =3D=3D + internals->active_child_count) return -EINVAL; =20 - port =3D &bond_mode_8023ad_ports[slave_id]; + port =3D &bond_mode_8023ad_ports[child_id]; info->selected =3D port->selected; =20 info->actor_state =3D port->actor_state; @@ -1550,7 +1550,7 @@ rte_eth_bond_8023ad_slave_info(uint16_t port_id, uint= 16_t slave_id, } =20 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 s= lave_id) return -EINVAL; =20 internals =3D bond_dev->data->dev_private; - if (find_slave_by_id(internals->active_slaves, - internals->active_slave_count, slave_id) =3D=3D - internals->active_slave_count) + if (find_child_by_id(internals->active_children, + internals->active_child_count, child_id) =3D=3D + internals->active_child_count) return -EINVAL; =20 mode4 =3D &internals->mode4; @@ -1578,17 +1578,17 @@ bond_8023ad_ext_validate(uint16_t port_id, uint16_t= slave_id) } =20 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; =20 - res =3D bond_8023ad_ext_validate(port_id, slave_id); + res =3D bond_8023ad_ext_validate(port_id, child_id); if (res !=3D 0) return res; =20 - port =3D &bond_mode_8023ad_ports[slave_id]; + port =3D &bond_mode_8023ad_ports[child_id]; =20 if (enabled) ACTOR_STATE_SET(port, COLLECTING); @@ -1599,17 +1599,17 @@ rte_eth_bond_8023ad_ext_collect(uint16_t port_id, u= int16_t slave_id, } =20 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; =20 - res =3D bond_8023ad_ext_validate(port_id, slave_id); + res =3D bond_8023ad_ext_validate(port_id, child_id); if (res !=3D 0) return res; =20 - port =3D &bond_mode_8023ad_ports[slave_id]; + port =3D &bond_mode_8023ad_ports[child_id]; =20 if (enabled) ACTOR_STATE_SET(port, DISTRIBUTING); @@ -1620,45 +1620,45 @@ rte_eth_bond_8023ad_ext_distrib(uint16_t port_id, u= int16_t slave_id, } =20 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; =20 - err =3D bond_8023ad_ext_validate(port_id, slave_id); + err =3D bond_8023ad_ext_validate(port_id, child_id); if (err !=3D 0) return err; =20 - port =3D &bond_mode_8023ad_ports[slave_id]; + port =3D &bond_mode_8023ad_ports[child_id]; return ACTOR_STATE(port, DISTRIBUTING); } =20 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; =20 - err =3D bond_8023ad_ext_validate(port_id, slave_id); + err =3D bond_8023ad_ext_validate(port_id, child_id); if (err !=3D 0) return err; =20 - port =3D &bond_mode_8023ad_ports[slave_id]; + port =3D &bond_mode_8023ad_ports[child_id]; return ACTOR_STATE(port, COLLECTING); } =20 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; =20 - res =3D bond_8023ad_ext_validate(port_id, slave_id); + res =3D bond_8023ad_ext_validate(port_id, child_id); if (res !=3D 0) return res; =20 - port =3D &bond_mode_8023ad_ports[slave_id]; + port =3D &bond_mode_8023ad_ports[child_id]; =20 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 =3D &internals->mode4; struct port *port; void *pkt =3D NULL; - uint16_t i, slave_id; + uint16_t i, child_id; =20 - for (i =3D 0; i < internals->active_slave_count; i++) { - slave_id =3D internals->active_slaves[i]; - port =3D &bond_mode_8023ad_ports[slave_id]; + for (i =3D 0; i < internals->active_child_count; i++) { + child_id =3D internals->active_children[i]; + port =3D &bond_mode_8023ad_ports[child_id]; =20 if (rte_ring_dequeue(port->rx_ring, &pkt) =3D=3D 0) { struct rte_mbuf *lacp_pkt =3D 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); } } =20 diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bondin= g/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 =20 -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); =20 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); =20 struct lacpdu_actor_partner_params { @@ -141,7 +141,7 @@ struct rte_eth_bond_8023ad_conf { enum rte_bond_8023ad_agg_selection agg_selection; }; =20 -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); =20 #ifdef __cplusplus } #endif =20 /** - * 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); =20 /** - * 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); =20 /** - * 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); =20 /** - * 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); =20 /** * 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); =20 /** - * 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 q= ueue + * programmed on each child to redirect all LACP slow packets to that rx q= ueue * for processing in the LACP state machine, this removes the need to filt= er * 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 fl= ow * filter rule required for rx and have enough queues that one rx and tx q= ueue * 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); =20 /** - * 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/r= te_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) } =20 static uint16_t -calculate_slave(struct bond_dev_private *internals) +calculate_child(struct bond_dev_private *internals) { uint16_t idx; =20 - idx =3D (internals->mode6.last_slave + 1) % internals->active_slave_count; - internals->mode6.last_slave =3D idx; - return internals->active_slaves[idx]; + idx =3D (internals->mode6.last_child + 1) % internals->active_child_count; + internals->mode6.last_child =3D idx; + return internals->active_children[idx]; } =20 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 =3D ALB_NULL_INDEX; + internals->mode6.last_child =3D ALB_NULL_INDEX; internals->mode6.ntt =3D 0; =20 /* 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 =3D=3D 0 || @@ -112,8 +112,8 @@ void bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h= , uint16_t offset, client_info->cli_ip =3D arp->arp_data.arp_sip; rte_ether_addr_copy(&arp->arp_data.arp_sha, &client_info->cli_mac); - client_info->slave_idx =3D calculate_slave(internals); - rte_eth_macaddr_get(client_info->slave_idx, + client_info->child_idx =3D 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, u= int16_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 =3D offset / sizeof(struct rte_vlan_hdr); rte_spinlock_unlock(&internals->mode6.lock); - return client_info->slave_idx; + return client_info->child_idx; } } =20 - /* 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 =3D 1; client_info->ntt =3D 0; client_info->app_ip =3D arp->arp_data.arp_sip; rte_ether_addr_copy(&arp->arp_data.arp_tha, &client_info->cli_mac); client_info->cli_ip =3D arp->arp_data.arp_tip; - client_info->slave_idx =3D calculate_slave(internals); - rte_eth_macaddr_get(client_info->slave_idx, + client_info->child_idx =3D 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 =3D offset / sizeof(struct rte_vlan_hdr); rte_spinlock_unlock(&internals->mode6.lock); - return client_info->slave_idx; + return client_info->child_idx; } =20 /* 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; =20 rte_spinlock_lock(&internals->mode6.lock); eth_h =3D 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 =3D sizeof(uint32_t); arp_h->arp_opcode =3D rte_cpu_to_be_16(RTE_ARP_OP_REPLY); =20 - slave_idx =3D client_info->slave_idx; + child_idx =3D client_info->child_idx; rte_spinlock_unlock(&internals->mode6.lock); =20 - return slave_idx; + return child_idx; } =20 void @@ -252,18 +252,18 @@ bond_mode_alb_client_list_upd(struct rte_eth_dev *bon= d_dev) =20 int i; =20 - /* If active slave count is 0, it's pointless to refresh alb table */ - if (internals->active_slave_count <=3D 0) + /* If active child count is 0, it's pointless to refresh alb table */ + if (internals->active_child_count <=3D 0) return; =20 rte_spinlock_lock(&internals->mode6.lock); - internals->mode6.last_slave =3D ALB_NULL_INDEX; + internals->mode6.last_child =3D ALB_NULL_INDEX; =20 for (i =3D 0; i < ALB_HASH_TABLE_SIZE; i++) { client_info =3D &internals->mode6.client_table[i]; if (client_info->in_use) { - client_info->slave_idx =3D calculate_slave(internals); - rte_eth_macaddr_get(client_info->slave_idx, &client_info->app_mac); + client_info->child_idx =3D calculate_child(internals); + rte_eth_macaddr_get(client_info->child_idx, &client_info->app_mac); internals->mode6.ntt =3D 1; } } diff --git a/drivers/net/bonding/rte_eth_bond_alb.h b/drivers/net/bonding/r= te_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 */ =20 - 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; }; =20 @@ -72,9 +72,9 @@ bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint1= 6_t offset, struct bond_dev_private *internals); =20 /** - * 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, uint1= 6_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, uin= t16_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); =20 /** - * 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/r= te_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) } =20 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) =20 internals =3D eth_dev->data->dev_private; =20 - /* Check if any of slave devices is a bonded device */ - for (i =3D 0; i < internals->slave_count; i++) - if (valid_bonded_port_id(internals->slaves[i].port_id) =3D=3D 0) + /* Check if any of child devices is a bonded device */ + for (i =3D 0; i < internals->child_count; i++) + if (valid_bonded_port_id(internals->children[i].port_id) =3D=3D 0) return 1; =20 return 0; } =20 int -valid_slave_port_id(struct bond_dev_private *internals, uint16_t slave_por= t_id) +valid_child_port_id(struct bond_dev_private *internals, uint16_t child_por= t_id) { - RTE_ETH_VALID_PORTID_OR_ERR_RET(slave_port_id, -1); + RTE_ETH_VALID_PORTID_OR_ERR_RET(child_port_id, -1); =20 - /* Verify that slave_port_id refers to a non bonded port */ - if (check_for_bonded_ethdev(&rte_eth_devices[slave_port_id]) =3D=3D 0 && + /* Verify that child_port_id refers to a non bonded port */ + if (check_for_bonded_ethdev(&rte_eth_devices[child_port_id]) =3D=3D 0 && internals->mode =3D=3D 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; } =20 - if (internals->port_id =3D=3D slave_port_id) { + if (internals->port_id =3D=3D 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; } =20 @@ -79,61 +79,61 @@ valid_slave_port_id(struct bond_dev_private *internals,= uint16_t slave_port_id) } =20 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 =3D eth_dev->data->dev_private; - uint16_t active_count =3D internals->active_slave_count; + uint16_t active_count =3D internals->active_child_count; =20 if (internals->mode =3D=3D BONDING_MODE_8023AD) - bond_mode_8023ad_activate_slave(eth_dev, port_id); + bond_mode_8023ad_activate_child(eth_dev, port_id); =20 if (internals->mode =3D=3D BONDING_MODE_TLB || internals->mode =3D=3D BONDING_MODE_ALB) { =20 - internals->tlb_slaves_order[active_count] =3D port_id; + internals->tlb_children_order[active_count] =3D port_id; } =20 - RTE_ASSERT(internals->active_slave_count < - (RTE_DIM(internals->active_slaves) - 1)); + RTE_ASSERT(internals->active_child_count < + (RTE_DIM(internals->active_children) - 1)); =20 - internals->active_slaves[internals->active_slave_count] =3D port_id; - internals->active_slave_count++; + internals->active_children[internals->active_child_count] =3D port_id; + internals->active_child_count++; =20 if (internals->mode =3D=3D BONDING_MODE_TLB) - bond_tlb_activate_slave(internals); + bond_tlb_activate_child(internals); if (internals->mode =3D=3D BONDING_MODE_ALB) bond_mode_alb_client_list_upd(eth_dev); } =20 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 =3D eth_dev->data->dev_private; - uint16_t active_count =3D internals->active_slave_count; + uint16_t active_count =3D internals->active_child_count; =20 if (internals->mode =3D=3D 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 =3D=3D BONDING_MODE_TLB || internals->mode =3D=3D BONDING_MODE_ALB) bond_tlb_disable(internals); =20 - slave_pos =3D find_slave_by_id(internals->active_slaves, active_count, + child_pos =3D find_child_by_id(internals->active_children, active_count, port_id); =20 - /* 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])); } =20 - RTE_ASSERT(active_count < RTE_DIM(internals->active_slaves)); - internals->active_slave_count =3D active_count; + RTE_ASSERT(active_count < RTE_DIM(internals->active_children)); + internals->active_child_count =3D active_count; =20 if (eth_dev->data->dev_started) { if (internals->mode =3D=3D BONDING_MODE_8023AD) { @@ -192,7 +192,7 @@ rte_eth_bond_free(const char *name) } =20 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 =3D pos + i; =20 - res =3D rte_eth_dev_vlan_filter(slave_port_id, + res =3D 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) } =20 static int -slave_rte_flow_prepare(uint16_t slave_id, struct bond_dev_private *interna= ls) +child_rte_flow_prepare(uint16_t child_id, struct bond_dev_private *interna= ls) { struct rte_flow *flow; struct rte_flow_error ferror; - uint16_t slave_port_id =3D internals->slaves[slave_id].port_id; + uint16_t child_port_id =3D internals->children[child_id].port_id; =20 if (internals->flow_isolated_valid !=3D 0) { - if (rte_eth_dev_stop(slave_port_id) !=3D 0) { + if (rte_eth_dev_stop(child_port_id) !=3D 0) { RTE_BOND_LOG(ERR, "Failed to stop device on port %u", - slave_port_id); + child_port_id); return -1; } =20 - 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] =3D rte_flow_create(slave_port_id, + flow->flows[child_id] =3D rte_flow_create(child_port_id, flow->rule.attr, flow->rule.pattern, flow->rule.actions, &ferror); - if (flow->flows[slave_id] =3D=3D NULL) { - RTE_BOND_LOG(ERR, "Cannot create flow for slave" - " %d: %s", slave_id, + if (flow->flows[child_id] =3D=3D 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] !=3D NULL) { - rte_flow_destroy(slave_port_id, - flow->flows[slave_id], + if (flow->flows[child_id] !=3D NULL) { + rte_flow_destroy(child_port_id, + flow->flows[child_id], &ferror); - flow->flows[slave_id] =3D NULL; + flow->flows[child_id] =3D NULL; } } return -1; @@ -284,7 +284,7 @@ slave_rte_flow_prepare(uint16_t slave_id, struct bond_d= ev_private *internals) } =20 static void -eth_bond_slave_inherit_dev_info_rx_first(struct bond_dev_private *internal= s, +eth_bond_child_inherit_dev_info_rx_first(struct bond_dev_private *internal= s, const struct rte_eth_dev_info *di) { struct rte_eth_rxconf *rxconf_i =3D &internals->default_rxconf; @@ -292,20 +292,20 @@ eth_bond_slave_inherit_dev_info_rx_first(struct bond_= dev_private *internals, internals->reta_size =3D di->reta_size; internals->rss_key_len =3D di->hash_key_size; =20 - /* Inherit Rx offload capabilities from the first slave device */ + /* Inherit Rx offload capabilities from the first child device */ internals->rx_offload_capa =3D di->rx_offload_capa; internals->rx_queue_offload_capa =3D di->rx_queue_offload_capa; internals->flow_type_rss_offloads =3D di->flow_type_rss_offloads; =20 - /* 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 =3D di->max_rx_pktlen; =20 - /* 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)); =20 /* * 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 =3D 0; rxconf_i->rx_thresh.hthresh =3D 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 =3D 0; =20 - /* Disable deferred start by default for all slave devices */ + /* Disable deferred start by default for all child devices */ rxconf_i->rx_deferred_start =3D 0; } =20 static void -eth_bond_slave_inherit_dev_info_tx_first(struct bond_dev_private *internal= s, +eth_bond_child_inherit_dev_info_tx_first(struct bond_dev_private *internal= s, const struct rte_eth_dev_info *di) { struct rte_eth_txconf *txconf_i =3D &internals->default_txconf; =20 - /* Inherit Tx offload capabilities from the first slave device */ + /* Inherit Tx offload capabilities from the first child device */ internals->tx_offload_capa =3D di->tx_offload_capa; internals->tx_queue_offload_capa =3D di->tx_queue_offload_capa; =20 - /* 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)); =20 /* * 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 =3D 0; txconf_i->tx_thresh.hthresh =3D 0; @@ -341,17 +341,17 @@ eth_bond_slave_inherit_dev_info_tx_first(struct bond_= dev_private *internals, =20 /* * 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 =3D 0; txconf_i->tx_rs_thresh =3D 0; =20 - /* Disable deferred start by default for all slave devices */ + /* Disable deferred start by default for all child devices */ txconf_i->tx_deferred_start =3D 0; } =20 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 =3D &internals->default_rxconf; @@ -362,32 +362,32 @@ eth_bond_slave_inherit_dev_info_rx_next(struct bond_d= ev_private *internals, internals->flow_type_rss_offloads &=3D di->flow_type_rss_offloads; =20 /* - * 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 =3D=3D 1) rxconf_i->rx_drop_en =3D 1; =20 /* - * 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 =3D (rxconf_i->offloads | rxconf->offloads) & internals->rx_queue_offload_capa; =20 /* - * 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 =3D 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 =3D di->hash_key_size; } @@ -398,7 +398,7 @@ eth_bond_slave_inherit_dev_info_rx_next(struct bond_dev= _private *internals, } =20 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 =3D &internals->default_txconf; @@ -408,34 +408,34 @@ eth_bond_slave_inherit_dev_info_tx_next(struct bond_d= ev_private *internals, internals->tx_queue_offload_capa &=3D di->tx_queue_offload_capa; =20 /* - * 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 =3D (txconf_i->offloads | txconf->offloads) & internals->tx_queue_offload_capa; } =20 static void -eth_bond_slave_inherit_desc_lim_first(struct rte_eth_desc_lim *bond_desc_l= im, - const struct rte_eth_desc_lim *slave_desc_lim) +eth_bond_child_inherit_desc_lim_first(struct rte_eth_desc_lim *bond_desc_l= im, + 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)); } =20 static int -eth_bond_slave_inherit_desc_lim_next(struct rte_eth_desc_lim *bond_desc_li= m, - const struct rte_eth_desc_lim *slave_desc_lim) +eth_bond_child_inherit_desc_lim_next(struct rte_eth_desc_lim *bond_desc_li= m, + const struct rte_eth_desc_lim *child_desc_lim) { bond_desc_lim->nb_max =3D RTE_MIN(bond_desc_lim->nb_max, - slave_desc_lim->nb_max); + child_desc_lim->nb_max); bond_desc_lim->nb_min =3D RTE_MAX(bond_desc_lim->nb_min, - slave_desc_lim->nb_min); + child_desc_lim->nb_min); bond_desc_lim->nb_align =3D RTE_MAX(bond_desc_lim->nb_align, - slave_desc_lim->nb_align); + child_desc_lim->nb_align); =20 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_d= esc_lim *bond_desc_lim, } =20 /* Treat maximum number of segments equal to 0 as unspecified */ - if (slave_desc_lim->nb_seg_max !=3D 0 && + if (child_desc_lim->nb_seg_max !=3D 0 && (bond_desc_lim->nb_seg_max =3D=3D 0 || - slave_desc_lim->nb_seg_max < bond_desc_lim->nb_seg_max)) - bond_desc_lim->nb_seg_max =3D slave_desc_lim->nb_seg_max; - if (slave_desc_lim->nb_mtu_seg_max !=3D 0 && + child_desc_lim->nb_seg_max < bond_desc_lim->nb_seg_max)) + bond_desc_lim->nb_seg_max =3D child_desc_lim->nb_seg_max; + if (child_desc_lim->nb_mtu_seg_max !=3D 0 && (bond_desc_lim->nb_mtu_seg_max =3D=3D 0 || - slave_desc_lim->nb_mtu_seg_max < bond_desc_lim->nb_mtu_seg_max)) - bond_desc_lim->nb_mtu_seg_max =3D 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 =3D child_desc_lim->nb_mtu_seg_max; =20 return 0; } =20 static int -__eth_bond_slave_add_lock_free(uint16_t bonded_port_id, uint16_t slave_por= t_id) +__eth_bond_child_add_lock_free(uint16_t bonded_port_id, uint16_t child_por= t_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_i= d, uint16_t slave_port_id) bonded_eth_dev =3D &rte_eth_devices[bonded_port_id]; internals =3D bonded_eth_dev->data->dev_private; =20 - if (valid_slave_port_id(internals, slave_port_id) !=3D 0) + if (valid_child_port_id(internals, child_port_id) !=3D 0) return -1; =20 - slave_eth_dev =3D &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 =3D &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; } =20 - ret =3D rte_eth_dev_info_get(slave_port_id, &dev_info); + ret =3D rte_eth_dev_info_get(child_port_id, &dev_info); if (ret !=3D 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)); =20 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; } =20 - slave_add(internals, slave_eth_dev); + child_add(internals, child_eth_dev); =20 - /* We need to store slaves reta_size to be able to synchronize RETA for a= ll - * 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 =3D dev_info.reta_siz= e; + internals->children[internals->child_count].reta_size =3D dev_info.reta_s= ize; =20 - 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; } } =20 - /* Make primary slave */ - internals->primary_port =3D slave_port_id; - internals->current_primary_port =3D slave_port_id; + /* Make primary child */ + internals->primary_port =3D child_port_id; + internals->current_primary_port =3D child_port_id; =20 internals->speed_capa =3D dev_info.speed_capa; =20 - /* Inherit queues settings from first slave */ - internals->nb_rx_queues =3D slave_eth_dev->data->nb_rx_queues; - internals->nb_tx_queues =3D slave_eth_dev->data->nb_tx_queues; + /* Inherit queues settings from first child */ + internals->nb_rx_queues =3D child_eth_dev->data->nb_rx_queues; + internals->nb_tx_queues =3D child_eth_dev->data->nb_tx_queues; =20 - 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); =20 - 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; =20 internals->speed_capa &=3D 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); =20 - ret =3D eth_bond_slave_inherit_desc_lim_next( + ret =3D eth_bond_child_inherit_desc_lim_next( &internals->rx_desc_lim, &dev_info.rx_desc_lim); if (ret !=3D 0) return ret; =20 - ret =3D eth_bond_slave_inherit_desc_lim_next( + ret =3D eth_bond_child_inherit_desc_lim_next( &internals->tx_desc_lim, &dev_info.tx_desc_lim); if (ret !=3D 0) return ret; @@ -552,79 +552,79 @@ __eth_bond_slave_add_lock_free(uint16_t bonded_port_i= d, uint16_t slave_port_id) bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf &=3D internals->flow_type_rss_offloads; =20 - if (slave_rte_flow_prepare(internals->slave_count, internals) !=3D 0) { - RTE_BOND_LOG(ERR, "Failed to prepare new slave flows: port=3D%d", - slave_port_id); + if (child_rte_flow_prepare(internals->child_count, internals) !=3D 0) { + RTE_BOND_LOG(ERR, "Failed to prepare new child flows: port=3D%d", + child_port_id); return -1; } =20 - /* Add additional MAC addresses to the slave */ - if (slave_add_mac_addresses(bonded_eth_dev, slave_port_id) !=3D 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) !=3D 0) { + RTE_BOND_LOG(ERR, "Failed to add mac address(es) to child %hu", + child_port_id); return -1; } =20 - internals->slave_count++; + internals->child_count++; =20 if (bonded_eth_dev->data->dev_started) { - if (slave_configure(bonded_eth_dev, slave_eth_dev) !=3D 0) { - internals->slave_count--; - RTE_BOND_LOG(ERR, "rte_bond_slaves_configure: port=3D%d", - slave_port_id); + if (child_configure(bonded_eth_dev, child_eth_dev) !=3D 0) { + internals->child_count--; + RTE_BOND_LOG(ERR, "rte_bond_children_configure: port=3D%d", + child_port_id); return -1; } - if (slave_start(bonded_eth_dev, slave_eth_dev) !=3D 0) { - internals->slave_count--; - RTE_BOND_LOG(ERR, "rte_bond_slaves_start: port=3D%d", - slave_port_id); + if (child_start(bonded_eth_dev, child_eth_dev) !=3D 0) { + internals->child_count--; + RTE_BOND_LOG(ERR, "rte_bond_children_start: port=3D%d", + child_port_id); return -1; } } =20 - /* Update all slave devices MACs */ - mac_address_slaves_update(bonded_eth_dev); + /* Update all child devices MACs */ + mac_address_children_update(bonded_eth_dev); =20 /* 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); =20 - /* 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 =3D rte_eth_link_get_nowait(slave_port_id, &link_props); + ret =3D 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; } =20 if (link_props.link_status =3D=3D RTE_ETH_LINK_UP) { - if (internals->active_slave_count =3D=3D 0 && + if (internals->active_child_count =3D=3D 0 && !internals->user_defined_primary_port) bond_ethdev_primary_set(internals, - slave_port_id); + child_port_id); } } =20 - /* Add slave details to bonded device */ - slave_eth_dev->data->dev_flags |=3D RTE_ETH_DEV_BONDED_SLAVE; + /* Add child details to bonded device */ + child_eth_dev->data->dev_flags |=3D RTE_ETH_DEV_BONDED_CHILD; =20 - slave_vlan_filter_set(bonded_port_id, slave_port_id); + child_vlan_filter_set(bonded_port_id, child_port_id); =20 return 0; =20 } =20 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, uint1= 6_t slave_port_id) bonded_eth_dev =3D &rte_eth_devices[bonded_port_id]; internals =3D bonded_eth_dev->data->dev_private; =20 - if (valid_slave_port_id(internals, slave_port_id) !=3D 0) + if (valid_child_port_id(internals, child_port_id) !=3D 0) return -1; =20 rte_spinlock_lock(&internals->lock); =20 - retval =3D __eth_bond_slave_add_lock_free(bonded_port_id, slave_port_id); + retval =3D __eth_bond_child_add_lock_free(bonded_port_id, child_port_id); =20 rte_spinlock_unlock(&internals->lock); =20 @@ -650,93 +650,93 @@ rte_eth_bond_slave_add(uint16_t bonded_port_id, uint1= 6_t slave_port_id) } =20 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; =20 bonded_eth_dev =3D &rte_eth_devices[bonded_port_id]; internals =3D bonded_eth_dev->data->dev_private; =20 - if (valid_slave_port_id(internals, slave_port_id) < 0) + if (valid_child_port_id(internals, child_port_id) < 0) return -1; =20 - /* first remove from active slave list */ - slave_idx =3D find_slave_by_id(internals->active_slaves, - internals->active_slave_count, slave_port_id); + /* first remove from active child list */ + child_idx =3D find_child_by_id(internals->active_children, + internals->active_child_count, child_port_id); =20 - 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); =20 - slave_idx =3D -1; - /* now find in slave list */ - for (i =3D 0; i < internals->slave_count; i++) - if (internals->slaves[i].port_id =3D=3D slave_port_id) { - slave_idx =3D i; + child_idx =3D -1; + /* now find in child list */ + for (i =3D 0; i < internals->child_count; i++) + if (internals->children[i].port_id =3D=3D child_port_id) { + child_idx =3D i; break; } =20 - 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; } =20 /* 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); =20 - /* 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)); =20 - /* 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); =20 /* - * 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] !=3D NULL) { - rte_flow_destroy(slave_port_id, flow->flows[slave_idx], + if (flow->flows[child_idx] !=3D NULL) { + rte_flow_destroy(child_port_id, flow->flows[child_idx], &flow_error); - flow->flows[slave_idx] =3D NULL; + flow->flows[child_idx] =3D NULL; } } =20 - slave_eth_dev =3D &rte_eth_devices[slave_port_id]; - slave_remove(internals, slave_eth_dev); - slave_eth_dev->data->dev_flags &=3D (~RTE_ETH_DEV_BONDED_SLAVE); + child_eth_dev =3D &rte_eth_devices[child_port_id]; + child_remove(internals, child_eth_dev); + child_eth_dev->data->dev_flags &=3D (~RTE_ETH_DEV_BONDED_CHILD); =20 - /* 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 =3D=3D slave_port_id) { - if (internals->active_slave_count > 0) - internals->current_primary_port =3D internals->active_slaves[0]; - else if (internals->slave_count > 0) - internals->current_primary_port =3D internals->slaves[0].port_id; + if (internals->current_primary_port =3D=3D child_port_id) { + if (internals->active_child_count > 0) + internals->current_primary_port =3D internals->active_children[0]; + else if (internals->child_count > 0) + internals->current_primary_port =3D internals->children[0].port_id; else internals->primary_port =3D 0; - mac_address_slaves_update(bonded_eth_dev); + mac_address_children_update(bonded_eth_dev); } =20 - 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 =3D=3D 0) { + if (internals->child_count =3D=3D 0) { internals->rx_offload_capa =3D 0; internals->tx_offload_capa =3D 0; internals->rx_queue_offload_capa =3D 0; @@ -750,7 +750,7 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_= id, } =20 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, uint= 16_t slave_port_id) =20 rte_spinlock_lock(&internals->lock); =20 - retval =3D __eth_bond_slave_remove_lock_free(bonded_port_id, slave_port_i= d); + retval =3D __eth_bond_child_remove_lock_free(bonded_port_id, child_port_i= d); =20 rte_spinlock_unlock(&internals->lock); =20 @@ -781,7 +781,7 @@ rte_eth_bond_mode_set(uint16_t bonded_port_id, uint8_t = mode) =20 bonded_eth_dev =3D &rte_eth_devices[bonded_port_id]; =20 - if (check_for_master_bonded_ethdev(bonded_eth_dev) !=3D 0 && + if (check_for_parent_bonded_ethdev(bonded_eth_dev) !=3D 0 && mode =3D=3D BONDING_MODE_8023AD) return -1; =20 @@ -802,7 +802,7 @@ rte_eth_bond_mode_get(uint16_t bonded_port_id) } =20 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; =20 @@ -811,13 +811,13 @@ rte_eth_bond_primary_set(uint16_t bonded_port_id, uin= t16_t slave_port_id) =20 internals =3D rte_eth_devices[bonded_port_id].data->dev_private; =20 - if (valid_slave_port_id(internals, slave_port_id) !=3D 0) + if (valid_child_port_id(internals, child_port_id) !=3D 0) return -1; =20 internals->user_defined_primary_port =3D 1; - internals->primary_port =3D slave_port_id; + internals->primary_port =3D child_port_id; =20 - bond_ethdev_primary_set(internals, slave_port_id); + bond_ethdev_primary_set(internals, child_port_id); =20 return 0; } @@ -832,14 +832,14 @@ rte_eth_bond_primary_get(uint16_t bonded_port_id) =20 internals =3D rte_eth_devices[bonded_port_id].data->dev_private; =20 - if (internals->slave_count < 1) + if (internals->child_count < 1) return -1; =20 return internals->current_primary_port; } =20 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, uint= 16_t slaves[], if (valid_bonded_port_id(bonded_port_id) !=3D 0) return -1; =20 - if (slaves =3D=3D NULL) + if (children =3D=3D NULL) return -1; =20 internals =3D rte_eth_devices[bonded_port_id].data->dev_private; =20 - if (internals->slave_count > len) + if (internals->child_count > len) return -1; =20 - for (i =3D 0; i < internals->slave_count; i++) - slaves[i] =3D internals->slaves[i].port_id; + for (i =3D 0; i < internals->child_count; i++) + children[i] =3D internals->children[i].port_id; =20 - return internals->slave_count; + return internals->child_count; } =20 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 childre= n[], uint16_t len) { struct bond_dev_private *internals; @@ -871,18 +871,18 @@ rte_eth_bond_active_slaves_get(uint16_t bonded_port_i= d, uint16_t slaves[], if (valid_bonded_port_id(bonded_port_id) !=3D 0) return -1; =20 - if (slaves =3D=3D NULL) + if (children =3D=3D NULL) return -1; =20 internals =3D rte_eth_devices[bonded_port_id].data->dev_private; =20 - if (internals->active_slave_count > len) + if (internals->active_child_count > len) return -1; =20 - 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])); =20 - return internals->active_slave_count; + return internals->active_child_count; } =20 int @@ -904,9 +904,9 @@ rte_eth_bond_mac_address_set(uint16_t bonded_port_id, =20 internals->user_defined_mac =3D 1; =20 - /* 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); =20 return 0; } @@ -925,30 +925,30 @@ rte_eth_bond_mac_address_reset(uint16_t bonded_port_i= d) =20 internals->user_defined_mac =3D 0; =20 - 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 =3D 0; slave_port < internals->slave_count; - slave_port++) { - if (internals->slaves[slave_port].port_id =3D=3D + for (child_port =3D 0; child_port < internals->child_count; + child_port++) { + if (internals->children[child_port].port_id =3D=3D internals->primary_port) break; } =20 /* 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) !=3D 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; } =20 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" =20 const char *pmd_bond_init_valid_arguments[] =3D { - 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) } =20 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; =20 if (value =3D=3D NULL || extra_args =3D=3D NULL) return -1; =20 - slave_ports =3D extra_args; + child_ports =3D extra_args; =20 - if (strcmp(key, PMD_BOND_SLAVE_PORT_KVARG) =3D=3D 0) { + if (strcmp(key, PMD_BOND_CHILD_PORT_KVARG) =3D=3D 0) { int port_id =3D 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++] =3D + child_ports->children[child_ports->child_count++] =3D port_id; } return 0; } =20 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; } } =20 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 __r= te_unused, } =20 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; =20 if (value =3D=3D NULL || extra_args =3D=3D NULL) return -1; =20 - primary_slave_port_id =3D parse_port_id(value); - if (primary_slave_port_id < 0) + primary_child_port_id =3D parse_port_id(value); + if (primary_child_port_id < 0) return -1; =20 - *(uint16_t *)extra_args =3D (uint16_t)primary_slave_port_id; + *(uint16_t *)extra_args =3D (uint16_t)primary_child_port_id; =20 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 struc= t rte_flow_attr *attr, int i; int ret; =20 - for (i =3D 0; i < internals->slave_count; i++) { - ret =3D rte_flow_validate(internals->slaves[i].port_id, attr, + for (i =3D 0; i < internals->child_count; i++) { + ret =3D 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 =3D 0; i < internals->slave_count; i++) { - flow->flows[i] =3D rte_flow_create(internals->slaves[i].port_id, + for (i =3D 0; i < internals->child_count; i++) { + flow->flows[i] =3D rte_flow_create(internals->children[i].port_id, attr, patterns, actions, err); if (unlikely(flow->flows[i] =3D=3D 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 struc= t rte_flow_attr *attr, TAILQ_INSERT_TAIL(&internals->flow_list, flow, next); return flow; err: - /* Destroy all slaves flows. */ - for (i =3D 0; i < internals->slave_count; i++) { + /* Destroy all children flows. */ + for (i =3D 0; i < internals->child_count; i++) { if (flow->flows[i] !=3D 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 =3D 0; =20 - for (i =3D 0; i < internals->slave_count; i++) { + for (i =3D 0; i < internals->child_count; i++) { int lret; =20 if (unlikely(flow->flows[i] =3D=3D NULL)) continue; - lret =3D rte_flow_destroy(internals->slaves[i].port_id, + lret =3D rte_flow_destroy(internals->children[i].port_id, flow->flows[i], err); if (unlikely(lret !=3D 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 =3D lret; } @@ -154,7 +154,7 @@ bond_flow_flush(struct rte_eth_dev *dev, struct rte_flo= w_error *err) int ret =3D 0; int lret; =20 - /* 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_flo= w_error *err) ret =3D lret; } if (unlikely(ret !=3D 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; } =20 @@ -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 =3D dev->data->dev_private; - struct rte_flow_query_count slave_count; + struct rte_flow_query_count child_count; int i; int ret; =20 count->bytes =3D 0; count->hits =3D 0; - rte_memcpy(&slave_count, count, sizeof(slave_count)); - for (i =3D 0; i < internals->slave_count; i++) { - ret =3D rte_flow_query(internals->slaves[i].port_id, + rte_memcpy(&child_count, count, sizeof(child_count)); + for (i =3D 0; i < internals->child_count; i++) { + ret =3D rte_flow_query(internals->children[i].port_id, flow->flows[i], action, - &slave_count, err); + &child_count, err); if (unlikely(ret !=3D 0)) { RTE_BOND_LOG(ERR, "Failed to query flow on" - " slave %d: %d", i, ret); + " child %d: %d", i, ret); return ret; } - count->bytes +=3D slave_count.bytes; - count->hits +=3D slave_count.hits; - slave_count.bytes =3D 0; - slave_count.hits =3D 0; + count->bytes +=3D child_count.bytes; + count->hits +=3D child_count.hits; + child_count.bytes =3D 0; + child_count.hits =3D 0; } return 0; } @@ -221,11 +221,11 @@ bond_flow_isolate(struct rte_eth_dev *dev, int set, int i; int ret; =20 - for (i =3D 0; i < internals->slave_count; i++) { - ret =3D rte_flow_isolate(internals->slaves[i].port_id, set, err); + for (i =3D 0; i < internals->child_count; i++) { + ret =3D rte_flow_isolate(internals->children[i].port_id, set, err); if (unlikely(ret !=3D 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 =3D 0; return ret; } diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/r= te_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 **buf= s, uint16_t nb_pkts) struct bond_dev_private *internals; =20 uint16_t num_rx_total =3D 0; - uint16_t slave_count; - uint16_t active_slave; + uint16_t child_count; + uint16_t active_child; int i; =20 /* Cast to structure, containing bonded device's port id and queue id */ struct bond_rx_queue *bd_rx_q =3D (struct bond_rx_queue *)queue; internals =3D bd_rx_q->dev_private; - slave_count =3D internals->active_slave_count; - active_slave =3D bd_rx_q->active_slave; + child_count =3D internals->active_child_count; + active_child =3D bd_rx_q->active_child; =20 - for (i =3D 0; i < slave_count && nb_pkts; i++) { - uint16_t num_rx_slave; + for (i =3D 0; i < child_count && nb_pkts; i++) { + uint16_t num_rx_child; =20 /* Offset of pointer to *bufs increases as packets are received - * from other slaves */ - num_rx_slave =3D - rte_eth_rx_burst(internals->active_slaves[active_slave], + * from other children */ + num_rx_child =3D + rte_eth_rx_burst(internals->active_children[active_child], bd_rx_q->queue_id, bufs + num_rx_total, nb_pkts); - num_rx_total +=3D num_rx_slave; - nb_pkts -=3D num_rx_slave; - if (++active_slave >=3D slave_count) - active_slave =3D 0; + num_rx_total +=3D num_rx_child; + nb_pkts -=3D num_rx_child; + if (++active_child >=3D child_count) + active_child =3D 0; } =20 - if (++bd_rx_q->active_slave >=3D slave_count) - bd_rx_q->active_slave =3D 0; + if (++bd_rx_q->active_child >=3D child_count) + bd_rx_q->active_child =3D 0; return num_rx_total; } =20 @@ -158,8 +158,8 @@ const struct rte_flow_attr flow_attr_8023ad =3D { =20 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 =3D bond_dev->data->dev_private; =20 @@ -177,29 +177,29 @@ bond_ethdev_8023ad_flow_verify(struct rte_eth_dev *bo= nd_dev, } }; =20 - int ret =3D rte_flow_validate(slave_port, &flow_attr_8023ad, + int ret =3D rte_flow_validate(child_port, &flow_attr_8023ad, flow_item_8023ad, actions, &error); if (ret < 0) { - RTE_BOND_LOG(ERR, "%s: %s (slave_port=3D%d queue_id=3D%d)", - __func__, error.message, slave_port, + RTE_BOND_LOG(ERR, "%s: %s (child_port=3D%d queue_id=3D%d)", + __func__, error.message, child_port, internals->mode4.dedicated_queues.rx_qid); return -1; } =20 - ret =3D rte_eth_dev_info_get(slave_port, &slave_info); + ret =3D rte_eth_dev_info_get(child_port, &child_info); if (ret !=3D 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)); =20 return ret; } =20 - 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; } =20 @@ -214,8 +214,8 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_= id) { uint16_t idx; int ret; =20 - /* 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 =3D rte_eth_dev_info_get(bond_dev->data->port_id, &bond_info); if (ret !=3D 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 =3D bond_info.nb_rx_queues; internals->mode4.dedicated_queues.tx_qid =3D bond_info.nb_tx_queues; =20 - for (idx =3D 0; idx < internals->slave_count; idx++) { + for (idx =3D 0; idx < internals->child_count; idx++) { if (bond_ethdev_8023ad_flow_verify(bond_dev, - internals->slaves[idx].port_id) !=3D 0) + internals->children[idx].port_id) !=3D 0) return -1; } } @@ -240,7 +240,7 @@ bond_8023ad_slow_pkt_hw_filter_supported(uint16_t port_= id) { } =20 int -bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t slave_p= ort) { +bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_dev, uint16_t child_p= ort) { =20 struct rte_flow_error error; struct bond_dev_private *internals =3D bond_dev->data->dev_private; @@ -258,12 +258,12 @@ bond_ethdev_8023ad_flow_set(struct rte_eth_dev *bond_= dev, uint16_t slave_port) { } }; =20 - internals->mode4.dedicated_queues.flow[slave_port] =3D rte_flow_create(sl= ave_port, + internals->mode4.dedicated_queues.flow[child_port] =3D rte_flow_create(ch= ild_port, &flow_attr_8023ad, flow_item_8023ad, actions, &error); - if (internals->mode4.dedicated_queues.flow[slave_port] =3D=3D NULL) { + if (internals->mode4.dedicated_queues.flow[child_port] =3D=3D NULL) { RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_set: %s " - "(slave_port=3D%d queue_id=3D%d)", - error.message, slave_port, + "(child_port=3D%d queue_id=3D%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 =3D rte_be_to_cpu_16(RTE_ETHER_TYPE_SLOW); uint16_t num_rx_total =3D 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; =20 - uint8_t collecting; /* current slave collecting status */ + uint8_t collecting; /* current child collecting status */ const uint8_t promisc =3D rte_eth_promiscuous_get(internals->port_id); const uint8_t allmulti =3D 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; =20 - /* 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 =3D internals->active_slave_count; - memcpy(slaves, internals->active_slaves, - sizeof(internals->active_slaves[0]) * slave_count); + child_count =3D internals->active_child_count; + memcpy(children, internals->active_children, + sizeof(internals->active_children[0]) * child_count); =20 - idx =3D bd_rx_q->active_slave; - if (idx >=3D slave_count) { - bd_rx_q->active_slave =3D 0; + idx =3D bd_rx_q->active_child; + if (idx >=3D child_count) { + bd_rx_q->active_child =3D 0; idx =3D 0; } - for (i =3D 0; i < slave_count && num_rx_total < nb_pkts; i++) { + for (i =3D 0; i < child_count && num_rx_total < nb_pkts; i++) { j =3D num_rx_total; - collecting =3D ACTOR_STATE(&bond_mode_8023ad_ports[slaves[idx]], + collecting =3D ACTOR_STATE(&bond_mode_8023ad_ports[children[idx]], COLLECTING); =20 - /* Read packets from this slave */ - num_rx_total +=3D rte_eth_rx_burst(slaves[idx], bd_rx_q->queue_id, + /* Read packets from this child */ + num_rx_total +=3D rte_eth_rx_burst(children[idx], bd_rx_q->queue_id, &bufs[num_rx_total], nb_pkts - num_rx_total); =20 for (k =3D j; k < 2 && k < num_rx_total; k++) @@ -348,7 +348,7 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, ui= nt16_t nb_pkts, =20 /* 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, ui= nt16_t nb_pkts, !allmulti)))) { if (hdr->ether_type =3D=3D 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]); =20 @@ -380,12 +380,12 @@ rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, = uint16_t nb_pkts, } else j++; } - if (unlikely(++idx =3D=3D slave_count)) + if (unlikely(++idx =3D=3D child_count)) idx =3D 0; } =20 - if (++bd_rx_q->active_slave >=3D slave_count) - bd_rx_q->active_slave =3D 0; + if (++bd_rx_q->active_child >=3D child_count) + bd_rx_q->active_child =3D 0; =20 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; =20 - struct rte_mbuf *slave_bufs[RTE_MAX_ETHPORTS][nb_pkts]; - uint16_t slave_nb_pkts[RTE_MAX_ETHPORTS] =3D { 0 }; + struct rte_mbuf *child_bufs[RTE_MAX_ETHPORTS][nb_pkts]; + uint16_t child_nb_pkts[RTE_MAX_ETHPORTS] =3D { 0 }; =20 - uint16_t num_of_slaves; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_children; + uint16_t children[RTE_MAX_ETHPORTS]; =20 - uint16_t num_tx_total =3D 0, num_tx_slave; + uint16_t num_tx_total =3D 0, num_tx_child; =20 - static int slave_idx =3D 0; - int i, cslave_idx =3D 0, tx_fail_total =3D 0; + static int child_idx =3D 0; + int i, cchild_idx =3D 0, tx_fail_total =3D 0; =20 bd_tx_q =3D (struct bond_tx_queue *)queue; internals =3D bd_tx_q->dev_private; =20 - /* 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 =3D internals->active_slave_count; - memcpy(slaves, internals->active_slaves, - sizeof(internals->active_slaves[0]) * num_of_slaves); + num_of_children =3D internals->active_child_count; + memcpy(children, internals->active_children, + sizeof(internals->active_children[0]) * num_of_children); =20 - if (num_of_slaves < 1) + if (num_of_children < 1) return num_tx_total; =20 - /* 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 =3D 0; i < nb_pkts; i++) { - cslave_idx =3D (slave_idx + i) % num_of_slaves; - slave_bufs[cslave_idx][(slave_nb_pkts[cslave_idx])++] =3D bufs[i]; + cchild_idx =3D (child_idx + i) % num_of_children; + child_bufs[cchild_idx][(child_nb_pkts[cchild_idx])++] =3D bufs[i]; } =20 - /* increment current slave index so the next call to tx burst starts on t= he - * next slave */ - slave_idx =3D ++cslave_idx; + /* increment current child index so the next call to tx burst starts on t= he + * next child */ + child_idx =3D ++cchild_idx; =20 - /* Send packet burst on each slave device */ - for (i =3D 0; i < num_of_slaves; i++) { - if (slave_nb_pkts[i] > 0) { - num_tx_slave =3D rte_eth_tx_prepare(slaves[i], - bd_tx_q->queue_id, slave_bufs[i], - slave_nb_pkts[i]); - num_tx_slave =3D 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 =3D 0; i < num_of_children; i++) { + if (child_nb_pkts[i] > 0) { + num_tx_child =3D rte_eth_tx_prepare(children[i], + bd_tx_q->queue_id, child_bufs[i], + child_nb_pkts[i]); + num_tx_child =3D rte_eth_tx_burst(children[i], bd_tx_q->queue_id, + child_bufs[i], num_tx_child); =20 /* if tx burst fails move packets to end of bufs */ - if (unlikely(num_tx_slave < slave_nb_pkts[i])) { - int tx_fail_slave =3D slave_nb_pkts[i] - num_tx_slave; + if (unlikely(num_tx_child < child_nb_pkts[i])) { + int tx_fail_child =3D child_nb_pkts[i] - num_tx_child; =20 - tx_fail_total +=3D tx_fail_slave; + tx_fail_total +=3D tx_fail_child; =20 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 +=3D num_tx_slave; + num_tx_total +=3D num_tx_child; } } =20 @@ -653,7 +653,7 @@ bond_ethdev_tx_burst_active_backup(void *queue, bd_tx_q =3D (struct bond_tx_queue *)queue; internals =3D bd_tx_q->dev_private; =20 - if (internals->active_slave_count < 1) + if (internals->active_child_count < 1) return 0; =20 nb_prep_pkts =3D rte_eth_tx_prepare(internals->current_primary_port, @@ -699,7 +699,7 @@ ipv6_hash(struct rte_ipv6_hdr *ipv6_hdr) =20 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, =20 hash =3D ether_hash(eth_hdr); =20 - slaves[i] =3D (hash ^=3D hash >> 8) % slave_count; + children[i] =3D (hash ^=3D hash >> 8) % child_count; } } =20 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 n= b_pkts, hash ^=3D hash >> 16; hash ^=3D hash >> 8; =20 - slaves[i] =3D hash % slave_count; + children[i] =3D hash % child_count; } } =20 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 n= b_pkts, hash ^=3D hash >> 16; hash ^=3D hash >> 8; =20 - slaves[i] =3D hash % slave_count; + children[i] =3D hash % child_count; } } =20 -struct bwg_slave { +struct bwg_child { uint64_t bwg_left_int; uint64_t bwg_left_remainder; - uint16_t slave; + uint16_t child; }; =20 void -bond_tlb_activate_slave(struct bond_dev_private *internals) { +bond_tlb_activate_child(struct bond_dev_private *internals) { int i; =20 - for (i =3D 0; i < internals->active_slave_count; i++) { - tlb_last_obytets[internals->active_slaves[i]] =3D 0; + for (i =3D 0; i < internals->active_child_count; i++) { + tlb_last_obytets[internals->active_children[i]] =3D 0; } } =20 static int bandwidth_cmp(const void *a, const void *b) { - const struct bwg_slave *bwg_a =3D a; - const struct bwg_slave *bwg_b =3D b; + const struct bwg_child *bwg_a =3D a; + const struct bwg_child *bwg_b =3D b; int64_t diff =3D (int64_t)bwg_b->bwg_left_int - (int64_t)bwg_a->bwg_left_= int; int64_t diff2 =3D (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) =20 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; =20 ret =3D 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 =3D=3D 0) return; link_bwg =3D link_bwg * (update_idx+1) * REORDER_PERIOD_MS; - bwg_slave->bwg_left_int =3D (link_bwg - 1000*load) / link_bwg; - bwg_slave->bwg_left_remainder =3D (link_bwg - 1000*load) % link_bwg; + bwg_child->bwg_left_int =3D (link_bwg - 1000*load) / link_bwg; + bwg_child->bwg_left_remainder =3D (link_bwg - 1000*load) % link_bwg; } =20 static void -bond_ethdev_update_tlb_slave_cb(void *arg) +bond_ethdev_update_tlb_child_cb(void *arg) { struct bond_dev_private *internals =3D 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; =20 uint8_t update_stats =3D 0; - uint16_t slave_id; + uint16_t child_id; uint16_t i; =20 - internals->slave_update_idx++; + internals->child_update_idx++; =20 =20 - if (internals->slave_update_idx >=3D REORDER_PERIOD_MS) + if (internals->child_update_idx >=3D REORDER_PERIOD_MS) update_stats =3D 1; =20 - for (i =3D 0; i < internals->active_slave_count; i++) { - slave_id =3D internals->active_slaves[i]; - rte_eth_stats_get(slave_id, &slave_stats); - tx_bytes =3D 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 =3D slave_id; + for (i =3D 0; i < internals->active_child_count; i++) { + child_id =3D internals->active_children[i]; + rte_eth_stats_get(child_id, &child_stats); + tx_bytes =3D 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 =3D child_id; =20 if (update_stats) { - tlb_last_obytets[slave_id] =3D slave_stats.obytes; + tlb_last_obytets[child_id] =3D child_stats.obytes; } } =20 if (update_stats =3D=3D 1) - internals->slave_update_idx =3D 0; + internals->child_update_idx =3D 0; =20 - slave_count =3D i; - qsort(bwg_array, slave_count, sizeof(bwg_array[0]), bandwidth_cmp); - for (i =3D 0; i < slave_count; i++) - internals->tlb_slaves_order[i] =3D bwg_array[i].slave; + child_count =3D i; + qsort(bwg_array, child_count, sizeof(bwg_array[0]), bandwidth_cmp); + for (i =3D 0; i < child_count; i++) + internals->tlb_children_order[i] =3D bwg_array[i].child; =20 - 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); } =20 @@ -937,29 +937,29 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf= **bufs, uint16_t nb_pkts) uint16_t num_tx_total =3D 0, num_tx_prep; uint16_t i, j; =20 - uint16_t num_of_slaves =3D internals->active_slave_count; - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t num_of_children =3D internals->active_child_count; + uint16_t children[RTE_MAX_ETHPORTS]; =20 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; =20 - if (num_of_slaves < 1) + if (num_of_children < 1) return num_tx_total; =20 - 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); =20 =20 - rte_ether_addr_copy(primary_port->data->mac_addrs, &primary_slave_addr); + rte_ether_addr_copy(primary_port->data->mac_addrs, &primary_child_addr); =20 if (nb_pkts > 3) { for (i =3D 0; i < 3; i++) rte_prefetch0(rte_pktmbuf_mtod(bufs[i], void*)); } =20 - for (i =3D 0; i < num_of_slaves; i++) { - rte_eth_macaddr_get(slaves[i], &active_slave_addr); + for (i =3D 0; i < num_of_children; i++) { + rte_eth_macaddr_get(children[i], &active_child_addr); for (j =3D 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 =3D 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_AL= B_L1) - mode6_debug("TX IPv4:", ether_hdr, slaves[i], &burstnumberTX); + mode6_debug("TX IPv4:", ether_hdr, children[i], &burstnumberTX); #endif } =20 - num_tx_prep =3D rte_eth_tx_prepare(slaves[i], bd_tx_q->queue_id, + num_tx_prep =3D rte_eth_tx_prepare(children[i], bd_tx_q->queue_id, bufs + num_tx_total, nb_pkts - num_tx_total); - num_tx_total +=3D rte_eth_tx_burst(slaves[i], bd_tx_q->queue_id, + num_tx_total +=3D rte_eth_tx_burst(children[i], bd_tx_q->queue_id, bufs + num_tx_total, num_tx_prep); =20 if (num_tx_total =3D=3D 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); } =20 void bond_tlb_enable(struct bond_dev_private *internals) { - bond_ethdev_update_tlb_slave_cb(internals); + bond_ethdev_update_tlb_child_cb(internals); } =20 static uint16_t @@ -1011,11 +1011,11 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mb= uf **bufs, uint16_t nb_pkts) struct client_data *client_info; =20 /* - * 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] =3D { 0 }; + struct rte_mbuf *child_bufs[RTE_MAX_ETHPORTS + 1][nb_pkts]; + uint16_t child_bufs_pkts[RTE_MAX_ETHPORTS + 1] =3D { 0 }; =20 /* * 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) =20 uint16_t num_send, num_not_send =3D 0; uint16_t num_tx_total =3D 0; - uint16_t slave_idx; + uint16_t child_idx; =20 int i, j; =20 @@ -1040,19 +1040,19 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mb= uf **bufs, uint16_t nb_pkts) offset =3D get_vlan_offset(eth_h, ðer_type); =20 if (ether_type =3D=3D rte_cpu_to_be_16(RTE_ETHER_TYPE_ARP)) { - slave_idx =3D bond_mode_alb_arp_xmit(eth_h, offset, internals); + child_idx =3D bond_mode_alb_arp_xmit(eth_h, offset, internals); =20 /* Change src mac in eth header */ - rte_eth_macaddr_get(slave_idx, ð_h->src_addr); + rte_eth_macaddr_get(child_idx, ð_h->src_addr); =20 - /* Add packet to slave tx buffer */ - slave_bufs[slave_idx][slave_bufs_pkts[slave_idx]] =3D bufs[i]; - slave_bufs_pkts[slave_idx]++; + /* Add packet to child tx buffer */ + child_bufs[child_idx][child_bufs_pkts[child_idx]] =3D 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]] =3D + child_bufs[RTE_MAX_ETHPORTS][child_bufs_pkts[RTE_MAX_ETHPORTS]] =3D bufs[i]; - slave_bufs_pkts[RTE_MAX_ETHPORTS]++; + child_bufs_pkts[RTE_MAX_ETHPORTS]++; } } =20 @@ -1062,7 +1062,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf= **bufs, uint16_t nb_pkts) client_info =3D &internals->mode6.client_table[i]; =20 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 =3D rte_pktmbuf_alloc(internals->mode6.mempool); if (upd_pkt =3D=3D NULL) { RTE_BOND_LOG(ERR, @@ -1076,36 +1076,36 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mb= uf **bufs, uint16_t nb_pkts) upd_pkt->data_len =3D pkt_size; upd_pkt->pkt_len =3D pkt_size; =20 - slave_idx =3D bond_mode_alb_arp_upd(client_info, upd_pkt, + child_idx =3D bond_mode_alb_arp_upd(client_info, upd_pkt, internals); =20 /* Add packet to update tx buffer */ - update_bufs[slave_idx][update_bufs_pkts[slave_idx]] =3D upd_pkt; - update_bufs_pkts[slave_idx]++; + update_bufs[child_idx][update_bufs_pkts[child_idx]] =3D upd_pkt; + update_bufs_pkts[child_idx]++; } } internals->mode6.ntt =3D 0; } =20 - /* Send ARP packets on proper slaves */ + /* Send ARP packets on proper children */ for (i =3D 0; i < RTE_MAX_ETHPORTS; i++) { - if (slave_bufs_pkts[i] > 0) { + if (child_bufs_pkts[i] > 0) { num_send =3D 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 =3D rte_eth_tx_burst(i, bd_tx_q->queue_id, - slave_bufs[i], num_send); - for (j =3D 0; j < slave_bufs_pkts[i] - num_send; j++) { + child_bufs[i], num_send); + for (j =3D 0; j < child_bufs_pkts[i] - num_send; j++) { bufs[nb_pkts - 1 - num_not_send - j] =3D - slave_bufs[i][nb_pkts - 1 - j]; + child_bufs[i][nb_pkts - 1 - j]; } =20 num_tx_total +=3D num_send; - num_not_send +=3D slave_bufs_pkts[i] - num_send; + num_not_send +=3D child_bufs_pkts[i] - num_send; =20 #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_AL= B_L1) /* Print TX stats including update packets */ - for (j =3D 0; j < slave_bufs_pkts[i]; j++) { - eth_h =3D rte_pktmbuf_mtod(slave_bufs[i][j], + for (j =3D 0; j < child_bufs_pkts[i]; j++) { + eth_h =3D 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) } } =20 - /* Send update packets on proper slaves */ + /* Send update packets on proper children */ for (i =3D 0; i < RTE_MAX_ETHPORTS; i++) { if (update_bufs_pkts[i] > 0) { num_send =3D rte_eth_tx_prepare(i, bd_tx_q->queue_id, @@ -1134,14 +1134,14 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mb= uf **bufs, uint16_t nb_pkts) } =20 /* 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 =3D 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]); =20 - for (j =3D 0; j < slave_bufs_pkts[RTE_MAX_ETHPORTS]; j++) { + for (j =3D 0; j < child_bufs_pkts[RTE_MAX_ETHPORTS]; j++) { bufs[nb_pkts - 1 - num_not_send - j] =3D - slave_bufs[RTE_MAX_ETHPORTS][nb_pkts - 1 - j]; + child_bufs[RTE_MAX_ETHPORTS][nb_pkts - 1 - j]; } =20 num_tx_total +=3D num_send; @@ -1152,59 +1152,59 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mb= uf **bufs, uint16_t nb_pkts) =20 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 =3D (struct bond_tx_queue *)queue; struct bond_dev_private *internals =3D bd_tx_q->dev_private; =20 - /* 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] =3D { 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] =3D { 0 }; + /* Mapping array generated by hash function to map mbufs to children */ + uint16_t bufs_child_port_idxs[nb_bufs]; =20 - uint16_t slave_tx_count; + uint16_t child_tx_count; uint16_t total_tx_count =3D 0, total_tx_fail_count =3D 0; =20 uint16_t i; =20 /* - * 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); =20 for (i =3D 0; i < nb_bufs; i++) { - /* Populate slave mbuf arrays with mbufs for that slave. */ - uint16_t slave_idx =3D bufs_slave_port_idxs[i]; + /* Populate child mbuf arrays with mbufs for that child. */ + uint16_t child_idx =3D bufs_child_port_idxs[i]; =20 - slave_bufs[slave_idx][slave_nb_bufs[slave_idx]++] =3D bufs[i]; + child_bufs[child_idx][child_nb_bufs[child_idx]++] =3D bufs[i]; } =20 - /* Send packet burst on each slave device */ - for (i =3D 0; i < slave_count; i++) { - if (slave_nb_bufs[i] =3D=3D 0) + /* Send packet burst on each child device */ + for (i =3D 0; i < child_count; i++) { + if (child_nb_bufs[i] =3D=3D 0) continue; =20 - slave_tx_count =3D rte_eth_tx_prepare(slave_port_ids[i], - bd_tx_q->queue_id, slave_bufs[i], - slave_nb_bufs[i]); - slave_tx_count =3D rte_eth_tx_burst(slave_port_ids[i], - bd_tx_q->queue_id, slave_bufs[i], - slave_tx_count); + child_tx_count =3D rte_eth_tx_prepare(child_port_ids[i], + bd_tx_q->queue_id, child_bufs[i], + child_nb_bufs[i]); + child_tx_count =3D rte_eth_tx_burst(child_port_ids[i], + bd_tx_q->queue_id, child_bufs[i], + child_tx_count); =20 - total_tx_count +=3D slave_tx_count; + total_tx_count +=3D child_tx_count; =20 /* If tx burst fails move packets to end of bufs */ - if (unlikely(slave_tx_count < slave_nb_bufs[i])) { - int slave_tx_fail_count =3D slave_nb_bufs[i] - - slave_tx_count; - total_tx_fail_count +=3D slave_tx_fail_count; + if (unlikely(child_tx_count < child_nb_bufs[i])) { + int child_tx_fail_count =3D child_nb_bufs[i] - + child_tx_count; + total_tx_fail_count +=3D 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])); } } =20 @@ -1218,23 +1218,23 @@ bond_ethdev_tx_burst_balance(void *queue, struct rt= e_mbuf **bufs, struct bond_tx_queue *bd_tx_q =3D (struct bond_tx_queue *)queue; struct bond_dev_private *internals =3D bd_tx_q->dev_private; =20 - uint16_t slave_port_ids[RTE_MAX_ETHPORTS]; - uint16_t slave_count; + uint16_t child_port_ids[RTE_MAX_ETHPORTS]; + uint16_t child_count; =20 if (unlikely(nb_bufs =3D=3D 0)) return 0; =20 - /* 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 =3D internals->active_slave_count; - if (unlikely(slave_count < 1)) + child_count =3D internals->active_child_count; + if (unlikely(child_count < 1)) return 0; =20 - 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); } =20 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 =3D (struct bond_tx_queue *)queue; struct bond_dev_private *internals =3D bd_tx_q->dev_private; =20 - uint16_t slave_port_ids[RTE_MAX_ETHPORTS]; - uint16_t slave_count; + uint16_t child_port_ids[RTE_MAX_ETHPORTS]; + uint16_t child_count; =20 - 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; =20 - uint16_t slave_tx_count; + uint16_t child_tx_count; =20 uint16_t i; =20 - /* 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 =3D internals->active_slave_count; - if (unlikely(slave_count < 1)) + child_count =3D internals->active_child_count; + if (unlikely(child_count < 1)) return 0; =20 - 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); =20 if (dedicated_txq) goto skip_tx_ring; =20 /* Check for LACP control packets and send if available */ - for (i =3D 0; i < slave_count; i++) { - struct port *port =3D &bond_mode_8023ad_ports[slave_port_ids[i]]; + for (i =3D 0; i < child_count; i++) { + struct port *port =3D &bond_mode_8023ad_ports[child_port_ids[i]]; struct rte_mbuf *ctrl_pkt =3D NULL; =20 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, =20 if (rte_ring_dequeue(port->tx_ring, (void **)&ctrl_pkt) !=3D -ENOENT) { - slave_tx_count =3D rte_eth_tx_prepare(slave_port_ids[i], + child_tx_count =3D rte_eth_tx_prepare(child_port_ids[i], bd_tx_q->queue_id, &ctrl_pkt, 1); - slave_tx_count =3D rte_eth_tx_burst(slave_port_ids[i], - bd_tx_q->queue_id, &ctrl_pkt, slave_tx_count); + child_tx_count =3D 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 !=3D 1) + if (child_tx_count !=3D 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 =3D=3D 0)) return 0; =20 - dist_slave_count =3D 0; - for (i =3D 0; i < slave_count; i++) { - struct port *port =3D &bond_mode_8023ad_ports[slave_port_ids[i]]; + dist_child_count =3D 0; + for (i =3D 0; i < child_count; i++) { + struct port *port =3D &bond_mode_8023ad_ports[child_port_ids[i]]; =20 if (ACTOR_STATE(port, DISTRIBUTING)) - dist_slave_port_ids[dist_slave_count++] =3D - slave_port_ids[i]; + dist_child_port_ids[dist_child_count++] =3D + child_port_ids[i]; } =20 - if (unlikely(dist_slave_count < 1)) + if (unlikely(dist_child_count < 1)) return 0; =20 - 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); } =20 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; =20 - uint16_t slaves[RTE_MAX_ETHPORTS]; + uint16_t children[RTE_MAX_ETHPORTS]; uint8_t tx_failed_flag =3D 0; - uint16_t num_of_slaves; + uint16_t num_of_children; =20 uint16_t max_nb_of_tx_pkts =3D 0; =20 - int slave_tx_total[RTE_MAX_ETHPORTS]; - int i, most_successful_tx_slave =3D -1; + int child_tx_total[RTE_MAX_ETHPORTS]; + int i, most_successful_tx_child =3D -1; =20 bd_tx_q =3D (struct bond_tx_queue *)queue; internals =3D bd_tx_q->dev_private; =20 - /* 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 =3D internals->active_slave_count; - memcpy(slaves, internals->active_slaves, - sizeof(internals->active_slaves[0]) * num_of_slaves); + num_of_children =3D internals->active_child_count; + memcpy(children, internals->active_children, + sizeof(internals->active_children[0]) * num_of_children); =20 - if (num_of_slaves < 1) + if (num_of_children < 1) return 0; =20 /* It is rare that bond different PMDs together, so just call tx-prepare = once */ - nb_pkts =3D rte_eth_tx_prepare(slaves[0], bd_tx_q->queue_id, bufs, nb_pkt= s); + nb_pkts =3D rte_eth_tx_prepare(children[0], bd_tx_q->queue_id, bufs, nb_p= kts); =20 /* Increment reference count on mbufs */ for (i =3D 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); =20 - /* Transmit burst on each active slave */ - for (i =3D 0; i < num_of_slaves; i++) { - slave_tx_total[i] =3D rte_eth_tx_burst(slaves[i], bd_tx_q->queue_id, + /* Transmit burst on each active child */ + for (i =3D 0; i < num_of_children; i++) { + child_tx_total[i] =3D rte_eth_tx_burst(children[i], bd_tx_q->queue_id, bufs, nb_pkts); =20 - if (unlikely(slave_tx_total[i] < nb_pkts)) + if (unlikely(child_tx_total[i] < nb_pkts)) tx_failed_flag =3D 1; =20 - /* 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 =3D slave_tx_total[i]; - most_successful_tx_slave =3D i; + if (child_tx_total[i] > max_nb_of_tx_pkts) { + max_nb_of_tx_pkts =3D child_tx_total[i]; + most_successful_tx_child =3D i; } } =20 - /* if slaves fail to transmit packets from burst, the calling application + /* if children fail to transmit packets from burst, the calling applicati= on * is not expected to know about multiple references to packets so we must - * handle failures of all packets except those of the most successful sla= ve + * handle failures of all packets except those of the most successful chi= ld */ if (unlikely(tx_failed_flag)) - for (i =3D 0; i < num_of_slaves; i++) - if (i !=3D most_successful_tx_slave) - while (slave_tx_total[i] < nb_pkts) - rte_pktmbuf_free(bufs[slave_tx_total[i]++]); + for (i =3D 0; i < num_of_children; i++) + if (i !=3D most_successful_tx_child) + while (child_tx_total[i] < nb_pkts) + rte_pktmbuf_free(bufs[child_tx_total[i]++]); =20 return max_nb_of_tx_pkts; } =20 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 =3D ethdev->data->dev_private; =20 if (bond_ctx->mode =3D=3D 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 =3D &bond_ctx->mode4.slave_link; + struct rte_eth_link *bond_link =3D &bond_ctx->mode4.child_link; =20 - bond_link->link_autoneg =3D slave_link->link_autoneg; - bond_link->link_duplex =3D slave_link->link_duplex; - bond_link->link_speed =3D slave_link->link_speed; + bond_link->link_autoneg =3D child_link->link_autoneg; + bond_link->link_duplex =3D child_link->link_duplex; + bond_link->link_speed =3D 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, str= uct rte_eth_link *slave_link) =20 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 =3D ethdev->data->dev_private; =20 if (bond_ctx->mode =3D=3D BONDING_MODE_8023AD) { - struct rte_eth_link *bond_link =3D &bond_ctx->mode4.slave_link; + struct rte_eth_link *bond_link =3D &bond_ctx->mode4.child_link; =20 - if (bond_link->link_duplex !=3D slave_link->link_duplex || - bond_link->link_autoneg !=3D slave_link->link_autoneg || - bond_link->link_speed !=3D slave_link->link_speed) + if (bond_link->link_duplex !=3D child_link->link_duplex || + bond_link->link_autoneg !=3D child_link->link_autoneg || + bond_link->link_speed !=3D child_link->link_speed) return -1; } =20 @@ -1480,11 +1480,11 @@ mac_address_set(struct rte_eth_dev *eth_dev, static const struct rte_ether_addr null_mac_addr; =20 /* - * 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; =20 - ret =3D rte_eth_dev_mac_addr_add(slave_port_id, mac_addr, 0); + ret =3D 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, } =20 /* - * 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; =20 - ret =3D rte_eth_dev_mac_addr_remove(slave_port_id, mac_addr); + ret =3D rte_eth_dev_mac_addr_remove(child_port_id, mac_addr); /* save only the first error */ if (ret < 0 && rc =3D=3D 0) rc =3D ret; @@ -1533,26 +1533,26 @@ slave_remove_mac_addresses(struct rte_eth_dev *bond= ed_eth_dev, } =20 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 =3D bonded_eth_dev->data->dev_private; bool set; int i; =20 - /* Update slave devices MAC addresses */ - if (internals->slave_count < 1) + /* Update child devices MAC addresses */ + if (internals->child_count < 1) return -1; =20 switch (internals->mode) { case BONDING_MODE_ROUND_ROBIN: case BONDING_MODE_BALANCE: case BONDING_MODE_BROADCAST: - for (i =3D 0; i < internals->slave_count; i++) { + for (i =3D 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 =3D true; - for (i =3D 0; i < internals->slave_count; i++) { - if (internals->slaves[i].port_id =3D=3D + for (i =3D 0; i < internals->child_count; i++) { + if (internals->children[i].port_id =3D=3D 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 *bonde= d_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, u= int8_t mode) =20 =20 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 =3D 0; struct bond_dev_private *internals =3D bonded_eth_dev->data->dev_private; - struct port *port =3D &bond_mode_8023ad_ports[slave_eth_dev->data->port_i= d]; + struct port *port =3D &bond_mode_8023ad_ports[child_eth_dev->data->port_i= d]; =20 if (port->slow_pool =3D=3D NULL) { char mem_name[256]; - int slave_id =3D slave_eth_dev->data->port_id; + int child_id =3D child_eth_dev->data->port_id; =20 - 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 =3D 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); =20 /* Any memory allocation failure in initialization is critical because * resources can't be free, so reinitialization is impossible. */ if (port->slow_pool =3D=3D 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)); } } =20 if (internals->mode4.dedicated_queues.enabled =3D=3D 1) { /* Configure slow Rx queue */ =20 - errval =3D rte_eth_rx_queue_setup(slave_eth_dev->data->port_id, + errval =3D 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 !=3D 0) { RTE_BOND_LOG(ERR, "rte_eth_rx_queue_setup: port=3D%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; } =20 - errval =3D rte_eth_tx_queue_setup(slave_eth_dev->data->port_id, + errval =3D 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 !=3D 0) { RTE_BOND_LOG(ERR, "rte_eth_tx_queue_setup: port=3D%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, } =20 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, =20 struct bond_dev_private *internals =3D bonded_eth_dev->data->dev_private; =20 - /* Stop slave */ - errval =3D rte_eth_dev_stop(slave_eth_dev->data->port_id); + /* Stop child */ + errval =3D rte_eth_dev_stop(child_eth_dev->data->port_id); if (errval !=3D 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); =20 - /* 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 =3D 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 =3D 1; =20 - /* 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_FLA= G) { /* 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 =3D + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len =3D internals->rss_key_len; - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key =3D + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key =3D internals->rss_key; =20 - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =3D + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =3D bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf; - slave_eth_dev->data->dev_conf.rxmode.mq_mode =3D + child_eth_dev->data->dev_conf.rxmode.mq_mode =3D bonded_eth_dev->data->dev_conf.rxmode.mq_mode; } else { - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len =3D 0; - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key =3D NULL; - slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =3D 0; - slave_eth_dev->data->dev_conf.rxmode.mq_mode =3D + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len =3D 0; + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key =3D NULL; + child_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =3D 0; + child_eth_dev->data->dev_conf.rxmode.mq_mode =3D bonded_eth_dev->data->dev_conf.rxmode.mq_mode; } =20 - slave_eth_dev->data->dev_conf.rxmode.mtu =3D + child_eth_dev->data->dev_conf.rxmode.mtu =3D bonded_eth_dev->data->dev_conf.rxmode.mtu; - slave_eth_dev->data->dev_conf.link_speeds =3D + child_eth_dev->data->dev_conf.link_speeds =3D bonded_eth_dev->data->dev_conf.link_speeds; =20 - slave_eth_dev->data->dev_conf.txmode.offloads =3D + child_eth_dev->data->dev_conf.txmode.offloads =3D bonded_eth_dev->data->dev_conf.txmode.offloads; =20 - slave_eth_dev->data->dev_conf.rxmode.offloads =3D + child_eth_dev->data->dev_conf.rxmode.offloads =3D bonded_eth_dev->data->dev_conf.rxmode.offloads; =20 nb_rx_queues =3D bonded_eth_dev->data->nb_rx_queues; @@ -1775,28 +1775,28 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev, } =20 /* Configure device */ - errval =3D rte_eth_dev_configure(slave_eth_dev->data->port_id, + errval =3D 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 !=3D 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; } =20 - errval =3D rte_eth_dev_set_mtu(slave_eth_dev->data->port_id, + errval =3D rte_eth_dev_set_mtu(child_eth_dev->data->port_id, bonded_eth_dev->data->mtu); if (errval !=3D 0 && errval !=3D -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; } =20 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 =3D 0; struct bond_rx_queue *bd_rx_q; @@ -1809,14 +1809,14 @@ slave_start(struct rte_eth_dev *bonded_eth_dev, for (q_id =3D 0; q_id < bonded_eth_dev->data->nb_rx_queues; q_id++) { bd_rx_q =3D (struct bond_rx_queue *)bonded_eth_dev->data->rx_queues[q_id= ]; =20 - errval =3D rte_eth_rx_queue_setup(slave_eth_dev->data->port_id, q_id, + errval =3D 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 !=3D 0) { RTE_BOND_LOG(ERR, "rte_eth_rx_queue_setup: port=3D%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 =3D 0; q_id < bonded_eth_dev->data->nb_tx_queues; q_id++) { bd_tx_q =3D (struct bond_tx_queue *)bonded_eth_dev->data->tx_queues[q_id= ]; =20 - errval =3D rte_eth_tx_queue_setup(slave_eth_dev->data->port_id, q_id, + errval =3D 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 !=3D 0) { RTE_BOND_LOG(ERR, "rte_eth_tx_queue_setup: port=3D%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; } } =20 if (internals->mode =3D=3D BONDING_MODE_8023AD && internals->mode4.dedicated_queues.enabled =3D=3D 1) { - if (slave_configure_slow_queue(bonded_eth_dev, slave_eth_dev) + if (child_configure_slow_queue(bonded_eth_dev, child_eth_dev) !=3D 0) return errval; =20 errval =3D bond_ethdev_8023ad_flow_verify(bonded_eth_dev, - slave_eth_dev->data->port_id); + child_eth_dev->data->port_id); if (errval !=3D 0) { RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_verify: port=3D%d, err (%d)", - slave_eth_dev->data->port_id, errval); + child_eth_dev->data->port_id, errval); return errval; } =20 - if (internals->mode4.dedicated_queues.flow[slave_eth_dev->data->port_id]= !=3D NULL) { - errval =3D 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]= !=3D NULL) { + errval =3D 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=3D%d, err (%d)= ", - slave_eth_dev->data->port_id, errval); + child_eth_dev->data->port_id, errval); } } =20 /* Start device */ - errval =3D rte_eth_dev_start(slave_eth_dev->data->port_id); + errval =3D rte_eth_dev_start(child_eth_dev->data->port_id); if (errval !=3D 0) { RTE_BOND_LOG(ERR, "rte_eth_dev_start: port=3D%u, err (%d)", - slave_eth_dev->data->port_id, errval); + child_eth_dev->data->port_id, errval); return -1; } =20 if (internals->mode =3D=3D BONDING_MODE_8023AD && internals->mode4.dedicated_queues.enabled =3D=3D 1) { errval =3D bond_ethdev_8023ad_flow_set(bonded_eth_dev, - slave_eth_dev->data->port_id); + child_eth_dev->data->port_id); if (errval !=3D 0) { RTE_BOND_LOG(ERR, "bond_ethdev_8023ad_flow_set: port=3D%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, =20 internals =3D bonded_eth_dev->data->dev_private; =20 - for (i =3D 0; i < internals->slave_count; i++) { - if (internals->slaves[i].port_id =3D=3D slave_eth_dev->data->port_id) { + for (i =3D 0; i < internals->child_count; i++) { + if (internals->children[i].port_id =3D=3D child_eth_dev->data->port_id)= { errval =3D 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 !=3D 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; } } } =20 - /* 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, } =20 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; =20 - for (i =3D 0; i < internals->slave_count; i++) - if (internals->slaves[i].port_id =3D=3D - slave_eth_dev->data->port_id) + for (i =3D 0; i < internals->child_count; i++) + if (internals->children[i].port_id =3D=3D + child_eth_dev->data->port_id) break; =20 - if (i < (internals->slave_count - 1)) { + if (i < (internals->child_count - 1)) { struct rte_flow *flow; =20 - 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] =3D NULL; + (internals->child_count - i - 1)); + flow->flows[internals->child_count - 1] =3D NULL; } } =20 - internals->slave_count--; + internals->child_count--; =20 - /* 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); } =20 static void -bond_ethdev_slave_link_status_change_monitor(void *cb_arg); +bond_ethdev_child_link_status_change_monitor(void *cb_arg); =20 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 =3D - &internals->slaves[internals->slave_count]; + struct bond_child_details *child_details =3D + &internals->children[internals->child_count]; =20 - slave_details->port_id =3D slave_eth_dev->data->port_id; - slave_details->last_link_status =3D 0; + child_details->port_id =3D child_eth_dev->data->port_id; + child_details->last_link_status =3D 0; =20 - /* 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 =3D 1; + if (!(child_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)) { + child_details->link_status_poll_enabled =3D 1; } =20 - slave_details->link_status_wait_to_complete =3D 0; + child_details->link_status_wait_to_complete =3D 0; /* clean tlb_last_obytes when adding port for bonding device */ - memcpy(&(slave_details->persisted_mac_addr), slave_eth_dev->data->mac_add= rs, + memcpy(&(child_details->persisted_mac_addr), child_eth_dev->data->mac_add= rs, sizeof(struct rte_ether_addr)); } =20 void bond_ethdev_primary_set(struct bond_dev_private *internals, - uint16_t slave_port_id) + uint16_t child_port_id) { int i; =20 - if (internals->active_slave_count < 1) - internals->current_primary_port =3D slave_port_id; + if (internals->active_child_count < 1) + internals->current_primary_port =3D child_port_id; else - /* Search bonded device slave ports for new proposed primary port */ - for (i =3D 0; i < internals->active_slave_count; i++) { - if (internals->active_slaves[i] =3D=3D slave_port_id) - internals->current_primary_port =3D slave_port_id; + /* Search bonded device child ports for new proposed primary port */ + for (i =3D 0; i < internals->active_child_count; i++) { + if (internals->active_children[i] =3D=3D child_port_id) + internals->current_primary_port =3D child_port_id; } } =20 @@ -1998,9 +1998,9 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) struct bond_dev_private *internals; int i; =20 - /* 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) =20 internals =3D eth_dev->data->dev_private; =20 - if (internals->slave_count =3D=3D 0) { - RTE_BOND_LOG(ERR, "Cannot start port since there are no slave devices"); + if (internals->child_count =3D=3D 0) { + RTE_BOND_LOG(ERR, "Cannot start port since there are no child devices"); goto out_err; } =20 if (internals->user_defined_mac =3D=3D 0) { struct rte_ether_addr *new_mac_addr =3D NULL; =20 - for (i =3D 0; i < internals->slave_count; i++) - if (internals->slaves[i].port_id =3D=3D internals->primary_port) - new_mac_addr =3D &internals->slaves[i].persisted_mac_addr; + for (i =3D 0; i < internals->child_count; i++) + if (internals->children[i].port_id =3D=3D internals->primary_port) + new_mac_addr =3D &internals->children[i].persisted_mac_addr; =20 if (new_mac_addr =3D=3D NULL) goto out_err; @@ -2042,28 +2042,28 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) } =20 =20 - /* Reconfigure each slave device if starting bonded device */ - for (i =3D 0; i < internals->slave_count; i++) { - struct rte_eth_dev *slave_ethdev =3D - &(rte_eth_devices[internals->slaves[i].port_id]); - if (slave_configure(eth_dev, slave_ethdev) !=3D 0) { + /* Reconfigure each child device if starting bonded device */ + for (i =3D 0; i < internals->child_count; i++) { + struct rte_eth_dev *child_ethdev =3D + &(rte_eth_devices[internals->children[i].port_id]); + if (child_configure(eth_dev, child_ethdev) !=3D 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) !=3D 0) { + if (child_start(eth_dev, child_ethdev) !=3D 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 =3D 1; } =20 @@ -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]); } =20 - /* Update all slave devices MACs*/ - if (mac_address_slaves_update(eth_dev) !=3D 0) + /* Update all child devices MACs*/ + if (mac_address_children_update(eth_dev) !=3D 0) goto out_err; =20 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); =20 /* Discard all messages to/from mode 4 state machines */ - for (i =3D 0; i < internals->active_slave_count; i++) { - port =3D &bond_mode_8023ad_ports[internals->active_slaves[i]]; + for (i =3D 0; i < internals->active_child_count; i++) { + port =3D &bond_mode_8023ad_ports[internals->active_children[i]]; =20 RTE_ASSERT(port->rx_ring !=3D NULL); while (rte_ring_dequeue(port->rx_ring, &pkt) !=3D -ENOENT) @@ -2148,30 +2148,30 @@ bond_ethdev_stop(struct rte_eth_dev *eth_dev) if (internals->mode =3D=3D BONDING_MODE_TLB || internals->mode =3D=3D BONDING_MODE_ALB) { bond_tlb_disable(internals); - for (i =3D 0; i < internals->active_slave_count; i++) - tlb_last_obytets[internals->active_slaves[i]] =3D 0; + for (i =3D 0; i < internals->active_child_count; i++) + tlb_last_obytets[internals->active_children[i]] =3D 0; } =20 eth_dev->data->dev_link.link_status =3D RTE_ETH_LINK_DOWN; eth_dev->data->dev_started =3D 0; =20 internals->link_status_polling_enabled =3D 0; - for (i =3D 0; i < internals->slave_count; i++) { - uint16_t slave_id =3D internals->slaves[i].port_id; + for (i =3D 0; i < internals->child_count; i++) { + uint16_t child_id =3D internals->children[i].port_id; =20 - internals->slaves[i].last_link_status =3D 0; - ret =3D rte_eth_dev_stop(slave_id); + internals->children[i].last_link_status =3D 0; + ret =3D rte_eth_dev_stop(child_id); if (ret !=3D 0) { RTE_BOND_LOG(ERR, "Failed to stop device on port %u", - slave_id); + child_id); return ret; } =20 - /* active slaves need to be deactivated. */ - if (find_slave_by_id(internals->active_slaves, - internals->active_slave_count, slave_id) !=3D - 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) !=3D + internals->active_child_count) + deactivate_child(eth_dev, child_id); } =20 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); =20 - while (internals->slave_count !=3D skipped) { - uint16_t port_id =3D internals->slaves[skipped].port_id; + while (internals->child_count !=3D skipped) { + uint16_t port_id =3D internals->children[skipped].port_id; int ret; =20 ret =3D rte_eth_dev_stop(port_id); @@ -2203,7 +2203,7 @@ bond_ethdev_cfg_cleanup(struct rte_eth_dev *dev, bool= remove) continue; } =20 - if (rte_eth_bond_slave_remove(bond_port_id, port_id) !=3D 0) { + if (rte_eth_bond_child_remove(bond_port_id, port_id) !=3D 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_inf= o) { struct bond_dev_private *internals =3D dev->data->dev_private; - struct bond_slave_details slave; + struct bond_child_details child; int ret; =20 uint16_t max_nb_rx_queues =3D UINT16_MAX; @@ -2259,31 +2259,31 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rt= e_eth_dev_info *dev_info) RTE_ETHER_MAX_JUMBO_FRAME_LEN; =20 /* 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; =20 - for (idx =3D 0; idx < internals->slave_count; idx++) { - slave =3D internals->slaves[idx]; - ret =3D rte_eth_dev_info_get(slave.port_id, &slave_info); + for (idx =3D 0; idx < internals->child_count; idx++) { + child =3D internals->children[idx]; + ret =3D rte_eth_dev_info_get(child.port_id, &child_info); if (ret !=3D 0) { RTE_BOND_LOG(ERR, "%s: Error during getting device (port %u) info: %s\n", __func__, - slave.port_id, + child.port_id, strerror(-ret)); =20 return ret; } =20 - if (slave_info.max_rx_queues < max_nb_rx_queues) - max_nb_rx_queues =3D slave_info.max_rx_queues; + if (child_info.max_rx_queues < max_nb_rx_queues) + max_nb_rx_queues =3D child_info.max_rx_queues; =20 - if (slave_info.max_tx_queues < max_nb_tx_queues) - max_nb_tx_queues =3D slave_info.max_tx_queues; + if (child_info.max_tx_queues < max_nb_tx_queues) + max_nb_tx_queues =3D child_info.max_tx_queues; } } =20 @@ -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 =3D dev->data->dev_private; =20 - /* 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); =20 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); =20 - for (i =3D 0; i < internals->slave_count; i++) { - uint16_t port_id =3D internals->slaves[i].port_id; + for (i =3D 0; i < internals->child_count; i++) { + uint16_t port_id =3D internals->children[i].port_id; =20 res =3D rte_eth_dev_vlan_filter(port_id, vlan_id, on); if (res =3D=3D 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); } =20 @@ -2424,14 +2424,14 @@ bond_ethdev_tx_queue_release(struct rte_eth_dev *de= v, uint16_t queue_id) } =20 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; =20 - /* 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 =3D 1; + int i, polling_child_found =3D 1; =20 if (cb_arg =3D=3D NULL) return; @@ -2443,28 +2443,28 @@ bond_ethdev_slave_link_status_change_monitor(void *= cb_arg) !internals->link_status_polling_enabled) return; =20 - /* 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 =3D 0; + if (internals->child_count > 0) + polling_child_found =3D 0; =20 - for (i =3D 0; i < internals->slave_count; i++) { - if (!internals->slaves[i].link_status_poll_enabled) + for (i =3D 0; i < internals->child_count; i++) { + if (!internals->children[i].link_status_poll_enabled) continue; =20 - slave_ethdev =3D &rte_eth_devices[internals->slaves[i].port_id]; - polling_slave_found =3D 1; + child_ethdev =3D &rte_eth_devices[internals->children[i].port_id]; + polling_child_found =3D 1; =20 - /* 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); =20 /* if link status has changed since last checked then call lsc * event callback */ - if (slave_ethdev->data->dev_link.link_status !=3D - internals->slaves[i].last_link_status) { - bond_ethdev_lsc_event_callback(internals->slaves[i].port_id, + if (child_ethdev->data->dev_link.link_status !=3D + 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); } =20 - 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); } =20 static int @@ -2485,7 +2485,7 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, i= nt wait_to_complete) int (*link_update)(uint16_t port_id, struct rte_eth_link *eth_link); =20 struct bond_dev_private *bond_ctx; - struct rte_eth_link slave_link; + struct rte_eth_link child_link; =20 bool one_link_update_succeeded; uint32_t idx; @@ -2496,7 +2496,7 @@ bond_ethdev_link_update(struct rte_eth_dev *ethdev, i= nt wait_to_complete) ethdev->data->dev_link.link_speed =3D RTE_ETH_SPEED_NUM_NONE; =20 if (ethdev->data->dev_started =3D=3D 0 || - bond_ctx->active_slave_count =3D=3D 0) { + bond_ctx->active_child_count =3D=3D 0) { ethdev->data->dev_link.link_status =3D 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 =3D UINT32_MAX; =20 /** - * 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 =3D 0; idx < bond_ctx->active_slave_count; idx++) { - ret =3D link_update(bond_ctx->active_slaves[idx], - &slave_link); + for (idx =3D 0; idx < bond_ctx->active_child_count; idx++) { + ret =3D link_update(bond_ctx->active_children[idx], + &child_link); if (ret < 0) { ethdev->data->dev_link.link_speed =3D 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; } =20 - if (slave_link.link_speed < + if (child_link.link_speed < ethdev->data->dev_link.link_speed) ethdev->data->dev_link.link_speed =3D - slave_link.link_speed; + child_link.link_speed; } break; case BONDING_MODE_ACTIVE_BACKUP: - /* Current primary slave */ - ret =3D link_update(bond_ctx->current_primary_port, &slave_link); + /* Current primary child */ + ret =3D 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; } =20 - ethdev->data->dev_link.link_speed =3D slave_link.link_speed; + ethdev->data->dev_link.link_speed =3D child_link.link_speed; break; case BONDING_MODE_8023AD: ethdev->data->dev_link.link_autoneg =3D - bond_ctx->mode4.slave_link.link_autoneg; + bond_ctx->mode4.child_link.link_autoneg; ethdev->data->dev_link.link_duplex =3D - 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 =3D RTE_ETH_SPEED_NUM_NONE; one_link_update_succeeded =3D false; =20 - for (idx =3D 0; idx < bond_ctx->active_slave_count; idx++) { - ret =3D link_update(bond_ctx->active_slaves[idx], - &slave_link); + for (idx =3D 0; idx < bond_ctx->active_child_count; idx++) { + ret =3D 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; } =20 one_link_update_succeeded =3D true; ethdev->data->dev_link.link_speed +=3D - slave_link.link_speed; + child_link.link_speed; } =20 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 =3D dev->data->dev_private; - struct rte_eth_stats slave_stats; + struct rte_eth_stats child_stats; int i, j; =20 - for (i =3D 0; i < internals->slave_count; i++) { - rte_eth_stats_get(internals->slaves[i].port_id, &slave_stats); + for (i =3D 0; i < internals->child_count; i++) { + rte_eth_stats_get(internals->children[i].port_id, &child_stats); =20 - stats->ipackets +=3D slave_stats.ipackets; - stats->opackets +=3D slave_stats.opackets; - stats->ibytes +=3D slave_stats.ibytes; - stats->obytes +=3D slave_stats.obytes; - stats->imissed +=3D slave_stats.imissed; - stats->ierrors +=3D slave_stats.ierrors; - stats->oerrors +=3D slave_stats.oerrors; - stats->rx_nombuf +=3D slave_stats.rx_nombuf; + stats->ipackets +=3D child_stats.ipackets; + stats->opackets +=3D child_stats.opackets; + stats->ibytes +=3D child_stats.ibytes; + stats->obytes +=3D child_stats.obytes; + stats->imissed +=3D child_stats.imissed; + stats->ierrors +=3D child_stats.ierrors; + stats->oerrors +=3D child_stats.oerrors; + stats->rx_nombuf +=3D child_stats.rx_nombuf; =20 for (j =3D 0; j < RTE_ETHDEV_QUEUE_STAT_CNTRS; j++) { - stats->q_ipackets[j] +=3D slave_stats.q_ipackets[j]; - stats->q_opackets[j] +=3D slave_stats.q_opackets[j]; - stats->q_ibytes[j] +=3D slave_stats.q_ibytes[j]; - stats->q_obytes[j] +=3D slave_stats.q_obytes[j]; - stats->q_errors[j] +=3D slave_stats.q_errors[j]; + stats->q_ipackets[j] +=3D child_stats.q_ipackets[j]; + stats->q_opackets[j] +=3D child_stats.q_opackets[j]; + stats->q_ibytes[j] +=3D child_stats.q_ibytes[j]; + stats->q_obytes[j] +=3D child_stats.q_obytes[j]; + stats->q_errors[j] +=3D child_stats.q_errors[j]; } =20 } @@ -2638,8 +2638,8 @@ bond_ethdev_stats_reset(struct rte_eth_dev *dev) int err; int ret; =20 - for (i =3D 0, err =3D 0; i < internals->slave_count; i++) { - ret =3D rte_eth_stats_reset(internals->slaves[i].port_id); + for (i =3D 0, err =3D 0; i < internals->child_count; i++) { + ret =3D rte_eth_stats_reset(internals->children[i].port_id); if (ret !=3D 0) err =3D ret; } @@ -2656,15 +2656,15 @@ bond_ethdev_promiscuous_enable(struct rte_eth_dev *= eth_dev) uint16_t port_id; =20 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 =3D 0; + unsigned int child_ok =3D 0; =20 - for (i =3D 0; i < internals->slave_count; i++) { - port_id =3D internals->slaves[i].port_id; + for (i =3D 0; i < internals->child_count; i++) { + port_id =3D internals->children[i].port_id; =20 ret =3D rte_eth_promiscuous_enable(port_id); if (ret !=3D 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 =3D 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 =3D=3D 0) + if (internals->child_count =3D=3D 0) break; port_id =3D internals->current_primary_port; ret =3D rte_eth_promiscuous_enable(port_id); @@ -2710,20 +2710,20 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev = *dev) uint16_t port_id; =20 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 =3D 0; + unsigned int child_ok =3D 0; =20 - for (i =3D 0; i < internals->slave_count; i++) { - port_id =3D internals->slaves[i].port_id; + for (i =3D 0; i < internals->child_count; i++) { + port_id =3D internals->children[i].port_id; =20 if (internals->mode =3D=3D BONDING_MODE_8023AD && bond_mode_8023ad_ports[port_id].forced_rx_flags =3D=3D BOND_8023AD_FORCED_PROMISC) { - slave_ok++; + child_ok++; continue; } ret =3D 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 =3D 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 =3D=3D 0) + if (internals->child_count =3D=3D 0) break; port_id =3D internals->current_primary_port; ret =3D rte_eth_promiscuous_disable(port_id); @@ -2772,7 +2772,7 @@ bond_ethdev_promiscuous_update(struct rte_eth_dev *de= v) 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 *de= v) 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) =3D=3D 1) @@ -2803,15 +2803,15 @@ bond_ethdev_allmulticast_enable(struct rte_eth_dev = *eth_dev) uint16_t port_id; =20 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 =3D 0; + unsigned int child_ok =3D 0; =20 - for (i =3D 0; i < internals->slave_count; i++) { - port_id =3D internals->slaves[i].port_id; + for (i =3D 0; i < internals->child_count; i++) { + port_id =3D internals->children[i].port_id; =20 ret =3D rte_eth_allmulticast_enable(port_id); if (ret !=3D 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 =3D 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 =3D=3D 0) + if (internals->child_count =3D=3D 0) break; port_id =3D internals->current_primary_port; ret =3D rte_eth_allmulticast_enable(port_id); @@ -2857,15 +2857,15 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev= *eth_dev) uint16_t port_id; =20 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 =3D 0; + unsigned int child_ok =3D 0; =20 - for (i =3D 0; i < internals->slave_count; i++) { - uint16_t port_id =3D internals->slaves[i].port_id; + for (i =3D 0; i < internals->child_count; i++) { + uint16_t port_id =3D internals->children[i].port_id; =20 if (internals->mode =3D=3D BONDING_MODE_8023AD && bond_mode_8023ad_ports[port_id].forced_rx_flags =3D=3D @@ -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 =3D 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 =3D=3D 0) + if (internals->child_count =3D=3D 0) break; port_id =3D internals->current_primary_port; ret =3D rte_eth_allmulticast_disable(port_id); @@ -2918,7 +2918,7 @@ bond_ethdev_allmulticast_update(struct rte_eth_dev *d= ev) 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 *d= ev) 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) =3D=3D 1) @@ -2961,8 +2961,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum= rte_eth_event_type type, int ret; =20 uint8_t lsc_flag =3D 0; - int valid_slave =3D 0; - uint16_t active_pos, slave_idx; + int valid_child =3D 0; + uint16_t active_pos, child_idx; uint16_t i; =20 if (type !=3D RTE_ETH_EVENT_INTR_LSC || param =3D=3D NULL) @@ -2979,62 +2979,62 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, en= um rte_eth_event_type type, if (!bonded_eth_dev->data->dev_started) return rc; =20 - /* verify that port_id is a valid slave of bonded port */ - for (i =3D 0; i < internals->slave_count; i++) { - if (internals->slaves[i].port_id =3D=3D port_id) { - valid_slave =3D 1; - slave_idx =3D i; + /* verify that port_id is a valid child of bonded port */ + for (i =3D 0; i < internals->child_count; i++) { + if (internals->children[i].port_id =3D=3D port_id) { + valid_child =3D 1; + child_idx =3D i; break; } } =20 - if (!valid_slave) + if (!valid_child) return rc; =20 /* 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); =20 /* Search for port in active port list */ - active_pos =3D find_slave_by_id(internals->active_slaves, - internals->active_slave_count, port_id); + active_pos =3D find_child_by_id(internals->active_children, + internals->active_child_count, port_id); =20 ret =3D 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); =20 if (ret =3D=3D 0 && link.link_status) { - if (active_pos < internals->active_slave_count) + if (active_pos < internals->active_child_count) goto link_update; =20 /* check link state properties if bonded link is up*/ if (bonded_eth_dev->data->dev_link.link_status =3D=3D RTE_ETH_LINK_UP) { if (link_properties_valid(bonded_eth_dev, &link) !=3D 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); } =20 - /* 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 =3D RTE_ETH_LINK_UP; internals->current_primary_port =3D port_id; lsc_flag =3D 1; =20 - 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); } =20 - activate_slave(bonded_eth_dev, port_id); + activate_child(bonded_eth_dev, port_id); =20 /* 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, en= um rte_eth_event_type type, internals->primary_port =3D=3D port_id) bond_ethdev_primary_set(internals, port_id); } else { - if (active_pos =3D=3D internals->active_slave_count) + if (active_pos =3D=3D internals->active_child_count) goto link_update; =20 - /* Remove from active slave list */ - deactivate_slave(bonded_eth_dev, port_id); + /* Remove from active child list */ + deactivate_child(bonded_eth_dev, port_id); =20 - if (internals->active_slave_count < 1) + if (internals->active_child_count < 1) lsc_flag =3D 1; =20 - /* 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 =3D=3D 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 =3D 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, en= um 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 =3D link.link_status; + internals->children[child_idx].last_link_status =3D link.link_status; =20 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 =3D 0; - int slave_reta_size; + int child_reta_size; unsigned reta_count; struct bond_dev_private *internals =3D dev->data->dev_private; =20 @@ -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); =20 - /* Propagate RETA over slaves */ - for (i =3D 0; i < internals->slave_count; i++) { - slave_reta_size =3D internals->slaves[i].reta_size; - result =3D rte_eth_dev_rss_reta_update(internals->slaves[i].port_id, - &internals->reta_conf[0], slave_reta_size); + /* Propagate RETA over children */ + for (i =3D 0; i < internals->child_count; i++) { + child_reta_size =3D internals->children[i].reta_size; + result =3D 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 =3D internals->rss_key_len; } =20 - for (i =3D 0; i < internals->slave_count; i++) { - result =3D rte_eth_dev_rss_hash_update(internals->slaves[i].port_id, + for (i =3D 0; i < internals->child_count; i++) { + result =3D 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 *d= ev, 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 =3D dev->data->dev_private; int ret, i; =20 rte_spinlock_lock(&internals->lock); =20 - for (i =3D 0; i < internals->slave_count; i++) { - slave_eth_dev =3D &rte_eth_devices[internals->slaves[i].port_id]; - if (*slave_eth_dev->dev_ops->mtu_set =3D=3D NULL) { + for (i =3D 0; i < internals->child_count; i++) { + child_eth_dev =3D &rte_eth_devices[internals->children[i].port_id]; + if (*child_eth_dev->dev_ops->mtu_set =3D=3D NULL) { rte_spinlock_unlock(&internals->lock); return -ENOTSUP; } } - for (i =3D 0; i < internals->slave_count; i++) { - ret =3D rte_eth_dev_set_mtu(internals->slaves[i].port_id, mtu); + for (i =3D 0; i < internals->child_count; i++) { + ret =3D 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 =3D dev->data->dev_private; int ret, i; =20 rte_spinlock_lock(&internals->lock); =20 - for (i =3D 0; i < internals->slave_count; i++) { - slave_eth_dev =3D &rte_eth_devices[internals->slaves[i].port_id]; - if (*slave_eth_dev->dev_ops->mac_addr_add =3D=3D NULL || - *slave_eth_dev->dev_ops->mac_addr_remove =3D=3D NULL) { + for (i =3D 0; i < internals->child_count; i++) { + child_eth_dev =3D &rte_eth_devices[internals->children[i].port_id]; + if (*child_eth_dev->dev_ops->mac_addr_add =3D=3D NULL || + *child_eth_dev->dev_ops->mac_addr_remove =3D=3D NULL) { ret =3D -ENOTSUP; goto end; } } =20 - for (i =3D 0; i < internals->slave_count; i++) { - ret =3D rte_eth_dev_mac_addr_add(internals->slaves[i].port_id, + for (i =3D 0; i < internals->child_count; i++) { + ret =3D rte_eth_dev_mac_addr_add(internals->children[i].port_id, mac_addr, vmdq); if (ret < 0) { /* rollback */ for (i--; i >=3D 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 =3D dev->data->dev_private; int i; =20 rte_spinlock_lock(&internals->lock); =20 - for (i =3D 0; i < internals->slave_count; i++) { - slave_eth_dev =3D &rte_eth_devices[internals->slaves[i].port_id]; - if (*slave_eth_dev->dev_ops->mac_addr_remove =3D=3D NULL) + for (i =3D 0; i < internals->child_count; i++) { + child_eth_dev =3D &rte_eth_devices[internals->children[i].port_id]; + if (*child_eth_dev->dev_ops->mac_addr_remove =3D=3D NULL) goto end; } =20 struct rte_ether_addr *mac_addr =3D &dev->data->mac_addrs[index]; =20 - for (i =3D 0; i < internals->slave_count; i++) - rte_eth_dev_mac_addr_remove(internals->slaves[i].port_id, + for (i =3D 0; i < internals->child_count; i++) + rte_eth_dev_mac_addr_remove(internals->children[i].port_id, mac_addr); =20 end: @@ -3402,30 +3402,30 @@ dump_basic(const struct rte_eth_dev *dev, FILE *f) fprintf(f, "\n"); } =20 - if (internals->slave_count > 0) { - fprintf(f, "\tSlaves (%u): [", internals->slave_count); - for (i =3D 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 =3D 0; i < internals->child_count - 1; i++) + fprintf(f, "%u ", internals->children[i].port_id); =20 - fprintf(f, "%u]\n", internals->slaves[internals->slave_count - 1].port_i= d); + fprintf(f, "%u]\n", internals->children[internals->child_count - 1].port= _id); } else { - fprintf(f, "\tSlaves: []\n"); + fprintf(f, "\tChilds: []\n"); } =20 - if (internals->active_slave_count > 0) { - fprintf(f, "\tActive Slaves (%u): [", internals->active_slave_count); - for (i =3D 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 =3D 0; i < internals->active_child_count - 1; i++) + fprintf(f, "%u ", internals->active_children[i]); =20 - fprintf(f, "%u]\n", internals->active_slaves[internals->active_slave_cou= nt - 1]); + fprintf(f, "%u]\n", internals->active_children[internals->active_child_c= ount - 1]); =20 } else { - fprintf(f, "\tActive Slaves: []\n"); + fprintf(f, "\tActive Childs: []\n"); } =20 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); } =20 @@ -3471,7 +3471,7 @@ dump_lacp_port_param(const struct port_params *params= , FILE *f) } =20 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] =3D { 0 }; char p_state[256] =3D { 0 }; @@ -3520,18 +3520,18 @@ dump_lacp_slave(const struct rte_eth_bond_8023ad_sl= ave_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; =20 fprintf(f, " - Lacp info:\n"); =20 - num_active_slaves =3D rte_eth_bond_active_slaves_get(port_id, slaves, + num_active_children =3D rte_eth_bond_active_children_get(port_id, childre= n, 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); =20 - for (i =3D 0; i < num_active_slaves; i++) { - ret =3D rte_eth_bond_8023ad_slave_info(port_id, slaves[i], - &slave_info); + for (i =3D 0; i < num_active_children; i++) { + ret =3D 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); } } =20 @@ -3655,8 +3655,8 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) internals->link_down_delay_ms =3D 0; internals->link_up_delay_ms =3D 0; =20 - internals->slave_count =3D 0; - internals->active_slave_count =3D 0; + internals->child_count =3D 0; + internals->active_child_count =3D 0; internals->rx_offload_capa =3D 0; internals->tx_offload_capa =3D 0; internals->rx_queue_offload_capa =3D 0; @@ -3684,8 +3684,8 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) internals->rx_desc_lim.nb_align =3D 1; internals->tx_desc_lim.nb_align =3D 1; =20 - 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)); =20 TAILQ_INIT(&internals->flow_list); internals->flow_isolated_valid =3D 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) =3D=3D 1) { if (rte_kvargs_process(kvlist, PMD_BOND_MODE_KVARG, - &bond_ethdev_parse_slave_mode_kvarg, + &bond_ethdev_parse_child_mode_kvarg, &bonding_mode) !=3D 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) =3D=3D 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) !=3D 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 =3D=3D &dev->device); =20 internals =3D eth_dev->data->dev_private; - if (internals->slave_count !=3D 0) + if (internals->child_count !=3D 0) return -EBUSY; =20 if (eth_dev->data->dev_started =3D=3D 1) { @@ -3877,7 +3877,7 @@ bond_remove(struct rte_vdev_device *dev) return ret; } =20 -/* this part will resolve the slave portids after all the other pdev and v= dev +/* this part will resolve the child portids after all the other pdev and v= dev * 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)) =3D=3D 0) { - RTE_BOND_LOG(ERR, "the fixed speed is not supported by all slave device= s."); + RTE_BOND_LOG(ERR, "the fixed speed is not supported by all child device= s."); return -EINVAL; } /* @@ -4041,7 +4041,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) if (rte_kvargs_count(kvlist, PMD_BOND_AGG_MODE_KVARG) =3D=3D 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) !=3D 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) } } =20 - /* 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; =20 - memset(&slave_ports, 0, sizeof(slave_ports)); + memset(&child_ports, 0, sizeof(child_ports)); =20 - if (rte_kvargs_process(kvlist, PMD_BOND_SLAVE_PORT_KVARG, - &bond_ethdev_parse_slave_port_kvarg, &slave_ports) !=3D 0) { + if (rte_kvargs_process(kvlist, PMD_BOND_CHILD_PORT_KVARG, + &bond_ethdev_parse_child_port_kvarg, &child_ports) !=3D 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; } =20 - for (i =3D 0; i < slave_ports.slave_count; i++) { - if (rte_eth_bond_slave_add(port_id, slave_ports.slaves[i]) !=3D 0) { + for (i =3D 0; i < child_ports.child_count; i++) { + if (rte_eth_bond_child_add(port_id, child_ports.children[i]) !=3D 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); } } =20 } 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; } =20 - /* Parse/set primary slave port id*/ - arg_count =3D rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_SLAVE_KVARG); + /* Parse/set primary child port id*/ + arg_count =3D rte_kvargs_count(kvlist, PMD_BOND_PRIMARY_CHILD_KVARG); if (arg_count =3D=3D 1) { - uint16_t primary_slave_port_id; + uint16_t primary_child_port_id; =20 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; } =20 /* 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) !=3D 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; } =20 - /* configure slaves so we can pass mtu setting */ - for (i =3D 0; i < internals->slave_count; i++) { - struct rte_eth_dev *slave_ethdev =3D - &(rte_eth_devices[internals->slaves[i].port_id]); - if (slave_configure(dev, slave_ethdev) !=3D 0) { + /* configure children so we can pass mtu setting */ + for (i =3D 0; i < internals->child_count; i++) { + struct rte_eth_dev *child_ethdev =3D + &(rte_eth_devices[internals->children[i].port_id]); + if (child_configure(dev, child_ethdev) !=3D 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); =20 RTE_PMD_REGISTER_PARAM_STRING(net_bonding, - "slave=3D " + "child=3D " "primary=3D " "mode=3D[0-6] " "xmit_policy=3D[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 { =20 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; =20 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)) =20 -uint16_t slaves[RTE_MAX_ETHPORTS]; -uint16_t slaves_count; +uint16_t children[RTE_MAX_ETHPORTS]; +uint16_t children_count; =20 static uint16_t BOND_PORT =3D 0xffff; =20 @@ -128,7 +128,7 @@ static struct rte_eth_conf port_conf =3D { }; =20 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 =3D 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=3D%d)\n", BOND_PORT, retval); =20 - for (i =3D 0; i < slaves_count; i++) { - if (rte_eth_bond_slave_add(BOND_PORT, slaves[i]) =3D=3D -1) - rte_exit(-1, "Oooops! adding slave (%u) to bond (%u) failed!\n", - slaves[i], BOND_PORT); + for (i =3D 0; i < children_count; i++) { + if (rte_eth_bond_child_add(BOND_PORT, children[i]) =3D=3D -1) + rte_exit(-1, "Oooops! adding child (%u) to bond (%u) failed!\n", + children[i], BOND_PORT); =20 } =20 @@ -283,18 +283,18 @@ bond_port_init(struct rte_mempool *mbuf_pool) if (retval < 0) rte_exit(retval, "Start port %d failed (res=3D%d)", BOND_PORT, retval); =20 - printf("Waiting for slaves to become active..."); + printf("Waiting for children to become active..."); while (wait_counter) { - uint16_t act_slaves[16] =3D {0}; - if (rte_eth_bond_active_slaves_get(BOND_PORT, act_slaves, 16) =3D=3D - slaves_count) { + uint16_t act_children[16] =3D {0}; + if (rte_eth_bond_active_children_get(BOND_PORT, act_children, 16) =3D=3D + children_count) { printf("\n"); break; } sleep(1); printf("..."); if (--wait_counter =3D=3D 0) - rte_exit(-1, "\nFailed to activate slaves\n"); + rte_exit(-1, "\nFailed to activate children\n"); } =20 retval =3D rte_eth_promiscuous_enable(BOND_PORT); @@ -631,7 +631,7 @@ static void cmd_help_parsed(__rte_unused void *parsed_r= esult, "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] =3D {0}; + uint16_t children[16] =3D {0}; uint8_t len =3D 16; struct rte_ether_addr addr; uint16_t i; int ret; =20 - for (i =3D 0; i < slaves_count; i++) { + for (i =3D 0; i < children_count; i++) { ret =3D rte_eth_macaddr_get(i, &addr); if (ret !=3D 0) { cmdline_printf(cl, @@ -763,9 +763,9 @@ static void cmd_show_parsed(__rte_unused void *parsed_r= esult, =20 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"); =20 /* initialize all ports */ - slaves_count =3D nb_ports; + children_count =3D nb_ports; RTE_ETH_FOREACH_DEV(i) { - slave_port_init(i, mbuf_pool); - slaves[i] =3D i; + child_port_init(i, mbuf_pool); + children[i] =3D i; } =20 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 */ --=20 2.39.2 --MP_/U=9tSJT/TL8p.c.S3uxGZmH--