net/bonding: replace master/slave to main/member
Subsystems (2)
PATCH 1/1 net/bonding: replace master/slave to main/member
From: Long Wu <[email protected]>
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.
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.
Also the macro RTE_ETH_DEV_BONDED_SLAVE was renamed to RTE_ETH_DEV_BONDED_MEMBER.
--- app/test-pmd/testpmd.c | 112 +- app/test-pmd/testpmd.h | 8 +- app/test/test_link_bonding.c | 2792 +++++++++-------- app/test/test_link_bonding_mode4.c | 588 ++-- app/test/test_link_bonding_rssconf.c | 166 +- doc/guides/prog_guide/img/bond-mode-1.svg | 2 +- .../link_bonding_poll_mode_drv_lib.rst | 222 +- drivers/net/bonding/bonding_testpmd.c | 178 +- drivers/net/bonding/eth_bond_8023ad_private.h | 40 +- drivers/net/bonding/eth_bond_private.h | 108 +- drivers/net/bonding/rte_eth_bond.h | 92 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 372 +-- drivers/net/bonding/rte_eth_bond_8023ad.h | 67 +- 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 | 474 +-- 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 | 1384 ++++---- drivers/net/bonding/version.map | 15 +- examples/bond/main.c | 40 +- lib/ethdev/rte_ethdev.h | 4 +- 22 files changed, 3446 insertions(+), 3368 deletions(-)
app/test-pmd/testpmd.c +56 -56
@@ -588,27 +588,27 @@ eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, }static int -change_bonding_slave_port_status (portid_t bond_pid,bool is_stop) +change_bonding_member_port_status (portid_t bond_pid,bool is_stop) {#ifdef RTE_NET_BOND -portid_t slave_pids[RTE_MAX_ETHPORTS ]; +portid_t member_pids[RTE_MAX_ETHPORTS ];struct rte_port *port; -int num_slaves; -portid_t slave_pid; +int num_members; +portid_t member_pid;int i; - num_slaves =rte_eth_bond_slaves_get (bond_pid, slave_pids, + num_members =rte_eth_bond_members_get (bond_pid, member_pids,RTE_MAX_ETHPORTS ); -if (num_slaves <0 ) { -fprintf (stderr,"Failed to get slave list for port = %u\n" , +if (num_members <0 ) { +fprintf (stderr,"Failed to get member list for port = %u\n" , bond_pid); -return num_slaves; +return num_members; } -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; - port = &ports[slave_pid]; +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; + port = &ports[member_pid]; port->port_status = is_stop ?RTE_PORT_STOPPED :RTE_PORT_STARTED ; }
@@ -632,12 +632,12 @@ eth_dev_start_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Starting a bonded port also starts all slaves under the bonded +* Starting a bonded port also starts all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, false); +return change_bonding_member_port_status (port_id, false); }return 0 ;
@@ -656,12 +656,12 @@ eth_dev_stop_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Stopping a bonded port also stops all slaves under the bonded +* Stopping a bonded port also stops all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, true); +return change_bonding_member_port_status (port_id, true); }return 0 ;
@@ -2610,7 +2610,7 @@ all_ports_started(void) port = &ports[pi];/* Check if there is a port which is not started */ if ((port->port_status !=RTE_PORT_STARTED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ; }
@@ -2624,7 +2624,7 @@ port_is_stopped(portid_t port_id)struct rte_port *port = &ports[port_id];if ((port->port_status !=RTE_PORT_STOPPED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ;return 1 ; }
@@ -2970,8 +2970,8 @@ fill_xstats_display_info(void)/* * Some capabilities (like, rx_offload_capa and tx_offload_capa) of bonding -* device in dev_info is zero when no slave is added. And its capability -* will be updated when add a new slave device. So adding a slave device need +* device in dev_info is zero when no member is added. And its capability +* will be updated when add a new member device. So adding a member device need * to update the port configurations of bonding device. */ static void
@@ -3028,7 +3028,7 @@ start_port(portid_t pid)if (pid != pi && pid != (portid_t )RTE_PORT_ALL )continue ; -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3350,7 +3350,7 @@ stop_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3439,28 +3439,28 @@ flush_port_owned_resources(portid_t pi) }static void -clear_bonding_slave_device (portid_t *slave_pids,uint16_t num_slaves) +clear_bonding_member_device (portid_t *member_pids,uint16_t num_members) {struct rte_port *port; -portid_t slave_pid; +portid_t member_pid;uint16_t i; -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; -if (port_is_started (slave_pid) ==1 ) { -if (rte_eth_dev_stop (slave_pid) !=0 ) +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; +if (port_is_started (member_pid) ==1 ) { +if (rte_eth_dev_stop (member_pid) !=0 )fprintf (stderr,"rte_eth_dev_stop failed for port %u\n" , - slave_pid); + member_pid); - port = &ports[slave_pid]; + port = &ports[member_pid]; port->port_status =RTE_PORT_STOPPED ; } -clear_port_slave_flag (slave_pid); +clear_port_member_flag (member_pid); -/* Close slave device when testpmd quit or is killed. */ +/* Close member device when testpmd quit or is killed. */ if (cl_quit ==1 || f_quit ==1 ) -rte_eth_dev_close (slave_pid); +rte_eth_dev_close (member_pid); } }
@@ -3469,8 +3469,8 @@ close_port(portid_t pid) {portid_t pi;struct rte_port *port; -portid_t slave_pids[RTE_MAX_ETHPORTS ]; -int num_slaves =0 ; +portid_t member_pids[RTE_MAX_ETHPORTS ]; +int num_members =0 ;if (port_id_is_invalid (pid,ENABLED_WARN ))return ;
@@ -3488,7 +3488,7 @@ close_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3505,17 +3505,17 @@ close_port(portid_t pid)flush_port_owned_resources (pi);#ifdef RTE_NET_BOND if (port->bond_flag ==1 ) - num_slaves =rte_eth_bond_slaves_get (pi, - slave_pids,RTE_MAX_ETHPORTS ); + num_members =rte_eth_bond_members_get (pi, + member_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 members under the * device need to be removed or closed. */ -if (port->bond_flag ==1 && num_slaves >0 ) -clear_bonding_slave_device (slave_pids, - num_slaves); +if (port->bond_flag ==1 && num_members >0 ) +clear_bonding_member_device (member_pids, + num_members); }free_xstats_display_info (pi);
@@ -3555,7 +3555,7 @@ reset_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -4203,38 +4203,38 @@ init_port_config(void) } } -void set_port_slave_flag (portid_t slave_pid) +void set_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =1 ; + port = &ports[member_pid]; + port->member_flag =1 ; } -void clear_port_slave_flag (portid_t slave_pid) +void clear_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =0 ; + port = &ports[member_pid]; + port->member_flag =0 ; } -uint8_t port_is_bonding_slave (portid_t slave_pid) +uint8_t port_is_bonding_member (portid_t member_pid) {struct rte_port *port;struct rte_eth_dev_info dev_info;int ret; - port = &ports[slave_pid]; - ret =eth_dev_info_get_print_err (slave_pid, &dev_info); + port = &ports[member_pid]; + ret =eth_dev_info_get_print_err (member_pid, &dev_info);if (ret !=0 ) {TESTPMD_LOG (ERR ,"Failed to get device info for port id %d," -"cannot determine if the port is a bonded slave" , - slave_pid); +"cannot determine if the port is a bonded member" , + member_pid);return 0 ; } -if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDED_SLAVE ) || (port->slave_flag ==1 )) +if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDED_MEMBER ) || (port->member_flag ==1 ))return 1 ;return 0 ; }
app/test-pmd/testpmd.h +4 -4
@@ -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 member_flag : 1, /**< bonding member 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_member_flag (portid_t member_pid); +void clear_port_member_flag (portid_t member_pid); +uint8_t port_is_bonding_member (portid_t member_pid); int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode, enum rte_eth_nb_tcs num_tcs,
app/test/test_link_bonding.c +1420 -1372
2,732 lines not on this page · raw message
app/test/test_link_bonding_mode4.c +295 -293
588 lines not on this page · raw message
app/test/test_link_bonding_rssconf.c +83 -83
166 lines not on this page · raw message
doc/guides/prog_guide/img/bond-mode-1.svg +1 -1
Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +111 -111
222 lines not on this page · raw message
drivers/net/bonding/bonding_testpmd.c +89 -89
178 lines not on this page · raw message
drivers/net/bonding/eth_bond_8023ad_private.h +20 -20
Lines of this file are not shown. View the raw message.
drivers/net/bonding/eth_bond_private.h +55 -53
108 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond.h +50 -42
92 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.c +187 -185
372 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.h +34 -33
67 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.c +22 -22
44 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.h +10 -10
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_api.c +240 -234
474 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_args.c +16 -16
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_flow.c +27 -27
54 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_pmd.c +694 -690
1,384 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.39.1
Part of the diff is not shown here. View the raw message.
Quoted 18 lines · On Wed, 17 May 2023 14:59:05 +0800 Chaoyong He <[email protected]> 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.
The bonding PMD's public API was modified according to the changes in word:
rte_eth_bond_8023ad_slave_infois now calledrte_eth_bond_8023ad_member_info,rte_eth_bond_active_slaves_getis now calledrte_eth_bond_active_members_get,rte_eth_bond_slave_addis now calledrte_eth_bond_member_add,rte_eth_bond_slave_removeis now calledrte_eth_bond_member_remove,rte_eth_bond_slaves_getis now calledrte_eth_bond_members_get.
Quoted 8 lines
Also the macro
RTE_ETH_DEV_BONDED_SLAVEwas renamed toRTE_ETH_DEV_BONDED_MEMBER.Signed-off-by Long Wu <[email protected]>Acked-by Niklas Söderlund <[email protected]>Reviewed-by James Hershaw <[email protected]>Reviewed-by Chaoyong He <[email protected]>---
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
============ ================== ============== ===============
Origin Feature Name Aggregate Name Device Name
============ ================== ============== ===============
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
============ ================== ============== ===============
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.
From 25aea59871533585bbaa18bdf7757e48aecb5380 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <[email protected]>
Date: Thu, 30 Mar 2023 10:24:03 -0700
Subject: [PATCH 05/12] bonding: replace use of slave device with child device
The term slave is inherited from the Linux bonding device and does not conform to the Linux Foundation Non-Inclusive Naming policy. Other networking products, operating systems, and 802 standards do not use the terms master or slave.
For DPDK change to using the terms parent and child when referring to devices that are managed in bond device.
Mark the old visible API's as deprecated and remove from the ABI.
--- 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(-)
app/test-pmd/testpmd.c +56 -56
@@ -588,27 +588,27 @@ eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, }static int -change_bonding_slave_port_status (portid_t bond_pid,bool is_stop) +change_bonding_child_port_status (portid_t bond_pid,bool is_stop) {#ifdef RTE_NET_BOND -portid_t slave_pids[RTE_MAX_ETHPORTS ]; +portid_t child_pids[RTE_MAX_ETHPORTS ];struct rte_port *port; -int num_slaves; -portid_t slave_pid; +int num_children; +portid_t child_pid;int i; - num_slaves =rte_eth_bond_slaves_get (bond_pid, slave_pids, + num_children =rte_eth_bond_children_get (bond_pid, child_pids,RTE_MAX_ETHPORTS ); -if (num_slaves <0 ) { -fprintf (stderr,"Failed to get slave list for port = %u\n" , +if (num_children <0 ) { +fprintf (stderr,"Failed to get child list for port = %u\n" , bond_pid); -return num_slaves; +return num_children; } -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; - port = &ports[slave_pid]; +for (i =0 ; i < num_children; i++) { + child_pid = child_pids[i]; + port = &ports[child_pid]; port->port_status = is_stop ?RTE_PORT_STOPPED :RTE_PORT_STARTED ; }
@@ -632,12 +632,12 @@ eth_dev_start_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Starting a bonded port also starts all slaves under the bonded +* Starting a bonded port also starts all children under the bonded * device. So if this port is bond device, we need to modify the -* port status of these slaves. +* port status of these children. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, false); +return change_bonding_child_port_status (port_id, false); }return 0 ;
@@ -656,12 +656,12 @@ eth_dev_stop_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Stopping a bonded port also stops all slaves under the bonded +* Stopping a bonded port also stops all children under the bonded * device. So if this port is bond device, we need to modify the -* port status of these slaves. +* port status of these children. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, true); +return change_bonding_child_port_status (port_id, true); }return 0 ;
@@ -2610,7 +2610,7 @@ all_ports_started(void) port = &ports[pi];/* Check if there is a port which is not started */ if ((port->port_status !=RTE_PORT_STARTED ) && - (port->slave_flag ==0 )) + (port->child_flag ==0 ))return 0 ; }
@@ -2624,7 +2624,7 @@ port_is_stopped(portid_t port_id)struct rte_port *port = &ports[port_id];if ((port->port_status !=RTE_PORT_STOPPED ) && - (port->slave_flag ==0 )) + (port->child_flag ==0 ))return 0 ;return 1 ; }
@@ -2970,8 +2970,8 @@ fill_xstats_display_info(void)/* * Some capabilities (like, rx_offload_capa and tx_offload_capa) of bonding -* device in dev_info is zero when no slave is added. And its capability -* will be updated when add a new slave device. So adding a slave device need +* device in dev_info is zero when no child is added. And its capability +* will be updated when add a new child device. So adding a child device need * to update the port configurations of bonding device. */ static void
@@ -3028,7 +3028,7 @@ start_port(portid_t pid)if (pid != pi && pid != (portid_t )RTE_PORT_ALL )continue ; -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_child (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3350,7 +3350,7 @@ stop_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_child (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3439,28 +3439,28 @@ flush_port_owned_resources(portid_t pi) }static void -clear_bonding_slave_device (portid_t *slave_pids,uint16_t num_slaves) +clear_bonding_child_device (portid_t *child_pids,uint16_t num_children) {struct rte_port *port; -portid_t slave_pid; +portid_t child_pid;uint16_t i; -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; -if (port_is_started (slave_pid) ==1 ) { -if (rte_eth_dev_stop (slave_pid) !=0 ) +for (i =0 ; i < num_children; i++) { + child_pid = child_pids[i]; +if (port_is_started (child_pid) ==1 ) { +if (rte_eth_dev_stop (child_pid) !=0 )fprintf (stderr,"rte_eth_dev_stop failed for port %u\n" , - slave_pid); + child_pid); - port = &ports[slave_pid]; + port = &ports[child_pid]; port->port_status =RTE_PORT_STOPPED ; } -clear_port_slave_flag (slave_pid); +clear_port_child_flag (child_pid); -/* Close slave device when testpmd quit or is killed. */ +/* Close child device when testpmd quit or is killed. */ if (cl_quit ==1 || f_quit ==1 ) -rte_eth_dev_close (slave_pid); +rte_eth_dev_close (child_pid); } }
@@ -3469,8 +3469,8 @@ close_port(portid_t pid) {portid_t pi;struct rte_port *port; -portid_t slave_pids[RTE_MAX_ETHPORTS ]; -int num_slaves =0 ; +portid_t child_pids[RTE_MAX_ETHPORTS ]; +int num_children =0 ;if (port_id_is_invalid (pid,ENABLED_WARN ))return ;
@@ -3488,7 +3488,7 @@ close_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_child (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3505,17 +3505,17 @@ close_port(portid_t pid)flush_port_owned_resources (pi);#ifdef RTE_NET_BOND if (port->bond_flag ==1 ) - num_slaves =rte_eth_bond_slaves_get (pi, - slave_pids,RTE_MAX_ETHPORTS ); + num_children =rte_eth_bond_children_get (pi, + child_pids,RTE_MAX_ETHPORTS );#endif rte_eth_dev_close (pi);/* -* If this port is bonded device, all slaves under the +* If this port is bonded device, all children under the * device need to be removed or closed. */ -if (port->bond_flag ==1 && num_slaves >0 ) -clear_bonding_slave_device (slave_pids, - num_slaves); +if (port->bond_flag ==1 && num_children >0 ) +clear_bonding_child_device (child_pids, + num_children); }free_xstats_display_info (pi);
@@ -3555,7 +3555,7 @@ reset_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_child (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -4203,38 +4203,38 @@ init_port_config(void) } } -void set_port_slave_flag (portid_t slave_pid) +void set_port_child_flag (portid_t child_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =1 ; + port = &ports[child_pid]; + port->child_flag =1 ; } -void clear_port_slave_flag (portid_t slave_pid) +void clear_port_child_flag (portid_t child_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =0 ; + port = &ports[child_pid]; + port->child_flag =0 ; } -uint8_t port_is_bonding_slave (portid_t slave_pid) +uint8_t port_is_bonding_child (portid_t child_pid) {struct rte_port *port;struct rte_eth_dev_info dev_info;int ret; - port = &ports[slave_pid]; - ret =eth_dev_info_get_print_err (slave_pid, &dev_info); + port = &ports[child_pid]; + ret =eth_dev_info_get_print_err (child_pid, &dev_info);if (ret !=0 ) {TESTPMD_LOG (ERR ,"Failed to get device info for port id %d," -"cannot determine if the port is a bonded slave" , - slave_pid); +"cannot determine if the port is a bonded child" , + child_pid);return 0 ; } -if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDED_SLAVE ) || (port->slave_flag ==1 )) +if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDED_CHILD ) || (port->child_flag ==1 ))return 1 ;return 0 ; }
app/test-pmd/testpmd.h +4 -4
@@ -321,7 +321,7 @@ struct rte_port {uint32_t mc_addr_nb;/**< nb. of addr. in mc_addr_pool */ queueid_t queue_nb;/**< nb. of queues for flow rules */ uint32_t queue_sz;/**< size of a queue for flow rules */ - uint8_t slave_flag : 1, /**< bonding slave port */ + uint8_t child_flag : 1, /**< bonding child port */ bond_flag : 1, /**< port is bond device */ fwd_mac_swap : 1, /**< swap packet MAC before forward */ update_conf : 1; /**< need to update bonding device configuration */
@@ -1082,9 +1082,9 @@ void stop_packet_forwarding(void);void dev_set_link_up (portid_t pid);void dev_set_link_down (portid_t pid);void init_port_config (void ); -void set_port_slave_flag (portid_t slave_pid); -void clear_port_slave_flag (portid_t slave_pid); -uint8_t port_is_bonding_slave (portid_t slave_pid); +void set_port_child_flag (portid_t child_pid); +void clear_port_child_flag (portid_t child_pid); +uint8_t port_is_bonding_child (portid_t child_pid); int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode, enum rte_eth_nb_tcs num_tcs,
app/test/test_link_bonding.c +1362 -1362
2,732 lines not on this page · raw message
app/test/test_link_bonding_mode4.c +292 -292
584 lines not on this page · raw message
app/test/test_link_bonding_rssconf.c +83 -83
166 lines not on this page · raw message
doc/guides/howto/lm_bond_virtio_sriov.rst +12 -12
Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +111 -111
222 lines not on this page · raw message
doc/guides/testpmd_app_ug/testpmd_funcs.rst +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/bonding/bonding_testpmd.c +89 -89
178 lines not on this page · raw message
drivers/net/bonding/eth_bond_8023ad_private.h +20 -20
Lines of this file are not shown. View the raw message.
drivers/net/bonding/eth_bond_private.h +58 -58
116 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond.h +62 -40
102 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.c +185 -185
370 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.h +33 -33
66 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.c +22 -22
44 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.h +10 -10
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_api.c +232 -232
464 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_args.c +16 -16
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_flow.c +27 -27
54 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_pmd.c +684 -684
1,368 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.39.2
Part of the diff is not shown here. View the raw message.
Quoted 46 lines
Quoted 9 lines · On Wed, 17 May 2023 14:59:05 +0800 Chaoyong He <[email protected]> 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.
The bonding PMD's public API was modified according to the changes in word:
rte_eth_bond_8023ad_slave_infois now calledrte_eth_bond_8023ad_member_info,rte_eth_bond_active_slaves_getisnow
Quoted 5 lines
called
rte_eth_bond_active_members_get,rte_eth_bond_slave_addis now calledrte_eth_bond_member_add,rte_eth_bond_slave_removeis now calledrte_eth_bond_member_remove,rte_eth_bond_slaves_getis now calledrte_eth_bond_members_get.Quoted 8 lines
Also the macro
RTE_ETH_DEV_BONDED_SLAVEwas renamed toRTE_ETH_DEV_BONDED_MEMBER.Signed-off-by Long Wu <[email protected]>Acked-by Niklas Söderlund <[email protected]>Reviewed-by James Hershaw <[email protected]>Reviewed-by Chaoyong He <[email protected]>---
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
============ ================== ============== ===============
Origin Feature Name Aggregate Name Device Name
============ ================== ============== ===============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
Quoted 6 lines
============ ================== ============== ===============
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.
Thanks for your kindly review and advice, we will revise and send out a v2 patch ASAP.
PATCH v2 1/1 net/bonding: replace master/slave to main/member
In reply to Chaoyong HeFrom: Long Wu <[email protected]>
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.
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.
Also the macro RTE_ETH_DEV_BONDED_SLAVE was renamed to RTE_ETH_DEV_BONDED_MEMBER.
Mark the old visible API's as deprecated and remove from the ABI.
--- app/test-pmd/testpmd.c | 112 +- app/test-pmd/testpmd.h | 8 +- app/test/test_link_bonding.c | 2792 +++++++++-------- app/test/test_link_bonding_mode4.c | 588 ++-- app/test/test_link_bonding_rssconf.c | 166 +- doc/guides/howto/lm_bond_virtio_sriov.rst | 24 +- doc/guides/nics/bnxt.rst | 4 +- doc/guides/prog_guide/img/bond-mode-1.svg | 2 +- .../link_bonding_poll_mode_drv_lib.rst | 222 +- drivers/net/bonding/bonding_testpmd.c | 178 +- drivers/net/bonding/eth_bond_8023ad_private.h | 40 +- drivers/net/bonding/eth_bond_private.h | 108 +- drivers/net/bonding/rte_eth_bond.h | 126 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 372 +-- drivers/net/bonding/rte_eth_bond_8023ad.h | 75 +- 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 | 474 +-- 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 | 1384 ++++---- drivers/net/bonding/version.map | 15 +- examples/bond/main.c | 40 +- lib/ethdev/rte_ethdev.h | 9 +- 24 files changed, 3505 insertions(+), 3384 deletions(-)
app/test-pmd/testpmd.c +56 -56
@@ -588,27 +588,27 @@ eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, }static int -change_bonding_slave_port_status (portid_t bond_pid,bool is_stop) +change_bonding_member_port_status (portid_t bond_pid,bool is_stop) {#ifdef RTE_NET_BOND -portid_t slave_pids[RTE_MAX_ETHPORTS ]; +portid_t member_pids[RTE_MAX_ETHPORTS ];struct rte_port *port; -int num_slaves; -portid_t slave_pid; +int num_members; +portid_t member_pid;int i; - num_slaves =rte_eth_bond_slaves_get (bond_pid, slave_pids, + num_members =rte_eth_bond_members_get (bond_pid, member_pids,RTE_MAX_ETHPORTS ); -if (num_slaves <0 ) { -fprintf (stderr,"Failed to get slave list for port = %u\n" , +if (num_members <0 ) { +fprintf (stderr,"Failed to get member list for port = %u\n" , bond_pid); -return num_slaves; +return num_members; } -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; - port = &ports[slave_pid]; +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; + port = &ports[member_pid]; port->port_status = is_stop ?RTE_PORT_STOPPED :RTE_PORT_STARTED ; }
@@ -632,12 +632,12 @@ eth_dev_start_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Starting a bonded port also starts all slaves under the bonded +* Starting a bonded port also starts all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, false); +return change_bonding_member_port_status (port_id, false); }return 0 ;
@@ -656,12 +656,12 @@ eth_dev_stop_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Stopping a bonded port also stops all slaves under the bonded +* Stopping a bonded port also stops all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, true); +return change_bonding_member_port_status (port_id, true); }return 0 ;
@@ -2610,7 +2610,7 @@ all_ports_started(void) port = &ports[pi];/* Check if there is a port which is not started */ if ((port->port_status !=RTE_PORT_STARTED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ; }
@@ -2624,7 +2624,7 @@ port_is_stopped(portid_t port_id)struct rte_port *port = &ports[port_id];if ((port->port_status !=RTE_PORT_STOPPED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ;return 1 ; }
@@ -2970,8 +2970,8 @@ fill_xstats_display_info(void)/* * Some capabilities (like, rx_offload_capa and tx_offload_capa) of bonding -* device in dev_info is zero when no slave is added. And its capability -* will be updated when add a new slave device. So adding a slave device need +* device in dev_info is zero when no member is added. And its capability +* will be updated when add a new member device. So adding a member device need * to update the port configurations of bonding device. */ static void
@@ -3028,7 +3028,7 @@ start_port(portid_t pid)if (pid != pi && pid != (portid_t )RTE_PORT_ALL )continue ; -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3350,7 +3350,7 @@ stop_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3439,28 +3439,28 @@ flush_port_owned_resources(portid_t pi) }static void -clear_bonding_slave_device (portid_t *slave_pids,uint16_t num_slaves) +clear_bonding_member_device (portid_t *member_pids,uint16_t num_members) {struct rte_port *port; -portid_t slave_pid; +portid_t member_pid;uint16_t i; -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; -if (port_is_started (slave_pid) ==1 ) { -if (rte_eth_dev_stop (slave_pid) !=0 ) +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; +if (port_is_started (member_pid) ==1 ) { +if (rte_eth_dev_stop (member_pid) !=0 )fprintf (stderr,"rte_eth_dev_stop failed for port %u\n" , - slave_pid); + member_pid); - port = &ports[slave_pid]; + port = &ports[member_pid]; port->port_status =RTE_PORT_STOPPED ; } -clear_port_slave_flag (slave_pid); +clear_port_member_flag (member_pid); -/* Close slave device when testpmd quit or is killed. */ +/* Close member device when testpmd quit or is killed. */ if (cl_quit ==1 || f_quit ==1 ) -rte_eth_dev_close (slave_pid); +rte_eth_dev_close (member_pid); } }
@@ -3469,8 +3469,8 @@ close_port(portid_t pid) {portid_t pi;struct rte_port *port; -portid_t slave_pids[RTE_MAX_ETHPORTS ]; -int num_slaves =0 ; +portid_t member_pids[RTE_MAX_ETHPORTS ]; +int num_members =0 ;if (port_id_is_invalid (pid,ENABLED_WARN ))return ;
@@ -3488,7 +3488,7 @@ close_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3505,17 +3505,17 @@ close_port(portid_t pid)flush_port_owned_resources (pi);#ifdef RTE_NET_BOND if (port->bond_flag ==1 ) - num_slaves =rte_eth_bond_slaves_get (pi, - slave_pids,RTE_MAX_ETHPORTS ); + num_members =rte_eth_bond_members_get (pi, + member_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 members under the * device need to be removed or closed. */ -if (port->bond_flag ==1 && num_slaves >0 ) -clear_bonding_slave_device (slave_pids, - num_slaves); +if (port->bond_flag ==1 && num_members >0 ) +clear_bonding_member_device (member_pids, + num_members); }free_xstats_display_info (pi);
@@ -3555,7 +3555,7 @@ reset_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -4203,38 +4203,38 @@ init_port_config(void) } } -void set_port_slave_flag (portid_t slave_pid) +void set_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =1 ; + port = &ports[member_pid]; + port->member_flag =1 ; } -void clear_port_slave_flag (portid_t slave_pid) +void clear_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =0 ; + port = &ports[member_pid]; + port->member_flag =0 ; } -uint8_t port_is_bonding_slave (portid_t slave_pid) +uint8_t port_is_bonding_member (portid_t member_pid) {struct rte_port *port;struct rte_eth_dev_info dev_info;int ret; - port = &ports[slave_pid]; - ret =eth_dev_info_get_print_err (slave_pid, &dev_info); + port = &ports[member_pid]; + ret =eth_dev_info_get_print_err (member_pid, &dev_info);if (ret !=0 ) {TESTPMD_LOG (ERR ,"Failed to get device info for port id %d," -"cannot determine if the port is a bonded slave" , - slave_pid); +"cannot determine if the port is a bonded member" , + member_pid);return 0 ; } -if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDED_SLAVE ) || (port->slave_flag ==1 )) +if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDED_MEMBER ) || (port->member_flag ==1 ))return 1 ;return 0 ; }
app/test-pmd/testpmd.h +4 -4
@@ -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 member_flag : 1, /**< bonding member 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_member_flag (portid_t member_pid); +void clear_port_member_flag (portid_t member_pid); +uint8_t port_is_bonding_member (portid_t member_pid); int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode, enum rte_eth_nb_tcs num_tcs,
app/test/test_link_bonding.c +1420 -1372
2,732 lines not on this page · raw message
app/test/test_link_bonding_mode4.c +295 -293
588 lines not on this page · raw message
app/test/test_link_bonding_rssconf.c +83 -83
166 lines not on this page · raw message
doc/guides/howto/lm_bond_virtio_sriov.rst +12 -12
Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/img/bond-mode-1.svg +1 -1
Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +111 -111
222 lines not on this page · raw message
drivers/net/bonding/bonding_testpmd.c +89 -89
178 lines not on this page · raw message
drivers/net/bonding/eth_bond_8023ad_private.h +20 -20
Lines of this file are not shown. View the raw message.
drivers/net/bonding/eth_bond_private.h +55 -53
108 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond.h +82 -44
126 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.c +187 -185
372 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.h +42 -33
75 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.c +22 -22
44 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.h +10 -10
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_api.c +240 -234
474 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_args.c +16 -16
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_flow.c +27 -27
54 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_pmd.c +694 -690
1,384 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.39.1
Part of the diff is not shown here. View the raw message.
PATCH v3 1/1 net/bonding: replace master/slave to main/member
From: Long Wu <[email protected]>
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.
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.
Also the macro RTE_ETH_DEV_BONDED_SLAVE was renamed to RTE_ETH_DEV_BONDED_MEMBER.
Mark the old visible API's as deprecated and remove from the ABI.
---
v2:
* Modify related doc.
* Add 'RTE_DEPRECATED' to related APIs.
v3:
* Fix the check warning about 'CamelCase'.
--- app/test-pmd/testpmd.c | 112 +- app/test-pmd/testpmd.h | 8 +- app/test/test_link_bonding.c | 2792 +++++++++-------- app/test/test_link_bonding_mode4.c | 588 ++-- app/test/test_link_bonding_rssconf.c | 166 +- doc/guides/howto/lm_bond_virtio_sriov.rst | 24 +- doc/guides/nics/bnxt.rst | 4 +- doc/guides/prog_guide/img/bond-mode-1.svg | 2 +- .../link_bonding_poll_mode_drv_lib.rst | 222 +- drivers/net/bonding/bonding_testpmd.c | 178 +- drivers/net/bonding/eth_bond_8023ad_private.h | 40 +- drivers/net/bonding/eth_bond_private.h | 108 +- drivers/net/bonding/rte_eth_bond.h | 126 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 372 +-- drivers/net/bonding/rte_eth_bond_8023ad.h | 75 +- 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 | 474 +-- 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 | 1384 ++++---- drivers/net/bonding/version.map | 15 +- examples/bond/main.c | 40 +- lib/ethdev/rte_ethdev.h | 9 +- 24 files changed, 3505 insertions(+), 3384 deletions(-)
app/test-pmd/testpmd.c +56 -56
@@ -588,27 +588,27 @@ eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, }static int -change_bonding_slave_port_status (portid_t bond_pid,bool is_stop) +change_bonding_member_port_status (portid_t bond_pid,bool is_stop) {#ifdef RTE_NET_BOND -portid_t slave_pids[RTE_MAX_ETHPORTS ]; +portid_t member_pids[RTE_MAX_ETHPORTS ];struct rte_port *port; -int num_slaves; -portid_t slave_pid; +int num_members; +portid_t member_pid;int i; - num_slaves =rte_eth_bond_slaves_get (bond_pid, slave_pids, + num_members =rte_eth_bond_members_get (bond_pid, member_pids,RTE_MAX_ETHPORTS ); -if (num_slaves <0 ) { -fprintf (stderr,"Failed to get slave list for port = %u\n" , +if (num_members <0 ) { +fprintf (stderr,"Failed to get member list for port = %u\n" , bond_pid); -return num_slaves; +return num_members; } -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; - port = &ports[slave_pid]; +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; + port = &ports[member_pid]; port->port_status = is_stop ?RTE_PORT_STOPPED :RTE_PORT_STARTED ; }
@@ -632,12 +632,12 @@ eth_dev_start_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Starting a bonded port also starts all slaves under the bonded +* Starting a bonded port also starts all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, false); +return change_bonding_member_port_status (port_id, false); }return 0 ;
@@ -656,12 +656,12 @@ eth_dev_stop_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Stopping a bonded port also stops all slaves under the bonded +* Stopping a bonded port also stops all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, true); +return change_bonding_member_port_status (port_id, true); }return 0 ;
@@ -2610,7 +2610,7 @@ all_ports_started(void) port = &ports[pi];/* Check if there is a port which is not started */ if ((port->port_status !=RTE_PORT_STARTED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ; }
@@ -2624,7 +2624,7 @@ port_is_stopped(portid_t port_id)struct rte_port *port = &ports[port_id];if ((port->port_status !=RTE_PORT_STOPPED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ;return 1 ; }
@@ -2970,8 +2970,8 @@ fill_xstats_display_info(void)/* * Some capabilities (like, rx_offload_capa and tx_offload_capa) of bonding -* device in dev_info is zero when no slave is added. And its capability -* will be updated when add a new slave device. So adding a slave device need +* device in dev_info is zero when no member is added. And its capability +* will be updated when add a new member device. So adding a member device need * to update the port configurations of bonding device. */ static void
@@ -3028,7 +3028,7 @@ start_port(portid_t pid)if (pid != pi && pid != (portid_t )RTE_PORT_ALL )continue ; -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3350,7 +3350,7 @@ stop_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3439,28 +3439,28 @@ flush_port_owned_resources(portid_t pi) }static void -clear_bonding_slave_device (portid_t *slave_pids,uint16_t num_slaves) +clear_bonding_member_device (portid_t *member_pids,uint16_t num_members) {struct rte_port *port; -portid_t slave_pid; +portid_t member_pid;uint16_t i; -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; -if (port_is_started (slave_pid) ==1 ) { -if (rte_eth_dev_stop (slave_pid) !=0 ) +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; +if (port_is_started (member_pid) ==1 ) { +if (rte_eth_dev_stop (member_pid) !=0 )fprintf (stderr,"rte_eth_dev_stop failed for port %u\n" , - slave_pid); + member_pid); - port = &ports[slave_pid]; + port = &ports[member_pid]; port->port_status =RTE_PORT_STOPPED ; } -clear_port_slave_flag (slave_pid); +clear_port_member_flag (member_pid); -/* Close slave device when testpmd quit or is killed. */ +/* Close member device when testpmd quit or is killed. */ if (cl_quit ==1 || f_quit ==1 ) -rte_eth_dev_close (slave_pid); +rte_eth_dev_close (member_pid); } }
@@ -3469,8 +3469,8 @@ close_port(portid_t pid) {portid_t pi;struct rte_port *port; -portid_t slave_pids[RTE_MAX_ETHPORTS ]; -int num_slaves =0 ; +portid_t member_pids[RTE_MAX_ETHPORTS ]; +int num_members =0 ;if (port_id_is_invalid (pid,ENABLED_WARN ))return ;
@@ -3488,7 +3488,7 @@ close_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3505,17 +3505,17 @@ close_port(portid_t pid)flush_port_owned_resources (pi);#ifdef RTE_NET_BOND if (port->bond_flag ==1 ) - num_slaves =rte_eth_bond_slaves_get (pi, - slave_pids,RTE_MAX_ETHPORTS ); + num_members =rte_eth_bond_members_get (pi, + member_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 members under the * device need to be removed or closed. */ -if (port->bond_flag ==1 && num_slaves >0 ) -clear_bonding_slave_device (slave_pids, - num_slaves); +if (port->bond_flag ==1 && num_members >0 ) +clear_bonding_member_device (member_pids, + num_members); }free_xstats_display_info (pi);
@@ -3555,7 +3555,7 @@ reset_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -4203,38 +4203,38 @@ init_port_config(void) } } -void set_port_slave_flag (portid_t slave_pid) +void set_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =1 ; + port = &ports[member_pid]; + port->member_flag =1 ; } -void clear_port_slave_flag (portid_t slave_pid) +void clear_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =0 ; + port = &ports[member_pid]; + port->member_flag =0 ; } -uint8_t port_is_bonding_slave (portid_t slave_pid) +uint8_t port_is_bonding_member (portid_t member_pid) {struct rte_port *port;struct rte_eth_dev_info dev_info;int ret; - port = &ports[slave_pid]; - ret =eth_dev_info_get_print_err (slave_pid, &dev_info); + port = &ports[member_pid]; + ret =eth_dev_info_get_print_err (member_pid, &dev_info);if (ret !=0 ) {TESTPMD_LOG (ERR ,"Failed to get device info for port id %d," -"cannot determine if the port is a bonded slave" , - slave_pid); +"cannot determine if the port is a bonded member" , + member_pid);return 0 ; } -if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDED_SLAVE ) || (port->slave_flag ==1 )) +if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDED_MEMBER ) || (port->member_flag ==1 ))return 1 ;return 0 ; }
app/test-pmd/testpmd.h +4 -4
@@ -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 member_flag : 1, /**< bonding member 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_member_flag (portid_t member_pid); +void clear_port_member_flag (portid_t member_pid); +uint8_t port_is_bonding_member (portid_t member_pid); int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode, enum rte_eth_nb_tcs num_tcs,
app/test/test_link_bonding.c +1420 -1372
2,732 lines not on this page · raw message
app/test/test_link_bonding_mode4.c +295 -293
588 lines not on this page · raw message
app/test/test_link_bonding_rssconf.c +83 -83
166 lines not on this page · raw message
doc/guides/howto/lm_bond_virtio_sriov.rst +12 -12
Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/img/bond-mode-1.svg +1 -1
Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +111 -111
222 lines not on this page · raw message
drivers/net/bonding/bonding_testpmd.c +89 -89
178 lines not on this page · raw message
drivers/net/bonding/eth_bond_8023ad_private.h +20 -20
Lines of this file are not shown. View the raw message.
drivers/net/bonding/eth_bond_private.h +55 -53
108 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond.h +82 -44
126 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.c +187 -185
372 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.h +42 -33
75 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.c +22 -22
44 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.h +10 -10
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_api.c +240 -234
474 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_args.c +16 -16
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_flow.c +27 -27
54 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_pmd.c +694 -690
1,384 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.39.1
Part of the diff is not shown here. View the raw message.
PATCH v4 1/1 net/bonding: replace master/slave to main/member
From: Long Wu <[email protected]>
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.
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.
Also the macro RTE_ETH_DEV_BONDED_SLAVE was renamed to RTE_ETH_DEV_BONDED_MEMBER.
Mark the old visible API's as deprecated and remove from the ABI.
---
v2:
* Modify related doc.
* Add 'RTE_DEPRECATED' to related APIs.
v3:
* Fix the check warning about 'CamelCase'.
v4:
* Fix the doc compile problem.
--- app/test-pmd/testpmd.c | 112 +- app/test-pmd/testpmd.h | 8 +- app/test/test_link_bonding.c | 2792 +++++++++-------- app/test/test_link_bonding_mode4.c | 588 ++-- app/test/test_link_bonding_rssconf.c | 166 +- doc/guides/howto/lm_bond_virtio_sriov.rst | 24 +- doc/guides/nics/bnxt.rst | 4 +- doc/guides/prog_guide/img/bond-mode-1.svg | 2 +- .../link_bonding_poll_mode_drv_lib.rst | 230 +- drivers/net/bonding/bonding_testpmd.c | 178 +- drivers/net/bonding/eth_bond_8023ad_private.h | 40 +- drivers/net/bonding/eth_bond_private.h | 108 +- drivers/net/bonding/rte_eth_bond.h | 126 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 372 +-- drivers/net/bonding/rte_eth_bond_8023ad.h | 75 +- 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 | 474 +-- 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 | 1384 ++++---- drivers/net/bonding/version.map | 15 +- examples/bond/main.c | 40 +- lib/ethdev/rte_ethdev.h | 9 +- 24 files changed, 3509 insertions(+), 3388 deletions(-)
app/test-pmd/testpmd.c +56 -56
@@ -588,27 +588,27 @@ eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, }static int -change_bonding_slave_port_status (portid_t bond_pid,bool is_stop) +change_bonding_member_port_status (portid_t bond_pid,bool is_stop) {#ifdef RTE_NET_BOND -portid_t slave_pids[RTE_MAX_ETHPORTS ]; +portid_t member_pids[RTE_MAX_ETHPORTS ];struct rte_port *port; -int num_slaves; -portid_t slave_pid; +int num_members; +portid_t member_pid;int i; - num_slaves =rte_eth_bond_slaves_get (bond_pid, slave_pids, + num_members =rte_eth_bond_members_get (bond_pid, member_pids,RTE_MAX_ETHPORTS ); -if (num_slaves <0 ) { -fprintf (stderr,"Failed to get slave list for port = %u\n" , +if (num_members <0 ) { +fprintf (stderr,"Failed to get member list for port = %u\n" , bond_pid); -return num_slaves; +return num_members; } -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; - port = &ports[slave_pid]; +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; + port = &ports[member_pid]; port->port_status = is_stop ?RTE_PORT_STOPPED :RTE_PORT_STARTED ; }
@@ -632,12 +632,12 @@ eth_dev_start_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Starting a bonded port also starts all slaves under the bonded +* Starting a bonded port also starts all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, false); +return change_bonding_member_port_status (port_id, false); }return 0 ;
@@ -656,12 +656,12 @@ eth_dev_stop_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Stopping a bonded port also stops all slaves under the bonded +* Stopping a bonded port also stops all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, true); +return change_bonding_member_port_status (port_id, true); }return 0 ;
@@ -2610,7 +2610,7 @@ all_ports_started(void) port = &ports[pi];/* Check if there is a port which is not started */ if ((port->port_status !=RTE_PORT_STARTED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ; }
@@ -2624,7 +2624,7 @@ port_is_stopped(portid_t port_id)struct rte_port *port = &ports[port_id];if ((port->port_status !=RTE_PORT_STOPPED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ;return 1 ; }
@@ -2970,8 +2970,8 @@ fill_xstats_display_info(void)/* * Some capabilities (like, rx_offload_capa and tx_offload_capa) of bonding -* device in dev_info is zero when no slave is added. And its capability -* will be updated when add a new slave device. So adding a slave device need +* device in dev_info is zero when no member is added. And its capability +* will be updated when add a new member device. So adding a member device need * to update the port configurations of bonding device. */ static void
@@ -3028,7 +3028,7 @@ start_port(portid_t pid)if (pid != pi && pid != (portid_t )RTE_PORT_ALL )continue ; -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3350,7 +3350,7 @@ stop_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3439,28 +3439,28 @@ flush_port_owned_resources(portid_t pi) }static void -clear_bonding_slave_device (portid_t *slave_pids,uint16_t num_slaves) +clear_bonding_member_device (portid_t *member_pids,uint16_t num_members) {struct rte_port *port; -portid_t slave_pid; +portid_t member_pid;uint16_t i; -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; -if (port_is_started (slave_pid) ==1 ) { -if (rte_eth_dev_stop (slave_pid) !=0 ) +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; +if (port_is_started (member_pid) ==1 ) { +if (rte_eth_dev_stop (member_pid) !=0 )fprintf (stderr,"rte_eth_dev_stop failed for port %u\n" , - slave_pid); + member_pid); - port = &ports[slave_pid]; + port = &ports[member_pid]; port->port_status =RTE_PORT_STOPPED ; } -clear_port_slave_flag (slave_pid); +clear_port_member_flag (member_pid); -/* Close slave device when testpmd quit or is killed. */ +/* Close member device when testpmd quit or is killed. */ if (cl_quit ==1 || f_quit ==1 ) -rte_eth_dev_close (slave_pid); +rte_eth_dev_close (member_pid); } }
@@ -3469,8 +3469,8 @@ close_port(portid_t pid) {portid_t pi;struct rte_port *port; -portid_t slave_pids[RTE_MAX_ETHPORTS ]; -int num_slaves =0 ; +portid_t member_pids[RTE_MAX_ETHPORTS ]; +int num_members =0 ;if (port_id_is_invalid (pid,ENABLED_WARN ))return ;
@@ -3488,7 +3488,7 @@ close_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3505,17 +3505,17 @@ close_port(portid_t pid)flush_port_owned_resources (pi);#ifdef RTE_NET_BOND if (port->bond_flag ==1 ) - num_slaves =rte_eth_bond_slaves_get (pi, - slave_pids,RTE_MAX_ETHPORTS ); + num_members =rte_eth_bond_members_get (pi, + member_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 members under the * device need to be removed or closed. */ -if (port->bond_flag ==1 && num_slaves >0 ) -clear_bonding_slave_device (slave_pids, - num_slaves); +if (port->bond_flag ==1 && num_members >0 ) +clear_bonding_member_device (member_pids, + num_members); }free_xstats_display_info (pi);
@@ -3555,7 +3555,7 @@ reset_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -4203,38 +4203,38 @@ init_port_config(void) } } -void set_port_slave_flag (portid_t slave_pid) +void set_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =1 ; + port = &ports[member_pid]; + port->member_flag =1 ; } -void clear_port_slave_flag (portid_t slave_pid) +void clear_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =0 ; + port = &ports[member_pid]; + port->member_flag =0 ; } -uint8_t port_is_bonding_slave (portid_t slave_pid) +uint8_t port_is_bonding_member (portid_t member_pid) {struct rte_port *port;struct rte_eth_dev_info dev_info;int ret; - port = &ports[slave_pid]; - ret =eth_dev_info_get_print_err (slave_pid, &dev_info); + port = &ports[member_pid]; + ret =eth_dev_info_get_print_err (member_pid, &dev_info);if (ret !=0 ) {TESTPMD_LOG (ERR ,"Failed to get device info for port id %d," -"cannot determine if the port is a bonded slave" , - slave_pid); +"cannot determine if the port is a bonded member" , + member_pid);return 0 ; } -if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDED_SLAVE ) || (port->slave_flag ==1 )) +if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDED_MEMBER ) || (port->member_flag ==1 ))return 1 ;return 0 ; }
app/test-pmd/testpmd.h +4 -4
@@ -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 member_flag : 1, /**< bonding member 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_member_flag (portid_t member_pid); +void clear_port_member_flag (portid_t member_pid); +uint8_t port_is_bonding_member (portid_t member_pid); int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode, enum rte_eth_nb_tcs num_tcs,
app/test/test_link_bonding.c +1420 -1372
2,732 lines not on this page · raw message
app/test/test_link_bonding_mode4.c +295 -293
588 lines not on this page · raw message
app/test/test_link_bonding_rssconf.c +83 -83
166 lines not on this page · raw message
doc/guides/howto/lm_bond_virtio_sriov.rst +12 -12
Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/img/bond-mode-1.svg +1 -1
Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +115 -115
230 lines not on this page · raw message
drivers/net/bonding/bonding_testpmd.c +89 -89
178 lines not on this page · raw message
drivers/net/bonding/eth_bond_8023ad_private.h +20 -20
Lines of this file are not shown. View the raw message.
drivers/net/bonding/eth_bond_private.h +55 -53
108 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond.h +82 -44
126 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.c +187 -185
372 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.h +42 -33
75 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.c +22 -22
44 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.h +10 -10
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_api.c +240 -234
474 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_args.c +16 -16
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_flow.c +27 -27
54 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_pmd.c +694 -690
1,384 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.39.1
Part of the diff is not shown here. View the raw message.
Quoted 23 lines · On Thu, 18 May 2023 16:44:58 +0800 Chaoyong He <[email protected]> wrote:
From: Long Wu <[email protected]>
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.
The bonding PMD's public API was modified according to the changes in word:
rte_eth_bond_8023ad_slave_infois now calledrte_eth_bond_8023ad_member_info,rte_eth_bond_active_slaves_getis now calledrte_eth_bond_active_members_get,rte_eth_bond_slave_addis now calledrte_eth_bond_member_add,rte_eth_bond_slave_removeis now calledrte_eth_bond_member_remove,rte_eth_bond_slaves_getis now calledrte_eth_bond_members_get.Also the macro
RTE_ETH_DEV_BONDED_SLAVEwas renamed toRTE_ETH_DEV_BONDED_MEMBER.
Quoted 6 lines
Mark the old visible API's as deprecated and remove from the ABI.
Signed-off-by Long Wu <[email protected]>Acked-by Niklas Söderlund <[email protected]>Reviewed-by James Hershaw <[email protected]>
Since this will be ABI change it will have to wait for 23.11 release. Could you make a deprecation notice now, to foreshadow that change?
Quoted 29 lines · Stephen Hemminger
Quoted 26 lines · On Thu, 18 May 2023 16:44:58 +0800 Chaoyong He <[email protected]> wrote:
From: Long Wu <[email protected]>
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.
The bonding PMD's public API was modified according to the changes in word:
rte_eth_bond_8023ad_slave_infois now calledrte_eth_bond_8023ad_member_info,rte_eth_bond_active_slaves_getis now calledrte_eth_bond_active_members_get,rte_eth_bond_slave_addis now calledrte_eth_bond_member_add,rte_eth_bond_slave_removeis now calledrte_eth_bond_member_remove,rte_eth_bond_slaves_getis now calledrte_eth_bond_members_get.Also the macro
RTE_ETH_DEV_BONDED_SLAVEwas renamed toRTE_ETH_DEV_BONDED_MEMBER.Mark the old visible API's as deprecated and remove from the ABI.
Quoted 9 lines
Quoted 3 lines
Signed-off-by Long Wu <[email protected]>Acked-by Niklas Söderlund <[email protected]>Reviewed-by James Hershaw <[email protected]>Since this will be ABI change it will have to wait for 23.11 release. Could you make a deprecation notice now, to foreshadow that change?
For reference, deprecation notice is:
https://patches.dpdk.org/project/dpdk/patch/[email protected]/
Deferring the patch to v23.11 release.
v5 cover replace master/slave to main/member
In reply to Chaoyong HeThis patch series aims to replace all the master/slave to main/member in the bonding PMD.
---
v5:
* Rebase to DPDK v23.11.
v4:
* Fix the doc compile problem.
v3:
* Fix the check warning about 'CamelCase'.
v2:
* Modify related doc.
* Add 'RTE_DEPRECATED' to related APIs.
---
Long Wu (2):
ethdev: remove bonding deprecated macro net/bonding: replace master/slave to main/member
app/test-pmd/testpmd.c | 113 +- app/test-pmd/testpmd.h | 8 +- app/test/test_link_bonding.c | 2792 +++++++++-------- app/test/test_link_bonding_mode4.c | 588 ++-- app/test/test_link_bonding_rssconf.c | 166 +- doc/guides/howto/lm_bond_virtio_sriov.rst | 24 +- doc/guides/nics/bnxt.rst | 4 +- doc/guides/prog_guide/img/bond-mode-1.svg | 2 +- .../link_bonding_poll_mode_drv_lib.rst | 230 +- doc/guides/rel_notes/deprecation.rst | 19 - doc/guides/rel_notes/release_23_11.rst | 19 + drivers/net/bonding/bonding_testpmd.c | 178 +- drivers/net/bonding/eth_bond_8023ad_private.h | 40 +- drivers/net/bonding/eth_bond_private.h | 108 +- drivers/net/bonding/rte_eth_bond.h | 96 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 372 +-- drivers/net/bonding/rte_eth_bond_8023ad.h | 67 +- 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 | 482 +-- 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 | 1384 ++++---- drivers/net/bonding/version.map | 15 +- examples/bond/main.c | 40 +- lib/ethdev/rte_ethdev.h | 1 - 26 files changed, 3488 insertions(+), 3410 deletions(-)
Signature · 1 line
2.39.1
PATCH v5 1/2 ethdev: remove bonding deprecated macro
From: Long Wu <[email protected]>
The macro RTE_ETH_DEV_BONDED_SLAVE was marked as deprecated in v23.07, we can remove it.
--- doc/guides/rel_notes/deprecation.rst | 5 +---- doc/guides/rel_notes/release_23_11.rst | 2 ++ lib/ethdev/rte_ethdev.h | 1 - 3 files changed, 3 insertions(+), 5 deletions(-)
doc/guides/rel_notes/deprecation.rst +1 -4
@@ -124,10 +124,7 @@ Deprecation Notices The legacy actions should be removed once ``MODIFY_FIELD`` alternative is implemented in drivers. -* bonding: The macro ``RTE_ETH_DEV_BONDED_SLAVE`` will be - deprecated in DPDK 23.07, and removed in DPDK 23.11. - The relevant code can be updated using ``RTE_ETH_DEV_BONDING_MEMBER``. - The data structure ``struct rte_eth_bond_8023ad_slave_info`` will be +* bonding: The data structure ``struct rte_eth_bond_8023ad_slave_info`` will be renamed to ``struct rte_eth_bond_8023ad_member_info`` in DPDK 23.11. The following functions will be removed in DPDK 23.11. The old functions:
doc/guides/rel_notes/release_23_11.rst +2 -0
@@ -87,6 +87,8 @@ Removed Items * eal: Removed deprecated ``RTE_FUNC_PTR_OR_*`` macros. +* ethdev: Removed deprecated macro ``RTE_ETH_DEV_BONDED_SLAVE``. + * flow_classify: Removed flow classification library and examples. * kni: Removed the Kernel Network Interface (KNI) library and driver.
lib/ethdev/rte_ethdev.h +0 -1
@@ -2038,7 +2038,6 @@ struct rte_eth_dev_owner {#define RTE_ETH_DEV_INTR_LSC RTE_BIT32(1)/** Device is a bonding member */ #define RTE_ETH_DEV_BONDING_MEMBER RTE_BIT32(2) -#define RTE_ETH_DEV_BONDED_SLAVE RTE_DEPRECATED(RTE_ETH_DEV_BONDED_SLAVE) RTE_ETH_DEV_BONDING_MEMBER/** Device supports device removal interrupt */ #define RTE_ETH_DEV_INTR_RMV RTE_BIT32(3)/** Device is port representor */
Signature · 1 line
2.39.1
Re: [PATCH v5 1/2] ethdev: remove bonding deprecated macro
Quoted 47 lines · Chaoyong He
From: Long Wu <[email protected]>
The macro
RTE_ETH_DEV_BONDED_SLAVEwas marked as deprecated in v23.07, we can remove it.Signed-off-by Long Wu <[email protected]>Reviewed-by Chaoyong He <[email protected]>--- doc/guides/rel_notes/deprecation.rst | 5 +---- doc/guides/rel_notes/release_23_11.rst | 2 ++ lib/ethdev/rte_ethdev.h | 1 - 3 files changed, 3 insertions(+), 5 deletions(-)doc/guides/rel_notes/deprecation.rst +1
-4@@ -124,10 +124,7 @@ Deprecation Notices The legacy actions should be removed once ``MODIFY_FIELD`` alternative is implemented in drivers. -* bonding: The macro ``RTE_ETH_DEV_BONDED_SLAVE`` will be - deprecated in DPDK 23.07, and removed in DPDK 23.11. - The relevant code can be updated using ``RTE_ETH_DEV_BONDING_MEMBER``. - The data structure ``struct rte_eth_bond_8023ad_slave_info`` will be +* bonding: The data structure ``struct rte_eth_bond_8023ad_slave_info`` will be renamed to ``struct rte_eth_bond_8023ad_member_info`` in DPDK 23.11. The following functions will be removed in DPDK 23.11. The old functions:doc/guides/rel_notes/release_23_11.rst +2
-0@@ -87,6 +87,8 @@ Removed Items * eal: Removed deprecated ``RTE_FUNC_PTR_OR_*`` macros. +* ethdev: Removed deprecated macro ``RTE_ETH_DEV_BONDED_SLAVE``. + * flow_classify: Removed flow classification library and examples. * kni: Removed the Kernel Network Interface (KNI) library and driver.lib/ethdev/rte_ethdev.h +0
-0
lib/ethdev/rte_ethdev.h struct rte_eth_dev_owner { · line 2043
Quoted 7 lines
lib/ethdev/rte_ethdev.h +0
-1@@ -2038,7 +2038,6 @@ struct rte_eth_dev_owner {#define RTE_ETH_DEV_INTR_LSC RTE_BIT32(1)/** Device is a bonding member */ #define RTE_ETH_DEV_BONDING_MEMBER RTE_BIT32(2) -#define RTE_ETH_DEV_BONDED_SLAVE RTE_DEPRECATED(RTE_ETH_DEV_BONDED_SLAVE) RTE_ETH_DEV_BONDING_MEMBER/** Device supports device removal interrupt */ #define RTE_ETH_DEV_INTR_RMV RTE_BIT32(3)/** Device is port representor */
PATCH v5 2/2 net/bonding: replace master/slave to main/member
In reply to Chaoyong HeFrom: Long Wu <[email protected]>
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.
The bonding PMD's public APIs were 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.
The data structure ``struct rte_eth_bond_8023ad_slave_info`` was renamed to ``struct rte_eth_bond_8023ad_member_info``
--- app/test-pmd/testpmd.c | 113 +- app/test-pmd/testpmd.h | 8 +- app/test/test_link_bonding.c | 2792 +++++++++-------- app/test/test_link_bonding_mode4.c | 588 ++-- app/test/test_link_bonding_rssconf.c | 166 +- doc/guides/howto/lm_bond_virtio_sriov.rst | 24 +- doc/guides/nics/bnxt.rst | 4 +- doc/guides/prog_guide/img/bond-mode-1.svg | 2 +- .../link_bonding_poll_mode_drv_lib.rst | 230 +- doc/guides/rel_notes/deprecation.rst | 16 - doc/guides/rel_notes/release_23_11.rst | 17 + drivers/net/bonding/bonding_testpmd.c | 178 +- drivers/net/bonding/eth_bond_8023ad_private.h | 40 +- drivers/net/bonding/eth_bond_private.h | 108 +- drivers/net/bonding/rte_eth_bond.h | 96 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 372 +-- drivers/net/bonding/rte_eth_bond_8023ad.h | 67 +- 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 | 482 +-- 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 | 1384 ++++---- drivers/net/bonding/version.map | 15 +- examples/bond/main.c | 40 +- 25 files changed, 3486 insertions(+), 3406 deletions(-)
app/test-pmd/testpmd.c +57 -56
@@ -602,27 +602,27 @@ eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, }static int -change_bonding_slave_port_status (portid_t bond_pid,bool is_stop) +change_bonding_member_port_status (portid_t bond_pid,bool is_stop) {#ifdef RTE_NET_BOND -portid_t slave_pids[RTE_MAX_ETHPORTS ]; +portid_t member_pids[RTE_MAX_ETHPORTS ];struct rte_port *port; -int num_slaves; -portid_t slave_pid; +int num_members; +portid_t member_pid;int i; - num_slaves =rte_eth_bond_slaves_get (bond_pid, slave_pids, + num_members =rte_eth_bond_members_get (bond_pid, member_pids,RTE_MAX_ETHPORTS ); -if (num_slaves <0 ) { -fprintf (stderr,"Failed to get slave list for port = %u\n" , +if (num_members <0 ) { +fprintf (stderr,"Failed to get member list for port = %u\n" , bond_pid); -return num_slaves; +return num_members; } -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; - port = &ports[slave_pid]; +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; + port = &ports[member_pid]; port->port_status = is_stop ?RTE_PORT_STOPPED :RTE_PORT_STARTED ; }
@@ -646,12 +646,12 @@ eth_dev_start_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Starting a bonded port also starts all slaves under the bonded +* Starting a bonded port also starts all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, false); +return change_bonding_member_port_status (port_id, false); }return 0 ;
@@ -670,12 +670,12 @@ eth_dev_stop_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Stopping a bonded port also stops all slaves under the bonded +* Stopping a bonded port also stops all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, true); +return change_bonding_member_port_status (port_id, true); }return 0 ;
@@ -2624,7 +2624,7 @@ all_ports_started(void) port = &ports[pi];/* Check if there is a port which is not started */ if ((port->port_status !=RTE_PORT_STARTED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ; }
@@ -2638,7 +2638,7 @@ port_is_stopped(portid_t port_id)struct rte_port *port = &ports[port_id];if ((port->port_status !=RTE_PORT_STOPPED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ;return 1 ; }
@@ -2984,8 +2984,8 @@ fill_xstats_display_info(void)/* * Some capabilities (like, rx_offload_capa and tx_offload_capa) of bonding -* device in dev_info is zero when no slave is added. And its capability -* will be updated when add a new slave device. So adding a slave device need +* device in dev_info is zero when no member is added. And its capability +* will be updated when add a new member device. So adding a member device need * to update the port configurations of bonding device. */ static void
@@ -3042,7 +3042,7 @@ start_port(portid_t pid)if (pid != pi && pid != (portid_t )RTE_PORT_ALL )continue ; -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3364,7 +3364,7 @@ stop_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3453,28 +3453,28 @@ flush_port_owned_resources(portid_t pi) }static void -clear_bonding_slave_device (portid_t *slave_pids,uint16_t num_slaves) +clear_bonding_member_device (portid_t *member_pids,uint16_t num_members) {struct rte_port *port; -portid_t slave_pid; +portid_t member_pid;uint16_t i; -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; -if (port_is_started (slave_pid) ==1 ) { -if (rte_eth_dev_stop (slave_pid) !=0 ) +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; +if (port_is_started (member_pid) ==1 ) { +if (rte_eth_dev_stop (member_pid) !=0 )fprintf (stderr,"rte_eth_dev_stop failed for port %u\n" , - slave_pid); + member_pid); - port = &ports[slave_pid]; + port = &ports[member_pid]; port->port_status =RTE_PORT_STOPPED ; } -clear_port_slave_flag (slave_pid); +clear_port_member_flag (member_pid); -/* Close slave device when testpmd quit or is killed. */ +/* Close member device when testpmd quit or is killed. */ if (cl_quit ==1 || f_quit ==1 ) -rte_eth_dev_close (slave_pid); +rte_eth_dev_close (member_pid); } }
@@ -3483,8 +3483,8 @@ close_port(portid_t pid) {portid_t pi;struct rte_port *port; -portid_t slave_pids[RTE_MAX_ETHPORTS ]; -int num_slaves =0 ; +portid_t member_pids[RTE_MAX_ETHPORTS ]; +int num_members =0 ;if (port_id_is_invalid (pid,ENABLED_WARN ))return ;
@@ -3502,7 +3502,7 @@ close_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -3519,17 +3519,17 @@ close_port(portid_t pid)flush_port_owned_resources (pi);#ifdef RTE_NET_BOND if (port->bond_flag ==1 ) - num_slaves =rte_eth_bond_slaves_get (pi, - slave_pids,RTE_MAX_ETHPORTS ); + num_members =rte_eth_bond_members_get (pi, + member_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 members under the * device need to be removed or closed. */ -if (port->bond_flag ==1 && num_slaves >0 ) -clear_bonding_slave_device (slave_pids, - num_slaves); +if (port->bond_flag ==1 && num_members >0 ) +clear_bonding_member_device (member_pids, + num_members); }free_xstats_display_info (pi);
@@ -3569,7 +3569,7 @@ reset_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);
@@ -4217,38 +4217,39 @@ init_port_config(void) } } -void set_port_slave_flag (portid_t slave_pid) +void set_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =1 ; + port = &ports[member_pid]; + port->member_flag =1 ; } -void clear_port_slave_flag (portid_t slave_pid) +void clear_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =0 ; + port = &ports[member_pid]; + port->member_flag =0 ; } -uint8_t port_is_bonding_slave (portid_t slave_pid) +uint8_t port_is_bonding_member (portid_t member_pid) {struct rte_port *port;struct rte_eth_dev_info dev_info;int ret; - port = &ports[slave_pid]; - ret =eth_dev_info_get_print_err (slave_pid, &dev_info); + port = &ports[member_pid]; + ret =eth_dev_info_get_print_err (member_pid, &dev_info);if (ret !=0 ) {TESTPMD_LOG (ERR ,"Failed to get device info for port id %d," -"cannot determine if the port is a bonded slave" , - slave_pid); +"cannot determine if the port is a bonded member" , + member_pid);return 0 ; } -if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDING_MEMBER ) || (port->slave_flag ==1 )) + +if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDING_MEMBER ) || (port->member_flag ==1 ))return 1 ;return 0 ; }
app/test-pmd/testpmd.h +4 -4
@@ -337,7 +337,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 member_flag : 1, /**< bonding member 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 */
@@ -1107,9 +1107,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_member_flag (portid_t member_pid); +void clear_port_member_flag (portid_t member_pid); +uint8_t port_is_bonding_member (portid_t member_pid); int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode, enum rte_eth_nb_tcs num_tcs,
app/test/test_link_bonding.c +1420 -1372
2,731 lines not on this page · raw message
app/test/test_link_bonding_mode4.c +295 -293
588 lines not on this page · raw message
app/test/test_link_bonding_rssconf.c +83 -83
166 lines not on this page · raw message
doc/guides/howto/lm_bond_virtio_sriov.rst +12 -12
Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/img/bond-mode-1.svg +1 -1
Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +115 -115
230 lines not on this page · raw message
doc/guides/rel_notes/release_23_11.rst +17 -0
Lines of this file are not shown. View the raw message.
drivers/net/bonding/bonding_testpmd.c +89 -89
178 lines not on this page · raw message
drivers/net/bonding/eth_bond_8023ad_private.h +20 -20
Lines of this file are not shown. View the raw message.
drivers/net/bonding/eth_bond_private.h +55 -53
108 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond.h +52 -44
96 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.c +187 -185
372 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_8023ad.h +34 -33
67 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.c +22 -22
44 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_alb.h +10 -10
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_api.c +244 -238
482 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_args.c +16 -16
Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_flow.c +27 -27
54 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_pmd.c +694 -690
1,384 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.39.1
Part of the diff is not shown here. View the raw message.
Quoted 20 lines · On Wed, 16 Aug 2023 14:27:10 +0800 Chaoyong He <[email protected]> wrote:
From: Long Wu <[email protected]>
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.
The bonding PMD's public APIs were modified according to the changes in word:
rte_eth_bond_8023ad_slave_infois now calledrte_eth_bond_8023ad_member_info,rte_eth_bond_active_slaves_getis now calledrte_eth_bond_active_members_get,rte_eth_bond_slave_addis now calledrte_eth_bond_member_add,rte_eth_bond_slave_removeis now calledrte_eth_bond_member_remove,rte_eth_bond_slaves_getis now calledrte_eth_bond_members_get.
Quoted 7 lines
The data structure ``struct rte_eth_bond_8023ad_slave_info`` was renamed to ``struct rte_eth_bond_8023ad_member_info``
Signed-off-by Long Wu <[email protected]>Reviewed-by James Hershaw <[email protected]>Reviewed-by Chaoyong He <[email protected]>Acked-by Niklas Söderlund <[email protected]>
good job. I doesn't find any where doesn't been replaced. thanks. How do you make such a perfect and accurate replacement?
Quoted 14,653 lines · Chaoyong He
From: Long Wu <[email protected]>
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.
The bonding PMD's public APIs were modified according to the changes in word:
rte_eth_bond_8023ad_slave_infois now calledrte_eth_bond_8023ad_member_info,rte_eth_bond_active_slaves_getis now calledrte_eth_bond_active_members_get,rte_eth_bond_slave_addis now calledrte_eth_bond_member_add,rte_eth_bond_slave_removeis now calledrte_eth_bond_member_remove,rte_eth_bond_slaves_getis now calledrte_eth_bond_members_get.The data structure ``struct rte_eth_bond_8023ad_slave_info`` was renamed to ``struct rte_eth_bond_8023ad_member_info``
Signed-off-by Long Wu <[email protected]>Reviewed-by James Hershaw <[email protected]>Reviewed-by Chaoyong He <[email protected]>Acked-by Niklas Söderlund <[email protected]>--- app/test-pmd/testpmd.c | 113 +- app/test-pmd/testpmd.h | 8 +- app/test/test_link_bonding.c | 2792 +++++++++-------- app/test/test_link_bonding_mode4.c | 588 ++-- app/test/test_link_bonding_rssconf.c | 166 +- doc/guides/howto/lm_bond_virtio_sriov.rst | 24 +- doc/guides/nics/bnxt.rst | 4 +- doc/guides/prog_guide/img/bond-mode-1.svg | 2 +- .../link_bonding_poll_mode_drv_lib.rst | 230 +- doc/guides/rel_notes/deprecation.rst | 16 - doc/guides/rel_notes/release_23_11.rst | 17 + drivers/net/bonding/bonding_testpmd.c | 178 +- drivers/net/bonding/eth_bond_8023ad_private.h | 40 +- drivers/net/bonding/eth_bond_private.h | 108 +- drivers/net/bonding/rte_eth_bond.h | 96 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 372 +-- drivers/net/bonding/rte_eth_bond_8023ad.h | 67 +- 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 | 482 +-- 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 | 1384 ++++---- drivers/net/bonding/version.map | 15 +- examples/bond/main.c | 40 +- 25 files changed, 3486 insertions(+), 3406 deletions(-)app/test-pmd/testpmd.c +57
-56@@ -602,27 +602,27 @@ eth_dev_configure_mp(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, }static int -change_bonding_slave_port_status (portid_t bond_pid,bool is_stop) +change_bonding_member_port_status (portid_t bond_pid,bool is_stop) {#ifdef RTE_NET_BOND -portid_t slave_pids[RTE_MAX_ETHPORTS ]; +portid_t member_pids[RTE_MAX_ETHPORTS ];struct rte_port *port; -int num_slaves; -portid_t slave_pid; +int num_members; +portid_t member_pid;int i; - num_slaves =rte_eth_bond_slaves_get (bond_pid, slave_pids, + num_members =rte_eth_bond_members_get (bond_pid, member_pids,RTE_MAX_ETHPORTS ); -if (num_slaves <0 ) { -fprintf (stderr,"Failed to get slave list for port = %u\n" , +if (num_members <0 ) { +fprintf (stderr,"Failed to get member list for port = %u\n" , bond_pid); -return num_slaves; +return num_members; } -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; - port = &ports[slave_pid]; +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; + port = &ports[member_pid]; port->port_status = is_stop ?RTE_PORT_STOPPED :RTE_PORT_STARTED ; }@@ -646,12 +646,12 @@ eth_dev_start_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Starting a bonded port also starts all slaves under the bonded +* Starting a bonded port also starts all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, false); +return change_bonding_member_port_status (port_id, false); }return 0 ;@@ -670,12 +670,12 @@ eth_dev_stop_mp(uint16_t port_id)struct rte_port *port = &ports[port_id];/* -* Stopping a bonded port also stops all slaves under the bonded +* Stopping a bonded port also stops all members 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 members. */ if (port->bond_flag ==1 ) -return change_bonding_slave_port_status (port_id, true); +return change_bonding_member_port_status (port_id, true); }return 0 ;@@ -2624,7 +2624,7 @@ all_ports_started(void) port = &ports[pi];/* Check if there is a port which is not started */ if ((port->port_status !=RTE_PORT_STARTED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ; }@@ -2638,7 +2638,7 @@ port_is_stopped(portid_t port_id)struct rte_port *port = &ports[port_id];if ((port->port_status !=RTE_PORT_STOPPED ) && - (port->slave_flag ==0 )) + (port->member_flag ==0 ))return 0 ;return 1 ; }@@ -2984,8 +2984,8 @@ fill_xstats_display_info(void)/* * Some capabilities (like, rx_offload_capa and tx_offload_capa) of bonding -* device in dev_info is zero when no slave is added. And its capability -* will be updated when add a new slave device. So adding a slave device need +* device in dev_info is zero when no member is added. And its capability +* will be updated when add a new member device. So adding a member device need * to update the port configurations of bonding device. */ static void@@ -3042,7 +3042,7 @@ start_port(portid_t pid)if (pid != pi && pid != (portid_t )RTE_PORT_ALL )continue ; -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);@@ -3364,7 +3364,7 @@ stop_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);@@ -3453,28 +3453,28 @@ flush_port_owned_resources(portid_t pi) }static void -clear_bonding_slave_device (portid_t *slave_pids,uint16_t num_slaves) +clear_bonding_member_device (portid_t *member_pids,uint16_t num_members) {struct rte_port *port; -portid_t slave_pid; +portid_t member_pid;uint16_t i; -for (i =0 ; i < num_slaves; i++) { - slave_pid = slave_pids[i]; -if (port_is_started (slave_pid) ==1 ) { -if (rte_eth_dev_stop (slave_pid) !=0 ) +for (i =0 ; i < num_members; i++) { + member_pid = member_pids[i]; +if (port_is_started (member_pid) ==1 ) { +if (rte_eth_dev_stop (member_pid) !=0 )fprintf (stderr,"rte_eth_dev_stop failed for port %u\n" , - slave_pid); + member_pid); - port = &ports[slave_pid]; + port = &ports[member_pid]; port->port_status =RTE_PORT_STOPPED ; } -clear_port_slave_flag (slave_pid); +clear_port_member_flag (member_pid); -/* Close slave device when testpmd quit or is killed. */ +/* Close member device when testpmd quit or is killed. */ if (cl_quit ==1 || f_quit ==1 ) -rte_eth_dev_close (slave_pid); +rte_eth_dev_close (member_pid); } }@@ -3483,8 +3483,8 @@ close_port(portid_t pid) {portid_t pi;struct rte_port *port; -portid_t slave_pids[RTE_MAX_ETHPORTS ]; -int num_slaves =0 ; +portid_t member_pids[RTE_MAX_ETHPORTS ]; +int num_members =0 ;if (port_id_is_invalid (pid,ENABLED_WARN ))return ;@@ -3502,7 +3502,7 @@ close_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);@@ -3519,17 +3519,17 @@ close_port(portid_t pid)flush_port_owned_resources (pi);#ifdef RTE_NET_BOND if (port->bond_flag ==1 ) - num_slaves =rte_eth_bond_slaves_get (pi, - slave_pids,RTE_MAX_ETHPORTS ); + num_members =rte_eth_bond_members_get (pi, + member_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 members under the * device need to be removed or closed. */ -if (port->bond_flag ==1 && num_slaves >0 ) -clear_bonding_slave_device (slave_pids, - num_slaves); +if (port->bond_flag ==1 && num_members >0 ) +clear_bonding_member_device (member_pids, + num_members); }free_xstats_display_info (pi);@@ -3569,7 +3569,7 @@ reset_port(portid_t pid)continue ; } -if (port_is_bonding_slave (pi)) { +if (port_is_bonding_member (pi)) {fprintf (stderr,"Please remove port %d from bonded device.\n" , pi);@@ -4217,38 +4217,39 @@ init_port_config(void) } } -void set_port_slave_flag (portid_t slave_pid) +void set_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =1 ; + port = &ports[member_pid]; + port->member_flag =1 ; } -void clear_port_slave_flag (portid_t slave_pid) +void clear_port_member_flag (portid_t member_pid) {struct rte_port *port; - port = &ports[slave_pid]; - port->slave_flag =0 ; + port = &ports[member_pid]; + port->member_flag =0 ; } -uint8_t port_is_bonding_slave (portid_t slave_pid) +uint8_t port_is_bonding_member (portid_t member_pid) {struct rte_port *port;struct rte_eth_dev_info dev_info;int ret; - port = &ports[slave_pid]; - ret =eth_dev_info_get_print_err (slave_pid, &dev_info); + port = &ports[member_pid]; + ret =eth_dev_info_get_print_err (member_pid, &dev_info);if (ret !=0 ) {TESTPMD_LOG (ERR ,"Failed to get device info for port id %d," -"cannot determine if the port is a bonded slave" , - slave_pid); +"cannot determine if the port is a bonded member" , + member_pid);return 0 ; } -if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDING_MEMBER ) || (port->slave_flag ==1 )) + +if ((*dev_info.dev_flags &RTE_ETH_DEV_BONDING_MEMBER ) || (port->member_flag ==1 ))return 1 ;return 0 ; }app/test-pmd/testpmd.h +4
-4@@ -337,7 +337,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 member_flag : 1, /**< bonding member 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 */@@ -1107,9 +1107,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_member_flag (portid_t member_pid); +void clear_port_member_flag (portid_t member_pid); +uint8_t port_is_bonding_member (portid_t member_pid); int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode, enum rte_eth_nb_tcs num_tcs,app/test/test_link_bonding.c +1420
-1372@@ -59,13 +59,13 @@#define INVALID_BONDING_MODE (-1) -uint8_t slave_mac[] = {0x00 ,0xFF ,0x00 ,0xFF ,0x00 ,0x00 }; +uint8_t member_mac[] = {0x00 ,0xFF ,0x00 ,0xFF ,0x00 ,0x00 };uint8_t bonded_mac[] = {0xAA ,0xFF ,0xAA ,0xFF ,0xAA ,0xFF };struct link_bonding_unittest_params {int16_t bonded_port_id; -int16_t slave_port_ids[TEST_MAX_NUMBER_OF_PORTS ]; -uint16_t bonded_slave_count; +int16_t member_port_ids[TEST_MAX_NUMBER_OF_PORTS ]; +uint16_t bonded_member_count;uint8_t bonding_mode;uint16_t nb_rx_q;@@ -73,7 +73,7 @@ struct link_bonding_unittest_params {struct rte_mempool *mbuf_pool; -struct rte_ether_addr *default_slave_mac; +struct rte_ether_addr *default_member_mac;struct rte_ether_addr *default_bonded_mac;/* Packet Headers */ @@ -90,8 +90,8 @@ static struct rte_udp_hdr pkt_udp_hdr;static struct link_bonding_unittest_params default_params = { .bonded_port_id =-1 , - .slave_port_ids = {-1 }, - .bonded_slave_count =0 , + .member_port_ids = {-1 }, + .bonded_member_count =0 , .bonding_mode =BONDING_MODE_ROUND_ROBIN , .nb_rx_q =1 ,@@ -99,7 +99,7 @@ static struct link_bonding_unittest_params default_params = { .mbuf_pool = NULL, - .default_slave_mac = (struct rte_ether_addr *)slave_mac, + .default_member_mac = (struct rte_ether_addr *)member_mac, .default_bonded_mac = (struct rte_ether_addr *)bonded_mac, .pkt_eth_hdr = NULL,@@ -202,8 +202,8 @@ configure_ethdev(uint16_t port_id, uint8_t start, uint8_t en_isr)return 0 ; } -static int slaves_initialized; -static int mac_slaves_initialized; +static int members_initialized; +static int mac_members_initialized;static pthread_mutex_t mutex =PTHREAD_MUTEX_INITIALIZER ;static pthread_cond_t cvar =PTHREAD_COND_INITIALIZER ;@@ -213,7 +213,7 @@ static inttest_setup (void) {int i, nb_mbuf_per_pool; -struct rte_ether_addr *mac_addr = (struct rte_ether_addr *)slave_mac; +struct rte_ether_addr *mac_addr = (struct rte_ether_addr *)member_mac;/* Allocate ethernet packet header with space for VLAN header */ if (test_params->pkt_eth_hdr ==NULL ) {@@ -235,7 +235,7 @@ test_setup(void) }/* Create / Initialize virtual eth devs */ -if (!slaves_initialized) { +if (!members_initialized) {for (i =0 ; i <TEST_MAX_NUMBER_OF_PORTS ; i++) {char pmd_name[RTE_ETH_NAME_MAX_LEN ];@@ -243,16 +243,16 @@ test_setup(void)snprintf (pmd_name,RTE_ETH_NAME_MAX_LEN ,"eth_virt_%d" , i); - test_params->slave_port_ids[i] =virtual_ethdev_create (pmd_name, + test_params->member_port_ids[i] =virtual_ethdev_create (pmd_name, mac_addr,rte_socket_id (),1 ); -TEST_ASSERT (test_params->slave_port_ids[i] >=0 , +TEST_ASSERT (test_params->member_port_ids[i] >=0 ,"Failed to create virtual virtual ethdev %s" , pmd_name);TEST_ASSERT_SUCCESS (configure_ethdev ( - test_params->slave_port_ids[i],1 ,0 ), + test_params->member_port_ids[i],1 ,0 ),"Failed to configure virtual ethdev %s" , pmd_name); } - slaves_initialized =1 ; + members_initialized =1 ; }return 0 ;@@ -261,9 +261,9 @@ test_setup(void)static int test_create_bonded_device (void ) { -int current_slave_count; +int current_member_count; -uint16_t slaves[RTE_MAX_ETHPORTS ]; +uint16_t members[RTE_MAX_ETHPORTS ];/* Don't try to recreate bonded device if re-running test suite*/ if (test_params->bonded_port_id ==-1 ) {@@ -281,19 +281,19 @@ test_create_bonded_device(void) test_params->bonding_mode), "Failed to set ethdev %d to mode %d", test_params->bonded_port_id, test_params->bonding_mode); - current_slave_count =rte_eth_bond_slaves_get (test_params->bonded_port_id, - slaves,RTE_MAX_ETHPORTS ); + current_member_count =rte_eth_bond_members_get (test_params->bonded_port_id, + members,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (current_slave_count,0 , -"Number of slaves %d is great than expected %d." , - current_slave_count,0 ); +TEST_ASSERT_EQUAL (current_member_count,0 , +"Number of members %d is great than expected %d." , + current_member_count,0 ); - current_slave_count =rte_eth_bond_active_slaves_get ( - test_params->bonded_port_id, slaves,RTE_MAX_ETHPORTS ); + current_member_count =rte_eth_bond_active_members_get ( + test_params->bonded_port_id, members,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (current_slave_count,0 , -"Number of active slaves %d is great than expected %d." , - current_slave_count,0 ); +TEST_ASSERT_EQUAL (current_member_count,0 , +"Number of active members %d is great than expected %d." , + current_member_count,0 );return 0 ; }@@ -329,46 +329,46 @@ test_create_bonded_device_with_invalid_params(void) }static int -test_add_slave_to_bonded_device (void ) +test_add_member_to_bonded_device (void ) { -int current_slave_count; +int current_member_count; -uint16_t slaves[RTE_MAX_ETHPORTS ]; +uint16_t members[RTE_MAX_ETHPORTS ]; -TEST_ASSERT_SUCCESS (rte_eth_bond_slave_add (test_params->bonded_port_id, - test_params->slave_port_ids[test_params->bonded_slave_count]), -"Failed to add slave (%d) to bonded port (%d)." , - test_params->slave_port_ids[test_params->bonded_slave_count], +TEST_ASSERT_SUCCESS (rte_eth_bond_member_add (test_params->bonded_port_id, + test_params->member_port_ids[test_params->bonded_member_count]), +"Failed to add member (%d) to bonded port (%d)." , + test_params->member_port_ids[test_params->bonded_member_count], test_params->bonded_port_id); - current_slave_count =rte_eth_bond_slaves_get (test_params->bonded_port_id, - slaves,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (current_slave_count, test_params->bonded_slave_count +1 , -"Number of slaves (%d) is greater than expected (%d)." , - current_slave_count, test_params->bonded_slave_count +1 ); + current_member_count =rte_eth_bond_members_get (test_params->bonded_port_id, + members,RTE_MAX_ETHPORTS ); +TEST_ASSERT_EQUAL (current_member_count, test_params->bonded_member_count +1 , +"Number of members (%d) is greater than expected (%d)." , + current_member_count, test_params->bonded_member_count +1 ); - current_slave_count =rte_eth_bond_active_slaves_get ( - test_params->bonded_port_id, slaves,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (current_slave_count,0 , -"Number of active slaves (%d) is not as expected (%d).\n" , - current_slave_count,0 ); + current_member_count =rte_eth_bond_active_members_get ( + test_params->bonded_port_id, members,RTE_MAX_ETHPORTS ); +TEST_ASSERT_EQUAL (current_member_count,0 , +"Number of active members (%d) is not as expected (%d).\n" , + current_member_count,0 ); - test_params->bonded_slave_count++; + test_params->bonded_member_count++;return 0 ; }static int -test_add_slave_to_invalid_bonded_device (void ) +test_add_member_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_member_add (test_params->bonded_port_id +5 , + test_params->member_port_ids[test_params->bonded_member_count]),"Expected call to failed as invalid port specified." );/* Non bonded device */ -TEST_ASSERT_FAIL (rte_eth_bond_slave_add (test_params->slave_port_ids[0 ], - test_params->slave_port_ids[test_params->bonded_slave_count]), +TEST_ASSERT_FAIL (rte_eth_bond_member_add (test_params->member_port_ids[0 ], + test_params->member_port_ids[test_params->bonded_member_count]),"Expected call to failed as invalid port specified." );return 0 ;@@ -376,63 +376,63 @@ test_add_slave_to_invalid_bonded_device(void)static int -test_remove_slave_from_bonded_device (void ) +test_remove_member_from_bonded_device (void ) { -int current_slave_count; +int current_member_count;struct rte_ether_addr read_mac_addr, *mac_addr; -uint16_t slaves[RTE_MAX_ETHPORTS ]; +uint16_t members[RTE_MAX_ETHPORTS ]; -TEST_ASSERT_SUCCESS (rte_eth_bond_slave_remove (test_params->bonded_port_id, - test_params->slave_port_ids[test_params->bonded_slave_count-1 ]), -"Failed to remove slave %d from bonded port (%d)." , - test_params->slave_port_ids[test_params->bonded_slave_count-1 ], +TEST_ASSERT_SUCCESS (rte_eth_bond_member_remove (test_params->bonded_port_id, + test_params->member_port_ids[test_params->bonded_member_count-1 ]), +"Failed to remove member %d from bonded port (%d)." , + test_params->member_port_ids[test_params->bonded_member_count-1 ], test_params->bonded_port_id); - current_slave_count =rte_eth_bond_slaves_get (test_params->bonded_port_id, - slaves,RTE_MAX_ETHPORTS ); + current_member_count =rte_eth_bond_members_get (test_params->bonded_port_id, + members,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (current_slave_count, test_params->bonded_slave_count -1 , -"Number of slaves (%d) is great than expected (%d).\n" , - current_slave_count, test_params->bonded_slave_count -1 ); +TEST_ASSERT_EQUAL (current_member_count, test_params->bonded_member_count -1 , +"Number of members (%d) is great than expected (%d).\n" , + current_member_count, test_params->bonded_member_count -1 ); - mac_addr = (struct rte_ether_addr *)slave_mac; + mac_addr = (struct rte_ether_addr *)member_mac; mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = - test_params->bonded_slave_count-1 ; + test_params->bonded_member_count-1 ;TEST_ASSERT_SUCCESS (rte_eth_macaddr_get ( - test_params->slave_port_ids[test_params->bonded_slave_count-1 ], + test_params->member_port_ids[test_params->bonded_member_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->member_port_ids[test_params->bonded_member_count-1 ]);TEST_ASSERT_SUCCESS (memcmp (mac_addr, &read_mac_addr,sizeof (read_mac_addr)),"bonded port mac address not set to that of primary port\n" );rte_eth_stats_reset ( - test_params->slave_port_ids[test_params->bonded_slave_count-1 ]); + test_params->member_port_ids[test_params->bonded_member_count-1 ]);virtual_ethdev_simulate_link_status_interrupt (test_params->bonded_port_id,0 ); - test_params->bonded_slave_count--; + test_params->bonded_member_count--;return 0 ; }static int -test_remove_slave_from_invalid_bonded_device (void ) +test_remove_member_from_invalid_bonded_device (void ) {/* Invalid port ID */ -TEST_ASSERT_FAIL (rte_eth_bond_slave_remove ( +TEST_ASSERT_FAIL (rte_eth_bond_member_remove ( test_params->bonded_port_id +5 , - test_params->slave_port_ids[test_params->bonded_slave_count -1 ]), + test_params->member_port_ids[test_params->bonded_member_count -1 ]),"Expected call to failed as invalid port specified." );/* Non bonded device */ -TEST_ASSERT_FAIL (rte_eth_bond_slave_remove ( - test_params->slave_port_ids[0 ], - test_params->slave_port_ids[test_params->bonded_slave_count -1 ]), +TEST_ASSERT_FAIL (rte_eth_bond_member_remove ( + test_params->member_port_ids[0 ], + test_params->member_port_ids[test_params->bonded_member_count -1 ]),"Expected call to failed as invalid port specified." );return 0 ;@@ -441,19 +441,19 @@ test_remove_slave_from_invalid_bonded_device(void)static int bonded_id =2 ;static int -test_add_already_bonded_slave_to_bonded_device (void ) +test_add_already_bonded_member_to_bonded_device (void ) { -int port_id, current_slave_count; -uint16_t slaves[RTE_MAX_ETHPORTS ]; +int port_id, current_member_count; +uint16_t members[RTE_MAX_ETHPORTS ];char pmd_name[RTE_ETH_NAME_MAX_LEN ]; -test_add_slave_to_bonded_device (); +test_add_member_to_bonded_device (); - current_slave_count =rte_eth_bond_slaves_get (test_params->bonded_port_id, - slaves,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (current_slave_count,1 , -"Number of slaves (%d) is not that expected (%d)." , - current_slave_count,1 ); + current_member_count =rte_eth_bond_members_get (test_params->bonded_port_id, + members,RTE_MAX_ETHPORTS ); +TEST_ASSERT_EQUAL (current_member_count,1 , +"Number of members (%d) is not that expected (%d)." , + current_member_count,1 );snprintf (pmd_name,RTE_ETH_NAME_MAX_LEN ,"%s_%d" ,BONDED_DEV_NAME , ++bonded_id);@@ -461,93 +461,93 @@ test_add_already_bonded_slave_to_bonded_device(void) rte_socket_id());TEST_ASSERT (port_id >=0 ,"Failed to create bonded device." ); -TEST_ASSERT (rte_eth_bond_slave_add (port_id, - test_params->slave_port_ids[test_params->bonded_slave_count -1 ]) +TEST_ASSERT (rte_eth_bond_member_add (port_id, + test_params->member_port_ids[test_params->bonded_member_count -1 ]) <0 , -"Added slave (%d) to bonded port (%d) unexpectedly." , - test_params->slave_port_ids[test_params->bonded_slave_count-1 ], +"Added member (%d) to bonded port (%d) unexpectedly." , + test_params->member_port_ids[test_params->bonded_member_count-1 ], port_id); -return test_remove_slave_from_bonded_device (); +return test_remove_member_from_bonded_device (); }static int -test_get_slaves_from_bonded_device (void ) +test_get_members_from_bonded_device (void ) { -int current_slave_count; -uint16_t slaves[RTE_MAX_ETHPORTS ]; +int current_member_count; +uint16_t members[RTE_MAX_ETHPORTS ]; -TEST_ASSERT_SUCCESS (test_add_slave_to_bonded_device (), -"Failed to add slave to bonded device" ); +TEST_ASSERT_SUCCESS (test_add_member_to_bonded_device (), +"Failed to add member to bonded device" );/* Invalid port id */ - current_slave_count =rte_eth_bond_slaves_get (INVALID_PORT_ID , slaves, + current_member_count =rte_eth_bond_members_get (INVALID_PORT_ID , members,RTE_MAX_ETHPORTS ); -TEST_ASSERT (current_slave_count <0 , +TEST_ASSERT (current_member_count <0 ,"Invalid port id unexpectedly succeeded" ); - current_slave_count =rte_eth_bond_active_slaves_get (INVALID_PORT_ID , - slaves,RTE_MAX_ETHPORTS ); -TEST_ASSERT (current_slave_count <0 , + current_member_count =rte_eth_bond_active_members_get (INVALID_PORT_ID , + members,RTE_MAX_ETHPORTS ); +TEST_ASSERT (current_member_count <0 ,"Invalid port id unexpectedly succeeded" ); -/* Invalid slaves pointer */ - current_slave_count =rte_eth_bond_slaves_get (test_params->bonded_port_id, +/* Invalid members pointer */ + current_member_count =rte_eth_bond_members_get (test_params->bonded_port_id,NULL ,RTE_MAX_ETHPORTS ); -TEST_ASSERT (current_slave_count <0 , -"Invalid slave array unexpectedly succeeded" ); +TEST_ASSERT (current_member_count <0 , +"Invalid member array unexpectedly succeeded" ); - current_slave_count =rte_eth_bond_active_slaves_get ( + current_member_count =rte_eth_bond_active_members_get ( test_params->bonded_port_id,NULL ,RTE_MAX_ETHPORTS ); -TEST_ASSERT (current_slave_count <0 , -"Invalid slave array unexpectedly succeeded" ); +TEST_ASSERT (current_member_count <0 , +"Invalid member array unexpectedly succeeded" );/* non bonded device*/ - current_slave_count =rte_eth_bond_slaves_get ( - test_params->slave_port_ids[0 ],NULL ,RTE_MAX_ETHPORTS ); -TEST_ASSERT (current_slave_count <0 , + current_member_count =rte_eth_bond_members_get ( + test_params->member_port_ids[0 ],NULL ,RTE_MAX_ETHPORTS ); +TEST_ASSERT (current_member_count <0 ,"Invalid port id unexpectedly succeeded" ); - current_slave_count =rte_eth_bond_active_slaves_get ( - test_params->slave_port_ids[0 ],NULL ,RTE_MAX_ETHPORTS ); -TEST_ASSERT (current_slave_count <0 , + current_member_count =rte_eth_bond_active_members_get ( + test_params->member_port_ids[0 ],NULL ,RTE_MAX_ETHPORTS ); +TEST_ASSERT (current_member_count <0 ,"Invalid port id unexpectedly succeeded" ); -TEST_ASSERT_SUCCESS (test_remove_slave_from_bonded_device (), -"Failed to remove slaves from bonded device" ); +TEST_ASSERT_SUCCESS (test_remove_member_from_bonded_device (), +"Failed to remove members from bonded device" );return 0 ; }static int -test_add_remove_multiple_slaves_to_from_bonded_device (void ) +test_add_remove_multiple_members_to_from_bonded_device (void ) {int i;for (i =0 ; i <TEST_MAX_NUMBER_OF_PORTS ; i++) -TEST_ASSERT_SUCCESS (test_add_slave_to_bonded_device (), -"Failed to add slave to bonded device" ); +TEST_ASSERT_SUCCESS (test_add_member_to_bonded_device (), +"Failed to add member to bonded device" );for (i =0 ; i <TEST_MAX_NUMBER_OF_PORTS ; i++) -TEST_ASSERT_SUCCESS (test_remove_slave_from_bonded_device (), -"Failed to remove slaves from bonded device" ); +TEST_ASSERT_SUCCESS (test_remove_member_from_bonded_device (), +"Failed to remove members from bonded device" );return 0 ; }static void -enable_bonded_slaves (void ) +enable_bonded_members (void ) {int i; -for (i =0 ; i < test_params->bonded_slave_count; i++) { -virtual_ethdev_tx_burst_fn_set_success (test_params->slave_port_ids[i], +for (i =0 ; i < test_params->bonded_member_count; i++) { +virtual_ethdev_tx_burst_fn_set_success (test_params->member_port_ids[i],1 );virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[i],1 ); + test_params->member_port_ids[i],1 ); } }@@ -556,34 +556,36 @@ test_start_bonded_device(void) {struct rte_eth_link link_status; -int current_slave_count, current_bonding_mode, primary_port; -uint16_t slaves[RTE_MAX_ETHPORTS ]; +int current_member_count, current_bonding_mode, primary_port; +uint16_t members[RTE_MAX_ETHPORTS ];int retval; -/* Add slave to bonded device*/ -TEST_ASSERT_SUCCESS (test_add_slave_to_bonded_device (), -"Failed to add slave to bonded device" ); +/* Add member to bonded device*/ +TEST_ASSERT_SUCCESS (test_add_member_to_bonded_device (), +"Failed to add member to bonded device" );TEST_ASSERT_SUCCESS (rte_eth_dev_start (test_params->bonded_port_id),"Failed to start bonded pmd eth device %d." , test_params->bonded_port_id); -/* Change link status of virtual pmd so it will be added to the active -* slave list of the bonded device*/ +/* +* Change link status of virtual pmd so it will be added to the active +* member 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->member_port_ids[test_params->bonded_member_count-1 ],1 ); - current_slave_count =rte_eth_bond_slaves_get (test_params->bonded_port_id, - slaves,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (current_slave_count, test_params->bonded_slave_count, -"Number of slaves (%d) is not expected value (%d)." , - current_slave_count, test_params->bonded_slave_count); + current_member_count =rte_eth_bond_members_get (test_params->bonded_port_id, + members,RTE_MAX_ETHPORTS ); +TEST_ASSERT_EQUAL (current_member_count, test_params->bonded_member_count, +"Number of members (%d) is not expected value (%d)." , + current_member_count, test_params->bonded_member_count); - current_slave_count =rte_eth_bond_active_slaves_get ( - test_params->bonded_port_id, slaves,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (current_slave_count, test_params->bonded_slave_count, -"Number of active slaves (%d) is not expected value (%d)." , - current_slave_count, test_params->bonded_slave_count); + current_member_count =rte_eth_bond_active_members_get ( + test_params->bonded_port_id, members,RTE_MAX_ETHPORTS ); +TEST_ASSERT_EQUAL (current_member_count, test_params->bonded_member_count, +"Number of active members (%d) is not expected value (%d)." , + current_member_count, test_params->bonded_member_count); current_bonding_mode =rte_eth_bond_mode_get (test_params->bonded_port_id); TEST_ASSERT_EQUAL(current_bonding_mode, test_params->bonding_mode,@@ -591,9 +593,9 @@ test_start_bonded_device(void) current_bonding_mode, test_params->bonding_mode); primary_port =rte_eth_bond_primary_get (test_params->bonded_port_id); -TEST_ASSERT_EQUAL (primary_port, test_params->slave_port_ids[0 ], +TEST_ASSERT_EQUAL (primary_port, test_params->member_port_ids[0 ],"Primary port (%d) is not expected value (%d)." , - primary_port, test_params->slave_port_ids[0 ]); + primary_port, test_params->member_port_ids[0 ]); retval =rte_eth_link_get (test_params->bonded_port_id, &link_status); TEST_ASSERT(retval >= 0,@@ -609,8 +611,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_member_count; +uint16_t members[RTE_MAX_ETHPORTS ];struct rte_eth_link link_status;int retval;@@ -627,29 +629,29 @@ test_stop_bonded_device(void)"Bonded port (%d) status (%d) is not expected value (%d)." , test_params->bonded_port_id, link_status.link_status, 0); - current_slave_count =rte_eth_bond_slaves_get (test_params->bonded_port_id, - slaves,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (current_slave_count, test_params->bonded_slave_count, -"Number of slaves (%d) is not expected value (%d)." , - current_slave_count, test_params->bonded_slave_count); + current_member_count =rte_eth_bond_members_get (test_params->bonded_port_id, + members,RTE_MAX_ETHPORTS ); +TEST_ASSERT_EQUAL (current_member_count, test_params->bonded_member_count, +"Number of members (%d) is not expected value (%d)." , + current_member_count, test_params->bonded_member_count); - current_slave_count =rte_eth_bond_active_slaves_get ( - test_params->bonded_port_id, slaves,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (current_slave_count,0 , -"Number of active slaves (%d) is not expected value (%d)." , - current_slave_count,0 ); + current_member_count =rte_eth_bond_active_members_get ( + test_params->bonded_port_id, members,RTE_MAX_ETHPORTS ); +TEST_ASSERT_EQUAL (current_member_count,0 , +"Number of active members (%d) is not expected value (%d)." , + current_member_count,0 );return 0 ; }static int -remove_slaves_and_stop_bonded_device (void ) +remove_members_and_stop_bonded_device (void ) { -/* Clean up and remove slaves from bonded device */ +/* Clean up and remove members 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_member_count >0 ) +TEST_ASSERT_SUCCESS (test_remove_member_from_bonded_device (), +"test_remove_member_from_bonded_device failed" ); TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), "Failed to stop bonded port %u",@@ -681,10 +683,10 @@ test_set_bonding_mode(void) INVALID_PORT_ID);/* Non bonded device */ -TEST_ASSERT_FAIL (rte_eth_bond_mode_set (test_params->slave_port_ids[0 ], +TEST_ASSERT_FAIL (rte_eth_bond_mode_set (test_params->member_port_ids[0 ], bonding_modes[i]),"Expected call to failed as invalid port (%d) specified." , - test_params->slave_port_ids[0 ]); + test_params->member_port_ids[0 ]); TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id, bonding_modes[i]),@@ -704,26 +706,26 @@ test_set_bonding_mode(void) INVALID_PORT_ID);/* Non bonded device */ - bonding_mode =rte_eth_bond_mode_get (test_params->slave_port_ids[0 ]); + bonding_mode =rte_eth_bond_mode_get (test_params->member_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->member_port_ids[0 ]); } -return remove_slaves_and_stop_bonded_device (); +return remove_members_and_stop_bonded_device (); }static int -test_set_primary_slave (void ) +test_set_primary_member (void ) {int i, j, retval;struct rte_ether_addr read_mac_addr;struct rte_ether_addr *expected_mac_addr; -/* Add 4 slaves to bonded device */ -for (i = test_params->bonded_slave_count; i <4 ; i++) -TEST_ASSERT_SUCCESS (test_add_slave_to_bonded_device (), -"Failed to add slave to bonded device." ); +/* Add 4 members to bonded device */ +for (i = test_params->bonded_member_count; i <4 ; i++) +TEST_ASSERT_SUCCESS (test_add_member_to_bonded_device (), +"Failed to add member to bonded device." ); TEST_ASSERT_SUCCESS(rte_eth_bond_mode_set(test_params->bonded_port_id, BONDING_MODE_ROUND_ROBIN),@@ -732,34 +734,34 @@ test_set_primary_slave(void)/* Invalid port ID */ TEST_ASSERT_FAIL (rte_eth_bond_primary_set (INVALID_PORT_ID , - test_params->slave_port_ids[i]), + test_params->member_port_ids[i]),"Expected call to failed as invalid port specified." );/* Non bonded device */ -TEST_ASSERT_FAIL (rte_eth_bond_primary_set (test_params->slave_port_ids[i], - test_params->slave_port_ids[i]), +TEST_ASSERT_FAIL (rte_eth_bond_primary_set (test_params->member_port_ids[i], + test_params->member_port_ids[i]),"Expected call to failed as invalid port specified." ); -/* Set slave as primary -* Verify slave it is now primary slave -* Verify that MAC address of bonded device is that of primary slave -* Verify that MAC address of all bonded slaves are that of primary slave +/* Set member as primary +* Verify member it is now primary member +* Verify that MAC address of bonded device is that of primary member +* Verify that MAC address of all bonded members are that of primary member */ for (i =0 ; i <4 ; i++) {TEST_ASSERT_SUCCESS (rte_eth_bond_primary_set (test_params->bonded_port_id, - test_params->slave_port_ids[i]), + test_params->member_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->member_port_ids[i]); retval =rte_eth_bond_primary_get (test_params->bonded_port_id);TEST_ASSERT (retval >=0 ,"Failed to read primary port from bonded port (%d)\n" , test_params->bonded_port_id); -TEST_ASSERT_EQUAL (retval, test_params->slave_port_ids[i], +TEST_ASSERT_EQUAL (retval, test_params->member_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->member_port_ids[i]);/* stop/start bonded eth dev to apply new MAC */ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id),@@ -770,13 +772,14 @@ test_set_primary_slave(void)"Failed to start bonded port %d" , test_params->bonded_port_id); - expected_mac_addr = (struct rte_ether_addr *)&slave_mac; + expected_mac_addr = (struct rte_ether_addr *)&member_mac; expected_mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = i; -/* Check primary slave MAC */ -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[i], &read_mac_addr), +/* Check primary member MAC */ +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[i], + &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[i]); + test_params->member_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 +792,17 @@ test_set_primary_slave(void) sizeof(read_mac_addr)), "bonded port mac address not set to that of primary port\n"); -/* Check other slaves MACs */ +/* Check other members MACs */ for (j =0 ; j <4 ; j++) {if (j != i) { -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[j], +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get ( + test_params->member_port_ids[j], &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[j]); + test_params->member_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 " +"member port mac address not set to that of primary " "port" ); } }@@ -809,14 +813,14 @@ test_set_primary_slave(void)TEST_ASSERT_FAIL (rte_eth_bond_primary_get (test_params->bonded_port_id +10 ),"read primary port from expectedly" ); -/* Test with slave port */ -TEST_ASSERT_FAIL (rte_eth_bond_primary_get (test_params->slave_port_ids[0 ]), +/* Test with member port */ +TEST_ASSERT_FAIL (rte_eth_bond_primary_get (test_params->member_port_ids[0 ]),"read primary port from expectedly\n" ); -TEST_ASSERT_SUCCESS (remove_slaves_and_stop_bonded_device (), -"Failed to stop and remove slaves from bonded device" ); +TEST_ASSERT_SUCCESS (remove_members_and_stop_bonded_device (), +"Failed to stop and remove members from bonded device" ); -/* No slaves */ +/* No members */ TEST_ASSERT (rte_eth_bond_primary_get (test_params->bonded_port_id) <0 ,"read primary port from expectedly\n" );@@ -840,7 +844,7 @@ test_set_explicit_bonded_mac(void)/* Non bonded device */ TEST_ASSERT_FAIL (rte_eth_bond_mac_address_set ( - test_params->slave_port_ids[0 ], mac_addr), + test_params->member_port_ids[0 ], mac_addr),"Expected call to failed as invalid port specified." );/* NULL MAC address */ @@ -853,10 +857,10 @@ test_set_explicit_bonded_mac(void)"Failed to set MAC address on bonded port (%d)" , test_params->bonded_port_id); -/* Add 4 slaves to bonded device */ -for (i = test_params->bonded_slave_count; i <4 ; i++) { -TEST_ASSERT_SUCCESS (test_add_slave_to_bonded_device (), -"Failed to add slave to bonded device.\n" ); +/* Add 4 members to bonded device */ +for (i = test_params->bonded_member_count; i <4 ; i++) { +TEST_ASSERT_SUCCESS (test_add_member_to_bonded_device (), +"Failed to add member to bonded device.\n" ); }/* Check bonded MAC */ @@ -866,14 +870,15 @@ test_set_explicit_bonded_mac(void)TEST_ASSERT_SUCCESS (memcmp (mac_addr, &read_mac_addr,sizeof (read_mac_addr)),"bonded port mac address not set to that of primary port" ); -/* Check other slaves MACs */ +/* Check other members MACs */ for (i =0 ; i <4 ; i++) { -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[i], &read_mac_addr), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[i], + &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[i]); + test_params->member_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" ); +"member port mac address not set to that of primary port" ); }/* test resetting mac address on bonded device */ @@ -883,13 +888,13 @@ test_set_explicit_bonded_mac(void) test_params->bonded_port_id);TEST_ASSERT_FAIL ( -rte_eth_bond_mac_address_reset (test_params->slave_port_ids[0 ]), +rte_eth_bond_mac_address_reset (test_params->member_port_ids[0 ]),"Reset MAC address on bonded port (%d) unexpectedly" , - test_params->slave_port_ids[1 ]); + test_params->member_port_ids[1 ]); -/* test resetting mac address on bonded device with no slaves */ -TEST_ASSERT_SUCCESS (remove_slaves_and_stop_bonded_device (), -"Failed to remove slaves and stop bonded device" ); +/* test resetting mac address on bonded device with no members */ +TEST_ASSERT_SUCCESS (remove_members_and_stop_bonded_device (), +"Failed to remove members and stop bonded device" ); TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_reset(test_params->bonded_port_id), "Failed to reset MAC address on bonded port (%d)",@@ -898,25 +903,25 @@ test_set_explicit_bonded_mac(void)return 0 ; } -#define BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT (3) +#define BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT (3)static int test_set_bonded_port_initialization_mac_assignment (void ) { -int i, slave_count; +int i, member_count; -uint16_t slaves[RTE_MAX_ETHPORTS ]; +uint16_t members[RTE_MAX_ETHPORTS ];static int bonded_port_id =-1 ; -static int slave_port_ids[BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT ]; +static int member_port_ids[BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT ]; -struct rte_ether_addr slave_mac_addr, bonded_mac_addr, read_mac_addr; +struct rte_ether_addr member_mac_addr, bonded_mac_addr, read_mac_addr;/* Initialize default values for MAC addresses */ -memcpy (&slave_mac_addr, slave_mac,sizeof (struct rte_ether_addr )); -memcpy (&bonded_mac_addr, slave_mac,sizeof (struct rte_ether_addr )); +memcpy (&member_mac_addr, member_mac,sizeof (struct rte_ether_addr )); +memcpy (&bonded_mac_addr, member_mac,sizeof (struct rte_ether_addr ));/* -* 1. a - Create / configure bonded / slave ethdevs +* 1. a - Create / configure bonded / member ethdevs */ if (bonded_port_id ==-1 ) { bonded_port_id = rte_eth_bond_create("net_bonding_mac_ass_test",@@ -927,46 +932,46 @@ test_set_bonded_port_initialization_mac_assignment(void) "Failed to configure bonded ethdev"); } -if (!mac_slaves_initialized) { -for (i =0 ; i <BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT ; i++) { +if (!mac_members_initialized) { +for (i =0 ; i <BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT ; i++) {char pmd_name[RTE_ETH_NAME_MAX_LEN ]; - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = + member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = i +100 ;snprintf (pmd_name,RTE_ETH_NAME_MAX_LEN , -"eth_slave_%d" , i); +"eth_member_%d" , i); - slave_port_ids[i] =virtual_ethdev_create (pmd_name, - &slave_mac_addr,rte_socket_id (),1 ); + member_port_ids[i] =virtual_ethdev_create (pmd_name, + &member_mac_addr,rte_socket_id (),1 ); -TEST_ASSERT (slave_port_ids[i] >=0 , -"Failed to create slave ethdev %s" , +TEST_ASSERT (member_port_ids[i] >=0 , +"Failed to create member ethdev %s" , pmd_name); -TEST_ASSERT_SUCCESS (configure_ethdev (slave_port_ids[i],1 ,0 ), +TEST_ASSERT_SUCCESS (configure_ethdev (member_port_ids[i],1 ,0 ),"Failed to configure virtual ethdev %s" , pmd_name); } - mac_slaves_initialized =1 ; + mac_members_initialized =1 ; }/* -* 2. Add slave ethdevs to bonded device +* 2. Add member ethdevs to bonded device */ -for (i =0 ; i <BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT ; i++) { -TEST_ASSERT_SUCCESS (rte_eth_bond_slave_add (bonded_port_id, - slave_port_ids[i]), -"Failed to add slave (%d) to bonded port (%d)." , - slave_port_ids[i], bonded_port_id); +for (i =0 ; i <BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT ; i++) { +TEST_ASSERT_SUCCESS (rte_eth_bond_member_add (bonded_port_id, + member_port_ids[i]), +"Failed to add member (%d) to bonded port (%d)." , + member_port_ids[i], bonded_port_id); } - slave_count =rte_eth_bond_slaves_get (bonded_port_id, slaves, + member_count =rte_eth_bond_members_get (bonded_port_id, members,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_MEMBER_COUNT , member_count, +"Number of members (%d) is not as expected (%d)" , + member_count,BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT );/* @@ -982,16 +987,16 @@ test_set_bonded_port_initialization_mac_assignment(void)/* 4. a - Start bonded ethdev -* b - Enable slave devices -* c - Verify bonded/slaves ethdev MAC addresses +* b - Enable member devices +* c - Verify bonded/members ethdev MAC addresses */ TEST_ASSERT_SUCCESS (rte_eth_dev_start (bonded_port_id),"Failed to start bonded pmd eth device %d." , bonded_port_id); -for (i =0 ; i <BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT ; i++) { +for (i =0 ; i <BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT ; i++) {virtual_ethdev_simulate_link_status_interrupt ( - slave_port_ids[i],1 ); + member_port_ids[i],1 ); } TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(bonded_port_id, &read_mac_addr),@@ -1001,36 +1006,36 @@ test_set_bonded_port_initialization_mac_assignment(void) sizeof(read_mac_addr)), "bonded port mac address not as expected"); -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (slave_port_ids[0 ], &read_mac_addr), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (member_port_ids[0 ], &read_mac_addr),"Failed to get mac address (port %d)" , - slave_port_ids[0 ]); + member_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" ); +"member port 0 mac address not as expected" ); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =1 +100 ; -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (slave_port_ids[1 ], &read_mac_addr), + member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =1 +100 ; +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (member_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, + member_port_ids[1 ]); +TEST_ASSERT_SUCCESS (memcmp (&member_mac_addr, &read_mac_addr,sizeof (read_mac_addr)), -"slave port 1 mac address not as expected" ); +"member port 1 mac address not as expected" ); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =2 +100 ; -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (slave_port_ids[2 ], &read_mac_addr), + member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =2 +100 ; +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (member_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, + member_port_ids[2 ]); +TEST_ASSERT_SUCCESS (memcmp (&member_mac_addr, &read_mac_addr,sizeof (read_mac_addr)), -"slave port 2 mac address not as expected" ); +"member port 2 mac address not as expected" );/* 7. a - Change primary port * b - Stop / Start bonded port -* d - Verify slave ethdev MAC addresses +* d - Verify member ethdev MAC addresses */ TEST_ASSERT_SUCCESS (rte_eth_bond_primary_set (bonded_port_id, - slave_port_ids[2 ]), + member_port_ids[2 ]),"failed to set primary port on bonded device." ); TEST_ASSERT_SUCCESS(rte_eth_dev_stop(bonded_port_id),@@ -1048,94 +1053,94 @@ test_set_bonded_port_initialization_mac_assignment(void) sizeof(read_mac_addr)), "bonded port mac address not as expected"); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =0 +100 ; -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (slave_port_ids[0 ], &read_mac_addr), + member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =0 +100 ; +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (member_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, + member_port_ids[0 ]); +TEST_ASSERT_SUCCESS (memcmp (&member_mac_addr, &read_mac_addr,sizeof (read_mac_addr)), -"slave port 0 mac address not as expected" ); +"member port 0 mac address not as expected" ); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =1 +100 ; -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (slave_port_ids[1 ], &read_mac_addr), + member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =1 +100 ; +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (member_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, + member_port_ids[1 ]); +TEST_ASSERT_SUCCESS (memcmp (&member_mac_addr, &read_mac_addr,sizeof (read_mac_addr)), -"slave port 1 mac address not as expected" ); +"member port 1 mac address not as expected" ); -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (slave_port_ids[2 ], &read_mac_addr), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (member_port_ids[2 ], &read_mac_addr),"Failed to get mac address (port %d)" , - slave_port_ids[2 ]); + member_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" ); +"member port 2 mac address not as expected" );/* 6. a - Stop bonded ethdev -* b - remove slave ethdevs -* c - Verify slave ethdevs MACs are restored +* b - remove member ethdevs +* c - Verify member ethdevs MACs are restored */ TEST_ASSERT_SUCCESS (rte_eth_dev_stop (bonded_port_id),"Failed to stop bonded port %u" , bonded_port_id); -for (i =0 ; i <BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT ; i++) { -TEST_ASSERT_SUCCESS (rte_eth_bond_slave_remove (bonded_port_id, - slave_port_ids[i]), -"Failed to remove slave %d from bonded port (%d)." , - slave_port_ids[i], bonded_port_id); +for (i =0 ; i <BONDED_INIT_MAC_ASSIGNMENT_MEMBER_COUNT ; i++) { +TEST_ASSERT_SUCCESS (rte_eth_bond_member_remove (bonded_port_id, + member_port_ids[i]), +"Failed to remove member %d from bonded port (%d)." , + member_port_ids[i], bonded_port_id); } - slave_count =rte_eth_bond_slaves_get (bonded_port_id, slaves, + member_count =rte_eth_bond_members_get (bonded_port_id, members,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (slave_count,0 , -"Number of slaves (%d) is great than expected (%d)." , - slave_count,0 ); +TEST_ASSERT_EQUAL (member_count,0 , +"Number of members (%d) is great than expected (%d)." , + member_count,0 ); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =0 +100 ; -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (slave_port_ids[0 ], &read_mac_addr), + member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =0 +100 ; +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (member_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, + member_port_ids[0 ]); +TEST_ASSERT_SUCCESS (memcmp (&member_mac_addr, &read_mac_addr,sizeof (read_mac_addr)), -"slave port 0 mac address not as expected" ); +"member port 0 mac address not as expected" ); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =1 +100 ; -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (slave_port_ids[1 ], &read_mac_addr), + member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =1 +100 ; +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (member_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, + member_port_ids[1 ]); +TEST_ASSERT_SUCCESS (memcmp (&member_mac_addr, &read_mac_addr,sizeof (read_mac_addr)), -"slave port 1 mac address not as expected" ); +"member port 1 mac address not as expected" ); - slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =2 +100 ; -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (slave_port_ids[2 ], &read_mac_addr), + member_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] =2 +100 ; +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (member_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, + member_port_ids[2 ]); +TEST_ASSERT_SUCCESS (memcmp (&member_mac_addr, &read_mac_addr,sizeof (read_mac_addr)), -"slave port 2 mac address not as expected" ); +"member port 2 mac address not as expected" );return 0 ; }static int -initialize_bonded_device_with_slaves (uint8_t bonding_mode,uint8_t bond_en_isr, -uint16_t number_of_slaves,uint8_t enable_slave) +initialize_bonded_device_with_members (uint8_t bonding_mode,uint8_t bond_en_isr, +uint16_t number_of_members,uint8_t enable_member) {/* 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) members." , test_params->bonded_port_id, bonding_mode, + number_of_members); + +/* Add members to bonded device */ +while (number_of_members > test_params->bonded_member_count) +TEST_ASSERT_SUCCESS (test_add_member_to_bonded_device (), +"Failed to add member (%d to bonding port (%d)." , + test_params->bonded_member_count -1 , test_params->bonded_port_id);/* Set link bonding mode */ @@ -1148,40 +1153,40 @@ initialize_bonded_device_with_slaves(uint8_t bonding_mode, uint8_t bond_en_isr,"Failed to start bonded pmd eth device %d." , test_params->bonded_port_id); -if (enable_slave) -enable_bonded_slaves (); +if (enable_member) +enable_bonded_members ();return 0 ; }static int -test_adding_slave_after_bonded_device_started (void ) +test_adding_member_after_bonded_device_started (void ) {int i; -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ROUND_ROBIN ,0 ,4 ,0 ), -"Failed to add slaves to bonded device" ); +"Failed to add members to bonded device" ); -/* Enabled slave devices */ -for (i =0 ; i < test_params->bonded_slave_count +1 ; i++) { +/* Enabled member devices */ +for (i =0 ; i < test_params->bonded_member_count +1 ; i++) {virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[i],1 ); + test_params->member_port_ids[i],1 ); } -TEST_ASSERT_SUCCESS (rte_eth_bond_slave_add (test_params->bonded_port_id, - test_params->slave_port_ids[test_params->bonded_slave_count]), -"Failed to add slave to bonded port.\n" ); +TEST_ASSERT_SUCCESS (rte_eth_bond_member_add (test_params->bonded_port_id, + test_params->member_port_ids[test_params->bonded_member_count]), +"Failed to add member to bonded port.\n" );rte_eth_stats_reset ( - test_params->slave_port_ids[test_params->bonded_slave_count]); + test_params->member_port_ids[test_params->bonded_member_count]); - test_params->bonded_slave_count++; + test_params->bonded_member_count++; -return remove_slaves_and_stop_bonded_device (); +return remove_members_and_stop_bonded_device (); } -#define TEST_STATUS_INTERRUPT_SLAVE_COUNT 4 +#define TEST_STATUS_INTERRUPT_MEMBER_COUNT 4#define TEST_LSC_WAIT_TIMEOUT_US 500000int test_lsc_interrupt_count;@@ -1237,13 +1242,13 @@ lsc_timeout(int wait_us)static int test_status_interrupt (void ) { -int slave_count; -uint16_t slaves[RTE_MAX_ETHPORTS ]; +int member_count; +uint16_t members[RTE_MAX_ETHPORTS ]; -/* initialized bonding device with T slaves */ -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +/* initialized bonding device with T members */ +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ROUND_ROBIN ,1 , -TEST_STATUS_INTERRUPT_SLAVE_COUNT ,1 ), +TEST_STATUS_INTERRUPT_MEMBER_COUNT ,1 ),"Failed to initialise bonded device" ); test_lsc_interrupt_count =0 ;@@ -1253,27 +1258,27 @@ test_status_interrupt(void)RTE_ETH_EVENT_INTR_LSC , test_bonding_lsc_event_callback, &test_params->bonded_port_id); - slave_count =rte_eth_bond_active_slaves_get (test_params->bonded_port_id, - slaves,RTE_MAX_ETHPORTS ); + member_count =rte_eth_bond_active_members_get (test_params->bonded_port_id, + members,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (slave_count,TEST_STATUS_INTERRUPT_SLAVE_COUNT , -"Number of active slaves (%d) is not as expected (%d)" , - slave_count,TEST_STATUS_INTERRUPT_SLAVE_COUNT ); +TEST_ASSERT_EQUAL (member_count,TEST_STATUS_INTERRUPT_MEMBER_COUNT , +"Number of active members (%d) is not as expected (%d)" , + member_count,TEST_STATUS_INTERRUPT_MEMBER_COUNT ); -/* Bring all 4 slaves link status to down and test that we have received a +/* Bring all 4 members link status to down and test that we have received a * lsc interrupts */ virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[0 ],0 ); + test_params->member_port_ids[0 ],0 );virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[1 ],0 ); + test_params->member_port_ids[1 ],0 );virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[2 ],0 ); + test_params->member_port_ids[2 ],0 );TEST_ASSERT_EQUAL (test_lsc_interrupt_count,0 ,"Received a link status change interrupt unexpectedly" );virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[3 ],0 ); + test_params->member_port_ids[3 ],0 );TEST_ASSERT (lsc_timeout (TEST_LSC_WAIT_TIMEOUT_US ) ==0 ,"timed out waiting for interrupt" );@@ -1281,18 +1286,18 @@ test_status_interrupt(void)TEST_ASSERT (test_lsc_interrupt_count >0 ,"Did not receive link status change interrupt" ); - slave_count =rte_eth_bond_active_slaves_get (test_params->bonded_port_id, - slaves,RTE_MAX_ETHPORTS ); + member_count =rte_eth_bond_active_members_get (test_params->bonded_port_id, + members,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (slave_count,0 , -"Number of active slaves (%d) is not as expected (%d)" , - slave_count,0 ); +TEST_ASSERT_EQUAL (member_count,0 , +"Number of active members (%d) is not as expected (%d)" , + member_count,0 ); -/* bring one slave port up so link status will change */ +/* bring one member port up so link status will change */ test_lsc_interrupt_count =0 ;virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[0 ],1 ); + test_params->member_port_ids[0 ],1 );TEST_ASSERT (lsc_timeout (TEST_LSC_WAIT_TIMEOUT_US ) ==0 ,"timed out waiting for interrupt" );@@ -1301,12 +1306,12 @@ test_status_interrupt(void)TEST_ASSERT (test_lsc_interrupt_count >0 ,"Did not receive link status change interrupt" ); -/* Verify that calling the same slave lsc interrupt doesn't cause another +/* Verify that calling the same member lsc interrupt doesn't cause another * lsc interrupt from bonded device */ test_lsc_interrupt_count =0 ;virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[0 ],1 ); + test_params->member_port_ids[0 ],1 );TEST_ASSERT (lsc_timeout (TEST_LSC_WAIT_TIMEOUT_US ) !=0 ,"received unexpected interrupt" );@@ -1320,8 +1325,8 @@ test_status_interrupt(void)RTE_ETH_EVENT_INTR_LSC , test_bonding_lsc_event_callback, &test_params->bonded_port_id); -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); } static int@@ -1398,11 +1403,11 @@ test_roundrobin_tx_burst(void)struct rte_mbuf *pkt_burst[MAX_PKT_BURST ];struct rte_eth_stats port_stats; -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ROUND_ROBIN ,0 ,2 ,1 ),"Failed to initialise bonded device" ); - burst_size =20 * test_params->bonded_slave_count; + burst_size =20 * test_params->bonded_member_count;TEST_ASSERT (burst_size <=MAX_PKT_BURST ,"Burst size specified is greater than supported." );@@ -1423,20 +1428,20 @@ test_roundrobin_tx_burst(void) test_params->bonded_port_id, (unsigned int )port_stats.opackets, burst_size); -/* Verify slave ports tx stats */ -for (i =0 ; i < test_params->bonded_slave_count; i++) { -rte_eth_stats_get (test_params->slave_port_ids[i], &port_stats); +/* Verify member ports tx stats */ +for (i =0 ; i < test_params->bonded_member_count; i++) { +rte_eth_stats_get (test_params->member_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_member_count, +"Member 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_member_count); } -/* Put all slaves down and try and transmit */ -for (i =0 ; i < test_params->bonded_slave_count; i++) { +/* Put all members down and try and transmit */ +for (i =0 ; i < test_params->bonded_member_count; i++) {virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[i],0 ); + test_params->member_port_ids[i],0 ); }/* Send burst on bonded port */ @@ -1444,8 +1449,8 @@ test_roundrobin_tx_burst(void) pkt_burst, burst_size), 0, "tx burst return unexpected value"); -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); } static int@@ -1471,13 +1476,13 @@ free_mbufs(struct rte_mbuf **mbufs, int nb_mbufs)rte_pktmbuf_free (mbufs[i]); } -#define TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT (2) -#define TEST_RR_SLAVE_TX_FAIL_BURST_SIZE (64) -#define TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT (22) -#define TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX (1) +#define TEST_RR_MEMBER_TX_FAIL_MEMBER_COUNT (2) +#define TEST_RR_MEMBER_TX_FAIL_BURST_SIZE (64) +#define TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT (22) +#define TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX (1)static int -test_roundrobin_tx_burst_slave_tx_fail (void ) +test_roundrobin_tx_burst_member_tx_fail (void ) {struct rte_mbuf *pkt_burst[MAX_PKT_BURST ];struct rte_mbuf *expected_tx_fail_pkts[MAX_PKT_BURST ];@@ -1486,49 +1491,51 @@ test_roundrobin_tx_burst_slave_tx_fail(void)int i, first_fail_idx, tx_count; -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ROUND_ROBIN ,0 , -TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT ,1 ), +TEST_RR_MEMBER_TX_FAIL_MEMBER_COUNT ,1 ),"Failed to initialise bonded device" );/* Generate test bursts of packets to transmit */ TEST_ASSERT_EQUAL (generate_test_burst (pkt_burst, -TEST_RR_SLAVE_TX_FAIL_BURST_SIZE ,0 ,1 ,0 ,0 ,0 ), -TEST_RR_SLAVE_TX_FAIL_BURST_SIZE , +TEST_RR_MEMBER_TX_FAIL_BURST_SIZE ,0 ,1 ,0 ,0 ,0 ), +TEST_RR_MEMBER_TX_FAIL_BURST_SIZE ,"Failed to generate test packet burst" );/* Copy references to packets which we expect not to be transmitted */ - first_fail_idx = (TEST_RR_SLAVE_TX_FAIL_BURST_SIZE - - (TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT * -TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT )) + -TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX ; + first_fail_idx = (TEST_RR_MEMBER_TX_FAIL_BURST_SIZE - + (TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT * +TEST_RR_MEMBER_TX_FAIL_MEMBER_COUNT )) + +TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX ; -for (i =0 ; i <TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT ; i++) { +for (i =0 ; i <TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT ; i++) { expected_tx_fail_pkts[i] = pkt_burst[first_fail_idx + - (i *TEST_RR_SLAVE_TX_FAIL_SLAVE_COUNT )]; + (i *TEST_RR_MEMBER_TX_FAIL_MEMBER_COUNT )]; } -/* Set virtual slave to only fail transmission of -* TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT packets in burst */ +/* +* Set virtual member to only fail transmission of +* TEST_RR_MEMBER_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->member_port_ids[TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX ],0 );virtual_ethdev_tx_burst_fn_set_tx_pkt_fail_count ( - test_params->slave_port_ids[TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX ], -TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT ); + test_params->member_port_ids[TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX ], +TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT ); tx_count =rte_eth_tx_burst (test_params->bonded_port_id,0 , pkt_burst, -TEST_RR_SLAVE_TX_FAIL_BURST_SIZE ); +TEST_RR_MEMBER_TX_FAIL_BURST_SIZE ); -TEST_ASSERT_EQUAL (tx_count,TEST_RR_SLAVE_TX_FAIL_BURST_SIZE - -TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT , +TEST_ASSERT_EQUAL (tx_count,TEST_RR_MEMBER_TX_FAIL_BURST_SIZE - +TEST_RR_MEMBER_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_MEMBER_TX_FAIL_BURST_SIZE - +TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT );/* Verify that failed packet are expected failed packets */ -for (i =0 ; i <TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT ; i++) { +for (i =0 ; i <TEST_RR_MEMBER_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 +1545,45 @@ test_roundrobin_tx_burst_slave_tx_fail(void)rte_eth_stats_get (test_params->bonded_port_id, &port_stats);TEST_ASSERT_EQUAL (port_stats.opackets, - (uint64_t )TEST_RR_SLAVE_TX_FAIL_BURST_SIZE - -TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT , + (uint64_t )TEST_RR_MEMBER_TX_FAIL_BURST_SIZE - +TEST_RR_MEMBER_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_MEMBER_TX_FAIL_BURST_SIZE - +TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT ); -/* Verify slave ports tx stats */ -for (i =0 ; i < test_params->bonded_slave_count; i++) { -int slave_expected_tx_count; +/* Verify member ports tx stats */ +for (i =0 ; i < test_params->bonded_member_count; i++) { +int member_expected_tx_count; -rte_eth_stats_get (test_params->slave_port_ids[i], &port_stats); +rte_eth_stats_get (test_params->member_port_ids[i], &port_stats); - slave_expected_tx_count =TEST_RR_SLAVE_TX_FAIL_BURST_SIZE / - test_params->bonded_slave_count; + member_expected_tx_count =TEST_RR_MEMBER_TX_FAIL_BURST_SIZE / + test_params->bonded_member_count; -if (i ==TEST_RR_SLAVE_TX_FAIL_FAILING_SLAVE_IDX ) - slave_expected_tx_count = slave_expected_tx_count - -TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT ; +if (i ==TEST_RR_MEMBER_TX_FAIL_FAILING_MEMBER_IDX ) + member_expected_tx_count = member_expected_tx_count - +TEST_RR_MEMBER_TX_FAIL_PACKETS_COUNT ;TEST_ASSERT_EQUAL (port_stats.opackets, - (uint64_t )slave_expected_tx_count, -"Slave Port (%d) opackets value (%u) not as expected (%d)" , - test_params->slave_port_ids[i], - (unsigned int )port_stats.opackets, slave_expected_tx_count); + (uint64_t )member_expected_tx_count, +"Member Port (%d) opackets value (%u) not as expected (%d)" , + test_params->member_port_ids[i], + (unsigned int )port_stats.opackets, member_expected_tx_count); }/* Verify that all mbufs have a ref value of zero */ TEST_ASSERT_SUCCESS (verify_mbufs_ref_count (&pkt_burst[tx_count], -TEST_RR_SLAVE_TX_FAIL_PACKETS_COUNT ,1 ), +TEST_RR_MEMBER_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_MEMBER_TX_FAIL_PACKETS_COUNT ); -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); }static int -test_roundrobin_rx_burst_on_single_slave (void ) +test_roundrobin_rx_burst_on_single_member (void ) {struct rte_mbuf *gen_pkt_burst[MAX_PKT_BURST ] = {NULL };struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST ] = {NULL };@@ -1585,19 +1592,19 @@ test_roundrobin_rx_burst_on_single_slave(void)int i, j, burst_size =25 ; -/* Initialize bonded device with 4 slaves in round robin mode */ -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +/* Initialize bonded device with 4 members in round robin mode */ +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ROUND_ROBIN ,0 ,4 ,1 ), -"Failed to initialize bonded device with slaves" ); +"Failed to initialize bonded device with members" );/* Generate test bursts of packets to transmit */ TEST_ASSERT_EQUAL (generate_test_burst ( gen_pkt_burst, burst_size,0 ,1 ,0 ,0 ,0 ), burst_size,"burst generation failed" ); -for (i =0 ; i < test_params->bonded_slave_count; i++) { -/* Add rx data to slave */ -virtual_ethdev_add_mbufs_to_rx_queue (test_params->slave_port_ids[i], +for (i =0 ; i < test_params->bonded_member_count; i++) { +/* Add rx data to member */ +virtual_ethdev_add_mbufs_to_rx_queue (test_params->member_port_ids[i], &gen_pkt_burst[0 ], burst_size);/* Call rx burst on bonded device */ @@ -1616,25 +1623,25 @@ test_roundrobin_rx_burst_on_single_slave(void) -/* Verify bonded slave devices rx count */ -/* Verify slave ports tx stats */ -for (j =0 ; j < test_params->bonded_slave_count; j++) { -rte_eth_stats_get (test_params->slave_port_ids[j], &port_stats); +/* Verify bonded member devices rx count */ +/* Verify member ports tx stats */ +for (j =0 ; j < test_params->bonded_member_count; j++) { +rte_eth_stats_get (test_params->member_port_ids[j], &port_stats);if (i == j) {TEST_ASSERT_EQUAL (port_stats.ipackets, (uint64_t )burst_size, -"Slave Port (%d) ipackets value (%u) not as expected" -" (%d)" , test_params->slave_port_ids[i], +"Member Port (%d) ipackets value (%u) not as expected" +" (%d)" , test_params->member_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], +"Member Port (%d) ipackets value (%u) not as expected" +" (%d)" , test_params->member_port_ids[i], (unsigned int )port_stats.ipackets,0 ); } -/* Reset bonded slaves stats */ -rte_eth_stats_reset (test_params->slave_port_ids[j]); +/* Reset bonded members stats */ +rte_eth_stats_reset (test_params->member_port_ids[j]); }/* reset bonded device stats */ rte_eth_stats_reset (test_params->bonded_port_id);@@ -1646,38 +1653,38 @@ test_roundrobin_rx_burst_on_single_slave(void) } -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); } -#define TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT (3) +#define TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT (3)static int -test_roundrobin_rx_burst_on_multiple_slaves (void ) +test_roundrobin_rx_burst_on_multiple_members (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_MEMBER_COUNT ][MAX_PKT_BURST ];struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST ] = {NULL };struct rte_eth_stats port_stats; -int burst_size[TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT ] = {15 ,13 ,36 }; +int burst_size[TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT ] = {15 ,13 ,36 };int i, nb_rx; -/* Initialize bonded device with 4 slaves in round robin mode */ -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +/* Initialize bonded device with 4 members in round robin mode */ +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ROUND_ROBIN ,0 ,4 ,1 ), -"Failed to initialize bonded device with slaves" ); +"Failed to initialize bonded device with members" );/* Generate test bursts of packets to transmit */ -for (i =0 ; i <TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT ; i++) { +for (i =0 ; i <TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT ; i++) {TEST_ASSERT_EQUAL (generate_test_burst ( &gen_pkt_burst[i][0 ], burst_size[i],0 ,1 ,0 ,0 ,0 ), burst_size[i],"burst generation failed" ); } -/* Add rx data to slaves */ -for (i =0 ; i <TEST_ROUNDROBIN_TX_BURST_SLAVE_COUNT ; i++) { -virtual_ethdev_add_mbufs_to_rx_queue (test_params->slave_port_ids[i], +/* Add rx data to members */ +for (i =0 ; i <TEST_ROUNDROBIN_TX_BURST_MEMBER_COUNT ; i++) { +virtual_ethdev_add_mbufs_to_rx_queue (test_params->member_port_ids[i], &gen_pkt_burst[i][0 ], burst_size[i]); }@@ -1697,29 +1704,29 @@ test_roundrobin_rx_burst_on_multiple_slaves(void) test_params->bonded_port_id, (unsigned int )port_stats.ipackets, burst_size[0] + burst_size[1] + burst_size[2]); -/* Verify bonded slave devices rx counts */ -rte_eth_stats_get (test_params->slave_port_ids[0 ], &port_stats); +/* Verify bonded member devices rx counts */ +rte_eth_stats_get (test_params->member_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 ], +"Member Port (%d) ipackets value (%u) not as expected (%d)" , + test_params->member_port_ids[0 ], (unsigned int )port_stats.ipackets, burst_size[0 ]); -rte_eth_stats_get (test_params->slave_port_ids[1 ], &port_stats); +rte_eth_stats_get (test_params->member_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, +"Member Port (%d) ipackets value (%u) not as expected (%d)" , + test_params->member_port_ids[1 ], (unsigned int )port_stats.ipackets, burst_size[1 ]); -rte_eth_stats_get (test_params->slave_port_ids[2 ], &port_stats); +rte_eth_stats_get (test_params->member_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 ], +"Member Port (%d) ipackets value (%u) not as expected (%d)" , + test_params->member_port_ids[2 ], (unsigned int )port_stats.ipackets, burst_size[2 ]); -rte_eth_stats_get (test_params->slave_port_ids[3 ], &port_stats); +rte_eth_stats_get (test_params->member_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 ], +"Member Port (%d) ipackets value (%u) not as expected (%d)" , + test_params->member_port_ids[3 ], (unsigned int )port_stats.ipackets,0 );/* free mbufs */ @@ -1727,8 +1734,8 @@ test_roundrobin_rx_burst_on_multiple_slaves(void)rte_pktmbuf_free (rx_pkt_burst[i]); } -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); } static int@@ -1739,48 +1746,54 @@ test_roundrobin_verify_mac_assignment(void)int i; -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[0 ], &expected_mac_addr_0), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_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->member_port_ids[0 ]); +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[2 ], + &expected_mac_addr_2),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[2 ]); + test_params->member_port_ids[2 ]); -/* Initialize bonded device with 4 slaves in round robin mode */ -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +/* Initialize bonded device with 4 members in round robin mode */ +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ROUND_ROBIN ,0 ,4 ,1 ), -"Failed to initialize bonded device with slaves" ); +"Failed to initialize bonded device with members" ); -/* Verify that all MACs are the same as first slave added to bonded dev */ -for (i =0 ; i < test_params->bonded_slave_count; i++) { -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[i], &read_mac_addr), +/* Verify that all MACs are the same as first member added to bonded dev */ +for (i =0 ; i < test_params->bonded_member_count; i++) { +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[i], + &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[i]); + test_params->member_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]); +"member port (%d) mac address not set to that of primary port" , + test_params->member_port_ids[i]); }/* change primary and verify that MAC addresses haven't changed */ TEST_ASSERT_SUCCESS (rte_eth_bond_primary_set (test_params->bonded_port_id, - test_params->slave_port_ids[2 ]), + test_params->member_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->member_port_ids[i]); -for (i =0 ; i < test_params->bonded_slave_count; i++) { -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[i], &read_mac_addr), +for (i =0 ; i < test_params->bonded_member_count; i++) { +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[i], + &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[i]); + test_params->member_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" +"member 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->member_port_ids[i]); } -/* stop / start bonded device and verify that primary MAC address is -* propagate to bonded device and slaves */ +/* +* stop / start bonded device and verify that primary MAC address is +* propagate to bonded device and members. +*/ 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 +1807,17 @@ 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->member_port_ids[i]); -for (i =0 ; i < test_params->bonded_slave_count; i++) { -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[i], &read_mac_addr), +for (i =0 ; i < test_params->bonded_member_count; i++) { +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[i], + &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[i]); + test_params->member_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]); +"member port (%d) mac address not set to that of new primary" +" port" , test_params->member_port_ids[i]); }/* Set explicit MAC address */ @@ -1818,19 +1832,20 @@ 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->member_port_ids[i]); -for (i =0 ; i < test_params->bonded_slave_count; i++) { -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[i], &read_mac_addr), +for (i =0 ; i < test_params->bonded_member_count; i++) { +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[i], + &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[i]); + test_params->member_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)),"member port (%d) mac address not set to" +" that of new primary port\n" , test_params->member_port_ids[i]); } -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); } static int@@ -1839,10 +1854,10 @@ test_roundrobin_verify_promiscuous_enable_disable(void)int i, promiscuous_en;int ret; -/* Initialize bonded device with 4 slaves in round robin mode */ -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +/* Initialize bonded device with 4 members in round robin mode */ +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ROUND_ROBIN ,0 ,4 ,1 ), -"Failed to initialize bonded device with slaves" ); +"Failed to initialize bonded device with members" ); ret =rte_eth_promiscuous_enable (test_params->bonded_port_id); TEST_ASSERT_SUCCESS(ret,@@ -1854,12 +1869,12 @@ test_roundrobin_verify_promiscuous_enable_disable(void)"Port (%d) promiscuous mode not enabled" , test_params->bonded_port_id); -for (i =0 ; i < test_params->bonded_slave_count; i++) { +for (i =0 ; i < test_params->bonded_member_count; i++) { promiscuous_en =rte_eth_promiscuous_get ( - test_params->slave_port_ids[i]); + test_params->member_port_ids[i]);TEST_ASSERT_EQUAL (promiscuous_en,1 , -"slave port (%d) promiscuous mode not enabled" , - test_params->slave_port_ids[i]); +"member port (%d) promiscuous mode not enabled" , + test_params->member_port_ids[i]); } ret =rte_eth_promiscuous_disable (test_params->bonded_port_id);@@ -1872,76 +1887,76 @@ test_roundrobin_verify_promiscuous_enable_disable(void)"Port (%d) promiscuous mode not disabled\n" , test_params->bonded_port_id); -for (i =0 ; i < test_params->bonded_slave_count; i++) { +for (i =0 ; i < test_params->bonded_member_count; i++) { promiscuous_en =rte_eth_promiscuous_get ( - test_params->slave_port_ids[i]); + test_params->member_port_ids[i]);TEST_ASSERT_EQUAL (promiscuous_en,0 ,"Port (%d) promiscuous mode not disabled\n" , - test_params->slave_port_ids[i]); + test_params->member_port_ids[i]); } -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); } -#define TEST_RR_LINK_STATUS_SLAVE_COUNT (4) -#define TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT (2) +#define TEST_RR_LINK_STATUS_MEMBER_COUNT (4) +#define TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_MEMBER_COUNT (2)static int -test_roundrobin_verify_slave_link_status_change_behaviour (void ) +test_roundrobin_verify_member_link_status_change_behaviour (void ) {struct rte_mbuf *tx_pkt_burst[MAX_PKT_BURST ] = {NULL }; -struct rte_mbuf *gen_pkt_burst[TEST_RR_LINK_STATUS_SLAVE_COUNT ][MAX_PKT_BURST ]; +struct rte_mbuf *gen_pkt_burst[TEST_RR_LINK_STATUS_MEMBER_COUNT ][MAX_PKT_BURST ];struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST ] = {NULL };struct rte_eth_stats port_stats; -uint16_t slaves[RTE_MAX_ETHPORTS ]; +uint16_t members[RTE_MAX_ETHPORTS ]; -int i, burst_size, slave_count; +int i, burst_size, member_count;/* NULL all pointers in array to simplify cleanup */ memset (gen_pkt_burst,0 ,sizeof (gen_pkt_burst)); -/* Initialize bonded device with TEST_RR_LINK_STATUS_SLAVE_COUNT slaves +/* Initialize bonded device with TEST_RR_LINK_STATUS_MEMBER_COUNT members * 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_members ( +BONDING_MODE_ROUND_ROBIN ,0 ,TEST_RR_LINK_STATUS_MEMBER_COUNT ,1 ), +"Failed to initialize bonded device with members" ); -/* Verify Current Slaves Count /Active Slave Count is */ - slave_count =rte_eth_bond_slaves_get (test_params->bonded_port_id, slaves, +/* Verify Current Members Count /Active Member Count is */ + member_count =rte_eth_bond_members_get (test_params->bonded_port_id, members,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 (member_count,TEST_RR_LINK_STATUS_MEMBER_COUNT , +"Number of members (%d) is not as expected (%d)." , + member_count,TEST_RR_LINK_STATUS_MEMBER_COUNT ); - slave_count =rte_eth_bond_active_slaves_get (test_params->bonded_port_id, - slaves,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (slave_count,TEST_RR_LINK_STATUS_SLAVE_COUNT , -"Number of active slaves (%d) is not as expected (%d)." , - slave_count,TEST_RR_LINK_STATUS_SLAVE_COUNT ); + member_count =rte_eth_bond_active_members_get (test_params->bonded_port_id, + members,RTE_MAX_ETHPORTS ); +TEST_ASSERT_EQUAL (member_count,TEST_RR_LINK_STATUS_MEMBER_COUNT , +"Number of active members (%d) is not as expected (%d)." , + member_count,TEST_RR_LINK_STATUS_MEMBER_COUNT ); -/* Set 2 slaves eth_devs link status to down */ +/* Set 2 members eth_devs link status to down */ virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[1 ],0 ); + test_params->member_port_ids[1 ],0 );virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[3 ],0 ); + test_params->member_port_ids[3 ],0 ); - slave_count =rte_eth_bond_active_slaves_get (test_params->bonded_port_id, - slaves,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (slave_count, -TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT , -"Number of active slaves (%d) is not as expected (%d).\n" , - slave_count,TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_SLAVE_COUNT ); + member_count =rte_eth_bond_active_members_get (test_params->bonded_port_id, + members,RTE_MAX_ETHPORTS ); +TEST_ASSERT_EQUAL (member_count, +TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_MEMBER_COUNT , +"Number of active members (%d) is not as expected (%d).\n" , + member_count,TEST_RR_LINK_STATUS_EXPECTED_ACTIVE_MEMBER_COUNT ); burst_size =20 ; -/* Verify that pkts are not sent on slaves with link status down: +/* Verify that pkts are not sent on members with link status down: * * 1. Generate test burst of traffic * 2. Transmit burst on bonded eth_dev * 3. Verify stats for bonded eth_dev (opackets = burst_size) -* 4. Verify stats for slave eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0) +* 4. Verify stats for member eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0) */ TEST_ASSERT_EQUAL( generate_test_burst(tx_pkt_burst, burst_size, 0, 1, 0, 0, 0),@@ -1960,41 +1975,41 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void) test_params->bonded_port_id, (int )port_stats.opackets, burst_size); -rte_eth_stats_get (test_params->slave_port_ids[0 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[0 ], (int )port_stats.opackets,10 ); -rte_eth_stats_get (test_params->slave_port_ids[1 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[1 ], (int )port_stats.opackets,0 ); -rte_eth_stats_get (test_params->slave_port_ids[2 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[2 ], (int )port_stats.opackets,10 ); -rte_eth_stats_get (test_params->slave_port_ids[3 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[3 ], (int )port_stats.opackets,0 ); -/* Verify that pkts are not sent on slaves with link status down: +/* Verify that pkts are not sent on members 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_MEMBER_COUNT) received * 4. Verify stats for bonded eth_dev -* 6. Verify stats for slave eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0) +* 6. Verify stats for member eth_devs (s0 = 10, s1 = 0, s2 = 10, s3 = 0) */ -for (i =0 ; i <TEST_RR_LINK_STATUS_SLAVE_COUNT ; i++) { +for (i =0 ; i <TEST_RR_LINK_STATUS_MEMBER_COUNT ; i++) {TEST_ASSERT_EQUAL (generate_test_burst ( &gen_pkt_burst[i][0 ], burst_size,0 ,1 ,0 ,0 ,0 ), burst_size,"failed to generate packet burst" ); -virtual_ethdev_add_mbufs_to_rx_queue (test_params->slave_port_ids[i], +virtual_ethdev_add_mbufs_to_rx_queue (test_params->member_port_ids[i], &gen_pkt_burst[i][0 ], burst_size); }@@ -2014,49 +2029,49 @@ test_roundrobin_verify_slave_link_status_change_behaviour(void)rte_pktmbuf_free (rx_pkt_burst[i]); } -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); } -#define TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT (2) +#define TEST_RR_POLLING_LINK_STATUS_MEMBER_COUNT (2) -uint8_t polling_slave_mac[] = {0xDE ,0xAD ,0xBE ,0xEF ,0x00 ,0x00 }; +uint8_t polling_member_mac[] = {0xDE ,0xAD ,0xBE ,0xEF ,0x00 ,0x00 }; -int polling_test_slaves[TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT ] = {-1 ,-1 }; +int polling_test_members[TEST_RR_POLLING_LINK_STATUS_MEMBER_COUNT ] = {-1 ,-1 };static int -test_roundrobin_verfiy_polling_slave_link_status_change (void ) +test_roundrobin_verify_polling_member_link_status_change (void ) {struct rte_ether_addr *mac_addr = - (struct rte_ether_addr *)polling_slave_mac; -char slave_name[RTE_ETH_NAME_MAX_LEN ]; + (struct rte_ether_addr *)polling_member_mac; +char member_name[RTE_ETH_NAME_MAX_LEN ];int i; -for (i =0 ; i <TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT ; i++) { -/* Generate slave name / MAC address */ -snprintf (slave_name,RTE_ETH_NAME_MAX_LEN ,"eth_virt_poll_%d" , i); +for (i =0 ; i <TEST_RR_POLLING_LINK_STATUS_MEMBER_COUNT ; i++) { +/* Generate member name / MAC address */ +snprintf (member_name,RTE_ETH_NAME_MAX_LEN ,"eth_virt_poll_%d" , i); mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = i; -/* Create slave devices with no ISR Support */ -if (polling_test_slaves[i] ==-1 ) { - polling_test_slaves[i] =virtual_ethdev_create (slave_name, mac_addr, +/* Create member devices with no ISR Support */ +if (polling_test_members[i] ==-1 ) { + polling_test_members[i] =virtual_ethdev_create (member_name, mac_addr,rte_socket_id (),0 ); -TEST_ASSERT (polling_test_slaves[i] >=0 , -"Failed to create virtual virtual ethdev %s\n" , slave_name); +TEST_ASSERT (polling_test_members[i] >=0 , +"Failed to create virtual ethdev %s\n" , member_name); -/* Configure slave */ -TEST_ASSERT_SUCCESS (configure_ethdev (polling_test_slaves[i],0 ,0 ), -"Failed to configure virtual ethdev %s(%d)" , slave_name, - polling_test_slaves[i]); +/* Configure member */ +TEST_ASSERT_SUCCESS (configure_ethdev (polling_test_members[i],0 ,0 ), +"Failed to configure virtual ethdev %s(%d)" , member_name, + polling_test_members[i]); } -/* Add slave to bonded device */ -TEST_ASSERT_SUCCESS (rte_eth_bond_slave_add (test_params->bonded_port_id, - polling_test_slaves[i]), -"Failed to add slave %s(%d) to bonded device %d" , - slave_name, polling_test_slaves[i], +/* Add member to bonded device */ +TEST_ASSERT_SUCCESS (rte_eth_bond_member_add (test_params->bonded_port_id, + polling_test_members[i]), +"Failed to add member %s(%d) to bonded device %d" , + member_name, polling_test_members[i], test_params->bonded_port_id); }@@ -2071,26 +2086,26 @@ test_roundrobin_verfiy_polling_slave_link_status_change(void)RTE_ETH_EVENT_INTR_LSC , test_bonding_lsc_event_callback, &test_params->bonded_port_id); -/* link status change callback for first slave link up */ +/* link status change callback for first member link up */ test_lsc_interrupt_count =0 ; -virtual_ethdev_set_link_status (polling_test_slaves[0 ],1 ); +virtual_ethdev_set_link_status (polling_test_members[0 ],1 );TEST_ASSERT_SUCCESS (lsc_timeout (15000 ),"timed out waiting for interrupt" ); -/* no link status change callback for second slave link up */ +/* no link status change callback for second member link up */ test_lsc_interrupt_count =0 ; -virtual_ethdev_set_link_status (polling_test_slaves[1 ],1 ); +virtual_ethdev_set_link_status (polling_test_members[1 ],1 );TEST_ASSERT_FAIL (lsc_timeout (15000 ),"unexpectedly succeeded" ); -/* link status change callback for both slave links down */ +/* link status change callback for both member links down */ test_lsc_interrupt_count =0 ; -virtual_ethdev_set_link_status (polling_test_slaves[0 ],0 ); -virtual_ethdev_set_link_status (polling_test_slaves[1 ],0 ); +virtual_ethdev_set_link_status (polling_test_members[0 ],0 ); +virtual_ethdev_set_link_status (polling_test_members[1 ],0 );TEST_ASSERT_SUCCESS (lsc_timeout (20000 ),"timed out waiting for interrupt" );@@ -2100,17 +2115,17 @@ test_roundrobin_verfiy_polling_slave_link_status_change(void) &test_params->bonded_port_id); -/* Clean up and remove slaves from bonded device */ -for (i =0 ; i <TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT ; i++) { +/* Clean up and remove members from bonded device */ +for (i =0 ; i <TEST_RR_POLLING_LINK_STATUS_MEMBER_COUNT ; i++) {TEST_ASSERT_SUCCESS ( -rte_eth_bond_slave_remove (test_params->bonded_port_id, - polling_test_slaves[i]), -"Failed to remove slave %d from bonded port (%d)" , - polling_test_slaves[i], test_params->bonded_port_id); +rte_eth_bond_member_remove (test_params->bonded_port_id, + polling_test_members[i]), +"Failed to remove member %d from bonded port (%d)" , + polling_test_members[i], test_params->bonded_port_id); } -return remove_slaves_and_stop_bonded_device (); +return remove_members_and_stop_bonded_device (); }@@ -2123,9 +2138,9 @@ test_activebackup_tx_burst(void)struct rte_mbuf *pkts_burst[MAX_PKT_BURST ];struct rte_eth_stats port_stats; -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ACTIVE_BACKUP ,0 ,1 ,1 ), -"Failed to initialize bonded device with slaves" ); +"Failed to initialize bonded device with members" ); initialize_eth_header(test_params->pkt_eth_hdr, (struct rte_ether_addr *)src_mac,@@ -2136,7 +2151,7 @@ test_activebackup_tx_burst(void) pktlen =initialize_ipv4_header (test_params->pkt_ipv4_hdr, src_addr, dst_addr_0, pktlen); - burst_size =20 * test_params->bonded_slave_count; + burst_size =20 * test_params->bonded_member_count;TEST_ASSERT (burst_size <MAX_PKT_BURST ,"Burst size specified is greater than supported." );@@ -2160,38 +2175,38 @@ test_activebackup_tx_burst(void) primary_port =rte_eth_bond_primary_get (test_params->bonded_port_id); -/* Verify slave ports tx stats */ -for (i =0 ; i < test_params->bonded_slave_count; i++) { -rte_eth_stats_get (test_params->slave_port_ids[i], &port_stats); -if (test_params->slave_port_ids[i] == primary_port) { +/* Verify member ports tx stats */ +for (i =0 ; i < test_params->bonded_member_count; i++) { +rte_eth_stats_get (test_params->member_port_ids[i], &port_stats); +if (test_params->member_port_ids[i] == primary_port) {TEST_ASSERT_EQUAL (port_stats.opackets, (uint64_t )burst_size, -"Slave Port (%d) opackets value (%u) not as expected (%d)" , +"Member 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_member_count); }else {TEST_ASSERT_EQUAL (port_stats.opackets,0 , -"Slave Port (%d) opackets value (%u) not as expected (%d)" , +"Member Port (%d) opackets value (%u) not as expected (%d)" , test_params->bonded_port_id, (unsigned int )port_stats.opackets,0 ); } } -/* Put all slaves down and try and transmit */ -for (i =0 ; i < test_params->bonded_slave_count; i++) { +/* Put all members down and try and transmit */ +for (i =0 ; i < test_params->bonded_member_count; i++) {virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[i],0 ); + test_params->member_port_ids[i],0 ); }/* Send burst on bonded port */ TEST_ASSERT_EQUAL (rte_eth_tx_burst (test_params->bonded_port_id,0 , pkts_burst, burst_size),0 ,"Sending empty burst failed" ); -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); } -#define TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT (4) +#define TEST_ACTIVE_BACKUP_RX_BURST_MEMBER_COUNT (4)static int test_activebackup_rx_burst (void )@@ -2205,24 +2220,24 @@ test_activebackup_rx_burst(void)int i, j, burst_size =17 ; -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (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_MEMBER_COUNT ,1 ), +"Failed to initialize bonded device with members" ); primary_port =rte_eth_bond_primary_get (test_params->bonded_port_id);TEST_ASSERT (primary_port >=0 , -"failed to get primary slave for bonded port (%d)" , +"failed to get primary member for bonded port (%d)" , test_params->bonded_port_id); -for (i =0 ; i < test_params->bonded_slave_count; i++) { +for (i =0 ; i < test_params->bonded_member_count; i++) {/* Generate test bursts of packets to transmit */ TEST_ASSERT_EQUAL (generate_test_burst ( &gen_pkt_burst[0 ], burst_size,0 ,1 ,0 ,0 ,0 ), burst_size,"burst generation failed" ); -/* Add rx data to slave */ -virtual_ethdev_add_mbufs_to_rx_queue (test_params->slave_port_ids[i], +/* Add rx data to member */ +virtual_ethdev_add_mbufs_to_rx_queue (test_params->member_port_ids[i], &gen_pkt_burst[0 ], burst_size);/* Call rx burst on bonded device */ @@ -2230,7 +2245,7 @@ test_activebackup_rx_burst(void) &rx_pkt_burst[0], MAX_PKT_BURST), burst_size, "rte_eth_rx_burst failed"); -if (test_params->slave_port_ids[i] == primary_port) { +if (test_params->member_port_ids[i] == primary_port) {/* Verify bonded device rx count */ rte_eth_stats_get (test_params->bonded_port_id, &port_stats); TEST_ASSERT_EQUAL(port_stats.ipackets, (uint64_t)burst_size,@@ -2238,27 +2253,30 @@ test_activebackup_rx_burst(void) test_params->bonded_port_id, (unsigned int)port_stats.ipackets, burst_size); -/* Verify bonded slave devices rx count */ -for (j =0 ; j < test_params->bonded_slave_count; j++) { -rte_eth_stats_get (test_params->slave_port_ids[j], &port_stats); +/* Verify bonded member devices rx count */ +for (j =0 ; j < test_params->bonded_member_count; j++) { +rte_eth_stats_get (test_params->member_port_ids[j], &port_stats);if (i == j) {TEST_ASSERT_EQUAL (port_stats.ipackets, (uint64_t )burst_size, -"Slave Port (%d) ipackets value (%u) not as " -"expected (%d)" , test_params->slave_port_ids[i], - (unsigned int )port_stats.ipackets, burst_size); +"Member Port (%d) ipackets value (%u) not as " +"expected (%d)" , + test_params->member_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], +"Member Port (%d) ipackets value (%u) not as " +"expected (%d)\n" , + test_params->member_port_ids[i], (unsigned int )port_stats.ipackets,0 ); } } }else { -for (j =0 ; j < test_params->bonded_slave_count; j++) { -rte_eth_stats_get (test_params->slave_port_ids[j], &port_stats); +for (j =0 ; j < test_params->bonded_member_count; j++) { +rte_eth_stats_get (test_params->member_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], +"Member Port (%d) ipackets value (%u) not as expected " +"(%d)" , test_params->member_port_ids[i], (unsigned int )port_stats.ipackets,0 ); } }@@ -2275,8 +2293,8 @@ test_activebackup_rx_burst(void)rte_eth_stats_reset (test_params->bonded_port_id); } -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); } static int@@ -2285,14 +2303,14 @@ test_activebackup_verify_promiscuous_enable_disable(void)int i, primary_port, promiscuous_en;int ret; -/* Initialize bonded device with 4 slaves in round robin mode */ -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +/* Initialize bonded device with 4 members in round robin mode */ +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ACTIVE_BACKUP ,0 ,4 ,1 ), -"Failed to initialize bonded device with slaves" ); +"Failed to initialize bonded device with members" ); primary_port =rte_eth_bond_primary_get (test_params->bonded_port_id);TEST_ASSERT (primary_port >=0 , -"failed to get primary slave for bonded port (%d)" , +"failed to get primary member for bonded port (%d)" , test_params->bonded_port_id); ret =rte_eth_promiscuous_enable (test_params->bonded_port_id);@@ -2304,17 +2322,17 @@ test_activebackup_verify_promiscuous_enable_disable(void)"Port (%d) promiscuous mode not enabled" , test_params->bonded_port_id); -for (i =0 ; i < test_params->bonded_slave_count; i++) { +for (i =0 ; i < test_params->bonded_member_count; i++) { promiscuous_en =rte_eth_promiscuous_get ( - test_params->slave_port_ids[i]); -if (primary_port == test_params->slave_port_ids[i]) { + test_params->member_port_ids[i]); +if (primary_port == test_params->member_port_ids[i]) {TEST_ASSERT_EQUAL (promiscuous_en,1 , -"slave port (%d) promiscuous mode not enabled" , - test_params->slave_port_ids[i]); +"member port (%d) promiscuous mode not enabled" , + test_params->member_port_ids[i]); }else {TEST_ASSERT_EQUAL (promiscuous_en,0 , -"slave port (%d) promiscuous mode enabled" , - test_params->slave_port_ids[i]); +"member port (%d) promiscuous mode enabled" , + test_params->member_port_ids[i]); } }@@ -2328,16 +2346,16 @@ test_activebackup_verify_promiscuous_enable_disable(void)"Port (%d) promiscuous mode not disabled\n" , test_params->bonded_port_id); -for (i =0 ; i < test_params->bonded_slave_count; i++) { +for (i =0 ; i < test_params->bonded_member_count; i++) { promiscuous_en =rte_eth_promiscuous_get ( - test_params->slave_port_ids[i]); + test_params->member_port_ids[i]);TEST_ASSERT_EQUAL (promiscuous_en,0 , -"slave port (%d) promiscuous mode not disabled\n" , - test_params->slave_port_ids[i]); +"member port (%d) promiscuous mode not disabled\n" , + test_params->member_port_ids[i]); } -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); } static int@@ -2346,19 +2364,21 @@ test_activebackup_verify_mac_assignment(void)struct rte_ether_addr read_mac_addr;struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1; -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[0 ], &expected_mac_addr_0), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_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->member_port_ids[0 ]); +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[1 ], + &expected_mac_addr_1),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[1 ]); + test_params->member_port_ids[1 ]); -/* Initialize bonded device with 2 slaves in active backup mode */ -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +/* Initialize bonded device with 2 members in active backup mode */ +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ACTIVE_BACKUP ,0 ,2 ,1 ), -"Failed to initialize bonded device with slaves" ); +"Failed to initialize bonded device with members" ); -/* Verify that bonded MACs is that of first slave and that the other slave +/* Verify that bonded MACs is that of first member and that the other member * MAC hasn't been changed */ TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), "Failed to get mac address (port %d)",@@ -2368,27 +2388,27 @@ test_activebackup_verify_mac_assignment(void)"bonded port (%d) mac address not set to that of primary port" , test_params->bonded_port_id); -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[0 ], &read_mac_addr), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[0 ], &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[0 ]); + test_params->member_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 ]); +"member port (%d) mac address not set to that of primary port" , + test_params->member_port_ids[0 ]); -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[1 ], &read_mac_addr), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[1 ], &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[1 ]); + test_params->member_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 ]); +"member port (%d) mac address not as expected" , + test_params->member_port_ids[1 ]);/* change primary and verify that MAC addresses haven't changed */ TEST_ASSERT_EQUAL (rte_eth_bond_primary_set (test_params->bonded_port_id, - test_params->slave_port_ids[1 ]),0 , + test_params->member_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->member_port_ids[1 ]); TEST_ASSERT_SUCCESS(rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr), "Failed to get mac address (port %d)",@@ -2398,24 +2418,26 @@ test_activebackup_verify_mac_assignment(void)"bonded port (%d) mac address not set to that of primary port" , test_params->bonded_port_id); -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[0 ], &read_mac_addr), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[0 ], &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[0 ]); + test_params->member_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 ]); +"member port (%d) mac address not set to that of primary port" , + test_params->member_port_ids[0 ]); -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[1 ], &read_mac_addr), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[1 ], &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[1 ]); + test_params->member_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 ]); +"member port (%d) mac address not as expected" , + test_params->member_port_ids[1 ]); -/* stop / start bonded device and verify that primary MAC address is -* propagated to bonded device and slaves */ +/* +* stop / start bonded device and verify that primary MAC address is +* propagated to bonded device and members. +*/ TEST_ASSERT_SUCCESS(rte_eth_dev_stop(test_params->bonded_port_id), "Failed to stop bonded port %u",@@ -2432,21 +2454,21 @@ test_activebackup_verify_mac_assignment(void)"bonded port (%d) mac address not set to that of primary port" , test_params->bonded_port_id); -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[0 ], &read_mac_addr), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[0 ], &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[0 ]); + test_params->member_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 ]); +"member port (%d) mac address not as expected" , + test_params->member_port_ids[0 ]); -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[1 ], &read_mac_addr), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[1 ], &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[1 ]); + test_params->member_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 ]); +"member port (%d) mac address not set to that of primary port" , + test_params->member_port_ids[1 ]);/* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set(@@ -2462,36 +2484,36 @@ test_activebackup_verify_mac_assignment(void)"bonded port (%d) mac address not set to that of bonded port" , test_params->bonded_port_id); -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[0 ], &read_mac_addr), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[0 ], &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[0 ]); + test_params->member_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 ]); +"member port (%d) mac address not as expected" , + test_params->member_port_ids[0 ]); -TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->slave_port_ids[1 ], &read_mac_addr), +TEST_ASSERT_SUCCESS (rte_eth_macaddr_get (test_params->member_port_ids[1 ], &read_mac_addr),"Failed to get mac address (port %d)" , - test_params->slave_port_ids[1 ]); + test_params->member_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 ]); +"member port (%d) mac address not set to that of bonded port" , + test_params->member_port_ids[1 ]); -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); }static int -test_activebackup_verify_slave_link_status_change_failover (void ) +test_activebackup_verify_member_link_status_change_failover (void ) { -struct rte_mbuf *pkt_burst[TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT ][MAX_PKT_BURST ]; +struct rte_mbuf *pkt_burst[TEST_ACTIVE_BACKUP_RX_BURST_MEMBER_COUNT ][MAX_PKT_BURST ];struct rte_mbuf *rx_pkt_burst[MAX_PKT_BURST ] = {NULL };struct rte_eth_stats port_stats; -uint16_t slaves[RTE_MAX_ETHPORTS ]; +uint16_t members[RTE_MAX_ETHPORTS ]; -int i, burst_size, slave_count, primary_port; +int i, burst_size, member_count, primary_port; burst_size =21 ;@@ -2502,96 +2524,96 @@ test_activebackup_verify_slave_link_status_change_failover(void) &pkt_burst[0][0], burst_size, 0, 1, 0, 0, 0), burst_size, "generate_test_burst failed"); -/* Initialize bonded device with 4 slaves in round robin mode */ -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +/* Initialize bonded device with 4 members in round robin mode */ +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (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_MEMBER_COUNT ,1 ), +"Failed to initialize bonded device with members" ); -/* Verify Current Slaves Count /Active Slave Count is */ - slave_count =rte_eth_bond_slaves_get (test_params->bonded_port_id, slaves, +/* Verify Current Members Count /Active Member Count is */ + member_count =rte_eth_bond_members_get (test_params->bonded_port_id, members,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (slave_count,4 , -"Number of slaves (%d) is not as expected (%d)." , - slave_count,4 ); +TEST_ASSERT_EQUAL (member_count,4 , +"Number of members (%d) is not as expected (%d)." , + member_count,4 ); - slave_count =rte_eth_bond_active_slaves_get (test_params->bonded_port_id, - slaves,RTE_MAX_ETHPORTS ); -TEST_ASSERT_EQUAL (slave_count,4 , -"Number of active slaves (%d) is not as expected (%d)." , - slave_count,4 ); + member_count =rte_eth_bond_active_members_get (test_params->bonded_port_id, + members,RTE_MAX_ETHPORTS ); +TEST_ASSERT_EQUAL (member_count,4 , +"Number of active members (%d) is not as expected (%d)." , + member_count,4 ); primary_port =rte_eth_bond_primary_get (test_params->bonded_port_id); -TEST_ASSERT_EQUAL (primary_port, test_params->slave_port_ids[0 ], +TEST_ASSERT_EQUAL (primary_port, test_params->member_port_ids[0 ],"Primary port not as expected" ); -/* Bring 2 slaves down and verify active slave count */ +/* Bring 2 members down and verify active member count */ virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[1 ],0 ); + test_params->member_port_ids[1 ],0 );virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[3 ],0 ); + test_params->member_port_ids[3 ],0 ); -TEST_ASSERT_EQUAL (rte_eth_bond_active_slaves_get ( - test_params->bonded_port_id, slaves,RTE_MAX_ETHPORTS ),2 , -"Number of active slaves (%d) is not as expected (%d)." , - slave_count,2 ); +TEST_ASSERT_EQUAL (rte_eth_bond_active_members_get ( + test_params->bonded_port_id, members,RTE_MAX_ETHPORTS ),2 , +"Number of active members (%d) is not as expected (%d)." , + member_count,2 );virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[1 ],1 ); + test_params->member_port_ids[1 ],1 );virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[3 ],1 ); + test_params->member_port_ids[3 ],1 ); -/* Bring primary port down, verify that active slave count is 3 and primary +/* Bring primary port down, verify that active member count is 3 and primary * has changed */ virtual_ethdev_simulate_link_status_interrupt ( - test_params->slave_port_ids[0 ],0 ); + test_params->member_port_ids[0 ],0 ); -TEST_ASSERT_EQUAL (rte_eth_bond_active_slaves_get ( - test_params->bonded_port_id, slaves,RTE_MAX_ETHPORTS ), +TEST_ASSERT_EQUAL (rte_eth_bond_active_members_get ( + test_params->bonded_port_id, members,RTE_MAX_ETHPORTS ),3 , -"Number of active slaves (%d) is not as expected (%d)." , - slave_count,3 ); +"Number of active members (%d) is not as expected (%d)." , + member_count,3 ); primary_port =rte_eth_bond_primary_get (test_params->bonded_port_id); -TEST_ASSERT_EQUAL (primary_port, test_params->slave_port_ids[2 ], +TEST_ASSERT_EQUAL (primary_port, test_params->member_port_ids[2 ],"Primary port not as expected" ); -/* Verify that pkts are sent on new primary slave */ +/* Verify that pkts are sent on new primary member */ TEST_ASSERT_EQUAL (rte_eth_tx_burst ( test_params->bonded_port_id,0 , &pkt_burst[0 ][0 ], burst_size), burst_size,"rte_eth_tx_burst failed" ); -rte_eth_stats_get (test_params->slave_port_ids[2 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[2 ]); -rte_eth_stats_get (test_params->slave_port_ids[0 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[0 ]); -rte_eth_stats_get (test_params->slave_port_ids[1 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[1 ]); -rte_eth_stats_get (test_params->slave_port_ids[3 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[3 ]);/* Generate packet burst for testing */ -for (i =0 ; i <TEST_ACTIVE_BACKUP_RX_BURST_SLAVE_COUNT ; i++) { +for (i =0 ; i <TEST_ACTIVE_BACKUP_RX_BURST_MEMBER_COUNT ; i++) {TEST_ASSERT_EQUAL (generate_test_burst ( &pkt_burst[i][0 ], burst_size,0 ,1 ,0 ,0 ,0 ), burst_size,"generate_test_burst failed" );virtual_ethdev_add_mbufs_to_rx_queue ( - test_params->slave_port_ids[i], &pkt_burst[i][0 ], burst_size); + test_params->member_port_ids[i], &pkt_burst[i][0 ], burst_size); } TEST_ASSERT_EQUAL(rte_eth_rx_burst(@@ -2604,28 +2626,28 @@ test_activebackup_verify_slave_link_status_change_failover(void)"(%d) port_stats.ipackets not as expected" , test_params->bonded_port_id); -rte_eth_stats_get (test_params->slave_port_ids[2 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[2 ]); -rte_eth_stats_get (test_params->slave_port_ids[0 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[0 ]); -rte_eth_stats_get (test_params->slave_port_ids[1 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[1 ]); -rte_eth_stats_get (test_params->slave_port_ids[3 ], &port_stats); +rte_eth_stats_get (test_params->member_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->member_port_ids[3 ]); -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); }/** Balance Mode Tests */ @@ -2633,9 +2655,9 @@ test_activebackup_verify_slave_link_status_change_failover(void)static int test_balance_xmit_policy_configuration (void ) { -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members (BONDING_MODE_ACTIVE_BACKUP ,0 ,2 ,1 ), -"Failed to initialize_bonded_device_with_slaves." ); +"Failed to initialize_bonded_device_with_members." );/* Invalid port id */ TEST_ASSERT_FAIL(rte_eth_bond_xmit_policy_set(@@ -2644,7 +2666,7 @@ test_balance_xmit_policy_configuration(void)/* Set xmit policy on non bonded device */ TEST_ASSERT_FAIL (rte_eth_bond_xmit_policy_set ( - test_params->slave_port_ids[0 ],BALANCE_XMIT_POLICY_LAYER2 ), + test_params->member_port_ids[0 ],BALANCE_XMIT_POLICY_LAYER2 ),"Expected call to failed as invalid port specified." );@@ -2677,25 +2699,25 @@ test_balance_xmit_policy_configuration(void)TEST_ASSERT_FAIL (rte_eth_bond_xmit_policy_get (INVALID_PORT_ID ),"Expected call to failed as invalid port specified." ); -/* Clean up and remove slaves from bonded device */ -return remove_slaves_and_stop_bonded_device (); +/* Clean up and remove members from bonded device */ +return remove_members_and_stop_bonded_device (); } -#define TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT (2) +#define TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT (2)static int test_balance_l2_tx_burst (void ) { -struct rte_mbuf *pkts_burst[TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT ][MAX_PKT_BURST ]; -int burst_size[TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT ] = {10 ,15 }; +struct rte_mbuf *pkts_burst[TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT ][MAX_PKT_BURST ]; +int burst_size[TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT ] = {10 ,15 };uint16_t pktlen;int i;struct rte_eth_stats port_stats; -TEST_ASSERT_SUCCESS (initialize_bonded_device_with_slaves ( -BONDING_MODE_BALANCE ,0 ,TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT ,1 ), -"Failed to initialize_bonded_device_with_slaves." ); +TEST_ASSERT_SUCCESS (initialize_bonded_device_with_members ( +BONDING_MODE_BALANCE ,0 ,TEST_BALANCE_L2_TX_BURST_MEMBER_COUNT ,1 ), +"Failed to initialize_bonded_device_with_members." ); TEST_ASSERT_SUCCESS(rte_eth_bond_xmit_policy_set( test_params->bonded_port_id, BALANCE_XMIT_POLICY_LAYER2),@@ -2730,7 +2752,7 @@ test_balance_l2_tx_burst(void) "failed to generate packet burst");/* Send burst 1 on bonded port */ -for (i =0 ; i <TEST_BALANCE_L2_TX_BURST_SLAVE_COUNT ; i++) { +for (i =0 ; i <TEST_BALANCE_L2_TX_BURST_MEMBER_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 +2767,24 @@ test_balance_l2_tx_burst(void) burst_size[0] + burst_size[1]); -/* Verify slave ports tx stats */ -rte_eth_stats_get (test_params->slave_port_ids[0 ], &port_stats); +/* Verify member ports tx stats */ +rte_eth_stats_get (test_params->member_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, +"Member Port (%d) opackets value (%u) not as expected (%d)" , + test_params->member_port_ids[0 ], (unsigned int )port_stats.opackets, burst_size[0 ]); -rte_eth_stats_get (test_params->slave_port_ids[1 ], &port_stats); +rte_eth_stats_get (test_params->member_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, + "Member Port (%d) opackets value (%u) not as expected (%d)\n", + test_params->member_port_ids[1], (unsigned int)port_stats.opackets,Lines of this file are not shown. View the raw message.
doc/guides/howto/lm_bond_virtio_sriov.rst +12
-12Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/img/bond-mode-1.svg +1
-1Lines of this file are not shown. View the raw message.
doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +115
-115Lines of this file are not shown. View the raw message.
doc/guides/rel_notes/release_23_11.rst +17
-0Lines of this file are not shown. View the raw message.
drivers/net/bonding/bonding_testpmd.c +89
-89Lines of this file are not shown. View the raw message.
drivers/net/bonding/eth_bond_8023ad_private.h +20
-20Lines of this file are not shown. View the raw message.
drivers/net/bonding/eth_bond_private.h +55
-53Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_8023ad.c +187
-185Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_8023ad.h +34
-33Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_alb.c +22
-22Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_alb.h +10
-10Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_api.c +244
-238Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_args.c +16
-16Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_flow.c +27
-27Lines of this file are not shown. View the raw message.
drivers/net/bonding/rte_eth_bond_pmd.c +694
-690Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
PATCH 1/1 app/test: fix reference to master in bonding test
In reply to Chaoyong HeMissed in previous patch
--- app/test/test_link_bonding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test/test_link_bonding.c +1 -1
@@ -4301,7 +4301,7 @@ test_tlb_tx_burst(void) burst_size);TEST_ASSERT_EQUAL (nb_tx,0 ," bad number of packet in burst" ); -/* Clean ugit checkout masterp and remove members from bonded device */ +/* Clean up check and remove members from bonded device */ return remove_members_and_stop_bonded_device (); }
Signature · 1 line
2.39.2
Re: [PATCH] app/test: fix reference to master in bonding test
Quoted 4 lines · Stephen Hemminger
Missed in previous patch
Signed-off-by Stephen Hemminger <[email protected]>---
Ferruh Yigit
AppliedRe: [PATCH] app/test: fix reference to master in bonding test
In reply to Stephen HemmingerQuoted 21 lines · Stephen Hemminger
Missed in previous patch
Signed-off-by Stephen Hemminger <[email protected]>--- app/test/test_link_bonding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)app/test/test_link_bonding.c +1
-1@@ -4301,7 +4301,7 @@ test_tlb_tx_burst(void) burst_size);TEST_ASSERT_EQUAL (nb_tx,0 ," bad number of packet in burst" ); -/* Clean ugit checkout masterp and remove members from bonded device */ +/* Clean up check and remove members from bonded device */ return remove_members_and_stop_bonded_device (); }
Quoted 2 lines
Acked-by Tyler Retzlaff <[email protected]>
Fixes: 0c8396e6d786 ("bond: unit tests for mode 5")
Cc: [email protected]'git checkout master' seems slip in, updated comment as following (on top of latest head):
/* Clean up and remove members from bonding device */
Applied to dpdk-next-net/main, thanks.
Re: [PATCH v5 0/2] replace master/slave to main/member
In reply to Chaoyong HeQuoted 15 lines · Chaoyong He
This patch series aims to replace all the master/slave to main/member in the bonding PMD.
---
v5:
* Rebase to DPDK v23.11.
v4:
* Fix the doc compile problem.
v3:
* Fix the check warning about 'CamelCase'.
v2:
* Modify related doc.
* Add 'RTE_DEPRECATED' to related APIs.
---
Quoted 4 lines
Long Wu (2):
ethdev: remove bonding deprecated macro net/bonding: replace master/slave to main/member
For series,
Series applied to dpdk-next-net/main, thanks.