Skip to contentSkip to conversation

bonding: rename bond components

PATCH Superseded Jarod Wilson 1 participant 7 messages Oct 7, 2020

Subsystems (14)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover bonding: rename bond components

The bonding driver's use of master and slave, while largely understood in technical circles, poses a barrier for inclusion to some potential members of the development and user community, due to the historical context of masters and slaves, particularly in the United States. This is a first full pass at replacing those phrases with more socially inclusive ones, opting for bond to replace master and port to replace slave, which is congruent with the bridge and team drivers.

There are a few problems with this change. First up, "port" is used in the bonding 802.3ad code, so the first step here is to rename port to ad_port, so we can reuse port. Second, we have the issue of not wanting to break any existing userspace, which I believe this patchset accomplishes, preserving all existing sysfs and procfs interfaces, and adding module parameter aliases where necessary.

Third, we do still have the issue of ease of backporting fixes to -stable trees. I've not had a huge amount of time to spend on it, but brief forays into coccinelle didn't really pay off (since it's meant to operate on code, not patches), and the best solution I can come up with is providing a shell script someone could run over git-format-patch output before git-am'ing the result to a -stable tree, though scripting these changes in the first place turned out to be not the best thing to do anyway, due to subtle cases where use of master or slave can NOT yet be replaced, so a large amount of work was done by hand, inspection, trial and error, which is why this set is a lot longer in coming than I'd originally hoped. I don't expect -stable backports to be horrible to figure out one way or another though, and I don't believe that a bit of inconvenience on that front is enough to warrant not making these changes.

See here for further details on Red Hat's commitment to this work:
https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language

As far as testing goes, I've manually operated on various bonds while working on this code, and have run it through multiple lnst test runs, which exercises the existing sysfs interfaces fairly extensively. As far as I can tell through testing and inspection, there is no breakage of any existing interfaces with this set.

v2: legacy module parameters are retained this time, and we're trying out bond/port instead of aggregator/link in place of master/slave. The procfs interface legacy output is also duplicated or dropped, depending on Kconfig, rather than being replaced.

v3: remove Kconfig knob, leave sysfs and procfs interfaces entirely untouched, but update documentation to reference their deprecated nature, explain the name changes, add references to NetworkManager, include more netlink/iproute2 examples and make note of netlink being the preferred interface for userspace interaction with bonds.

Cc Jay Vosburgh <[email protected]>
Cc Veaceslav Falico <[email protected]>
Cc Andy Gospodarek <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Thomas Davis <[email protected]>

Jarod Wilson (5):
bonding: rename 802.3ad's struct port to ad_port
bonding: replace use of the term master where possible
bonding: rename slave to port where possible
bonding: rename bonding_sysfs_slave.c to _port.c
bonding: update Documentation for port/bond terminology

 .clang-format                                 |    4 +-
 Documentation/networking/bonding.rst          |  578 ++--
 drivers/infiniband/core/cma.c                 |    2 +-
 drivers/infiniband/core/lag.c                 |    2 +-
 drivers/infiniband/core/roce_gid_mgmt.c       |   10 +-
 drivers/infiniband/hw/mlx4/main.c             |    2 +-
 drivers/net/bonding/Makefile                  |    2 +-
 drivers/net/bonding/bond_3ad.c                | 1701 ++++++------
 drivers/net/bonding/bond_alb.c                |  689 ++---
 drivers/net/bonding/bond_debugfs.c            |    2 +-
 drivers/net/bonding/bond_main.c               | 2339 +++++++++--------
 drivers/net/bonding/bond_netlink.c            |  114 +-
 drivers/net/bonding/bond_options.c            |  258 +-
 drivers/net/bonding/bond_procfs.c             |   86 +-
 drivers/net/bonding/bond_sysfs.c              |   78 +-
 drivers/net/bonding/bond_sysfs_port.c         |  185 ++
 drivers/net/bonding/bond_sysfs_slave.c        |  176 --
 .../ethernet/chelsio/cxgb3/cxgb3_offload.c    |    2 +-
 .../net/ethernet/mellanox/mlx4/en_netdev.c    |   14 +-
 .../ethernet/mellanox/mlx5/core/en/rep/bond.c |    4 +-
 .../net/ethernet/mellanox/mlx5/core/en_tc.c   |    2 +-
 .../ethernet/netronome/nfp/flower/lag_conf.c  |    2 +-
 .../ethernet/qlogic/netxen/netxen_nic_main.c  |   12 +-
 include/linux/netdevice.h                     |   22 +-
 include/net/bond_3ad.h                        |   42 +-
 include/net/bond_alb.h                        |   74 +-
 include/net/bond_options.h                    |   18 +-
 include/net/bonding.h                         |  362 +--
 include/net/lag.h                             |    2 +-
 29 files changed, 3479 insertions(+), 3305 deletions(-)
 create mode 100644 drivers/net/bonding/bond_sysfs_port.c
 delete mode 100644 drivers/net/bonding/bond_sysfs_slave.c
Signature · 1 line
2.27.0
#1 lore raw

PATCH v3 1/5 bonding: rename 802.3ad's struct port to ad_port

The intention is to reuse "port" in place of "slave" in the bonding driver after making this change, as port is consistent with the bridge and team drivers, and allows us to remove socially problematic language from the bonding driver.

Cc Jay Vosburgh <[email protected]>
Cc Veaceslav Falico <[email protected]>
Cc Andy Gospodarek <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Thomas Davis <[email protected]>
---
 drivers/net/bonding/bond_3ad.c         | 1307 ++++++++++++------------
 drivers/net/bonding/bond_main.c        |    4 +-
 drivers/net/bonding/bond_netlink.c     |    6 +-
 drivers/net/bonding/bond_procfs.c      |   36 +-
 drivers/net/bonding/bond_sysfs_slave.c |   10 +-
 include/net/bond_3ad.h                 |   14 +-
 6 files changed, 688 insertions(+), 689 deletions(-)
drivers/net/bonding/bond_3ad.c +653 -654
index aa001b16765a..0eb717b0bfc6 100644
@@ -89,60 +89,60 @@ static const u8 lacpdu_mcast_addr[ETH_ALEN + 2] __long_aligned =
 	MULTICAST_LACPDU_ADDR;
 
 /* ================= main 802.3ad protocol functions ================== */
-static int ad_lacpdu_send(struct port *port);
-static int ad_marker_send(struct port *port, struct bond_marker *marker);
-static void ad_mux_machine(struct port *port, bool *update_slave_arr);
-static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port);
-static void ad_tx_machine(struct port *port);
-static void ad_periodic_machine(struct port *port);
-static void ad_port_selection_logic(struct port *port, bool *update_slave_arr);
+static int ad_lacpdu_send(struct ad_port *ad_port);
+static int ad_marker_send(struct ad_port *ad_port, struct bond_marker *marker);
+static void ad_mux_machine(struct ad_port *ad_port, bool *update_slave_arr);
+static void ad_rx_machine(struct lacpdu *lacpdu, struct ad_port *ad_port);
+static void ad_tx_machine(struct ad_port *ad_port);
+static void ad_periodic_machine(struct ad_port *ad_port);
+static void ad_port_selection_logic(struct ad_port *ad_port, bool *update_slave_arr);
 static void ad_agg_selection_logic(struct aggregator *aggregator,
 				   bool *update_slave_arr);
 static void ad_clear_agg(struct aggregator *aggregator);
 static void ad_initialize_agg(struct aggregator *aggregator);
-static void ad_initialize_port(struct port *port, int lacp_fast);
-static void ad_enable_collecting_distributing(struct port *port,
+static void ad_initialize_port(struct ad_port *ad_port, int lacp_fast);
+static void ad_enable_collecting_distributing(struct ad_port *ad_port,
 					      bool *update_slave_arr);
-static void ad_disable_collecting_distributing(struct port *port,
+static void ad_disable_collecting_distributing(struct ad_port *ad_port,
 					       bool *update_slave_arr);
 static void ad_marker_info_received(struct bond_marker *marker_info,
-				    struct port *port);
+				    struct ad_port *ad_port);
 static void ad_marker_response_received(struct bond_marker *marker,
-					struct port *port);
-static void ad_update_actor_keys(struct port *port, bool reset);
+					struct ad_port *ad_port);
+static void ad_update_actor_keys(struct ad_port *ad_port, bool reset);
 
 
 /* ================= api to bonding and kernel code ================== */
 
 /**
- * __get_bond_by_port - get the port's bonding struct
- * @port: the port we're looking at
+ * __get_bond_by_ad_port - get the ad_port's bonding struct
+ * @ad_port: the ad_port we're looking at
  *
- * Return @port's bonding struct, or %NULL if it can't be found.
+ * Return @ad_port's bonding struct, or %NULL if it can't be found.
  */
-static inline struct bonding *__get_bond_by_port(struct port *port)
+static inline struct bonding *__get_bond_by_ad_port(struct ad_port *ad_port)
 {
-	if (port->slave == NULL)
+	if (ad_port->slave == NULL)
 		return NULL;
 
-	return bond_get_bond_by_slave(port->slave);
+	return bond_get_bond_by_slave(ad_port->slave);
 }
 
 /**
  * __get_first_agg - get the first aggregator in the bond
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  *
  * Return the aggregator of the first slave in @bond, or %NULL if it can't be
  * found.
  * The caller must hold RCU or RTNL lock.
  */
-static inline struct aggregator *__get_first_agg(struct port *port)
+static inline struct aggregator *__get_first_agg(struct ad_port *ad_port)
 {
-	struct bonding *bond = __get_bond_by_port(port);
+	struct bonding *bond = __get_bond_by_ad_port(ad_port);
 	struct slave *first_slave;
 	struct aggregator *agg;
 
-	/* If there's no bond for this port, or bond has no slaves */
+	/* If there's no bond for this ad_port, or bond has no slaves */
 	if (bond == NULL)
 		return NULL;
 
@@ -167,44 +167,44 @@ static inline int __agg_has_partner(struct aggregator *agg)
 }
 
 /**
- * __disable_port - disable the port's slave
- * @port: the port we're looking at
+ * __disable_ad_port - disable the ad_port's slave
+ * @ad_port: the ad_port we're looking at
  */
-static inline void __disable_port(struct port *port)
+static inline void __disable_ad_port(struct ad_port *ad_port)
 {
-	bond_set_slave_inactive_flags(port->slave, BOND_SLAVE_NOTIFY_LATER);
+	bond_set_slave_inactive_flags(ad_port->slave, BOND_SLAVE_NOTIFY_LATER);
 }
 
 /**
- * __enable_port - enable the port's slave, if it's up
- * @port: the port we're looking at
+ * __enable_ad_port - enable the ad_port's slave, if it's up
+ * @ad_port: the ad_port we're looking at
  */
-static inline void __enable_port(struct port *port)
+static inline void __enable_ad_port(struct ad_port *ad_port)
 {
-	struct slave *slave = port->slave;
+	struct slave *slave = ad_port->slave;
 
 	if ((slave->link == BOND_LINK_UP) && bond_slave_is_up(slave))
 		bond_set_slave_active_flags(slave, BOND_SLAVE_NOTIFY_LATER);
 }
 
 /**
- * __port_is_enabled - check if the port's slave is in active state
- * @port: the port we're looking at
+ * __ad_port_is_enabled - check if the ad_port's slave is in active state
+ * @ad_port: the ad_port we're looking at
  */
-static inline int __port_is_enabled(struct port *port)
+static inline int __ad_port_is_enabled(struct ad_port *ad_port)
 {
-	return bond_is_active_slave(port->slave);
+	return bond_is_active_slave(ad_port->slave);
 }
 
 /**
  * __get_agg_selection_mode - get the aggregator selection mode
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  *
  * Get the aggregator selection mode. Can be %STABLE, %BANDWIDTH or %COUNT.
  */
-static inline u32 __get_agg_selection_mode(struct port *port)
+static inline u32 __get_agg_selection_mode(struct ad_port *ad_port)
 {
-	struct bonding *bond = __get_bond_by_port(port);
+	struct bonding *bond = __get_bond_by_ad_port(ad_port);
 
 	if (bond == NULL)
 		return BOND_AD_STABLE;
@@ -214,11 +214,11 @@ static inline u32 __get_agg_selection_mode(struct port *port)
 
 /**
  * __check_agg_selection_timer - check if the selection timer has expired
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  */
-static inline int __check_agg_selection_timer(struct port *port)
+static inline int __check_agg_selection_timer(struct ad_port *ad_port)
 {
-	struct bonding *bond = __get_bond_by_port(port);
+	struct bonding *bond = __get_bond_by_ad_port(ad_port);
 
 	if (bond == NULL)
 		return 0;
@@ -227,10 +227,10 @@ static inline int __check_agg_selection_timer(struct port *port)
 }
 
 /**
- * __get_link_speed - get a port's speed
- * @port: the port we're looking at
+ * __get_link_speed - get an ad_port's speed
+ * @ad_port: the ad_port we're looking at
  *
- * Return @port's speed in 802.3ad enum format. i.e. one of:
+ * Return @ad_port's speed in 802.3ad enum format. i.e. one of:
  *     0,
  *     %AD_LINK_SPEED_10MBPS,
  *     %AD_LINK_SPEED_100MBPS,
@@ -246,9 +246,9 @@ static inline int __check_agg_selection_timer(struct port *port)
  *     %AD_LINK_SPEED_56000MBPS
  *     %AD_LINK_SPEED_100000MBPS
  */
-static u16 __get_link_speed(struct port *port)
+static u16 __get_link_speed(struct ad_port *ad_port)
 {
-	struct slave *slave = port->slave;
+	struct slave *slave = ad_port->slave;
 	u16 speed;
 
 	/* this if covers only a special case: when the configuration starts
@@ -318,28 +318,28 @@ static u16 __get_link_speed(struct port *port)
 				pr_warn_once("%s: (slave %s): unknown ethtool speed (%d) for port %d (set it to 0)\n",
 					     slave->bond->dev->name,
 					     slave->dev->name, slave->speed,
-					     port->actor_port_number);
+					     ad_port->actor_port_number);
 			speed = 0;
 			break;
 		}
 	}
 
 	slave_dbg(slave->bond->dev, slave->dev, "Port %d Received link speed %d update from adapter\n",
-		  port->actor_port_number, speed);
+		  ad_port->actor_port_number, speed);
 	return speed;
 }
 
 /**
- * __get_duplex - get a port's duplex
- * @port: the port we're looking at
+ * __get_duplex - get an ad_port's duplex
+ * @ad_port: the ad_port we're looking at
  *
- * Return @port's duplex in 802.3ad bitmask format. i.e.:
+ * Return @ad_port's duplex in 802.3ad bitmask format. i.e.:
  *     0x01 if in full duplex
  *     0x00 otherwise
  */
-static u8 __get_duplex(struct port *port)
+static u8 __get_duplex(struct ad_port *ad_port)
 {
-	struct slave *slave = port->slave;
+	struct slave *slave = ad_port->slave;
 	u8 retval = 0x0;
 
 	/* handling a special case: when the configuration starts with
@@ -350,25 +350,25 @@ static u8 __get_duplex(struct port *port)
 		case DUPLEX_FULL:
 			retval = 0x1;
 			slave_dbg(slave->bond->dev, slave->dev, "Port %d Received status full duplex update from adapter\n",
-				  port->actor_port_number);
+				  ad_port->actor_port_number);
 			break;
 		case DUPLEX_HALF:
 		default:
 			retval = 0x0;
 			slave_dbg(slave->bond->dev, slave->dev, "Port %d Received status NOT full duplex update from adapter\n",
-				  port->actor_port_number);
+				  ad_port->actor_port_number);
 			break;
 		}
 	}
 	return retval;
 }
 
-static void __ad_actor_update_port(struct port *port)
+static void __ad_actor_update_port(struct ad_port *ad_port)
 {
-	const struct bonding *bond = bond_get_bond_by_slave(port->slave);
+	const struct bonding *bond = bond_get_bond_by_slave(ad_port->slave);
 
-	port->actor_system = BOND_AD_INFO(bond).system.sys_mac_addr;
-	port->actor_system_priority = BOND_AD_INFO(bond).system.sys_priority;
+	ad_port->actor_system = BOND_AD_INFO(bond).system.sys_mac_addr;
+	ad_port->actor_system_priority = BOND_AD_INFO(bond).system.sys_priority;
 }
 
 /* Conversions */
@@ -414,9 +414,9 @@ static u16 __ad_timer_to_ticks(u16 timer_type, u16 par)
 /* ================= ad_rx_machine helper functions ================== */
 
 /**
- * __choose_matched - update a port's matched variable from a received lacpdu
+ * __choose_matched - update an ad_port's matched variable from a received lacpdu
  * @lacpdu: the lacpdu we've received
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  *
  * Update the value of the matched variable, using parameter values from a
  * newly received lacpdu. Parameter values for the partner carried in the
@@ -436,41 +436,41 @@ static u16 __ad_timer_to_ticks(u16 timer_type, u16 par)
  * used here to implement the language from 802.3ad 43.4.9 that requires
  * recordPDU to "match" the LACPDU parameters to the stored values.
  */
-static void __choose_matched(struct lacpdu *lacpdu, struct port *port)
+static void __choose_matched(struct lacpdu *lacpdu, struct ad_port *ad_port)
 {
 	/* check if all parameters are alike
 	 * or this is individual link(aggregation == FALSE)
 	 * then update the state machine Matched variable.
 	 */
-	if (((ntohs(lacpdu->partner_port) == port->actor_port_number) &&
-	     (ntohs(lacpdu->partner_port_priority) == port->actor_port_priority) &&
-	     MAC_ADDRESS_EQUAL(&(lacpdu->partner_system), &(port->actor_system)) &&
-	     (ntohs(lacpdu->partner_system_priority) == port->actor_system_priority) &&
-	     (ntohs(lacpdu->partner_key) == port->actor_oper_port_key) &&
-	     ((lacpdu->partner_state & LACP_STATE_AGGREGATION) == (port->actor_oper_port_state & LACP_STATE_AGGREGATION))) ||
+	if (((ntohs(lacpdu->partner_port) == ad_port->actor_port_number) &&
+	     (ntohs(lacpdu->partner_port_priority) == ad_port->actor_port_priority) &&
+	     MAC_ADDRESS_EQUAL(&(lacpdu->partner_system), &(ad_port->actor_system)) &&
+	     (ntohs(lacpdu->partner_system_priority) == ad_port->actor_system_priority) &&
+	     (ntohs(lacpdu->partner_key) == ad_port->actor_oper_port_key) &&
+	     ((lacpdu->partner_state & LACP_STATE_AGGREGATION) == (ad_port->actor_oper_port_state & LACP_STATE_AGGREGATION))) ||
 	    ((lacpdu->actor_state & LACP_STATE_AGGREGATION) == 0)
 		) {
-		port->sm_vars |= AD_PORT_MATCHED;
+		ad_port->sm_vars |= AD_PORT_MATCHED;
 	} else {
-		port->sm_vars &= ~AD_PORT_MATCHED;
+		ad_port->sm_vars &= ~AD_PORT_MATCHED;
 	}
 }
 
 /**
  * __record_pdu - record parameters from a received lacpdu
  * @lacpdu: the lacpdu we've received
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  *
  * Record the parameter values for the Actor carried in a received lacpdu as
  * the current partner operational parameter values and sets
  * actor_oper_port_state.defaulted to FALSE.
  */
-static void __record_pdu(struct lacpdu *lacpdu, struct port *port)
+static void __record_pdu(struct lacpdu *lacpdu, struct ad_port *ad_port)
 {
-	if (lacpdu && port) {
-		struct port_params *partner = &port->partner_oper;
+	if (lacpdu && ad_port) {
+		struct port_params *partner = &ad_port->partner_oper;
 
-		__choose_matched(lacpdu, port);
+		__choose_matched(lacpdu, ad_port);
 		/* record the new parameter values for the partner
 		 * operational
 		 */
@@ -482,19 +482,19 @@ static void __record_pdu(struct lacpdu *lacpdu, struct port *port)
 		partner->port_state = lacpdu->actor_state;
 
 		/* set actor_oper_port_state.defaulted to FALSE */
-		port->actor_oper_port_state &= ~LACP_STATE_DEFAULTED;
+		ad_port->actor_oper_port_state &= ~LACP_STATE_DEFAULTED;
 
 		/* set the partner sync. to on if the partner is sync,
-		 * and the port is matched
+		 * and the ad_port is matched
 		 */
-		if ((port->sm_vars & AD_PORT_MATCHED) &&
+		if ((ad_port->sm_vars & AD_PORT_MATCHED) &&
 		    (lacpdu->actor_state & LACP_STATE_SYNCHRONIZATION)) {
 			partner->port_state |= LACP_STATE_SYNCHRONIZATION;
-			slave_dbg(port->slave->bond->dev, port->slave->dev,
+			slave_dbg(ad_port->slave->bond->dev, ad_port->slave->dev,
 				  "partner sync=1\n");
 		} else {
 			partner->port_state &= ~LACP_STATE_SYNCHRONIZATION;
-			slave_dbg(port->slave->bond->dev, port->slave->dev,
+			slave_dbg(ad_port->slave->bond->dev, ad_port->slave->dev,
 				  "partner sync=0\n");
 		}
 	}
@@ -502,41 +502,41 @@ static void __record_pdu(struct lacpdu *lacpdu, struct port *port)
 
 /**
  * __record_default - record default parameters
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  *
  * This function records the default parameter values for the partner carried
  * in the Partner Admin parameters as the current partner operational parameter
  * values and sets actor_oper_port_state.defaulted to TRUE.
  */
-static void __record_default(struct port *port)
+static void __record_default(struct ad_port *ad_port)
 {
-	if (port) {
+	if (ad_port) {
 		/* record the partner admin parameters */
-		memcpy(&port->partner_oper, &port->partner_admin,
+		memcpy(&ad_port->partner_oper, &ad_port->partner_admin,
 		       sizeof(struct port_params));
 
 		/* set actor_oper_port_state.defaulted to true */
-		port->actor_oper_port_state |= LACP_STATE_DEFAULTED;
+		ad_port->actor_oper_port_state |= LACP_STATE_DEFAULTED;
 	}
 }
 
 /**
- * __update_selected - update a port's Selected variable from a received lacpdu
+ * __update_selected - update an ad_port's Selected variable from a received lacpdu
  * @lacpdu: the lacpdu we've received
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  *
  * Update the value of the selected variable, using parameter values from a
  * newly received lacpdu. The parameter values for the Actor carried in the
  * received PDU are compared with the corresponding operational parameter
- * values for the ports partner. If one or more of the comparisons shows that
+ * values for the ad_ports partner. If one or more of the comparisons shows that
  * the value(s) received in the PDU differ from the current operational values,
  * then selected is set to FALSE and actor_oper_port_state.synchronization is
  * set to out_of_sync. Otherwise, selected remains unchanged.
  */
-static void __update_selected(struct lacpdu *lacpdu, struct port *port)
+static void __update_selected(struct lacpdu *lacpdu, struct ad_port *ad_port)
 {
-	if (lacpdu && port) {
-		const struct port_params *partner = &port->partner_oper;
+	if (lacpdu && ad_port) {
+		const struct port_params *partner = &ad_port->partner_oper;
 
 		/* check if any parameter is different then
 		 * update the state machine selected variable.
@@ -547,14 +547,14 @@ static void __update_selected(struct lacpdu *lacpdu, struct port *port)
 		    ntohs(lacpdu->actor_system_priority) != partner->system_priority ||
 		    ntohs(lacpdu->actor_key) != partner->key ||
 		    (lacpdu->actor_state & LACP_STATE_AGGREGATION) != (partner->port_state & LACP_STATE_AGGREGATION)) {
-			port->sm_vars &= ~AD_PORT_SELECTED;
+			ad_port->sm_vars &= ~AD_PORT_SELECTED;
 		}
 	}
 }
 
 /**
- * __update_default_selected - update a port's Selected variable from Partner
- * @port: the port we're looking at
+ * __update_default_selected - update an ad_port's Selected variable from Partner
+ * @ad_port: the ad_port we're looking at
  *
  * This function updates the value of the selected variable, using the partner
  * administrative parameter values. The administrative values are compared with
@@ -564,11 +564,11 @@ static void __update_selected(struct lacpdu *lacpdu, struct port *port)
  * actor_oper_port_state.synchronization is set to OUT_OF_SYNC. Otherwise,
  * Selected remains unchanged.
  */
-static void __update_default_selected(struct port *port)
+static void __update_default_selected(struct ad_port *ad_port)
 {
-	if (port) {
-		const struct port_params *admin = &port->partner_admin;
-		const struct port_params *oper = &port->partner_oper;
+	if (ad_port) {
+		const struct port_params *admin = &ad_port->partner_admin;
+		const struct port_params *oper = &ad_port->partner_oper;
 
 		/* check if any parameter is different then
 		 * update the state machine selected variable.
@@ -580,15 +580,15 @@ static void __update_default_selected(struct port *port)
 		    admin->key != oper->key ||
 		    (admin->port_state & LACP_STATE_AGGREGATION)
 			!= (oper->port_state & LACP_STATE_AGGREGATION)) {
-			port->sm_vars &= ~AD_PORT_SELECTED;
+			ad_port->sm_vars &= ~AD_PORT_SELECTED;
 		}
 	}
 }
 
 /**
- * __update_ntt - update a port's ntt variable from a received lacpdu
+ * __update_ntt - update an ad_port's ntt variable from a received lacpdu
  * @lacpdu: the lacpdu we've received
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  *
  * Updates the value of the ntt variable, using parameter values from a newly
  * received lacpdu. The parameter values for the partner carried in the
@@ -597,46 +597,46 @@ static void __update_default_selected(struct port *port)
  * value(s) received in the PDU differ from the current operational values,
  * then ntt is set to TRUE. Otherwise, ntt remains unchanged.
  */
-static void __update_ntt(struct lacpdu *lacpdu, struct port *port)
+static void __update_ntt(struct lacpdu *lacpdu, struct ad_port *ad_port)
 {
-	/* validate lacpdu and port */
-	if (lacpdu && port) {
+	/* validate lacpdu and ad_port */
+	if (lacpdu && ad_port) {
 		/* check if any parameter is different then
-		 * update the port->ntt.
+		 * update the ad_port->ntt.
 		 */
-		if ((ntohs(lacpdu->partner_port) != port->actor_port_number) ||
-		    (ntohs(lacpdu->partner_port_priority) != port->actor_port_priority) ||
-		    !MAC_ADDRESS_EQUAL(&(lacpdu->partner_system), &(port->actor_system)) ||
-		    (ntohs(lacpdu->partner_system_priority) != port->actor_system_priority) ||
-		    (ntohs(lacpdu->partner_key) != port->actor_oper_port_key) ||
-		    ((lacpdu->partner_state & LACP_STATE_LACP_ACTIVITY) != (port->actor_oper_port_state & LACP_STATE_LACP_ACTIVITY)) ||
-		    ((lacpdu->partner_state & LACP_STATE_LACP_TIMEOUT) != (port->actor_oper_port_state & LACP_STATE_LACP_TIMEOUT)) ||
-		    ((lacpdu->partner_state & LACP_STATE_SYNCHRONIZATION) != (port->actor_oper_port_state & LACP_STATE_SYNCHRONIZATION)) ||
-		    ((lacpdu->partner_state & LACP_STATE_AGGREGATION) != (port->actor_oper_port_state & LACP_STATE_AGGREGATION))
+		if ((ntohs(lacpdu->partner_port) != ad_port->actor_port_number) ||
+		    (ntohs(lacpdu->partner_port_priority) != ad_port->actor_port_priority) ||
+		    !MAC_ADDRESS_EQUAL(&(lacpdu->partner_system), &(ad_port->actor_system)) ||
+		    (ntohs(lacpdu->partner_system_priority) != ad_port->actor_system_priority) ||
+		    (ntohs(lacpdu->partner_key) != ad_port->actor_oper_port_key) ||
+		    ((lacpdu->partner_state & LACP_STATE_LACP_ACTIVITY) != (ad_port->actor_oper_port_state & LACP_STATE_LACP_ACTIVITY)) ||
+		    ((lacpdu->partner_state & LACP_STATE_LACP_TIMEOUT) != (ad_port->actor_oper_port_state & LACP_STATE_LACP_TIMEOUT)) ||
+		    ((lacpdu->partner_state & LACP_STATE_SYNCHRONIZATION) != (ad_port->actor_oper_port_state & LACP_STATE_SYNCHRONIZATION)) ||
+		    ((lacpdu->partner_state & LACP_STATE_AGGREGATION) != (ad_port->actor_oper_port_state & LACP_STATE_AGGREGATION))
 		   ) {
-			port->ntt = true;
+			ad_port->ntt = true;
 		}
 	}
 }
 
 /**
- * __agg_ports_are_ready - check if all ports in an aggregator are ready
+ * __agg_ports_are_ready - check if all ad_ports in an aggregator are ready
  * @aggregator: the aggregator we're looking at
  *
  */
 static int __agg_ports_are_ready(struct aggregator *aggregator)
 {
-	struct port *port;
+	struct ad_port *ad_port;
 	int retval = 1;
 
 	if (aggregator) {
-		/* scan all ports in this aggregator to verfy if they are
+		/* scan all ad_ports in this aggregator to verfy if they are
 		 * all ready.
 		 */
-		for (port = aggregator->lag_ports;
-		     port;
-		     port = port->next_port_in_aggregator) {
-			if (!(port->sm_vars & AD_PORT_READY_N)) {
+		for (ad_port = aggregator->lag_ports;
+		     ad_port;
+		     ad_port = ad_port->next_port_in_aggregator) {
+			if (!(ad_port->sm_vars & AD_PORT_READY_N)) {
 				retval = 0;
 				break;
 			}
@@ -647,32 +647,32 @@ static int __agg_ports_are_ready(struct aggregator *aggregator)
 }
 
 /**
- * __set_agg_ports_ready - set value of Ready bit in all ports of an aggregator
+ * __set_agg_ports_ready - set value of Ready bit in all ad_ports of an aggregator
  * @aggregator: the aggregator we're looking at
- * @val: Should the ports' ready bit be set on or off
+ * @val: Should the ad_ports' ready bit be set on or off
  *
  */
 static void __set_agg_ports_ready(struct aggregator *aggregator, int val)
 {
-	struct port *port;
+	struct ad_port *ad_port;
 
-	for (port = aggregator->lag_ports; port;
-	     port = port->next_port_in_aggregator) {
+	for (ad_port = aggregator->lag_ports; ad_port;
+	     ad_port = ad_port->next_port_in_aggregator) {
 		if (val)
-			port->sm_vars |= AD_PORT_READY;
+			ad_port->sm_vars |= AD_PORT_READY;
 		else
-			port->sm_vars &= ~AD_PORT_READY;
+			ad_port->sm_vars &= ~AD_PORT_READY;
 	}
 }
 
-static int __agg_active_ports(struct aggregator *agg)
+static int __agg_active_ad_ports(struct aggregator *agg)
 {
-	struct port *port;
+	struct ad_port *ad_port;
 	int active = 0;
 
-	for (port = agg->lag_ports; port;
-	     port = port->next_port_in_aggregator) {
-		if (port->is_enabled)
+	for (ad_port = agg->lag_ports; ad_port;
+	     ad_port = ad_port->next_port_in_aggregator) {
+		if (ad_port->is_enabled)
 			active++;
 	}
 
@@ -686,7 +686,7 @@ static int __agg_active_ports(struct aggregator *agg)
  */
 static u32 __get_agg_bandwidth(struct aggregator *aggregator)
 {
-	int nports = __agg_active_ports(aggregator);
+	int nports = __agg_active_ad_ports(aggregator);
 	u32 bandwidth = 0;
 
 	if (nports) {
@@ -760,13 +760,13 @@ static struct aggregator *__get_active_agg(struct aggregator *aggregator)
 }
 
 /**
- * __update_lacpdu_from_port - update a port's lacpdu fields
- * @port: the port we're looking at
+ * __update_lacpdu_from_ad_port - update an ad_port's lacpdu fields
+ * @ad_port: the ad_port we're looking at
  */
-static inline void __update_lacpdu_from_port(struct port *port)
+static inline void __update_lacpdu_from_ad_port(struct ad_port *ad_port)
 {
-	struct lacpdu *lacpdu = &port->lacpdu;
-	const struct port_params *partner = &port->partner_oper;
+	struct lacpdu *lacpdu = &ad_port->lacpdu;
+	const struct port_params *partner = &ad_port->partner_oper;
 
 	/* update current actual Actor parameters
 	 * lacpdu->subtype                   initialized
@@ -775,15 +775,15 @@ static inline void __update_lacpdu_from_port(struct port *port)
 	 * lacpdu->actor_information_length  initialized
 	 */
 
-	lacpdu->actor_system_priority = htons(port->actor_system_priority);
-	lacpdu->actor_system = port->actor_system;
-	lacpdu->actor_key = htons(port->actor_oper_port_key);
-	lacpdu->actor_port_priority = htons(port->actor_port_priority);
-	lacpdu->actor_port = htons(port->actor_port_number);
-	lacpdu->actor_state = port->actor_oper_port_state;
-	slave_dbg(port->slave->bond->dev, port->slave->dev,
-		  "update lacpdu: actor port state %x\n",
-		  port->actor_oper_port_state);
+	lacpdu->actor_system_priority = htons(ad_port->actor_system_priority);
+	lacpdu->actor_system = ad_port->actor_system;
+	lacpdu->actor_key = htons(ad_port->actor_oper_port_key);
+	lacpdu->actor_port_priority = htons(ad_port->actor_port_priority);
+	lacpdu->actor_port = htons(ad_port->actor_port_number);
+	lacpdu->actor_state = ad_port->actor_oper_port_state;
+	slave_dbg(ad_port->slave->bond->dev, ad_port->slave->dev,
+		  "update lacpdu: actor ad port state %x\n",
+		  ad_port->actor_oper_port_state);
 
 	/* lacpdu->reserved_3_1              initialized
 	 * lacpdu->tlv_type_partner_info     initialized
@@ -811,15 +811,15 @@ static inline void __update_lacpdu_from_port(struct port *port)
 /* ================= main 802.3ad protocol code ========================= */
 
 /**
- * ad_lacpdu_send - send out a lacpdu packet on a given port
- * @port: the port we're looking at
+ * ad_lacpdu_send - send out a lacpdu packet on a given ad_port
+ * @ad_port: the ad_port we're looking at
  *
  * Returns:   0 on success
  *          < 0 on error
  */
-static int ad_lacpdu_send(struct port *port)
+static int ad_lacpdu_send(struct ad_port *ad_port)
 {
-	struct slave *slave = port->slave;
+	struct slave *slave = ad_port->slave;
 	struct sk_buff *skb;
 	struct lacpdu_header *lacpdu_header;
 	int length = sizeof(struct lacpdu_header);
@@ -846,7 +846,7 @@ static int ad_lacpdu_send(struct port *port)
 	ether_addr_copy(lacpdu_header->hdr.h_source, slave->perm_hwaddr);
 	lacpdu_header->hdr.h_proto = PKT_TYPE_LACPDU;
 
-	lacpdu_header->lacpdu = port->lacpdu;
+	lacpdu_header->lacpdu = ad_port->lacpdu;
 
 	dev_queue_xmit(skb);
 
@@ -854,16 +854,16 @@ static int ad_lacpdu_send(struct port *port)
 }
 
 /**
- * ad_marker_send - send marker information/response on a given port
- * @port: the port we're looking at
+ * ad_marker_send - send marker information/response on a given ad_port
+ * @ad_port: the ad_port we're looking at
  * @marker: marker data to send
  *
  * Returns:   0 on success
  *          < 0 on error
  */
-static int ad_marker_send(struct port *port, struct bond_marker *marker)
+static int ad_marker_send(struct ad_port *ad_port, struct bond_marker *marker)
 {
-	struct slave *slave = port->slave;
+	struct slave *slave = ad_port->slave;
 	struct sk_buff *skb;
 	struct bond_marker_header *marker_header;
 	int length = sizeof(struct bond_marker_header);
@@ -907,104 +907,104 @@ static int ad_marker_send(struct port *port, struct bond_marker *marker)
 }
 
 /**
- * ad_mux_machine - handle a port's mux state machine
- * @port: the port we're looking at
+ * ad_mux_machine - handle an ad_port's mux state machine
+ * @ad_port: the ad_port we're looking at
  * @update_slave_arr: Does slave array need update?
  */
-static void ad_mux_machine(struct port *port, bool *update_slave_arr)
+static void ad_mux_machine(struct ad_port *ad_port, bool *update_slave_arr)
 {
 	mux_states_t last_state;
 
 	/* keep current State Machine state to compare later if it was
 	 * changed
 	 */
-	last_state = port->sm_mux_state;
+	last_state = ad_port->sm_mux_state;
 
-	if (port->sm_vars & AD_PORT_BEGIN) {
-		port->sm_mux_state = AD_MUX_DETACHED;
+	if (ad_port->sm_vars & AD_PORT_BEGIN) {
+		ad_port->sm_mux_state = AD_MUX_DETACHED;
 	} else {
-		switch (port->sm_mux_state) {
+		switch (ad_port->sm_mux_state) {
 		case AD_MUX_DETACHED:
-			if ((port->sm_vars & AD_PORT_SELECTED)
-			    || (port->sm_vars & AD_PORT_STANDBY))
+			if ((ad_port->sm_vars & AD_PORT_SELECTED)
+			    || (ad_port->sm_vars & AD_PORT_STANDBY))
 				/* if SELECTED or STANDBY */
-				port->sm_mux_state = AD_MUX_WAITING;
+				ad_port->sm_mux_state = AD_MUX_WAITING;
 			break;
 		case AD_MUX_WAITING:
 			/* if SELECTED == FALSE return to DETACH state */
-			if (!(port->sm_vars & AD_PORT_SELECTED)) {
-				port->sm_vars &= ~AD_PORT_READY_N;
+			if (!(ad_port->sm_vars & AD_PORT_SELECTED)) {
+				ad_port->sm_vars &= ~AD_PORT_READY_N;
 				/* in order to withhold the Selection Logic to
 				 * check all ports READY_N value every callback
 				 * cycle to update ready variable, we check
 				 * READY_N and update READY here
 				 */
-				__set_agg_ports_ready(port->aggregator, __agg_ports_are_ready(port->aggregator));
-				port->sm_mux_state = AD_MUX_DETACHED;
+				__set_agg_ports_ready(ad_port->aggregator, __agg_ports_are_ready(ad_port->aggregator));
+				ad_port->sm_mux_state = AD_MUX_DETACHED;
 				break;
 			}
 
 			/* check if the wait_while_timer expired */
-			if (port->sm_mux_timer_counter
-			    && !(--port->sm_mux_timer_counter))
-				port->sm_vars |= AD_PORT_READY_N;
+			if (ad_port->sm_mux_timer_counter
+			    && !(--ad_port->sm_mux_timer_counter))
+				ad_port->sm_vars |= AD_PORT_READY_N;
 
 			/* in order to withhold the selection logic to check
 			 * all ports READY_N value every callback cycle to
 			 * update ready variable, we check READY_N and update
 			 * READY here
 			 */
-			__set_agg_ports_ready(port->aggregator, __agg_ports_are_ready(port->aggregator));
+			__set_agg_ports_ready(ad_port->aggregator, __agg_ports_are_ready(ad_port->aggregator));
 
-			/* if the wait_while_timer expired, and the port is
+			/* if the wait_while_timer expired, and the ad_port is
 			 * in READY state, move to ATTACHED state
 			 */
-			if ((port->sm_vars & AD_PORT_READY)
-			    && !port->sm_mux_timer_counter)
-				port->sm_mux_state = AD_MUX_ATTACHED;
+			if ((ad_port->sm_vars & AD_PORT_READY)
+			    && !ad_port->sm_mux_timer_counter)
+				ad_port->sm_mux_state = AD_MUX_ATTACHED;
 			break;
 		case AD_MUX_ATTACHED:
 			/* check also if agg_select_timer expired (so the
-			 * edable port will take place only after this timer)
+			 * edable ad_port will take place only after this timer)
 			 */
-			if ((port->sm_vars & AD_PORT_SELECTED) &&
-			    (port->partner_oper.port_state & LACP_STATE_SYNCHRONIZATION) &&
-			    !__check_agg_selection_timer(port)) {
-				if (port->aggregator->is_active)
-					port->sm_mux_state =
+			if ((ad_port->sm_vars & AD_PORT_SELECTED) &&
+			    (ad_port->partner_oper.port_state & LACP_STATE_SYNCHRONIZATION) &&
+			    !__check_agg_selection_timer(ad_port)) {
+				if (ad_port->aggregator->is_active)
+					ad_port->sm_mux_state =
 					    AD_MUX_COLLECTING_DISTRIBUTING;
-			} else if (!(port->sm_vars & AD_PORT_SELECTED) ||
-				   (port->sm_vars & AD_PORT_STANDBY)) {
+			} else if (!(ad_port->sm_vars & AD_PORT_SELECTED) ||
+				   (ad_port->sm_vars & AD_PORT_STANDBY)) {
 				/* if UNSELECTED or STANDBY */
-				port->sm_vars &= ~AD_PORT_READY_N;
+				ad_port->sm_vars &= ~AD_PORT_READY_N;
 				/* in order to withhold the selection logic to
 				 * check all ports READY_N value every callback
 				 * cycle to update ready variable, we check
 				 * READY_N and update READY here
 				 */
-				__set_agg_ports_ready(port->aggregator, __agg_ports_are_ready(port->aggregator));
-				port->sm_mux_state = AD_MUX_DETACHED;
-			} else if (port->aggregator->is_active) {
-				port->actor_oper_port_state |=
+				__set_agg_ports_ready(ad_port->aggregator, __agg_ports_are_ready(ad_port->aggregator));
+				ad_port->sm_mux_state = AD_MUX_DETACHED;
+			} else if (ad_port->aggregator->is_active) {
+				ad_port->actor_oper_port_state |=
 				    LACP_STATE_SYNCHRONIZATION;
 			}
 			break;
 		case AD_MUX_COLLECTING_DISTRIBUTING:
-			if (!(port->sm_vars & AD_PORT_SELECTED) ||
-			    (port->sm_vars & AD_PORT_STANDBY) ||
-			    !(port->partner_oper.port_state & LACP_STATE_SYNCHRONIZATION) ||
-			    !(port->actor_oper_port_state & LACP_STATE_SYNCHRONIZATION)) {
-				port->sm_mux_state = AD_MUX_ATTACHED;
+			if (!(ad_port->sm_vars & AD_PORT_SELECTED) ||
+			    (ad_port->sm_vars & AD_PORT_STANDBY) ||
+			    !(ad_port->partner_oper.port_state & LACP_STATE_SYNCHRONIZATION) ||
+			    !(ad_port->actor_oper_port_state & LACP_STATE_SYNCHRONIZATION)) {
+				ad_port->sm_mux_state = AD_MUX_ATTACHED;
 			} else {
-				/* if port state hasn't changed make
+				/* if ad_port state hasn't changed make
 				 * sure that a collecting distributing
-				 * port in an active aggregator is enabled
+				 * ad_port in an active aggregator is enabled
 				 */
-				if (port->aggregator &&
-				    port->aggregator->is_active &&
-				    !__port_is_enabled(port)) {
+				if (ad_port->aggregator &&
+				    ad_port->aggregator->is_active &&
+				    !__ad_port_is_enabled(ad_port)) {
 
-					__enable_port(port);
+					__enable_ad_port(ad_port);
 				}
 			}
 			break;
@@ -1014,44 +1014,43 @@ static void ad_mux_machine(struct port *port, bool *update_slave_arr)
 	}
 
 	/* check if the state machine was changed */
-	if (port->sm_mux_state != last_state) {
-		slave_dbg(port->slave->bond->dev, port->slave->dev,
+	if (ad_port->sm_mux_state != last_state) {
+		slave_dbg(ad_port->slave->bond->dev, ad_port->slave->dev,
 			  "Mux Machine: Port=%d, Last State=%d, Curr State=%d\n",
-			  port->actor_port_number,
-			  last_state,
-			  port->sm_mux_state);
-		switch (port->sm_mux_state) {
+			  ad_port->actor_port_number, last_state,
+			  ad_port->sm_mux_state);
+		switch (ad_port->sm_mux_state) {
 		case AD_MUX_DETACHED:
-			port->actor_oper_port_state &= ~LACP_STATE_SYNCHRONIZATION;
-			ad_disable_collecting_distributing(port,
+			ad_port->actor_oper_port_state &= ~LACP_STATE_SYNCHRONIZATION;
+			ad_disable_collecting_distributing(ad_port,
 							   update_slave_arr);
-			port->actor_oper_port_state &= ~LACP_STATE_COLLECTING;
-			port->actor_oper_port_state &= ~LACP_STATE_DISTRIBUTING;
-			port->ntt = true;
+			ad_port->actor_oper_port_state &= ~LACP_STATE_COLLECTING;
+			ad_port->actor_oper_port_state &= ~LACP_STATE_DISTRIBUTING;
+			ad_port->ntt = true;
 			break;
 		case AD_MUX_WAITING:
-			port->sm_mux_timer_counter = __ad_timer_to_ticks(AD_WAIT_WHILE_TIMER, 0);
+			ad_port->sm_mux_timer_counter = __ad_timer_to_ticks(AD_WAIT_WHILE_TIMER, 0);
 			break;
 		case AD_MUX_ATTACHED:
-			if (port->aggregator->is_active)
-				port->actor_oper_port_state |=
+			if (ad_port->aggregator->is_active)
+				ad_port->actor_oper_port_state |=
 				    LACP_STATE_SYNCHRONIZATION;
 			else
-				port->actor_oper_port_state &=
+				ad_port->actor_oper_port_state &=
 				    ~LACP_STATE_SYNCHRONIZATION;
-			port->actor_oper_port_state &= ~LACP_STATE_COLLECTING;
-			port->actor_oper_port_state &= ~LACP_STATE_DISTRIBUTING;
-			ad_disable_collecting_distributing(port,
+			ad_port->actor_oper_port_state &= ~LACP_STATE_COLLECTING;
+			ad_port->actor_oper_port_state &= ~LACP_STATE_DISTRIBUTING;
+			ad_disable_collecting_distributing(ad_port,
 							   update_slave_arr);
-			port->ntt = true;
+			ad_port->ntt = true;
 			break;
 		case AD_MUX_COLLECTING_DISTRIBUTING:
-			port->actor_oper_port_state |= LACP_STATE_COLLECTING;
-			port->actor_oper_port_state |= LACP_STATE_DISTRIBUTING;
-			port->actor_oper_port_state |= LACP_STATE_SYNCHRONIZATION;
-			ad_enable_collecting_distributing(port,
+			ad_port->actor_oper_port_state |= LACP_STATE_COLLECTING;
+			ad_port->actor_oper_port_state |= LACP_STATE_DISTRIBUTING;
+			ad_port->actor_oper_port_state |= LACP_STATE_SYNCHRONIZATION;
+			ad_enable_collecting_distributing(ad_port,
 							  update_slave_arr);
-			port->ntt = true;
+			ad_port->ntt = true;
 			break;
 		default:
 			break;
@@ -1060,69 +1059,69 @@ static void ad_mux_machine(struct port *port, bool *update_slave_arr)
 }
 
 /**
- * ad_rx_machine - handle a port's rx State Machine
+ * ad_rx_machine - handle an ad_port's rx State Machine
  * @lacpdu: the lacpdu we've received
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  *
  * If lacpdu arrived, stop previous timer (if exists) and set the next state as
  * CURRENT. If timer expired set the state machine in the proper state.
  * In other cases, this function checks if we need to switch to other state.
  */
-static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
+static void ad_rx_machine(struct lacpdu *lacpdu, struct ad_port *ad_port)
 {
 	rx_states_t last_state;
 
 	/* keep current State Machine state to compare later if it was
 	 * changed
 	 */
-	last_state = port->sm_rx_state;
+	last_state = ad_port->sm_rx_state;
 
 	if (lacpdu) {
-		atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.lacpdu_rx);
-		atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.lacpdu_rx);
+		atomic64_inc(&SLAVE_AD_INFO(ad_port->slave)->stats.lacpdu_rx);
+		atomic64_inc(&BOND_AD_INFO(ad_port->slave->bond).stats.lacpdu_rx);
 	}
 	/* check if state machine should change state */
 
-	/* first, check if port was reinitialized */
-	if (port->sm_vars & AD_PORT_BEGIN) {
-		port->sm_rx_state = AD_RX_INITIALIZE;
-		port->sm_vars |= AD_PORT_CHURNED;
+	/* first, check if ad_port was reinitialized */
+	if (ad_port->sm_vars & AD_PORT_BEGIN) {
+		ad_port->sm_rx_state = AD_RX_INITIALIZE;
+		ad_port->sm_vars |= AD_PORT_CHURNED;
 	/* check if port is not enabled */
-	} else if (!(port->sm_vars & AD_PORT_BEGIN) && !port->is_enabled)
-		port->sm_rx_state = AD_RX_PORT_DISABLED;
+	} else if (!(ad_port->sm_vars & AD_PORT_BEGIN) && !ad_port->is_enabled)
+		ad_port->sm_rx_state = AD_RX_PORT_DISABLED;
 	/* check if new lacpdu arrived */
-	else if (lacpdu && ((port->sm_rx_state == AD_RX_EXPIRED) ||
-		 (port->sm_rx_state == AD_RX_DEFAULTED) ||
-		 (port->sm_rx_state == AD_RX_CURRENT))) {
-		if (port->sm_rx_state != AD_RX_CURRENT)
-			port->sm_vars |= AD_PORT_CHURNED;
-		port->sm_rx_timer_counter = 0;
-		port->sm_rx_state = AD_RX_CURRENT;
+	else if (lacpdu && ((ad_port->sm_rx_state == AD_RX_EXPIRED) ||
+		 (ad_port->sm_rx_state == AD_RX_DEFAULTED) ||
+		 (ad_port->sm_rx_state == AD_RX_CURRENT))) {
+		if (ad_port->sm_rx_state != AD_RX_CURRENT)
+			ad_port->sm_vars |= AD_PORT_CHURNED;
+		ad_port->sm_rx_timer_counter = 0;
+		ad_port->sm_rx_state = AD_RX_CURRENT;
 	} else {
 		/* if timer is on, and if it is expired */
-		if (port->sm_rx_timer_counter &&
-		    !(--port->sm_rx_timer_counter)) {
-			switch (port->sm_rx_state) {
+		if (ad_port->sm_rx_timer_counter &&
+		    !(--ad_port->sm_rx_timer_counter)) {
+			switch (ad_port->sm_rx_state) {
 			case AD_RX_EXPIRED:
-				port->sm_rx_state = AD_RX_DEFAULTED;
+				ad_port->sm_rx_state = AD_RX_DEFAULTED;
 				break;
 			case AD_RX_CURRENT:
-				port->sm_rx_state = AD_RX_EXPIRED;
+				ad_port->sm_rx_state = AD_RX_EXPIRED;
 				break;
 			default:
 				break;
 			}
 		} else {
 			/* if no lacpdu arrived and no timer is on */
-			switch (port->sm_rx_state) {
+			switch (ad_port->sm_rx_state) {
 			case AD_RX_PORT_DISABLED:
-				if (port->is_enabled &&
-				    (port->sm_vars & AD_PORT_LACP_ENABLED))
-					port->sm_rx_state = AD_RX_EXPIRED;
-				else if (port->is_enabled
-					 && ((port->sm_vars
+				if (ad_port->is_enabled &&
+				    (ad_port->sm_vars & AD_PORT_LACP_ENABLED))
+					ad_port->sm_rx_state = AD_RX_EXPIRED;
+				else if (ad_port->is_enabled
+					 && ((ad_port->sm_vars
 					      & AD_PORT_LACP_ENABLED) == 0))
-					port->sm_rx_state = AD_RX_LACP_DISABLED;
+					ad_port->sm_rx_state = AD_RX_LACP_DISABLED;
 				break;
 			default:
 				break;
@@ -1132,68 +1131,68 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
 	}
 
 	/* check if the State machine was changed or new lacpdu arrived */
-	if ((port->sm_rx_state != last_state) || (lacpdu)) {
-		slave_dbg(port->slave->bond->dev, port->slave->dev,
+	if ((ad_port->sm_rx_state != last_state) || (lacpdu)) {
+		slave_dbg(ad_port->slave->bond->dev, ad_port->slave->dev,
 			  "Rx Machine: Port=%d, Last State=%d, Curr State=%d\n",
-			  port->actor_port_number,
+			  ad_port->actor_port_number,
 			  last_state,
-			  port->sm_rx_state);
-		switch (port->sm_rx_state) {
+			  ad_port->sm_rx_state);
+		switch (ad_port->sm_rx_state) {
 		case AD_RX_INITIALIZE:
-			if (!(port->actor_oper_port_key & AD_DUPLEX_KEY_MASKS))
-				port->sm_vars &= ~AD_PORT_LACP_ENABLED;
+			if (!(ad_port->actor_oper_port_key & AD_DUPLEX_KEY_MASKS))
+				ad_port->sm_vars &= ~AD_PORT_LACP_ENABLED;
 			else
-				port->sm_vars |= AD_PORT_LACP_ENABLED;
-			port->sm_vars &= ~AD_PORT_SELECTED;
-			__record_default(port);
-			port->actor_oper_port_state &= ~LACP_STATE_EXPIRED;
-			port->sm_rx_state = AD_RX_PORT_DISABLED;
+				ad_port->sm_vars |= AD_PORT_LACP_ENABLED;
+			ad_port->sm_vars &= ~AD_PORT_SELECTED;
+			__record_default(ad_port);
+			ad_port->actor_oper_port_state &= ~LACP_STATE_EXPIRED;
+			ad_port->sm_rx_state = AD_RX_PORT_DISABLED;
 
 			fallthrough;
 		case AD_RX_PORT_DISABLED:
-			port->sm_vars &= ~AD_PORT_MATCHED;
+			ad_port->sm_vars &= ~AD_PORT_MATCHED;
 			break;
 		case AD_RX_LACP_DISABLED:
-			port->sm_vars &= ~AD_PORT_SELECTED;
-			__record_default(port);
-			port->partner_oper.port_state &= ~LACP_STATE_AGGREGATION;
-			port->sm_vars |= AD_PORT_MATCHED;
-			port->actor_oper_port_state &= ~LACP_STATE_EXPIRED;
+			ad_port->sm_vars &= ~AD_PORT_SELECTED;
+			__record_default(ad_port);
+			ad_port->partner_oper.port_state &= ~LACP_STATE_AGGREGATION;
+			ad_port->sm_vars |= AD_PORT_MATCHED;
+			ad_port->actor_oper_port_state &= ~LACP_STATE_EXPIRED;
 			break;
 		case AD_RX_EXPIRED:
 			/* Reset of the Synchronization flag (Standard 43.4.12)
-			 * This reset cause to disable this port in the
+			 * This reset cause to disable this ad_port in the
 			 * COLLECTING_DISTRIBUTING state of the mux machine in
 			 * case of EXPIRED even if LINK_DOWN didn't arrive for
-			 * the port.
+			 * the ad_port.
 			 */
-			port->partner_oper.port_state &= ~LACP_STATE_SYNCHRONIZATION;
-			port->sm_vars &= ~AD_PORT_MATCHED;
-			port->partner_oper.port_state |= LACP_STATE_LACP_TIMEOUT;
-			port->partner_oper.port_state |= LACP_STATE_LACP_ACTIVITY;
-			port->sm_rx_timer_counter = __ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER, (u16)(AD_SHORT_TIMEOUT));
-			port->actor_oper_port_state |= LACP_STATE_EXPIRED;
-			port->sm_vars |= AD_PORT_CHURNED;
+			ad_port->partner_oper.port_state &= ~LACP_STATE_SYNCHRONIZATION;
+			ad_port->sm_vars &= ~AD_PORT_MATCHED;
+			ad_port->partner_oper.port_state |= LACP_STATE_LACP_TIMEOUT;
+			ad_port->partner_oper.port_state |= LACP_STATE_LACP_ACTIVITY;
+			ad_port->sm_rx_timer_counter = __ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER, (u16)(AD_SHORT_TIMEOUT));
+			ad_port->actor_oper_port_state |= LACP_STATE_EXPIRED;
+			ad_port->sm_vars |= AD_PORT_CHURNED;
 			break;
 		case AD_RX_DEFAULTED:
-			__update_default_selected(port);
-			__record_default(port);
-			port->sm_vars |= AD_PORT_MATCHED;
-			port->actor_oper_port_state &= ~LACP_STATE_EXPIRED;
+			__update_default_selected(ad_port);
+			__record_default(ad_port);
+			ad_port->sm_vars |= AD_PORT_MATCHED;
+			ad_port->actor_oper_port_state &= ~LACP_STATE_EXPIRED;
 			break;
 		case AD_RX_CURRENT:
 			/* detect loopback situation */
 			if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system),
-					      &(port->actor_system))) {
-				slave_err(port->slave->bond->dev, port->slave->dev, "An illegal loopback occurred on slave\n"
+					      &(ad_port->actor_system))) {
+				slave_err(ad_port->slave->bond->dev, ad_port->slave->dev, "An illegal loopback occurred on slave\n"
 					  "Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n");
 				return;
 			}
-			__update_selected(lacpdu, port);
-			__update_ntt(lacpdu, port);
-			__record_pdu(lacpdu, port);
-			port->sm_rx_timer_counter = __ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER, (u16)(port->actor_oper_port_state & LACP_STATE_LACP_TIMEOUT));
-			port->actor_oper_port_state &= ~LACP_STATE_EXPIRED;
+			__update_selected(lacpdu, ad_port);
+			__update_ntt(lacpdu, ad_port);
+			__record_pdu(lacpdu, ad_port);
+			ad_port->sm_rx_timer_counter = __ad_timer_to_ticks(AD_CURRENT_WHILE_TIMER, (u16)(ad_port->actor_oper_port_state & LACP_STATE_LACP_TIMEOUT));
+			ad_port->actor_oper_port_state &= ~LACP_STATE_EXPIRED;
 			break;
 		default:
 			break;
@@ -1202,116 +1201,116 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
 }
 
 /**
- * ad_churn_machine - handle port churn's state machine
- * @port: the port we're looking at
+ * ad_churn_machine - handle ad_port churn's state machine
+ * @ad_port: the ad_port we're looking at
  *
  */
-static void ad_churn_machine(struct port *port)
+static void ad_churn_machine(struct ad_port *ad_port)
 {
-	if (port->sm_vars & AD_PORT_CHURNED) {
-		port->sm_vars &= ~AD_PORT_CHURNED;
-		port->sm_churn_actor_state = AD_CHURN_MONITOR;
-		port->sm_churn_partner_state = AD_CHURN_MONITOR;
-		port->sm_churn_actor_timer_counter =
+	if (ad_port->sm_vars & AD_PORT_CHURNED) {
+		ad_port->sm_vars &= ~AD_PORT_CHURNED;
+		ad_port->sm_churn_actor_state = AD_CHURN_MONITOR;
+		ad_port->sm_churn_partner_state = AD_CHURN_MONITOR;
+		ad_port->sm_churn_actor_timer_counter =
 			__ad_timer_to_ticks(AD_ACTOR_CHURN_TIMER, 0);
-		port->sm_churn_partner_timer_counter =
+		ad_port->sm_churn_partner_timer_counter =
 			 __ad_timer_to_ticks(AD_PARTNER_CHURN_TIMER, 0);
 		return;
 	}
-	if (port->sm_churn_actor_timer_counter &&
-	    !(--port->sm_churn_actor_timer_counter) &&
-	    port->sm_churn_actor_state == AD_CHURN_MONITOR) {
-		if (port->actor_oper_port_state & LACP_STATE_SYNCHRONIZATION) {
-			port->sm_churn_actor_state = AD_NO_CHURN;
+	if (ad_port->sm_churn_actor_timer_counter &&
+	    !(--ad_port->sm_churn_actor_timer_counter) &&
+	    ad_port->sm_churn_actor_state == AD_CHURN_MONITOR) {
+		if (ad_port->actor_oper_port_state & LACP_STATE_SYNCHRONIZATION) {
+			ad_port->sm_churn_actor_state = AD_NO_CHURN;
 		} else {
-			port->churn_actor_count++;
-			port->sm_churn_actor_state = AD_CHURN;
+			ad_port->churn_actor_count++;
+			ad_port->sm_churn_actor_state = AD_CHURN;
 		}
 	}
-	if (port->sm_churn_partner_timer_counter &&
-	    !(--port->sm_churn_partner_timer_counter) &&
-	    port->sm_churn_partner_state == AD_CHURN_MONITOR) {
-		if (port->partner_oper.port_state & LACP_STATE_SYNCHRONIZATION) {
-			port->sm_churn_partner_state = AD_NO_CHURN;
+	if (ad_port->sm_churn_partner_timer_counter &&
+	    !(--ad_port->sm_churn_partner_timer_counter) &&
+	    ad_port->sm_churn_partner_state == AD_CHURN_MONITOR) {
+		if (ad_port->partner_oper.port_state & LACP_STATE_SYNCHRONIZATION) {
+			ad_port->sm_churn_partner_state = AD_NO_CHURN;
 		} else {
-			port->churn_partner_count++;
-			port->sm_churn_partner_state = AD_CHURN;
+			ad_port->churn_partner_count++;
+			ad_port->sm_churn_partner_state = AD_CHURN;
 		}
 	}
 }
 
 /**
- * ad_tx_machine - handle a port's tx state machine
- * @port: the port we're looking at
+ * ad_tx_machine - handle an ad_port's tx state machine
+ * @ad_port: the ad_port we're looking at
  */
-static void ad_tx_machine(struct port *port)
+static void ad_tx_machine(struct ad_port *ad_port)
 {
 	/* check if tx timer expired, to verify that we do not send more than
 	 * 3 packets per second
 	 */
-	if (port->sm_tx_timer_counter && !(--port->sm_tx_timer_counter)) {
+	if (ad_port->sm_tx_timer_counter && !(--ad_port->sm_tx_timer_counter)) {
 		/* check if there is something to send */
-		if (port->ntt && (port->sm_vars & AD_PORT_LACP_ENABLED)) {
-			__update_lacpdu_from_port(port);
+		if (ad_port->ntt && (ad_port->sm_vars & AD_PORT_LACP_ENABLED)) {
+			__update_lacpdu_from_ad_port(ad_port);
 
-			if (ad_lacpdu_send(port) >= 0) {
-				slave_dbg(port->slave->bond->dev,
-					  port->slave->dev,
+			if (ad_lacpdu_send(ad_port) >= 0) {
+				slave_dbg(ad_port->slave->bond->dev,
+					  ad_port->slave->dev,
 					  "Sent LACPDU on port %d\n",
-					  port->actor_port_number);
+					  ad_port->actor_port_number);
 
 				/* mark ntt as false, so it will not be sent
 				 * again until demanded
 				 */
-				port->ntt = false;
+				ad_port->ntt = false;
 			}
 		}
 		/* restart tx timer(to verify that we will not exceed
 		 * AD_MAX_TX_IN_SECOND
 		 */
-		port->sm_tx_timer_counter = ad_ticks_per_sec/AD_MAX_TX_IN_SECOND;
+		ad_port->sm_tx_timer_counter = ad_ticks_per_sec/AD_MAX_TX_IN_SECOND;
 	}
 }
 
 /**
- * ad_periodic_machine - handle a port's periodic state machine
- * @port: the port we're looking at
+ * ad_periodic_machine - handle an ad_port's periodic state machine
+ * @ad_port: the ad_port we're looking at
  *
  * Turn ntt flag on priodically to perform periodic transmission of lacpdu's.
  */
-static void ad_periodic_machine(struct port *port)
+static void ad_periodic_machine(struct ad_port *ad_port)
 {
 	periodic_states_t last_state;
 
 	/* keep current state machine state to compare later if it was changed */
-	last_state = port->sm_periodic_state;
+	last_state = ad_port->sm_periodic_state;
 
-	/* check if port was reinitialized */
-	if (((port->sm_vars & AD_PORT_BEGIN) || !(port->sm_vars & AD_PORT_LACP_ENABLED) || !port->is_enabled) ||
-	    (!(port->actor_oper_port_state & LACP_STATE_LACP_ACTIVITY) && !(port->partner_oper.port_state & LACP_STATE_LACP_ACTIVITY))
+	/* check if ad_port was reinitialized */
+	if (((ad_port->sm_vars & AD_PORT_BEGIN) || !(ad_port->sm_vars & AD_PORT_LACP_ENABLED) || !ad_port->is_enabled) ||
+	    (!(ad_port->actor_oper_port_state & LACP_STATE_LACP_ACTIVITY) && !(ad_port->partner_oper.port_state & LACP_STATE_LACP_ACTIVITY))
 	   ) {
-		port->sm_periodic_state = AD_NO_PERIODIC;
+		ad_port->sm_periodic_state = AD_NO_PERIODIC;
 	}
 	/* check if state machine should change state */
-	else if (port->sm_periodic_timer_counter) {
+	else if (ad_port->sm_periodic_timer_counter) {
 		/* check if periodic state machine expired */
-		if (!(--port->sm_periodic_timer_counter)) {
+		if (!(--ad_port->sm_periodic_timer_counter)) {
 			/* if expired then do tx */
-			port->sm_periodic_state = AD_PERIODIC_TX;
+			ad_port->sm_periodic_state = AD_PERIODIC_TX;
 		} else {
 			/* If not expired, check if there is some new timeout
 			 * parameter from the partner state
 			 */
-			switch (port->sm_periodic_state) {
+			switch (ad_port->sm_periodic_state) {
 			case AD_FAST_PERIODIC:
-				if (!(port->partner_oper.port_state
+				if (!(ad_port->partner_oper.port_state
 				      & LACP_STATE_LACP_TIMEOUT))
-					port->sm_periodic_state = AD_SLOW_PERIODIC;
+					ad_port->sm_periodic_state = AD_SLOW_PERIODIC;
 				break;
 			case AD_SLOW_PERIODIC:
-				if ((port->partner_oper.port_state & LACP_STATE_LACP_TIMEOUT)) {
-					port->sm_periodic_timer_counter = 0;
-					port->sm_periodic_state = AD_PERIODIC_TX;
+				if ((ad_port->partner_oper.port_state & LACP_STATE_LACP_TIMEOUT)) {
+					ad_port->sm_periodic_timer_counter = 0;
+					ad_port->sm_periodic_state = AD_PERIODIC_TX;
 				}
 				break;
 			default:
@@ -1319,16 +1318,16 @@ static void ad_periodic_machine(struct port *port)
 			}
 		}
 	} else {
-		switch (port->sm_periodic_state) {
+		switch (ad_port->sm_periodic_state) {
 		case AD_NO_PERIODIC:
-			port->sm_periodic_state = AD_FAST_PERIODIC;
+			ad_port->sm_periodic_state = AD_FAST_PERIODIC;
 			break;
 		case AD_PERIODIC_TX:
-			if (!(port->partner_oper.port_state &
+			if (!(ad_port->partner_oper.port_state &
 			    LACP_STATE_LACP_TIMEOUT))
-				port->sm_periodic_state = AD_SLOW_PERIODIC;
+				ad_port->sm_periodic_state = AD_SLOW_PERIODIC;
 			else
-				port->sm_periodic_state = AD_FAST_PERIODIC;
+				ad_port->sm_periodic_state = AD_FAST_PERIODIC;
 			break;
 		default:
 			break;
@@ -1336,25 +1335,25 @@ static void ad_periodic_machine(struct port *port)
 	}
 
 	/* check if the state machine was changed */
-	if (port->sm_periodic_state != last_state) {
-		slave_dbg(port->slave->bond->dev, port->slave->dev,
+	if (ad_port->sm_periodic_state != last_state) {
+		slave_dbg(ad_port->slave->bond->dev, ad_port->slave->dev,
 			  "Periodic Machine: Port=%d, Last State=%d, Curr State=%d\n",
-			  port->actor_port_number, last_state,
-			  port->sm_periodic_state);
-		switch (port->sm_periodic_state) {
+			  ad_port->actor_port_number, last_state,
+			  ad_port->sm_periodic_state);
+		switch (ad_port->sm_periodic_state) {
 		case AD_NO_PERIODIC:
-			port->sm_periodic_timer_counter = 0;
+			ad_port->sm_periodic_timer_counter = 0;
 			break;
 		case AD_FAST_PERIODIC:
 			/* decrement 1 tick we lost in the PERIODIC_TX cycle */
-			port->sm_periodic_timer_counter = __ad_timer_to_ticks(AD_PERIODIC_TIMER, (u16)(AD_FAST_PERIODIC_TIME))-1;
+			ad_port->sm_periodic_timer_counter = __ad_timer_to_ticks(AD_PERIODIC_TIMER, (u16)(AD_FAST_PERIODIC_TIME))-1;
 			break;
 		case AD_SLOW_PERIODIC:
 			/* decrement 1 tick we lost in the PERIODIC_TX cycle */
-			port->sm_periodic_timer_counter = __ad_timer_to_ticks(AD_PERIODIC_TIMER, (u16)(AD_SLOW_PERIODIC_TIME))-1;
+			ad_port->sm_periodic_timer_counter = __ad_timer_to_ticks(AD_PERIODIC_TIMER, (u16)(AD_SLOW_PERIODIC_TIME))-1;
 			break;
 		case AD_PERIODIC_TX:
-			port->ntt = true;
+			ad_port->ntt = true;
 			break;
 		default:
 			break;
@@ -1364,60 +1363,60 @@ static void ad_periodic_machine(struct port *port)
 
 /**
  * ad_port_selection_logic - select aggregation groups
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  * @update_slave_arr: Does slave array need update?
  *
- * Select aggregation groups, and assign each port for it's aggregetor. The
+ * Select aggregation groups, and assign each ad_port for it's aggregetor. The
  * selection logic is called in the inititalization (after all the handshkes),
  * and after every lacpdu receive (if selected is off).
  */
-static void ad_port_selection_logic(struct port *port, bool *update_slave_arr)
+static void ad_port_selection_logic(struct ad_port *ad_port, bool *update_slave_arr)
 {
 	struct aggregator *aggregator, *free_aggregator = NULL, *temp_aggregator;
-	struct port *last_port = NULL, *curr_port;
+	struct ad_port *last_port = NULL, *curr_port;
 	struct list_head *iter;
 	struct bonding *bond;
 	struct slave *slave;
 	int found = 0;
 
-	/* if the port is already Selected, do nothing */
-	if (port->sm_vars & AD_PORT_SELECTED)
+	/* if the ad_port is already Selected, do nothing */
+	if (ad_port->sm_vars & AD_PORT_SELECTED)
 		return;
 
-	bond = __get_bond_by_port(port);
+	bond = __get_bond_by_ad_port(ad_port);
 
-	/* if the port is connected to other aggregator, detach it */
-	if (port->aggregator) {
-		/* detach the port from its former aggregator */
-		temp_aggregator = port->aggregator;
+	/* if the ad_port is connected to other aggregator, detach it */
+	if (ad_port->aggregator) {
+		/* detach the ad_port from its former aggregator */
+		temp_aggregator = ad_port->aggregator;
 		for (curr_port = temp_aggregator->lag_ports; curr_port;
 		     last_port = curr_port,
 		     curr_port = curr_port->next_port_in_aggregator) {
-			if (curr_port == port) {
+			if (curr_port == ad_port) {
 				temp_aggregator->num_of_ports--;
-				/* if it is the first port attached to the
+				/* if it is the first ad_port attached to the
 				 * aggregator
 				 */
 				if (!last_port) {
 					temp_aggregator->lag_ports =
-						port->next_port_in_aggregator;
+						ad_port->next_port_in_aggregator;
 				} else {
-					/* not the first port attached to the
+					/* not the first ad_port attached to the
 					 * aggregator
 					 */
 					last_port->next_port_in_aggregator =
-						port->next_port_in_aggregator;
+						ad_port->next_port_in_aggregator;
 				}
 
-				/* clear the port's relations to this
+				/* clear the ad_port's relations to this
 				 * aggregator
 				 */
-				port->aggregator = NULL;
-				port->next_port_in_aggregator = NULL;
-				port->actor_port_aggregator_identifier = 0;
+				ad_port->aggregator = NULL;
+				ad_port->next_port_in_aggregator = NULL;
+				ad_port->actor_port_aggregator_identifier = 0;
 
-				slave_dbg(bond->dev, port->slave->dev, "Port %d left LAG %d\n",
-					  port->actor_port_number,
+				slave_dbg(bond->dev, ad_port->slave->dev, "Port %d left LAG %d\n",
+					  ad_port->actor_port_number,
 					  temp_aggregator->aggregator_identifier);
 				/* if the aggregator is empty, clear its
 				 * parameters, and set it ready to be attached
@@ -1428,17 +1427,17 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr)
 			}
 		}
 		if (!curr_port) {
-			/* meaning: the port was related to an aggregator
-			 * but was not on the aggregator port list
+			/* meaning: the ad_port was related to an aggregator
+			 * but was not on the aggregator ad_port list
 			 */
 			net_warn_ratelimited("%s: (slave %s): Warning: Port %d was related to aggregator %d but was not on its port list\n",
-					     port->slave->bond->dev->name,
-					     port->slave->dev->name,
-					     port->actor_port_number,
-					     port->aggregator->aggregator_identifier);
+					     ad_port->slave->bond->dev->name,
+					     ad_port->slave->dev->name,
+					     ad_port->actor_port_number,
+					     ad_port->aggregator->aggregator_identifier);
 		}
 	}
-	/* search on all aggregators for a suitable aggregator for this port */
+	/* search all aggregators for a suitable aggregator for this ad_port */
 	bond_for_each_slave(bond, slave, iter) {
 		aggregator = &(SLAVE_AD_INFO(slave)->aggregator);
 
@@ -1449,90 +1448,90 @@ static void ad_port_selection_logic(struct port *port, bool *update_slave_arr)
 			continue;
 		}
 		/* check if current aggregator suits us */
-		if (((aggregator->actor_oper_aggregator_key == port->actor_oper_port_key) && /* if all parameters match AND */
-		     MAC_ADDRESS_EQUAL(&(aggregator->partner_system), &(port->partner_oper.system)) &&
-		     (aggregator->partner_system_priority == port->partner_oper.system_priority) &&
-		     (aggregator->partner_oper_aggregator_key == port->partner_oper.key)
+		if (((aggregator->actor_oper_aggregator_key == ad_port->actor_oper_port_key) && /* if all parameters match AND */
+		     MAC_ADDRESS_EQUAL(&(aggregator->partner_system), &(ad_port->partner_oper.system)) &&
+		     (aggregator->partner_system_priority == ad_port->partner_oper.system_priority) &&
+		     (aggregator->partner_oper_aggregator_key == ad_port->partner_oper.key)
 		    ) &&
-		    ((!MAC_ADDRESS_EQUAL(&(port->partner_oper.system), &(null_mac_addr)) && /* partner answers */
+		    ((!MAC_ADDRESS_EQUAL(&(ad_port->partner_oper.system), &(null_mac_addr)) && /* partner answers */
 		      !aggregator->is_individual)  /* but is not individual OR */
 		    )
 		   ) {
 			/* attach to the founded aggregator */
-			port->aggregator = aggregator;
-			port->actor_port_aggregator_identifier =
-				port->aggregator->aggregator_identifier;
-			port->next_port_in_aggregator = aggregator->lag_ports;
-			port->aggregator->num_of_ports++;
-			aggregator->lag_ports = port;
+			ad_port->aggregator = aggregator;
+			ad_port->actor_port_aggregator_identifier =
+				ad_port->aggregator->aggregator_identifier;
+			ad_port->next_port_in_aggregator = aggregator->lag_ports;
+			ad_port->aggregator->num_of_ports++;
+			aggregator->lag_ports = ad_port;
 			slave_dbg(bond->dev, slave->dev, "Port %d joined LAG %d (existing LAG)\n",
-				  port->actor_port_number,
-				  port->aggregator->aggregator_identifier);
+				  ad_port->actor_port_number,
+				  ad_port->aggregator->aggregator_identifier);
 
-			/* mark this port as selected */
-			port->sm_vars |= AD_PORT_SELECTED;
+			/* mark this ad_port as selected */
+			ad_port->sm_vars |= AD_PORT_SELECTED;
 			found = 1;
 			break;
 		}
 	}
 
-	/* the port couldn't find an aggregator - attach it to a new
+	/* the ad_port couldn't find an aggregator - attach it to a new
 	 * aggregator
 	 */
 	if (!found) {
 		if (free_aggregator) {
-			/* assign port a new aggregator */
-			port->aggregator = free_aggregator;
-			port->actor_port_aggregator_identifier =
-				port->aggregator->aggregator_identifier;
+			/* assign ad_port a new aggregator */
+			ad_port->aggregator = free_aggregator;
+			ad_port->actor_port_aggregator_identifier =
+				ad_port->aggregator->aggregator_identifier;
 
 			/* update the new aggregator's parameters
-			 * if port was responsed from the end-user
+			 * if ad_port was responsed from the end-user
 			 */
-			if (port->actor_oper_port_key & AD_DUPLEX_KEY_MASKS)
+			if (ad_port->actor_oper_port_key & AD_DUPLEX_KEY_MASKS)
 				/* if port is full duplex */
-				port->aggregator->is_individual = false;
+				ad_port->aggregator->is_individual = false;
 			else
-				port->aggregator->is_individual = true;
-
-			port->aggregator->actor_admin_aggregator_key =
-				port->actor_admin_port_key;
-			port->aggregator->actor_oper_aggregator_key =
-				port->actor_oper_port_key;
-			port->aggregator->partner_system =
-				port->partner_oper.system;
-			port->aggregator->partner_system_priority =
-				port->partner_oper.system_priority;
-			port->aggregator->partner_oper_aggregator_key = port->partner_oper.key;
-			port->aggregator->receive_state = 1;
-			port->aggregator->transmit_state = 1;
-			port->aggregator->lag_ports = port;
-			port->aggregator->num_of_ports++;
+				ad_port->aggregator->is_individual = true;
+
+			ad_port->aggregator->actor_admin_aggregator_key =
+				ad_port->actor_admin_port_key;
+			ad_port->aggregator->actor_oper_aggregator_key =
+				ad_port->actor_oper_port_key;
+			ad_port->aggregator->partner_system =
+				ad_port->partner_oper.system;
+			ad_port->aggregator->partner_system_priority =
+				ad_port->partner_oper.system_priority;
+			ad_port->aggregator->partner_oper_aggregator_key = ad_port->partner_oper.key;
+			ad_port->aggregator->receive_state = 1;
+			ad_port->aggregator->transmit_state = 1;
+			ad_port->aggregator->lag_ports = ad_port;
+			ad_port->aggregator->num_of_ports++;
 
 			/* mark this port as selected */
-			port->sm_vars |= AD_PORT_SELECTED;
+			ad_port->sm_vars |= AD_PORT_SELECTED;
 
-			slave_dbg(bond->dev, port->slave->dev, "Port %d joined LAG %d (new LAG)\n",
-				  port->actor_port_number,
-				  port->aggregator->aggregator_identifier);
+			slave_dbg(bond->dev, ad_port->slave->dev, "Port %d joined LAG %d (new LAG)\n",
+				  ad_port->actor_port_number,
+				  ad_port->aggregator->aggregator_identifier);
 		} else {
-			slave_err(bond->dev, port->slave->dev,
+			slave_err(bond->dev, ad_port->slave->dev,
 				  "Port %d did not find a suitable aggregator\n",
-				  port->actor_port_number);
+				  ad_port->actor_port_number);
 		}
 	}
-	/* if all aggregator's ports are READY_N == TRUE, set ready=TRUE
-	 * in all aggregator's ports, else set ready=FALSE in all
-	 * aggregator's ports
+	/* if all aggregator's ad_ports are READY_N == TRUE, set ready=TRUE
+	 * in all aggregator's ad_ports, else set ready=FALSE in all
+	 * aggregator's ad_ports
 	 */
-	__set_agg_ports_ready(port->aggregator,
-			      __agg_ports_are_ready(port->aggregator));
+	__set_agg_ports_ready(ad_port->aggregator,
+			      __agg_ports_are_ready(ad_port->aggregator));
 
-	aggregator = __get_first_agg(port);
+	aggregator = __get_first_agg(ad_port);
 	ad_agg_selection_logic(aggregator, update_slave_arr);
 
-	if (!port->aggregator->is_active)
-		port->actor_oper_port_state &= ~LACP_STATE_SYNCHRONIZATION;
+	if (!ad_port->aggregator->is_active)
+		ad_port->actor_oper_port_state &= ~LACP_STATE_SYNCHRONIZATION;
 }
 
 /* Decide if "agg" is a better choice for the new active aggregator that
@@ -1560,7 +1559,7 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
 	 * 4.  Therefore, current and best both have partner replies or
 	 *     both do not, so perform selection policy:
 	 *
-	 * BOND_AD_COUNT: Select by count of ports.  If count is equal,
+	 * BOND_AD_COUNT: Select by count of ad_ports.  If count is equal,
 	 *     select by bandwidth.
 	 *
 	 * BOND_AD_STABLE, BOND_AD_BANDWIDTH: Select by bandwidth.
@@ -1582,10 +1581,10 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
 
 	switch (__get_agg_selection_mode(curr->lag_ports)) {
 	case BOND_AD_COUNT:
-		if (__agg_active_ports(curr) > __agg_active_ports(best))
+		if (__agg_active_ad_ports(curr) > __agg_active_ad_ports(best))
 			return curr;
 
-		if (__agg_active_ports(curr) < __agg_active_ports(best))
+		if (__agg_active_ad_ports(curr) < __agg_active_ad_ports(best))
 			return best;
 
 		fallthrough;
@@ -1609,15 +1608,15 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
 
 static int agg_device_up(const struct aggregator *agg)
 {
-	struct port *port = agg->lag_ports;
+	struct ad_port *ad_port = agg->lag_ports;
 
-	if (!port)
+	if (!ad_port)
 		return 0;
 
-	for (port = agg->lag_ports; port;
-	     port = port->next_port_in_aggregator) {
-		if (netif_running(port->slave->dev) &&
-		    netif_carrier_ok(port->slave->dev))
+	for (ad_port = agg->lag_ports; ad_port;
+	     ad_port = ad_port->next_port_in_aggregator) {
+		if (netif_running(ad_port->slave->dev) &&
+		    netif_carrier_ok(ad_port->slave->dev))
 			return 1;
 	}
 
@@ -1634,15 +1633,15 @@ static int agg_device_up(const struct aggregator *agg)
  * The logic of this function is to select the aggregator according to
  * the ad_select policy:
  *
- * BOND_AD_STABLE: select the aggregator with the most ports attached to
+ * BOND_AD_STABLE: select the aggregator with the most ad_ports attached to
  * it, and to reselect the active aggregator only if the previous
- * aggregator has no more ports related to it.
+ * aggregator has no more ad_ports related to it.
  *
  * BOND_AD_BANDWIDTH: select the aggregator with the highest total
  * bandwidth, and reselect whenever a link state change takes place or the
  * set of slaves in the bond changes.
  *
- * BOND_AD_COUNT: select the aggregator with largest number of ports
+ * BOND_AD_COUNT: select the aggregator with largest number of ad_ports
  * (slaves), and reselect whenever a link state change takes place or the
  * set of slaves in the bond changes.
  *
@@ -1657,7 +1656,7 @@ static void ad_agg_selection_logic(struct aggregator *agg,
 	struct bonding *bond = agg->slave->bond;
 	struct list_head *iter;
 	struct slave *slave;
-	struct port *port;
+	struct ad_port *ad_port;
 
 	rcu_read_lock();
 	origin = agg;
@@ -1669,7 +1668,7 @@ static void ad_agg_selection_logic(struct aggregator *agg,
 
 		agg->is_active = 0;
 
-		if (__agg_active_ports(agg) && agg_device_up(agg))
+		if (__agg_active_ad_ports(agg) && agg_device_up(agg))
 			best = ad_agg_selection_test(best, agg);
 	}
 
@@ -1681,7 +1680,7 @@ static void ad_agg_selection_logic(struct aggregator *agg,
 		 * answering partner.
 		 */
 		if (active && active->lag_ports &&
-		    __agg_active_ports(active) &&
+		    __agg_active_ad_ports(active) &&
 		    (__agg_has_partner(active) ||
 		     (!__agg_has_partner(active) &&
 		     !__agg_has_partner(best)))) {
@@ -1736,13 +1735,13 @@ static void ad_agg_selection_logic(struct aggregator *agg,
 			   best->partner_oper_aggregator_key,
 			   best->is_individual, best->is_active);
 
-		/* disable the ports that were related to the former
+		/* disable the ad_ports that were related to the former
 		 * active_aggregator
 		 */
 		if (active) {
-			for (port = active->lag_ports; port;
-			     port = port->next_port_in_aggregator) {
-				__disable_port(port);
+			for (ad_port = active->lag_ports; ad_port;
+			     ad_port = ad_port->next_port_in_aggregator) {
+				__disable_ad_port(ad_port);
 			}
 		}
 		/* Slave array needs update. */
@@ -1750,15 +1749,15 @@ static void ad_agg_selection_logic(struct aggregator *agg,
 	}
 
 	/* if the selected aggregator is of join individuals
-	 * (partner_system is NULL), enable their ports
+	 * (partner_system is NULL), enable their ad_ports
 	 */
 	active = __get_active_agg(origin);
 
 	if (active) {
 		if (!__agg_has_partner(active)) {
-			for (port = active->lag_ports; port;
-			     port = port->next_port_in_aggregator) {
-				__enable_port(port);
+			for (ad_port = active->lag_ports; ad_port;
+			     ad_port = ad_port->next_port_in_aggregator) {
+				__enable_ad_port(ad_port);
 			}
 		}
 	}
@@ -1809,11 +1808,11 @@ static void ad_initialize_agg(struct aggregator *aggregator)
 }
 
 /**
- * ad_initialize_port - initialize a given port's parameters
- * @port: the port we're looking at
+ * ad_initialize_port - initialize a given ad_port's parameters
+ * @ad_port: the ad_port we're looking at
  * @lacp_fast: boolean. whether fast periodic should be used
  */
-static void ad_initialize_port(struct port *port, int lacp_fast)
+static void ad_initialize_port(struct ad_port *ad_port, int lacp_fast)
 {
 	static const struct port_params tmpl = {
 		.system_priority = 0xffff,
@@ -1834,83 +1833,83 @@ static void ad_initialize_port(struct port *port, int lacp_fast)
 		.collector_max_delay = htons(AD_COLLECTOR_MAX_DELAY),
 	};
 
-	if (port) {
-		port->actor_port_priority = 0xff;
-		port->actor_port_aggregator_identifier = 0;
-		port->ntt = false;
-		port->actor_admin_port_state = LACP_STATE_AGGREGATION |
+	if (ad_port) {
+		ad_port->actor_port_priority = 0xff;
+		ad_port->actor_port_aggregator_identifier = 0;
+		ad_port->ntt = false;
+		ad_port->actor_admin_port_state = LACP_STATE_AGGREGATION |
 					       LACP_STATE_LACP_ACTIVITY;
-		port->actor_oper_port_state  = LACP_STATE_AGGREGATION |
+		ad_port->actor_oper_port_state  = LACP_STATE_AGGREGATION |
 					       LACP_STATE_LACP_ACTIVITY;
 
 		if (lacp_fast)
-			port->actor_oper_port_state |= LACP_STATE_LACP_TIMEOUT;
+			ad_port->actor_oper_port_state |= LACP_STATE_LACP_TIMEOUT;
 
-		memcpy(&port->partner_admin, &tmpl, sizeof(tmpl));
-		memcpy(&port->partner_oper, &tmpl, sizeof(tmpl));
+		memcpy(&ad_port->partner_admin, &tmpl, sizeof(tmpl));
+		memcpy(&ad_port->partner_oper, &tmpl, sizeof(tmpl));
 
-		port->is_enabled = true;
+		ad_port->is_enabled = true;
 		/* private parameters */
-		port->sm_vars = AD_PORT_BEGIN | AD_PORT_LACP_ENABLED;
-		port->sm_rx_state = 0;
-		port->sm_rx_timer_counter = 0;
-		port->sm_periodic_state = 0;
-		port->sm_periodic_timer_counter = 0;
-		port->sm_mux_state = 0;
-		port->sm_mux_timer_counter = 0;
-		port->sm_tx_state = 0;
-		port->aggregator = NULL;
-		port->next_port_in_aggregator = NULL;
-		port->transaction_id = 0;
-
-		port->sm_churn_actor_timer_counter = 0;
-		port->sm_churn_actor_state = 0;
-		port->churn_actor_count = 0;
-		port->sm_churn_partner_timer_counter = 0;
-		port->sm_churn_partner_state = 0;
-		port->churn_partner_count = 0;
-
-		memcpy(&port->lacpdu, &lacpdu, sizeof(lacpdu));
+		ad_port->sm_vars = AD_PORT_BEGIN | AD_PORT_LACP_ENABLED;
+		ad_port->sm_rx_state = 0;
+		ad_port->sm_rx_timer_counter = 0;
+		ad_port->sm_periodic_state = 0;
+		ad_port->sm_periodic_timer_counter = 0;
+		ad_port->sm_mux_state = 0;
+		ad_port->sm_mux_timer_counter = 0;
+		ad_port->sm_tx_state = 0;
+		ad_port->aggregator = NULL;
+		ad_port->next_port_in_aggregator = NULL;
+		ad_port->transaction_id = 0;
+
+		ad_port->sm_churn_actor_timer_counter = 0;
+		ad_port->sm_churn_actor_state = 0;
+		ad_port->churn_actor_count = 0;
+		ad_port->sm_churn_partner_timer_counter = 0;
+		ad_port->sm_churn_partner_state = 0;
+		ad_port->churn_partner_count = 0;
+
+		memcpy(&ad_port->lacpdu, &lacpdu, sizeof(lacpdu));
 	}
 }
 
 /**
- * ad_enable_collecting_distributing - enable a port's transmit/receive
- * @port: the port we're looking at
+ * ad_enable_collecting_distributing - enable an ad_port's transmit/receive
+ * @ad_port: the ad_port we're looking at
  * @update_slave_arr: Does slave array need update?
  *
- * Enable @port if it's in an active aggregator
+ * Enable @ad_port if it's in an active aggregator
  */
-static void ad_enable_collecting_distributing(struct port *port,
+static void ad_enable_collecting_distributing(struct ad_port *ad_port,
 					      bool *update_slave_arr)
 {
-	if (port->aggregator->is_active) {
-		slave_dbg(port->slave->bond->dev, port->slave->dev,
+	if (ad_port->aggregator->is_active) {
+		slave_dbg(ad_port->slave->bond->dev, ad_port->slave->dev,
 			  "Enabling port %d (LAG %d)\n",
-			  port->actor_port_number,
-			  port->aggregator->aggregator_identifier);
-		__enable_port(port);
+			  ad_port->actor_port_number,
+			  ad_port->aggregator->aggregator_identifier);
+		__enable_ad_port(ad_port);
 		/* Slave array needs update */
 		*update_slave_arr = true;
 	}
 }
 
 /**
- * ad_disable_collecting_distributing - disable a port's transmit/receive
- * @port: the port we're looking at
+ * ad_disable_collecting_distributing - disable an ad_port's transmit/receive
+ * @ad_port: the ad_port we're looking at
  * @update_slave_arr: Does slave array need update?
  */
-static void ad_disable_collecting_distributing(struct port *port,
+static void ad_disable_collecting_distributing(struct ad_port *ad_port,
 					       bool *update_slave_arr)
 {
-	if (port->aggregator &&
-	    !MAC_ADDRESS_EQUAL(&(port->aggregator->partner_system),
+	if (ad_port->aggregator &&
+	    !MAC_ADDRESS_EQUAL(&(ad_port->aggregator->partner_system),
 			       &(null_mac_addr))) {
-		slave_dbg(port->slave->bond->dev, port->slave->dev,
+		slave_dbg(ad_port->slave->bond->dev, ad_port->slave->dev,
 			  "Disabling port %d (LAG %d)\n",
-			  port->actor_port_number,
-			  port->aggregator->aggregator_identifier);
-		__disable_port(port);
+			  ad_port->actor_port_number,
+			  ad_port->aggregator->aggregator_identifier);
+		__disable_ad_port(ad_port);
 		/* Slave array needs an update */
 		*update_slave_arr = true;
 	}
@@ -1919,15 +1918,15 @@ static void ad_disable_collecting_distributing(struct port *port,
 /**
  * ad_marker_info_received - handle receive of a Marker information frame
  * @marker_info: Marker info received
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  */
 static void ad_marker_info_received(struct bond_marker *marker_info,
-				    struct port *port)
+				    struct ad_port *ad_port)
 {
 	struct bond_marker marker;
 
-	atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.marker_rx);
-	atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.marker_rx);
+	atomic64_inc(&SLAVE_AD_INFO(ad_port->slave)->stats.marker_rx);
+	atomic64_inc(&BOND_AD_INFO(ad_port->slave->bond).stats.marker_rx);
 
 	/* copy the received marker data to the response marker */
 	memcpy(&marker, marker_info, sizeof(struct bond_marker));
@@ -1935,26 +1934,26 @@ static void ad_marker_info_received(struct bond_marker *marker_info,
 	marker.tlv_type = AD_MARKER_RESPONSE_SUBTYPE;
 
 	/* send the marker response */
-	if (ad_marker_send(port, &marker) >= 0)
-		slave_dbg(port->slave->bond->dev, port->slave->dev,
+	if (ad_marker_send(ad_port, &marker) >= 0)
+		slave_dbg(ad_port->slave->bond->dev, ad_port->slave->dev,
 			  "Sent Marker Response on port %d\n",
-			  port->actor_port_number);
+			  ad_port->actor_port_number);
 }
 
 /**
  * ad_marker_response_received - handle receive of a marker response frame
  * @marker: marker PDU received
- * @port: the port we're looking at
+ * @ad_port: the ad_port we're looking at
  *
  * This function does nothing since we decided not to implement send and handle
  * response for marker PDU's, in this stage, but only to respond to marker
  * information.
  */
 static void ad_marker_response_received(struct bond_marker *marker,
-					struct port *port)
+					struct ad_port *ad_port)
 {
-	atomic64_inc(&SLAVE_AD_INFO(port->slave)->stats.marker_resp_rx);
-	atomic64_inc(&BOND_AD_INFO(port->slave->bond).stats.marker_resp_rx);
+	atomic64_inc(&SLAVE_AD_INFO(ad_port->slave)->stats.marker_resp_rx);
+	atomic64_inc(&BOND_AD_INFO(ad_port->slave->bond).stats.marker_resp_rx);
 
 	/* DO NOTHING, SINCE WE DECIDED NOT TO IMPLEMENT THIS FEATURE FOR NOW */
 }
@@ -2014,7 +2013,7 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
 }
 
 /**
- * bond_3ad_bind_slave - initialize a slave's port
+ * bond_3ad_bind_slave - initialize a slave's ad_port
  * @slave: slave struct to work on
  *
  * Returns:   0 on success
@@ -2023,32 +2022,32 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
 void bond_3ad_bind_slave(struct slave *slave)
 {
 	struct bonding *bond = bond_get_bond_by_slave(slave);
-	struct port *port;
+	struct ad_port *ad_port;
 	struct aggregator *aggregator;
 
 	/* check that the slave has not been initialized yet. */
-	if (SLAVE_AD_INFO(slave)->port.slave != slave) {
+	if (SLAVE_AD_INFO(slave)->ad_port.slave != slave) {
 
-		/* port initialization */
-		port = &(SLAVE_AD_INFO(slave)->port);
+		/* ad_port initialization */
+		ad_port = &(SLAVE_AD_INFO(slave)->ad_port);
 
-		ad_initialize_port(port, bond->params.lacp_fast);
+		ad_initialize_port(ad_port, bond->params.lacp_fast);
 
-		port->slave = slave;
-		port->actor_port_number = SLAVE_AD_INFO(slave)->id;
+		ad_port->slave = slave;
+		ad_port->actor_port_number = SLAVE_AD_INFO(slave)->id;
 		/* key is determined according to the link speed, duplex and
 		 * user key
 		 */
-		port->actor_admin_port_key = bond->params.ad_user_port_key << 6;
-		ad_update_actor_keys(port, false);
+		ad_port->actor_admin_port_key = bond->params.ad_user_port_key << 6;
+		ad_update_actor_keys(ad_port, false);
 		/* actor system is the bond's system */
-		__ad_actor_update_port(port);
+		__ad_actor_update_port(ad_port);
 		/* tx timer(to verify that no more than MAX_TX_IN_SECOND
 		 * lacpdu's are sent in one second)
 		 */
-		port->sm_tx_timer_counter = ad_ticks_per_sec/AD_MAX_TX_IN_SECOND;
+		ad_port->sm_tx_timer_counter = ad_ticks_per_sec/AD_MAX_TX_IN_SECOND;
 
-		__disable_port(port);
+		__disable_ad_port(ad_port);
 
 		/* aggregator initialization */
 		aggregator = &(SLAVE_AD_INFO(slave)->aggregator);
@@ -2064,16 +2063,16 @@ void bond_3ad_bind_slave(struct slave *slave)
 }
 
 /**
- * bond_3ad_unbind_slave - deinitialize a slave's port
+ * bond_3ad_unbind_slave - deinitialize a slave's ad_port
  * @slave: slave struct to work on
  *
- * Search for the aggregator that is related to this port, remove the
- * aggregator and assign another aggregator for other port related to it
- * (if any), and remove the port.
+ * Search for the aggregator that is related to this ad_port, remove the
+ * aggregator and assign another aggregator for other ad_port related to it
+ * (if any), and remove the ad_port.
  */
 void bond_3ad_unbind_slave(struct slave *slave)
 {
-	struct port *port, *prev_port, *temp_port;
+	struct ad_port *ad_port, *prev_port, *temp_port;
 	struct aggregator *aggregator, *new_aggregator, *temp_aggregator;
 	int select_new_active_agg = 0;
 	struct bonding *bond = slave->bond;
@@ -2084,10 +2083,10 @@ void bond_3ad_unbind_slave(struct slave *slave)
 	/* Sync against bond_3ad_state_machine_handler() */
 	spin_lock_bh(&bond->mode_lock);
 	aggregator = &(SLAVE_AD_INFO(slave)->aggregator);
-	port = &(SLAVE_AD_INFO(slave)->port);
+	ad_port = &(SLAVE_AD_INFO(slave)->ad_port);
 
-	/* if slave is null, the whole port is not initialized */
-	if (!port->slave) {
+	/* if slave is null, the whole ad_port is not initialized */
+	if (!ad_port->slave) {
 		slave_warn(bond->dev, slave->dev, "Trying to unbind an uninitialized port\n");
 		goto out;
 	}
@@ -2095,31 +2094,31 @@ void bond_3ad_unbind_slave(struct slave *slave)
 	slave_dbg(bond->dev, slave->dev, "Unbinding Link Aggregation Group %d\n",
 		  aggregator->aggregator_identifier);
 
-	/* Tell the partner that this port is not suitable for aggregation */
-	port->actor_oper_port_state &= ~LACP_STATE_SYNCHRONIZATION;
-	port->actor_oper_port_state &= ~LACP_STATE_COLLECTING;
-	port->actor_oper_port_state &= ~LACP_STATE_DISTRIBUTING;
-	port->actor_oper_port_state &= ~LACP_STATE_AGGREGATION;
-	__update_lacpdu_from_port(port);
-	ad_lacpdu_send(port);
+	/* Tell the partner that this ad_port is not suitable for aggregation */
+	ad_port->actor_oper_port_state &= ~LACP_STATE_SYNCHRONIZATION;
+	ad_port->actor_oper_port_state &= ~LACP_STATE_COLLECTING;
+	ad_port->actor_oper_port_state &= ~LACP_STATE_DISTRIBUTING;
+	ad_port->actor_oper_port_state &= ~LACP_STATE_AGGREGATION;
+	__update_lacpdu_from_ad_port(ad_port);
+	ad_lacpdu_send(ad_port);
 
 	/* check if this aggregator is occupied */
 	if (aggregator->lag_ports) {
-		/* check if there are other ports related to this aggregator
-		 * except the port related to this slave(thats ensure us that
+		/* check if there are other ad_ports related to this aggregator
+		 * except the ad_port related to this slave(thats ensure us that
 		 * there is a reason to search for new aggregator, and that we
 		 * will find one
 		 */
-		if ((aggregator->lag_ports != port) ||
+		if ((aggregator->lag_ports != ad_port) ||
 		    (aggregator->lag_ports->next_port_in_aggregator)) {
-			/* find new aggregator for the related port(s) */
+			/* find new aggregator for the related ad_port(s) */
 			bond_for_each_slave(bond, slave_iter, iter) {
 				new_aggregator = &(SLAVE_AD_INFO(slave_iter)->aggregator);
 				/* if the new aggregator is empty, or it is
-				 * connected to our port only
+				 * connected to our ad_port only
 				 */
 				if (!new_aggregator->lag_ports ||
-				    ((new_aggregator->lag_ports == port) &&
+				    ((new_aggregator->lag_ports == ad_port) &&
 				     !new_aggregator->lag_ports->next_port_in_aggregator))
 					break;
 			}
@@ -2130,12 +2129,12 @@ void bond_3ad_unbind_slave(struct slave *slave)
 			 * parameters and connect the related lag_ports to the
 			 * new aggregator
 			 */
-			if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) {
+			if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == ad_port) && !new_aggregator->lag_ports->next_port_in_aggregator))) {
 				slave_dbg(bond->dev, slave->dev, "Some port(s) related to LAG %d - replacing with LAG %d\n",
 					  aggregator->aggregator_identifier,
 					  new_aggregator->aggregator_identifier);
 
-				if ((new_aggregator->lag_ports == port) &&
+				if ((new_aggregator->lag_ports == ad_port) &&
 				    new_aggregator->is_active) {
 					slave_info(bond->dev, slave->dev, "Removing an active aggregator\n");
 					select_new_active_agg = 1;
@@ -2165,13 +2164,13 @@ void bond_3ad_unbind_slave(struct slave *slave)
 				ad_clear_agg(aggregator);
 
 				if (select_new_active_agg)
-					ad_agg_selection_logic(__get_first_agg(port),
+					ad_agg_selection_logic(__get_first_agg(ad_port),
 							       &dummy_slave_update);
 			} else {
 				slave_warn(bond->dev, slave->dev, "unbinding aggregator, and could not find a new aggregator for its ports\n");
 			}
 		} else {
-			/* in case that the only port related to this
+			/* in case that the only ad_port related to this
 			 * aggregator is the one we want to remove
 			 */
 			select_new_active_agg = aggregator->is_active;
@@ -2179,7 +2178,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
 			if (select_new_active_agg) {
 				slave_info(bond->dev, slave->dev, "Removing an active aggregator\n");
 				/* select new active aggregator */
-				temp_aggregator = __get_first_agg(port);
+				temp_aggregator = __get_first_agg(ad_port);
 				if (temp_aggregator)
 					ad_agg_selection_logic(temp_aggregator,
 							       &dummy_slave_update);
@@ -2187,17 +2186,17 @@ void bond_3ad_unbind_slave(struct slave *slave)
 		}
 	}
 
-	slave_dbg(bond->dev, slave->dev, "Unbinding port %d\n", port->actor_port_number);
+	slave_dbg(bond->dev, slave->dev, "Unbinding port %d\n", ad_port->actor_port_number);
 
-	/* find the aggregator that this port is connected to */
+	/* find the aggregator that this ad_port is connected to */
 	bond_for_each_slave(bond, slave_iter, iter) {
 		temp_aggregator = &(SLAVE_AD_INFO(slave_iter)->aggregator);
 		prev_port = NULL;
-		/* search the port in the aggregator's related ports */
+		/* search the ad_port in the aggregator's related ad_ports */
 		for (temp_port = temp_aggregator->lag_ports; temp_port;
 		     prev_port = temp_port,
 		     temp_port = temp_port->next_port_in_aggregator) {
-			if (temp_port == port) {
+			if (temp_port == ad_port) {
 				/* the aggregator found - detach the port from
 				 * this aggregator
 				 */
@@ -2206,13 +2205,13 @@ void bond_3ad_unbind_slave(struct slave *slave)
 				else
 					temp_aggregator->lag_ports = temp_port->next_port_in_aggregator;
 				temp_aggregator->num_of_ports--;
-				if (__agg_active_ports(temp_aggregator) == 0) {
+				if (__agg_active_ad_ports(temp_aggregator) == 0) {
 					select_new_active_agg = temp_aggregator->is_active;
 					ad_clear_agg(temp_aggregator);
 					if (select_new_active_agg) {
 						slave_info(bond->dev, slave->dev, "Removing an active aggregator\n");
 						/* select new active aggregator */
-						ad_agg_selection_logic(__get_first_agg(port),
+						ad_agg_selection_logic(__get_first_agg(ad_port),
 							               &dummy_slave_update);
 					}
 				}
@@ -2220,17 +2219,17 @@ void bond_3ad_unbind_slave(struct slave *slave)
 			}
 		}
 	}
-	port->slave = NULL;
+	ad_port->slave = NULL;
 
 out:
 	spin_unlock_bh(&bond->mode_lock);
 }
 
 /**
- * bond_3ad_update_ad_actor_settings - reflect change of actor settings to ports
+ * bond_3ad_update_ad_actor_settings - reflect change of actor settings to ad_ports
  * @bond: bonding struct to work on
  *
- * If an ad_actor setting gets changed we need to update the individual port
+ * If an ad_actor setting gets changed we need to update the individual ad_port
  * settings so the bond device will use the new values when it gets upped.
  */
 void bond_3ad_update_ad_actor_settings(struct bonding *bond)
@@ -2250,10 +2249,10 @@ void bond_3ad_update_ad_actor_settings(struct bonding *bond)
 
 	spin_lock_bh(&bond->mode_lock);
 	bond_for_each_slave(bond, slave, iter) {
-		struct port *port = &(SLAVE_AD_INFO(slave))->port;
+		struct ad_port *ad_port = &(SLAVE_AD_INFO(slave))->ad_port;
 
-		__ad_actor_update_port(port);
-		port->ntt = true;
+		__ad_actor_update_port(ad_port);
+		ad_port->ntt = true;
 	}
 	spin_unlock_bh(&bond->mode_lock);
 }
@@ -2268,7 +2267,7 @@ void bond_3ad_update_ad_actor_settings(struct bonding *bond)
  * reply of one to each other might be delayed until next tick.
  *
  * This function also complete the initialization when the agg_select_timer
- * times out, and it selects an aggregator for the ports that are yet not
+ * times out, and it selects an aggregator for the ad_ports that are yet not
  * related to any aggregator, and selects the active aggregator for a bond.
  */
 void bond_3ad_state_machine_handler(struct work_struct *work)
@@ -2278,11 +2277,11 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
 	struct aggregator *aggregator;
 	struct list_head *iter;
 	struct slave *slave;
-	struct port *port;
+	struct ad_port *ad_port;
 	bool should_notify_rtnl = BOND_SLAVE_NOTIFY_LATER;
 	bool update_slave_arr = false;
 
-	/* Lock to protect data accessed by all (e.g., port->sm_vars) and
+	/* Lock to protect data accessed by all (e.g., ad_port->sm_vars) and
 	 * against running with bond_3ad_unbind_slave. ad_rx_machine may run
 	 * concurrently due to incoming LACPDU as well.
 	 */
@@ -2297,41 +2296,41 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
 	if (BOND_AD_INFO(bond).agg_select_timer &&
 	    !(--BOND_AD_INFO(bond).agg_select_timer)) {
 		slave = bond_first_slave_rcu(bond);
-		port = slave ? &(SLAVE_AD_INFO(slave)->port) : NULL;
+		ad_port = slave ? &(SLAVE_AD_INFO(slave)->ad_port) : NULL;
 
 		/* select the active aggregator for the bond */
-		if (port) {
-			if (!port->slave) {
+		if (ad_port) {
+			if (!ad_port->slave) {
 				net_warn_ratelimited("%s: Warning: bond's first port is uninitialized\n",
 						     bond->dev->name);
 				goto re_arm;
 			}
 
-			aggregator = __get_first_agg(port);
+			aggregator = __get_first_agg(ad_port);
 			ad_agg_selection_logic(aggregator, &update_slave_arr);
 		}
 		bond_3ad_set_carrier(bond);
 	}
 
-	/* for each port run the state machines */
+	/* for each ad_port run the state machines */
 	bond_for_each_slave_rcu(bond, slave, iter) {
-		port = &(SLAVE_AD_INFO(slave)->port);
-		if (!port->slave) {
+		ad_port = &(SLAVE_AD_INFO(slave)->ad_port);
+		if (!ad_port->slave) {
 			net_warn_ratelimited("%s: Warning: Found an uninitialized port\n",
 					    bond->dev->name);
 			goto re_arm;
 		}
 
-		ad_rx_machine(NULL, port);
-		ad_periodic_machine(port);
-		ad_port_selection_logic(port, &update_slave_arr);
-		ad_mux_machine(port, &update_slave_arr);
-		ad_tx_machine(port);
-		ad_churn_machine(port);
+		ad_rx_machine(NULL, ad_port);
+		ad_periodic_machine(ad_port);
+		ad_port_selection_logic(ad_port, &update_slave_arr);
+		ad_mux_machine(ad_port, &update_slave_arr);
+		ad_tx_machine(ad_port);
+		ad_churn_machine(ad_port);
 
 		/* turn off the BEGIN bit, since we already handled it */
-		if (port->sm_vars & AD_PORT_BEGIN)
-			port->sm_vars &= ~AD_PORT_BEGIN;
+		if (ad_port->sm_vars & AD_PORT_BEGIN)
+			ad_port->sm_vars &= ~AD_PORT_BEGIN;
 	}
 
 re_arm:
@@ -2368,11 +2367,11 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave)
 	struct bonding *bond = slave->bond;
 	int ret = RX_HANDLER_ANOTHER;
 	struct bond_marker *marker;
-	struct port *port;
+	struct ad_port *ad_port;
 	atomic64_t *stat;
 
-	port = &(SLAVE_AD_INFO(slave)->port);
-	if (!port->slave) {
+	ad_port = &(SLAVE_AD_INFO(slave)->ad_port);
+	if (!ad_port->slave) {
 		net_warn_ratelimited("%s: Warning: port of slave %s is uninitialized\n",
 				     slave->dev->name, slave->bond->dev->name);
 		return ret;
@@ -2383,10 +2382,10 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave)
 		ret = RX_HANDLER_CONSUMED;
 		slave_dbg(slave->bond->dev, slave->dev,
 			  "Received LACPDU on port %d\n",
-			  port->actor_port_number);
+			  ad_port->actor_port_number);
 		/* Protect against concurrent state machines */
 		spin_lock(&slave->bond->mode_lock);
-		ad_rx_machine(lacpdu, port);
+		ad_rx_machine(lacpdu, ad_port);
 		spin_unlock(&slave->bond->mode_lock);
 		break;
 	case AD_TYPE_MARKER:
@@ -2398,17 +2397,17 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave)
 		switch (marker->tlv_type) {
 		case AD_MARKER_INFORMATION_SUBTYPE:
 			slave_dbg(slave->bond->dev, slave->dev, "Received Marker Information on port %d\n",
-				  port->actor_port_number);
-			ad_marker_info_received(marker, port);
+				  ad_port->actor_port_number);
+			ad_marker_info_received(marker, ad_port);
 			break;
 		case AD_MARKER_RESPONSE_SUBTYPE:
 			slave_dbg(slave->bond->dev, slave->dev, "Received Marker Response on port %d\n",
-				  port->actor_port_number);
-			ad_marker_response_received(marker, port);
+				  ad_port->actor_port_number);
+			ad_marker_response_received(marker, ad_port);
 			break;
 		default:
 			slave_dbg(slave->bond->dev, slave->dev, "Received an unknown Marker subtype on port %d\n",
-				  port->actor_port_number);
+				  ad_port->actor_port_number);
 			stat = &SLAVE_AD_INFO(slave)->stats.marker_unknown_rx;
 			atomic64_inc(stat);
 			stat = &BOND_AD_INFO(bond).stats.marker_unknown_rx;
@@ -2424,47 +2423,47 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave)
 }
 
 /**
- * ad_update_actor_keys - Update the oper / admin keys for a port based on
+ * ad_update_actor_keys - Update the oper / admin keys for an ad_port based on
  * its current speed and duplex settings.
  *
- * @port: the port we'are looking at
+ * @ad_port: the ad_port we'are looking at
  * @reset: Boolean to just reset the speed and the duplex part of the key
  *
  * The logic to change the oper / admin keys is:
  * (a) A full duplex port can participate in LACP with partner.
  * (b) When the speed is changed, LACP need to be reinitiated.
  */
-static void ad_update_actor_keys(struct port *port, bool reset)
+static void ad_update_actor_keys(struct ad_port *ad_port, bool reset)
 {
 	u8 duplex = 0;
 	u16 ospeed = 0, speed = 0;
-	u16 old_oper_key = port->actor_oper_port_key;
+	u16 old_oper_key = ad_port->actor_oper_port_key;
 
-	port->actor_admin_port_key &= ~(AD_SPEED_KEY_MASKS|AD_DUPLEX_KEY_MASKS);
+	ad_port->actor_admin_port_key &= ~(AD_SPEED_KEY_MASKS|AD_DUPLEX_KEY_MASKS);
 	if (!reset) {
-		speed = __get_link_speed(port);
+		speed = __get_link_speed(ad_port);
 		ospeed = (old_oper_key & AD_SPEED_KEY_MASKS) >> 1;
-		duplex = __get_duplex(port);
-		port->actor_admin_port_key |= (speed << 1) | duplex;
+		duplex = __get_duplex(ad_port);
+		ad_port->actor_admin_port_key |= (speed << 1) | duplex;
 	}
-	port->actor_oper_port_key = port->actor_admin_port_key;
+	ad_port->actor_oper_port_key = ad_port->actor_admin_port_key;
 
-	if (old_oper_key != port->actor_oper_port_key) {
+	if (old_oper_key != ad_port->actor_oper_port_key) {
 		/* Only 'duplex' port participates in LACP */
 		if (duplex)
-			port->sm_vars |= AD_PORT_LACP_ENABLED;
+			ad_port->sm_vars |= AD_PORT_LACP_ENABLED;
 		else
-			port->sm_vars &= ~AD_PORT_LACP_ENABLED;
+			ad_port->sm_vars &= ~AD_PORT_LACP_ENABLED;
 
 		if (!reset) {
 			if (!speed) {
-				slave_err(port->slave->bond->dev,
-					  port->slave->dev,
+				slave_err(ad_port->slave->bond->dev,
+					  ad_port->slave->dev,
 					  "speed changed to 0 on port %d\n",
-					  port->actor_port_number);
+					  ad_port->actor_port_number);
 			} else if (duplex && ospeed != speed) {
 				/* Speed change restarts LACP state-machine */
-				port->sm_vars |= AD_PORT_BEGIN;
+				ad_port->sm_vars |= AD_PORT_BEGIN;
 			}
 		}
 	}
@@ -2476,26 +2475,26 @@ static void ad_update_actor_keys(struct port *port, bool reset)
  *
  * @slave: slave struct to work on
  *
- * Handle reselection of aggregator (if needed) for this port.
+ * Handle reselection of aggregator (if needed) for this ad_port.
  */
 void bond_3ad_adapter_speed_duplex_changed(struct slave *slave)
 {
-	struct port *port;
+	struct ad_port *ad_port;
 
-	port = &(SLAVE_AD_INFO(slave)->port);
+	ad_port = &(SLAVE_AD_INFO(slave)->ad_port);
 
-	/* if slave is null, the whole port is not initialized */
-	if (!port->slave) {
+	/* if slave is null, the whole ad_port is not initialized */
+	if (!ad_port->slave) {
 		slave_warn(slave->bond->dev, slave->dev,
 			   "speed/duplex changed for uninitialized port\n");
 		return;
 	}
 
 	spin_lock_bh(&slave->bond->mode_lock);
-	ad_update_actor_keys(port, false);
+	ad_update_actor_keys(ad_port, false);
 	spin_unlock_bh(&slave->bond->mode_lock);
 	slave_dbg(slave->bond->dev, slave->dev, "Port %d changed speed/duplex\n",
-		  port->actor_port_number);
+		  ad_port->actor_port_number);
 }
 
 /**
@@ -2503,18 +2502,18 @@ void bond_3ad_adapter_speed_duplex_changed(struct slave *slave)
  * @slave: slave struct to work on
  * @link: whether the link is now up or down
  *
- * Handle reselection of aggregator (if needed) for this port.
+ * Handle reselection of aggregator (if needed) for this ad_port.
  */
 void bond_3ad_handle_link_change(struct slave *slave, char link)
 {
 	struct aggregator *agg;
-	struct port *port;
+	struct ad_port *ad_port;
 	bool dummy;
 
-	port = &(SLAVE_AD_INFO(slave)->port);
+	ad_port = &(SLAVE_AD_INFO(slave)->ad_port);
 
-	/* if slave is null, the whole port is not initialized */
-	if (!port->slave) {
+	/* if slave is null, the whole ad_port is not initialized */
+	if (!ad_port->slave) {
 		slave_warn(slave->bond->dev, slave->dev, "link status changed for uninitialized port\n");
 		return;
 	}
@@ -2528,20 +2527,20 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
 	 * some of he adaptors(ce1000.lan) report.
 	 */
 	if (link == BOND_LINK_UP) {
-		port->is_enabled = true;
-		ad_update_actor_keys(port, false);
+		ad_port->is_enabled = true;
+		ad_update_actor_keys(ad_port, false);
 	} else {
 		/* link has failed */
-		port->is_enabled = false;
-		ad_update_actor_keys(port, true);
+		ad_port->is_enabled = false;
+		ad_update_actor_keys(ad_port, true);
 	}
-	agg = __get_first_agg(port);
+	agg = __get_first_agg(ad_port);
 	ad_agg_selection_logic(agg, &dummy);
 
 	spin_unlock_bh(&slave->bond->mode_lock);
 
 	slave_dbg(slave->bond->dev, slave->dev, "Port %d changed link status to %s\n",
-		  port->actor_port_number,
+		  ad_port->actor_port_number,
 		  link == BOND_LINK_UP ? "UP" : "DOWN");
 
 	/* RTNL is held and mode_lock is released so it's safe
@@ -2578,7 +2577,7 @@ int bond_3ad_set_carrier(struct bonding *bond)
 	active = __get_active_agg(&(SLAVE_AD_INFO(first_slave)->aggregator));
 	if (active) {
 		/* are enough slaves available to consider link up? */
-		if (__agg_active_ports(active) < bond->params.min_links) {
+		if (__agg_active_ad_ports(active) < bond->params.min_links) {
 			if (netif_carrier_ok(bond->dev)) {
 				netif_carrier_off(bond->dev);
 				goto out;
@@ -2609,12 +2608,12 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond,
 	struct aggregator *aggregator = NULL;
 	struct list_head *iter;
 	struct slave *slave;
-	struct port *port;
+	struct ad_port *ad_port;
 
 	bond_for_each_slave_rcu(bond, slave, iter) {
-		port = &(SLAVE_AD_INFO(slave)->port);
-		if (port->aggregator && port->aggregator->is_active) {
-			aggregator = port->aggregator;
+		ad_port = &(SLAVE_AD_INFO(slave)->ad_port);
+		if (ad_port->aggregator && ad_port->aggregator->is_active) {
+			aggregator = ad_port->aggregator;
 			break;
 		}
 	}
@@ -2623,7 +2622,7 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond,
 		return -1;
 
 	ad_info->aggregator_id = aggregator->aggregator_identifier;
-	ad_info->ports = __agg_active_ports(aggregator);
+	ad_info->ports = __agg_active_ad_ports(aggregator);
 	ad_info->actor_key = aggregator->actor_oper_aggregator_key;
 	ad_info->partner_key = aggregator->partner_oper_aggregator_key;
 	ether_addr_copy(ad_info->partner_system,
@@ -2668,15 +2667,15 @@ int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
  * @bond: bonding struct
  *
  * When modify lacp_rate parameter via sysfs,
- * update actor_oper_port_state of each port.
+ * update actor_oper_port_state of each ad_port.
  *
  * Hold bond->mode_lock,
- * so we can modify port->actor_oper_port_state,
+ * so we can modify ad_port->actor_oper_port_state,
  * no matter bond is up or down.
  */
 void bond_3ad_update_lacp_rate(struct bonding *bond)
 {
-	struct port *port = NULL;
+	struct ad_port *ad_port = NULL;
 	struct list_head *iter;
 	struct slave *slave;
 	int lacp_fast;
@@ -2684,11 +2683,11 @@ void bond_3ad_update_lacp_rate(struct bonding *bond)
 	lacp_fast = bond->params.lacp_fast;
 	spin_lock_bh(&bond->mode_lock);
 	bond_for_each_slave(bond, slave, iter) {
-		port = &(SLAVE_AD_INFO(slave)->port);
+		ad_port = &(SLAVE_AD_INFO(slave)->ad_port);
 		if (lacp_fast)
-			port->actor_oper_port_state |= LACP_STATE_LACP_TIMEOUT;
+			ad_port->actor_oper_port_state |= LACP_STATE_LACP_TIMEOUT;
 		else
-			port->actor_oper_port_state &= ~LACP_STATE_LACP_TIMEOUT;
+			ad_port->actor_oper_port_state &= ~LACP_STATE_LACP_TIMEOUT;
 	}
 	spin_unlock_bh(&bond->mode_lock);
 }
drivers/net/bonding/bond_main.c +2 -2
index 42ef25ec0af5..28c04a7a5105 100644
@@ -1151,7 +1151,7 @@ static void bond_poll_controller(struct net_device *bond_dev)
 
 		if (BOND_MODE(bond) == BOND_MODE_8023AD) {
 			struct aggregator *agg =
-			    SLAVE_AD_INFO(slave)->port.aggregator;
+			    SLAVE_AD_INFO(slave)->ad_port.aggregator;
 
 			if (agg &&
 			    agg->aggregator_identifier != ad_info.aggregator_id)
@@ -4334,7 +4334,7 @@ int bond_update_slave_arr(struct bonding *bond, struct slave *skipslave)
 		if (BOND_MODE(bond) == BOND_MODE_8023AD) {
 			struct aggregator *agg;
 
-			agg = SLAVE_AD_INFO(slave)->port.aggregator;
+			agg = SLAVE_AD_INFO(slave)->ad_port.aggregator;
 			if (!agg || agg->aggregator_identifier != agg_id)
 				continue;
 		}
drivers/net/bonding/bond_netlink.c +3 -3
index f0f9138e967f..fa7304d3eefe 100644
@@ -54,10 +54,10 @@ static int bond_fill_slave_info(struct sk_buff *skb,
 
 	if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) {
 		const struct aggregator *agg;
-		const struct port *ad_port;
+		const struct ad_port *ad_port;
 
-		ad_port = &SLAVE_AD_INFO(slave)->port;
-		agg = SLAVE_AD_INFO(slave)->port.aggregator;
+		ad_port = &SLAVE_AD_INFO(slave)->ad_port;
+		agg = SLAVE_AD_INFO(slave)->ad_port.aggregator;
 		if (agg) {
 			if (nla_put_u16(skb, IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
 					agg->aggregator_identifier))
drivers/net/bonding/bond_procfs.c +18 -18
index fd5c9cbe45b1..9017bc163088 100644
@@ -191,49 +191,49 @@ static void bond_info_show_slave(struct seq_file *seq,
 	seq_printf(seq, "Slave queue ID: %d\n", slave->queue_id);
 
 	if (BOND_MODE(bond) == BOND_MODE_8023AD) {
-		const struct port *port = &SLAVE_AD_INFO(slave)->port;
-		const struct aggregator *agg = port->aggregator;
+		const struct ad_port *ad_port = &SLAVE_AD_INFO(slave)->ad_port;
+		const struct aggregator *agg = ad_port->aggregator;
 
 		if (agg) {
 			seq_printf(seq, "Aggregator ID: %d\n",
 				   agg->aggregator_identifier);
 			seq_printf(seq, "Actor Churn State: %s\n",
-				   bond_3ad_churn_desc(port->sm_churn_actor_state));
+				   bond_3ad_churn_desc(ad_port->sm_churn_actor_state));
 			seq_printf(seq, "Partner Churn State: %s\n",
-				   bond_3ad_churn_desc(port->sm_churn_partner_state));
+				   bond_3ad_churn_desc(ad_port->sm_churn_partner_state));
 			seq_printf(seq, "Actor Churned Count: %d\n",
-				   port->churn_actor_count);
+				   ad_port->churn_actor_count);
 			seq_printf(seq, "Partner Churned Count: %d\n",
-				   port->churn_partner_count);
+				   ad_port->churn_partner_count);
 
 			if (capable(CAP_NET_ADMIN)) {
 				seq_puts(seq, "details actor lacp pdu:\n");
 				seq_printf(seq, "    system priority: %d\n",
-					   port->actor_system_priority);
+					   ad_port->actor_system_priority);
 				seq_printf(seq, "    system mac address: %pM\n",
-					   &port->actor_system);
+					   &ad_port->actor_system);
 				seq_printf(seq, "    port key: %d\n",
-					   port->actor_oper_port_key);
+					   ad_port->actor_oper_port_key);
 				seq_printf(seq, "    port priority: %d\n",
-					   port->actor_port_priority);
+					   ad_port->actor_port_priority);
 				seq_printf(seq, "    port number: %d\n",
-					   port->actor_port_number);
+					   ad_port->actor_port_number);
 				seq_printf(seq, "    port state: %d\n",
-					   port->actor_oper_port_state);
+					   ad_port->actor_oper_port_state);
 
 				seq_puts(seq, "details partner lacp pdu:\n");
 				seq_printf(seq, "    system priority: %d\n",
-					   port->partner_oper.system_priority);
+					   ad_port->partner_oper.system_priority);
 				seq_printf(seq, "    system mac address: %pM\n",
-					   &port->partner_oper.system);
+					   &ad_port->partner_oper.system);
 				seq_printf(seq, "    oper key: %d\n",
-					   port->partner_oper.key);
+					   ad_port->partner_oper.key);
 				seq_printf(seq, "    port priority: %d\n",
-					   port->partner_oper.port_priority);
+					   ad_port->partner_oper.port_priority);
 				seq_printf(seq, "    port number: %d\n",
-					   port->partner_oper.port_number);
+					   ad_port->partner_oper.port_number);
 				seq_printf(seq, "    port state: %d\n",
-					   port->partner_oper.port_state);
+					   ad_port->partner_oper.port_state);
 			}
 		} else {
 			seq_puts(seq, "Aggregator ID: N/A\n");
drivers/net/bonding/bond_sysfs_slave.c +5 -5
index 9b8346638f69..5c0b30d5cadb 100644
@@ -68,7 +68,7 @@ static ssize_t ad_aggregator_id_show(struct slave *slave, char *buf)
 	const struct aggregator *agg;
 
 	if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) {
-		agg = SLAVE_AD_INFO(slave)->port.aggregator;
+		agg = SLAVE_AD_INFO(slave)->ad_port.aggregator;
 		if (agg)
 			return sprintf(buf, "%d\n",
 				       agg->aggregator_identifier);
@@ -80,10 +80,10 @@ static SLAVE_ATTR_RO(ad_aggregator_id);
 
 static ssize_t ad_actor_oper_port_state_show(struct slave *slave, char *buf)
 {
-	const struct port *ad_port;
+	const struct ad_port *ad_port;
 
 	if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) {
-		ad_port = &SLAVE_AD_INFO(slave)->port;
+		ad_port = &SLAVE_AD_INFO(slave)->ad_port;
 		if (ad_port->aggregator)
 			return sprintf(buf, "%u\n",
 				       ad_port->actor_oper_port_state);
@@ -95,10 +95,10 @@ static SLAVE_ATTR_RO(ad_actor_oper_port_state);
 
 static ssize_t ad_partner_oper_port_state_show(struct slave *slave, char *buf)
 {
-	const struct port *ad_port;
+	const struct ad_port *ad_port;
 
 	if (BOND_MODE(slave->bond) == BOND_MODE_8023AD) {
-		ad_port = &SLAVE_AD_INFO(slave)->port;
+		ad_port = &SLAVE_AD_INFO(slave)->ad_port;
 		if (ad_port->aggregator)
 			return sprintf(buf, "%u\n",
 				       ad_port->partner_oper.port_state);
include/net/bond_3ad.h +7 -7
index c8696a230b7d..8c838eb9a997 100644
@@ -157,7 +157,7 @@ typedef struct bond_marker_header {
 struct slave;
 struct bonding;
 struct ad_info;
-struct port;
+struct ad_port;
 
 #ifdef __ia64__
 #pragma pack(8)
@@ -188,7 +188,7 @@ typedef struct aggregator {
 	u16 partner_oper_aggregator_key;
 	u16 receive_state;	/* BOOLEAN */
 	u16 transmit_state;	/* BOOLEAN */
-	struct port *lag_ports;
+	struct ad_port *lag_ports;
 	/* ****** PRIVATE PARAMETERS ****** */
 	struct slave *slave;	/* pointer to the bond slave that this aggregator belongs to */
 	u16 is_active;		/* BOOLEAN. Indicates if this aggregator is active */
@@ -204,8 +204,8 @@ struct port_params {
 	u16 port_state;
 };
 
-/* port structure(43.4.6 in the 802.3ad standard) */
-typedef struct port {
+/* ad_port structure(43.4.6 in the 802.3ad standard) */
+typedef struct ad_port {
 	u16 actor_port_number;
 	u16 actor_port_priority;
 	struct mac_addr actor_system;	/* This parameter is added here although it is not specified in the standard, just for simplification */
@@ -240,10 +240,10 @@ typedef struct port {
 	churn_state_t sm_churn_partner_state;
 	struct slave *slave;		/* pointer to the bond slave that this port belongs to */
 	struct aggregator *aggregator;	/* pointer to an aggregator that this port related to */
-	struct port *next_port_in_aggregator;	/* Next port on the linked list of the parent aggregator */
+	struct ad_port *next_port_in_aggregator;	/* Next port on the linked list of the parent aggregator */
 	u32 transaction_id;		/* continuous number for identification of Marker PDU's; */
 	struct lacpdu lacpdu;		/* the lacpdu that will be sent for this port */
-} port_t;
+} ad_port_t;
 
 /* system structure */
 struct ad_system {
@@ -268,7 +268,7 @@ struct ad_bond_info {
 
 struct ad_slave_info {
 	struct aggregator aggregator;	/* 802.3ad aggregator structure */
-	struct port port;		/* 802.3ad port structure */
+	struct ad_port ad_port;		/* 802.3ad port structure */
 	struct bond_3ad_stats stats;
 	u16 id;
 };
Signature · 1 line
2.27.0
#2 lore raw

PATCH v3 2/5 bonding: replace use of the term master where possible

In reply to Jarod Wilson

Simply refer to what was the bonding "master" as the "bond" or bonding device, depending on context. However, do retain compat code for the bonding_masters sysfs interface to avoid breaking userspace.

Cc Jay Vosburgh <[email protected]>
Cc Veaceslav Falico <[email protected]>
Cc Andy Gospodarek <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Thomas Davis <[email protected]>
---
 drivers/infiniband/core/cma.c                 |  2 +-
 drivers/infiniband/core/lag.c                 |  2 +-
 drivers/infiniband/core/roce_gid_mgmt.c       |  6 +-
 drivers/net/bonding/bond_3ad.c                |  2 +-
 drivers/net/bonding/bond_main.c               | 58 +++++++++----------
 drivers/net/bonding/bond_procfs.c             |  4 +-
 drivers/net/bonding/bond_sysfs.c              |  8 +--
 .../net/ethernet/mellanox/mlx4/en_netdev.c    | 10 ++--
 .../ethernet/netronome/nfp/flower/lag_conf.c  |  2 +-
 .../ethernet/qlogic/netxen/netxen_nic_main.c  |  8 +--
 include/linux/netdevice.h                     |  8 +--
 include/net/bonding.h                         |  4 +-
 12 files changed, 58 insertions(+), 56 deletions(-)
drivers/infiniband/core/cma.c +1 -1
index 7f0e91e92968..fd5ad5139106 100644
@@ -4687,7 +4687,7 @@ static int cma_netdev_callback(struct notifier_block *self, unsigned long event,
 	if (event != NETDEV_BONDING_FAILOVER)
 		return NOTIFY_DONE;
 
-	if (!netif_is_bond_master(ndev))
+	if (!netif_is_bond_dev(ndev))
 		return NOTIFY_DONE;
 
 	mutex_lock(&lock);
drivers/infiniband/core/lag.c +1 -1
index 7063e41eaf26..2afaca2f9d0b 100644
@@ -128,7 +128,7 @@ struct net_device *rdma_lag_get_ah_roce_slave(struct ib_device *device,
 	dev_hold(master);
 	rcu_read_unlock();
 
-	if (!netif_is_bond_master(master))
+	if (!netif_is_bond_dev(master))
 		goto put;
 
 	slave = rdma_get_xmit_slave_udp(device, master, ah_attr, flags);
drivers/infiniband/core/roce_gid_mgmt.c +3 -3
index 2860def84f4d..85c48977be6c 100644
@@ -129,7 +129,7 @@ enum bonding_slave_state {
 static enum bonding_slave_state is_eth_active_slave_of_bonding_rcu(struct net_device *dev,
 								   struct net_device *upper)
 {
-	if (upper && netif_is_bond_master(upper)) {
+	if (upper && netif_is_bond_dev(upper)) {
 		struct net_device *pdev =
 			bond_option_active_slave_get_rcu(netdev_priv(upper));
 
@@ -216,7 +216,7 @@ is_ndev_for_default_gid_filter(struct ib_device *ib_dev, u8 port,
 	 * make sure that it the upper netdevice of rdma netdevice.
 	 */
 	res = ((cookie_ndev == rdma_ndev && !netif_is_bond_slave(rdma_ndev)) ||
-	       (netif_is_bond_master(cookie_ndev) &&
+	       (netif_is_bond_dev(cookie_ndev) &&
 		rdma_is_upper_dev_rcu(rdma_ndev, cookie_ndev)));
 
 	rcu_read_unlock();
@@ -271,7 +271,7 @@ is_upper_ndev_bond_master_filter(struct ib_device *ib_dev, u8 port,
 		return false;
 
 	rcu_read_lock();
-	if (netif_is_bond_master(cookie_ndev) &&
+	if (netif_is_bond_dev(cookie_ndev) &&
 	    rdma_is_upper_dev_rcu(rdma_ndev, cookie_ndev))
 		match = true;
 	rcu_read_unlock();
drivers/net/bonding/bond_3ad.c +1 -1
index 0eb717b0bfc6..852b9c4f6a47 100644
@@ -2550,7 +2550,7 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
 }
 
 /**
- * bond_3ad_set_carrier - set link state for bonding master
+ * bond_3ad_set_carrier - set link state for bonding device
  * @bond: bonding structure
  *
  * if we have an active aggregator, we're up, if not, we're down.
drivers/net/bonding/bond_main.c +29 -29

200 lines not on this page · raw message

drivers/net/bonding/bond_procfs.c +2 -2
index 9017bc163088..2ac60cff9b3a 100644
@@ -54,7 +54,7 @@ static void bond_info_seq_stop(struct seq_file *seq, void *v)
 	rcu_read_unlock();
 }
 
-static void bond_info_show_master(struct seq_file *seq)
+static void bond_info_show_bond_dev(struct seq_file *seq)
 {
 	struct bonding *bond = PDE_DATA(file_inode(seq->file));
 	const struct bond_opt_value *optval;
@@ -245,7 +245,7 @@ static int bond_info_seq_show(struct seq_file *seq, void *v)
 {
 	if (v == SEQ_START_TOKEN) {
 		seq_printf(seq, "%s\n", bond_version);
-		bond_info_show_master(seq);
+		bond_info_show_bond_dev(seq);
 	} else
 		bond_info_show_slave(seq, v);
 
drivers/net/bonding/bond_sysfs.c +4 -4
index 2d615a93685e..f3b9db1a4a84 100644
@@ -28,7 +28,7 @@
 
 #define to_bond(cd)	((struct bonding *)(netdev_priv(to_net_dev(cd))))
 
-/* "show" function for the bond_masters attribute.
+/* "show" function for the bonding_masters attribute.
  * The class parameter is ignored.
  */
 static ssize_t bonding_show_bonds(struct class *cls,
@@ -70,7 +70,7 @@ static struct net_device *bond_get_by_name(struct bond_net *bn, const char *ifna
 	return NULL;
 }
 
-/* "store" function for the bond_masters attribute.  This is what
+/* "store" function for the bonding_masters attribute.  This is what
  * creates and deletes entire bonds.
  *
  * The class parameter is ignored.
@@ -127,7 +127,7 @@ static ssize_t bonding_store_bonds(struct class *cls,
 	return -EPERM;
 }
 
-/* class attribute for bond_masters file.  This ends up in /sys/class/net */
+/* class attribute for bonding_masters file.  This ends up in /sys/class/net */
 static const struct class_attribute class_attr_bonding_masters = {
 	.attr = {
 		.name = "bonding_masters",
@@ -788,7 +788,7 @@ int bond_create_sysfs(struct bond_net *bn)
 	 * configure multiple bonding devices.
 	 */
 	if (ret == -EEXIST) {
-		/* Is someone being kinky and naming a device bonding_master? */
+		/* Is someone naming a device bonding_masters? */
 		if (__dev_get_by_name(bn->net,
 				      class_attr_bonding_masters.attr.name))
 			pr_err("network device named %s already exists in sysfs\n",
drivers/net/ethernet/mellanox/mlx4/en_netdev.c +5 -5
index 106513f772c3..598aaf8ae7ae 100644
@@ -2982,18 +2982,18 @@ int mlx4_en_netdev_event(struct notifier_block *this,
 			&notifier_info->bonding_info;
 
 		/* required mode 1, 2 or 4 */
-		if ((bonding_info->master.bond_mode != BOND_MODE_ACTIVEBACKUP) &&
-		    (bonding_info->master.bond_mode != BOND_MODE_XOR) &&
-		    (bonding_info->master.bond_mode != BOND_MODE_8023AD))
+		if ((bonding_info->bond.bond_mode != BOND_MODE_ACTIVEBACKUP) &&
+		    (bonding_info->bond.bond_mode != BOND_MODE_XOR) &&
+		    (bonding_info->bond.bond_mode != BOND_MODE_8023AD))
 			do_bond = false;
 
 		/* require exactly 2 slaves */
-		if (bonding_info->master.num_slaves != 2)
+		if (bonding_info->bond.num_slaves != 2)
 			do_bond = false;
 
 		/* calc v2p */
 		if (do_bond) {
-			if (bonding_info->master.bond_mode ==
+			if (bonding_info->bond.bond_mode ==
 			    BOND_MODE_ACTIVEBACKUP) {
 				/* in active-backup mode virtual ports are
 				 * mapped to the physical port of the active
drivers/net/ethernet/netronome/nfp/flower/lag_conf.c +1 -1
index 63907aeb3884..431d696c9ac4 100644
@@ -483,7 +483,7 @@ nfp_fl_lag_schedule_group_delete(struct nfp_fl_lag *lag,
 
 	priv = container_of(lag, struct nfp_flower_priv, nfp_lag);
 
-	if (!netif_is_bond_master(master))
+	if (!netif_is_bond_dev(master))
 		return;
 
 	mutex_lock(&lag->lock);
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +4 -4
index f21847739ef1..aa28a7d8e2ea 100644
@@ -3216,7 +3216,7 @@ netxen_list_config_ip(struct netxen_adapter *adapter,
 			goto out;
 		if (is_vlan_dev(dev))
 			dev = vlan_dev_real_dev(dev);
-		cur->master = !!netif_is_bond_master(dev);
+		cur->master = !!netif_is_bond_dev(dev);
 		cur->ip_addr = ifa->ifa_address;
 		list_add_tail(&cur->list, &adapter->ip_list);
 		netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_UP);
@@ -3322,7 +3322,7 @@ static void netxen_config_master(struct net_device *dev, unsigned long event)
 	 * Now we should program the bond's (and its vlans')
 	 * addresses in the netxen NIC.
 	 */
-	if (master && netif_is_bond_master(master) &&
+	if (master && netif_is_bond_dev(master) &&
 	    !netif_is_bond_slave(dev)) {
 		netxen_config_indev_addr(adapter, master, event);
 		for_each_netdev_rcu(&init_net, slave)
@@ -3358,7 +3358,7 @@ static int netxen_netdev_event(struct notifier_block *this,
 	}
 	if (event == NETDEV_UP || event == NETDEV_DOWN) {
 		/* If this is a bonding device, look for netxen-based slaves*/
-		if (netif_is_bond_master(dev)) {
+		if (netif_is_bond_dev(dev)) {
 			rcu_read_lock();
 			for_each_netdev_in_bond_rcu(dev, slave) {
 				if (!netxen_config_checkdev(slave))
@@ -3403,7 +3403,7 @@ netxen_inetaddr_event(struct notifier_block *this,
 	}
 	if (event == NETDEV_UP || event == NETDEV_DOWN) {
 		/* If this is a bonding device, look for netxen-based slaves*/
-		if (netif_is_bond_master(dev)) {
+		if (netif_is_bond_dev(dev)) {
 			rcu_read_lock();
 			for_each_netdev_in_bond_rcu(dev, slave) {
 				if (!netxen_config_checkdev(slave))
include/linux/netdevice.h +4 -4
index 0c79d9e56a5e..66c47631407a 100644
@@ -1497,7 +1497,7 @@ struct net_device_ops {
  *
  * @IFF_802_1Q_VLAN: 802.1Q VLAN device
  * @IFF_EBRIDGE: Ethernet bridging device
- * @IFF_BONDING: bonding master or slave
+ * @IFF_BONDING: bonding netdev or slave
  * @IFF_ISATAP: ISATAP interface (RFC4214)
  * @IFF_WAN_HDLC: WAN HDLC device
  * @IFF_XMIT_DST_RELEASE: dev_hard_start_xmit() is allowed to
@@ -4581,7 +4581,7 @@ struct sk_buff *skb_mac_gso_segment(struct sk_buff *skb,
 
 struct netdev_bonding_info {
 	ifslave	slave;
-	ifbond	master;
+	ifbond	bond;
 };
 
 struct netdev_notifier_bonding_info {
@@ -4805,7 +4805,7 @@ static inline bool netif_is_macvlan_port(const struct net_device *dev)
 	return dev->priv_flags & IFF_MACVLAN_PORT;
 }
 
-static inline bool netif_is_bond_master(const struct net_device *dev)
+static inline bool netif_is_bond_dev(const struct net_device *dev)
 {
 	return dev->flags & IFF_MASTER && dev->priv_flags & IFF_BONDING;
 }
@@ -4872,7 +4872,7 @@ static inline bool netif_is_team_port(const struct net_device *dev)
 
 static inline bool netif_is_lag_master(const struct net_device *dev)
 {
-	return netif_is_bond_master(dev) || netif_is_team_master(dev);
+	return netif_is_bond_dev(dev) || netif_is_team_master(dev);
 }
 
 static inline bool netif_is_lag_port(const struct net_device *dev)
include/net/bonding.h +3 -1
index 7d132cc1e584..bf4f0e1dc2bf 100644
@@ -156,7 +156,7 @@ struct bond_parm_tbl {
 
 struct slave {
 	struct net_device *dev; /* first - useful for panic debug */
-	struct bonding *bond; /* our master */
+	struct bonding *bond; /* our bond link aggregator */
 	int    delay;
 	/* all three in jiffies */
 	unsigned long last_link_up;
@@ -613,7 +613,9 @@ struct bond_net {
 #ifdef CONFIG_PROC_FS
 	struct proc_dir_entry	*proc_dir;
 #endif
+	/* _masters is a legacy interface identical to _devs */
 	struct class_attribute	class_attr_bonding_masters;
+	struct class_attribute	class_attr_bonding_devs;
 };
 
 int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave);
Signature · 1 line
2.27.0
#3 lore raw

PATCH v3 3/5 bonding: rename slave to port where possible

In reply to Jarod Wilson

Use "port" to denote individual component interfaces in a bond, rather than "slave". This is more consistent with the team and bridge drivers, and eliminates the use of a good amount of problematic language in the bonding driver.

Legacy sysfs, procfs and module parameter bits that use slave in their names are retained for the purposes of not breaking anyone's userspace.

v3: simply omit interfaces with new names, sysfs and procfs should already be deprecated in favor of netlink/iproute2.

Cc Jay Vosburgh <[email protected]>
Cc Veaceslav Falico <[email protected]>
Cc Andy Gospodarek <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Thomas Davis <[email protected]>
---
 .clang-format                                 |    4 +-
 drivers/infiniband/core/roce_gid_mgmt.c       |    4 +-
 drivers/infiniband/hw/mlx4/main.c             |    2 +-
 drivers/net/bonding/bond_3ad.c                |  598 ++---
 drivers/net/bonding/bond_alb.c                |  689 ++---
 drivers/net/bonding/bond_debugfs.c            |    2 +-
 drivers/net/bonding/bond_main.c               | 2319 +++++++++--------
 drivers/net/bonding/bond_netlink.c            |  112 +-
 drivers/net/bonding/bond_options.c            |  258 +-
 drivers/net/bonding/bond_procfs.c             |   48 +-
 drivers/net/bonding/bond_sysfs.c              |   70 +-
 drivers/net/bonding/bond_sysfs_slave.c        |  159 +-
 .../ethernet/chelsio/cxgb3/cxgb3_offload.c    |    2 +-
 .../net/ethernet/mellanox/mlx4/en_netdev.c    |    4 +-
 .../ethernet/mellanox/mlx5/core/en/rep/bond.c |    4 +-
 .../net/ethernet/mellanox/mlx5/core/en_tc.c   |    2 +-
 .../ethernet/qlogic/netxen/netxen_nic_main.c  |    4 +-
 include/linux/netdevice.h                     |   16 +-
 include/net/bond_3ad.h                        |   30 +-
 include/net/bond_alb.h                        |   74 +-
 include/net/bond_options.h                    |   18 +-
 include/net/bonding.h                         |  358 +--
 include/net/lag.h                             |    2 +-
 23 files changed, 2419 insertions(+), 2360 deletions(-)
.clang-format +2 -2
index badfc1ba440a..1f1a16388ccb 100644
@@ -92,8 +92,8 @@ ForEachMacros:
   - 'blkg_for_each_descendant_post'
   - 'blkg_for_each_descendant_pre'
   - 'blk_queue_for_each_rl'
-  - 'bond_for_each_slave'
-  - 'bond_for_each_slave_rcu'
+  - 'bond_for_each_port'
+  - 'bond_for_each_port_rcu'
   - 'bpf_for_each_spilled_reg'
   - 'btree_for_each_safe128'
   - 'btree_for_each_safe32'
drivers/infiniband/core/roce_gid_mgmt.c +2 -2
index 85c48977be6c..fe95d928c5cf 100644
@@ -131,7 +131,7 @@ static enum bonding_slave_state is_eth_active_slave_of_bonding_rcu(struct net_de
 {
 	if (upper && netif_is_bond_dev(upper)) {
 		struct net_device *pdev =
-			bond_option_active_slave_get_rcu(netdev_priv(upper));
+			bond_option_active_port_get_rcu(netdev_priv(upper));
 
 		if (pdev)
 			return dev == pdev ? BONDING_SLAVE_STATE_ACTIVE :
@@ -215,7 +215,7 @@ is_ndev_for_default_gid_filter(struct ib_device *ib_dev, u8 port,
 	 * Additionally when event(cookie) netdevice is bond master device,
 	 * make sure that it the upper netdevice of rdma netdevice.
 	 */
-	res = ((cookie_ndev == rdma_ndev && !netif_is_bond_slave(rdma_ndev)) ||
+	res = ((cookie_ndev == rdma_ndev && !netif_is_bond_port(rdma_ndev)) ||
 	       (netif_is_bond_dev(cookie_ndev) &&
 		rdma_is_upper_dev_rcu(rdma_ndev, cookie_ndev)));
 
drivers/infiniband/hw/mlx4/main.c +1 -1
index bd4f975e7f9a..8a964224b8b1 100644
@@ -145,7 +145,7 @@ static struct net_device *mlx4_ib_get_netdev(struct ib_device *device, u8 port_n
 			if (upper) {
 				struct net_device *active;
 
-				active = bond_option_active_slave_get_rcu(netdev_priv(upper));
+				active = bond_option_active_port_get_rcu(netdev_priv(upper));
 				if (active)
 					dev = active;
 			}
drivers/net/bonding/bond_3ad.c +299 -299

1,339 lines not on this page · raw message

drivers/net/bonding/bond_alb.c +345 -344

1,454 lines not on this page · raw message

drivers/net/bonding/bond_debugfs.c +1 -1
index f3f86ef68ae0..a547e1cbb31a 100644
@@ -38,7 +38,7 @@ static int bond_debug_rlb_hash_show(struct seq_file *m, void *v)
 			&client_info->ip_src,
 			&client_info->ip_dst,
 			&client_info->mac_dst,
-			client_info->slave->dev->name);
+			client_info->port->dev->name);
 	}
 
 	spin_unlock_bh(&bond->mode_lock);
drivers/net/bonding/bond_main.c +1164 -1155

165 lines not on this page · raw message

drivers/net/bonding/bond_netlink.c +56 -56

112 lines not on this page · raw message

drivers/net/bonding/bond_options.c +145 -113

258 lines not on this page · raw message

drivers/net/bonding/bond_procfs.c +24 -24

48 lines not on this page · raw message

drivers/net/bonding/bond_sysfs.c +35 -35

70 lines not on this page · raw message

drivers/net/bonding/bond_sysfs_slave.c +84 -75

159 lines not on this page · raw message

drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c +1 -1
index 84604aff53ce..5cb931228b6d 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx4/en_netdev.c +2 -2
index 598aaf8ae7ae..abcef955e55a 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/en/rep/bond.c +2 -2
index 3e44e4d820c5..908c1755e6fb 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +1 -1
index a0c356987e1a..dbf98be3080c 100644

Lines of this file are not shown. View the raw message.

drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +2 -2
index aa28a7d8e2ea..6de1da62fcce 100644

Lines of this file are not shown. View the raw message.

include/linux/netdevice.h +8 -8
index 66c47631407a..ccdecdaf1c69 100644

Lines of this file are not shown. View the raw message.

include/net/bond_3ad.h +15 -15
index 8c838eb9a997..751d6055a53d 100644

Lines of this file are not shown. View the raw message.

include/net/bond_alb.h +38 -36

74 lines not on this page · raw message

include/net/bond_options.h +12 -6
index 9d382f2f0bc5..424e627877a5 100644

Lines of this file are not shown. View the raw message.

include/net/bonding.h +179 -179

358 lines not on this page · raw message

include/net/lag.h +1 -1
index 95b880e6fdde..8a7e7af74e92 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.27.0

Part of the diff is not shown here. View the raw message.

#4 lore raw

PATCH v3 4/5 bonding: rename bonding_sysfs_slave.c to _port.c

In reply to Jarod Wilson

Now that use of "slave" has been replaced by "port", rename this file too.

Cc Jay Vosburgh <[email protected]>
Cc Veaceslav Falico <[email protected]>
Cc Andy Gospodarek <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Thomas Davis <[email protected]>
---
 drivers/net/bonding/Makefile                                  | 2 +-
 drivers/net/bonding/{bond_sysfs_slave.c => bond_sysfs_port.c} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename drivers/net/bonding/{bond_sysfs_slave.c => bond_sysfs_port.c} (100%)
drivers/net/bonding/Makefile +1 -1
index 30e8ae3da2da..2ed0083514a6 100644
@@ -5,7 +5,7 @@
 
 obj-$(CONFIG_BONDING) += bonding.o
 
-bonding-objs := bond_main.o bond_3ad.o bond_alb.o bond_sysfs.o bond_sysfs_slave.o bond_debugfs.o bond_netlink.o bond_options.o
+bonding-objs := bond_main.o bond_3ad.o bond_alb.o bond_sysfs.o bond_sysfs_port.o bond_debugfs.o bond_netlink.o bond_options.o
 
 proc-$(CONFIG_PROC_FS) += bond_procfs.o
 bonding-objs += $(proc-y)
drivers/net/bonding/bond_sysfs_port.c renamed from drivers/net/bonding/bond_sysfs_slave.c +0 -0
similarity index 100%
rename from drivers/net/bonding/bond_sysfs_slave.c
rename to drivers/net/bonding/bond_sysfs_port.c
Signature · 1 line
2.27.0
#5 lore raw

PATCH v3 5/5 bonding: update Documentation for port/bond terminology

In reply to Jarod Wilson

Swap in port/bond terminology where appropriate, leaving all legacy sysfs and procfs interface mentions in place, but marked as deprecated. Additionally, add more netlink/iproute2 documentation, and note that this is the preferred method of interfacing with the bonding driver. While we're at it, also make some mention of NetworkManager's existence.

Cc Jay Vosburgh <[email protected]>
Cc Veaceslav Falico <[email protected]>
Cc Andy Gospodarek <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Jakub Kicinski <[email protected]>
Cc Thomas Davis <[email protected]>
---
 Documentation/networking/bonding.rst | 578 ++++++++++++++++-----------
 1 file changed, 346 insertions(+), 232 deletions(-)
Documentation/networking/bonding.rst +346 -232
index adc314639085..a1b3aace600b 100644
@@ -21,6 +21,15 @@ Added Sysfs information: 2006/04/24
 
   - Mitch Williams <mitch.a.williams at intel.com>
 
+Major terminology rework done late 2020, to start to remove the use of
+the socially problematic terms "master" and "slave" from the code. The
+"master" device is now referred to as simply the "bond" device and the
+"slave" devices as "ports", but all sysfs, procfs and module options
+have been retained as-is for userspace compatibility. The sysfs and
+procfs interfaces are deprecated though, in favor of userspace making
+use of netlink and iproute for any and all bonding configuration and
+information-gathering work.
+
 Introduction
 ============
 
@@ -167,22 +176,23 @@ or, for backwards compatibility, the option value.  E.g.,
 
 The parameters are as follows:
 
-active_slave
+active_port
+active_slave (DEPRECATED)
 
-	Specifies the new active slave for modes that support it
+	Specifies the new active port for modes that support it
 	(active-backup, balance-alb and balance-tlb).  Possible values
-	are the name of any currently enslaved interface, or an empty
-	string.  If a name is given, the slave and its link must be up in order
-	to be selected as the new active slave.  If an empty string is
-	specified, the current active slave is cleared, and a new active
-	slave is selected automatically.
+	are the name of any currently aggregated interface, or an empty
+	string.  If a name is given, the port and its port must be up in order
+	to be selected as the new active port.  If an empty string is
+	specified, the current active port is cleared, and a new active
+	port is selected automatically.
 
 	Note that this is only available through the sysfs interface. No module
 	parameter by this name exists.
 
 	The normal value of this option is the name of the currently
-	active slave, or the empty string if there is no active slave or
-	the current mode does not use an active slave.
+	active port, or the empty string if there is no active port or
+	the current mode does not use an active port.
 
 ad_actor_sys_prio
 
@@ -199,8 +209,8 @@ ad_actor_system
 	protocol packet exchanges (LACPDUs). The value cannot be NULL or
 	multicast. It is preferred to have the local-admin bit set for this
 	mac but driver does not enforce it. If the value is not given then
-	system defaults to using the masters' mac address as actors' system
-	address.
+	system defaults to using the bonds' mac address as actors'
+	system address.
 
 	This parameter has effect only in 802.3ad mode and is available through
 	SysFs interface.
@@ -216,8 +226,8 @@ ad_select
 		bandwidth.
 
 		Reselection of the active aggregator occurs only when all
-		slaves of the active aggregator are down or the active
-		aggregator has no slaves.
+		ports of the active aggregator are down or the active
+		aggregator has no ports.
 
 		This is the default value.
 
@@ -226,18 +236,18 @@ ad_select
 		The active aggregator is chosen by largest aggregate
 		bandwidth.  Reselection occurs if:
 
-		- A slave is added to or removed from the bond
+		- A port is added to or removed from the bond
 
-		- Any slave's link state changes
+		- Any port's link state changes
 
-		- Any slave's 802.3ad association state changes
+		- Any port's 802.3ad association state changes
 
 		- The bond's administrative state changes to up
 
 	count or 2
 
 		The active aggregator is chosen by the largest number of
-		ports (slaves).  Reselection occurs as described under the
+		ports (ports).  Reselection occurs as described under the
 		"bandwidth" setting, above.
 
 	The bandwidth and count selection policies permit failover of
@@ -265,7 +275,8 @@ ad_user_port_key
 	This parameter has effect only in 802.3ad mode and is available through
 	SysFs interface.
 
-all_slaves_active
+all_ports_active
+all_slaves_active (DEPRECATED)
 
 	Specifies that duplicate frames (received on inactive ports) should be
 	dropped (0) or delivered (1).
@@ -281,10 +292,10 @@ arp_interval
 
 	Specifies the ARP link monitoring frequency in milliseconds.
 
-	The ARP monitor works by periodically checking the slave
+	The ARP monitor works by periodically checking the port
 	devices to determine whether they have sent or received
 	traffic recently (the precise criteria depends upon the
-	bonding mode, and the state of the slave).  Regular traffic is
+	bonding mode, and the state of the port).  Regular traffic is
 	generated via ARP probes issued for the addresses specified by
 	the arp_ip_target option.
 
@@ -327,50 +338,50 @@ arp_validate
 
 	active or 1
 
-		Validation is performed only for the active slave.
+		Validation is performed only for the active port.
 
 	backup or 2
 
-		Validation is performed only for backup slaves.
+		Validation is performed only for backup ports.
 
 	all or 3
 
-		Validation is performed for all slaves.
+		Validation is performed for all ports.
 
 	filter or 4
 
-		Filtering is applied to all slaves. No validation is
+		Filtering is applied to all ports. No validation is
 		performed.
 
 	filter_active or 5
 
-		Filtering is applied to all slaves, validation is performed
-		only for the active slave.
+		Filtering is applied to all ports, validation is performed
+		only for the active port.
 
 	filter_backup or 6
 
-		Filtering is applied to all slaves, validation is performed
-		only for backup slaves.
+		Filtering is applied to all ports, validation is performed
+		only for backup ports.
 
 	Validation:
 
 	Enabling validation causes the ARP monitor to examine the incoming
-	ARP requests and replies, and only consider a slave to be up if it
+	ARP requests and replies, and only consider a port to be up if it
 	is receiving the appropriate ARP traffic.
 
-	For an active slave, the validation checks ARP replies to confirm
-	that they were generated by an arp_ip_target.  Since backup slaves
+	For an active port, the validation checks ARP replies to confirm
+	that they were generated by an arp_ip_target.  Since backup ports
 	do not typically receive these replies, the validation performed
-	for backup slaves is on the broadcast ARP request sent out via the
-	active slave.  It is possible that some switch or network
-	configurations may result in situations wherein the backup slaves
+	for backup ports is on the broadcast ARP request sent out via the
+	active port.  It is possible that some switch or network
+	configurations may result in situations wherein the backup ports
 	do not receive the ARP requests; in such a situation, validation
-	of backup slaves must be disabled.
+	of backup ports must be disabled.
 
-	The validation of ARP requests on backup slaves is mainly helping
-	bonding to decide which slaves are more likely to work in case of
-	the active slave failure, it doesn't really guarantee that the
-	backup slave will work if it's selected as the next active slave.
+	The validation of ARP requests on backup ports is mainly helping
+	bonding to decide which ports are more likely to work in case of
+	the active port failure, it doesn't really guarantee that the
+	backup port will work if it's selected as the next active port.
 
 	Validation is useful in network configurations in which multiple
 	bonding hosts are concurrently issuing ARPs to one or more targets
@@ -387,11 +398,11 @@ arp_validate
 	Enabling filtering causes the ARP monitor to only use incoming ARP
 	packets for link availability purposes.  Arriving packets that are
 	not ARPs are delivered normally, but do not count when determining
-	if a slave is available.
+	if a port is available.
 
 	Filtering operates by only considering the reception of ARP
 	packets (any ARP packet, regardless of source or destination) when
-	determining if a slave has received traffic for link availability
+	determining if a port has received traffic for link availability
 	purposes.
 
 	Filtering is useful in network configurations in which significant
@@ -405,26 +416,26 @@ arp_validate
 arp_all_targets
 
 	Specifies the quantity of arp_ip_targets that must be reachable
-	in order for the ARP monitor to consider a slave as being up.
-	This option affects only active-backup mode for slaves with
+	in order for the ARP monitor to consider a port as being up.
+	This option affects only active-backup mode for ports with
 	arp_validation enabled.
 
 	Possible values are:
 
 	any or 0
 
-		consider the slave up only when any of the arp_ip_targets
+		consider the port up only when any of the arp_ip_targets
 		is reachable
 
 	all or 1
 
-		consider the slave up only when all of the arp_ip_targets
+		consider the port up only when all of the arp_ip_targets
 		are reachable
 
 downdelay
 
 	Specifies the time, in milliseconds, to wait before disabling
-	a slave after a link failure has been detected.  This option
+	a port after a link failure has been detected.  This option
 	is only valid for the miimon link monitor.  The downdelay
 	value should be a multiple of the miimon value; if not, it
 	will be rounded down to the nearest multiple.  The default
@@ -432,8 +443,8 @@ downdelay
 
 fail_over_mac
 
-	Specifies whether active-backup mode should set all slaves to
-	the same MAC address at enslavement (the traditional
+	Specifies whether active-backup mode should set all ports to
+	the same MAC address at connection (the traditional
 	behavior), or, when enabled, perform special handling of the
 	bond's MAC address in accordance with the selected policy.
 
@@ -442,16 +453,16 @@ fail_over_mac
 	none or 0
 
 		This setting disables fail_over_mac, and causes
-		bonding to set all slaves of an active-backup bond to
-		the same MAC address at enslavement time.  This is the
+		bonding to set all ports of an active-backup bond to
+		the same MAC address at connection time.  This is the
 		default.
 
 	active or 1
 
 		The "active" fail_over_mac policy indicates that the
 		MAC address of the bond should always be the MAC
-		address of the currently active slave.  The MAC
-		address of the slaves is not changed; instead, the MAC
+		address of the currently active port.  The MAC
+		address of the ports is not changed; instead, the MAC
 		address of the bond changes during a failover.
 
 		This policy is useful for devices that cannot ever
@@ -478,12 +489,12 @@ fail_over_mac
 
 		The "follow" fail_over_mac policy causes the MAC
 		address of the bond to be selected normally (normally
-		the MAC address of the first slave added to the bond).
-		However, the second and subsequent slaves are not set
+		the MAC address of the first port added to the bond).
+		However, the second and subsequent ports are not set
 		to this MAC address while they are in a backup role; a
-		slave is programmed with the bond's MAC address at
-		failover time (and the formerly active slave receives
-		the newly active slave's MAC address).
+		port is programmed with the bond's MAC address at
+		failover time (and the formerly active port receives
+		the newly active port's MAC address).
 
 		This policy is useful for multiport devices that
 		either become confused or incur a performance penalty
@@ -491,11 +502,11 @@ fail_over_mac
 		address.
 
 
-	The default policy is none, unless the first slave cannot
+	The default policy is none, unless the first port cannot
 	change its MAC address, in which case the active policy is
 	selected by default.
 
-	This option may be modified via sysfs only when no slaves are
+	This option may be modified via sysfs only when no ports are
 	present in the bond.
 
 	This option was added in bonding version 3.2.0.  The "follow"
@@ -526,7 +537,7 @@ max_bonds
 miimon
 
 	Specifies the MII link monitoring frequency in milliseconds.
-	This determines how often the link state of each slave is
+	This determines how often the link state of each port is
 	inspected for link failures.  A value of zero disables MII
 	link monitoring.  A value of 100 is a good starting point.
 	The use_carrier option, below, affects how the link state is
@@ -558,22 +569,22 @@ mode
 	balance-rr or 0
 
 		Round-robin policy: Transmit packets in sequential
-		order from the first available slave through the
+		order from the first available port through the
 		last.  This mode provides load balancing and fault
 		tolerance.
 
 	active-backup or 1
 
-		Active-backup policy: Only one slave in the bond is
-		active.  A different slave becomes active if, and only
-		if, the active slave fails.  The bond's MAC address is
+		Active-backup policy: Only one port in the bond is
+		active.  A different port becomes active if, and only
+		if, the active port fails.  The bond's MAC address is
 		externally visible on only one port (network adapter)
 		to avoid confusing the switch.
 
 		In bonding version 2.6.2 or later, when a failover
 		occurs in active-backup mode, bonding will issue one
-		or more gratuitous ARPs on the newly active slave.
-		One gratuitous ARP is issued for the bonding master
+		or more gratuitous ARPs on the newly active port.
+		One gratuitous ARP is issued for the bonding device
 		interface and each VLAN interfaces configured above
 		it, provided that the interface has at least one IP
 		address configured.  Gratuitous ARPs issued for VLAN
@@ -588,7 +599,7 @@ mode
 		XOR policy: Transmit based on the selected transmit
 		hash policy.  The default policy is a simple [(source
 		MAC address XOR'd with destination MAC address XOR
-		packet type ID) modulo slave count].  Alternate transmit
+		packet type ID) modulo port count].  Alternate transmit
 		policies may be	selected via the xmit_hash_policy option,
 		described below.
 
@@ -596,17 +607,17 @@ mode
 
 	broadcast or 3
 
-		Broadcast policy: transmits everything on all slave
+		Broadcast policy: transmits everything on all port
 		interfaces.  This mode provides fault tolerance.
 
 	802.3ad or 4
 
 		IEEE 802.3ad Dynamic link aggregation.  Creates
 		aggregation groups that share the same speed and
-		duplex settings.  Utilizes all slaves in the active
+		duplex settings.  Utilizes all ports in the active
 		aggregator according to the 802.3ad specification.
 
-		Slave selection for outgoing traffic is done according
+		Port selection for outgoing traffic is done according
 		to the transmit hash policy, which may be changed from
 		the default simple XOR policy via the xmit_hash_policy
 		option, documented below.  Note that not all transmit
@@ -619,7 +630,7 @@ mode
 		Prerequisites:
 
 		1. Ethtool support in the base drivers for retrieving
-		the speed and duplex of each slave.
+		the speed and duplex of each port.
 
 		2. A switch that supports IEEE 802.3ad Dynamic link
 		aggregation.
@@ -634,20 +645,20 @@ mode
 
 		In tlb_dynamic_lb=1 mode; the outgoing traffic is
 		distributed according to the current load (computed
-		relative to the speed) on each slave.
+		relative to the speed) on each port.
 
 		In tlb_dynamic_lb=0 mode; the load balancing based on
 		current load is disabled and the load is distributed
 		only using the hash distribution.
 
-		Incoming traffic is received by the current slave.
-		If the receiving slave fails, another slave takes over
-		the MAC address of the failed receiving slave.
+		Incoming traffic is received by the current port.
+		If the receiving port fails, another port takes over
+		the MAC address of the failed receiving port.
 
 		Prerequisite:
 
 		Ethtool support in the base drivers for retrieving the
-		speed of each slave.
+		speed of each port.
 
 	balance-alb or 6
 
@@ -658,7 +669,7 @@ mode
 		The bonding driver intercepts the ARP Replies sent by
 		the local system on their way out and overwrites the
 		source hardware address with the unique hardware
-		address of one of the slaves in the bond such that
+		address of one of the ports in the bond such that
 		different peers use different hardware addresses for
 		the server.
 
@@ -668,24 +679,24 @@ mode
 		IP information from the ARP packet.  When the ARP
 		Reply arrives from the peer, its hardware address is
 		retrieved and the bonding driver initiates an ARP
-		reply to this peer assigning it to one of the slaves
+		reply to this peer assigning it to one of the ports
 		in the bond.  A problematic outcome of using ARP
 		negotiation for balancing is that each time that an
 		ARP request is broadcast it uses the hardware address
 		of the bond.  Hence, peers learn the hardware address
 		of the bond and the balancing of receive traffic
-		collapses to the current slave.  This is handled by
+		collapses to the current port.  This is handled by
 		sending updates (ARP Replies) to all the peers with
 		their individually assigned hardware address such that
 		the traffic is redistributed.  Receive traffic is also
-		redistributed when a new slave is added to the bond
-		and when an inactive slave is re-activated.  The
+		redistributed when a new port is added to the bond
+		and when an inactive port is re-activated.  The
 		receive load is distributed sequentially (round robin)
-		among the group of highest speed slaves in the bond.
+		among the group of highest speed ports in the bond.
 
-		When a link is reconnected or a new slave joins the
+		When a link is reconnected or a new port joins the
 		bond the receive traffic is redistributed among all
-		active slaves in the bond by initiating ARP Replies
+		active ports in the bond by initiating ARP Replies
 		with the selected MAC address to each of the
 		clients. The updelay parameter (detailed below) must
 		be set to a value equal or greater than the switch's
@@ -695,16 +706,16 @@ mode
 		Prerequisites:
 
 		1. Ethtool support in the base drivers for retrieving
-		the speed of each slave.
+		the speed of each port.
 
 		2. Base driver support for setting the hardware
 		address of a device while it is open.  This is
-		required so that there will always be one slave in the
+		required so that there will always be one port in the
 		team using the bond hardware address (the
-		curr_active_slave) while having a unique hardware
-		address for each slave in the bond.  If the
-		curr_active_slave fails its hardware address is
-		swapped with the new curr_active_slave that was
+		curr_active_port) while having a unique hardware
+		address for each port in the bond.  If the
+		curr_active_port fails its hardware address is
+		swapped with the new curr_active_port that was
 		chosen.
 
 num_grat_arp,
@@ -712,7 +723,7 @@ num_unsol_na
 
 	Specify the number of peer notifications (gratuitous ARPs and
 	unsolicited IPv6 Neighbor Advertisements) to be issued after a
-	failover event.  As soon as the link is up on the new slave
+	failover event.  As soon as the link is up on the new port
 	(possibly immediately) a peer notification is sent on the
 	bonding device and each VLAN sub-device. This is repeated at
 	the rate specified by peer_notif_delay if the number is
@@ -726,10 +737,11 @@ num_unsol_na
 	are generated by the ipv4 and ipv6 code and the numbers of
 	repetitions cannot be set independently.
 
-packets_per_slave
+packets_per_port
+packets_per_slave (DEPRECATED)
 
-	Specify the number of packets to transmit through a slave before
-	moving to the next one. When set to 0 then a slave is chosen at
+	Specify the number of packets to transmit through a port before
+	moving to the next one. When set to 0 then a port is chosen at
 	random.
 
 	The valid range is 0 - 65535; the default value is 1. This option
@@ -747,11 +759,11 @@ peer_notif_delay
 
 primary
 
-	A string (eth0, eth2, etc) specifying which slave is the
+	A string (eth0, eth2, etc) specifying which port is the
 	primary device.  The specified device will always be the
-	active slave while it is available.  Only when the primary is
+	active port while it is available.  Only when the primary is
 	off-line will alternate devices be used.  This is useful when
-	one slave is preferred over another, e.g., when one slave has
+	one port is preferred over another, e.g., when one port has
 	higher throughput than another.
 
 	The primary option is only valid for active-backup(1),
@@ -759,41 +771,41 @@ primary
 
 primary_reselect
 
-	Specifies the reselection policy for the primary slave.  This
-	affects how the primary slave is chosen to become the active slave
-	when failure of the active slave or recovery of the primary slave
+	Specifies the reselection policy for the primary port.  This
+	affects how the primary port is chosen to become the active port
+	when failure of the active port or recovery of the primary port
 	occurs.  This option is designed to prevent flip-flopping between
-	the primary slave and other slaves.  Possible values are:
+	the primary port and other ports.  Possible values are:
 
 	always or 0 (default)
 
-		The primary slave becomes the active slave whenever it
+		The primary port becomes the active port whenever it
 		comes back up.
 
 	better or 1
 
-		The primary slave becomes the active slave when it comes
-		back up, if the speed and duplex of the primary slave is
+		The primary port becomes the active port when it comes
+		back up, if the speed and duplex of the primary port is
 		better than the speed and duplex of the current active
-		slave.
+		port.
 
 	failure or 2
 
-		The primary slave becomes the active slave only if the
-		current active slave fails and the primary slave is up.
+		The primary port becomes the active port only if the
+		current active port fails and the primary port is up.
 
 	The primary_reselect setting is ignored in two cases:
 
-		If no slaves are active, the first slave to recover is
-		made the active slave.
+		If no ports are active, the first port to recover is
+		made the active port.
 
-		When initially enslaved, the primary slave is always made
-		the active slave.
+		When initially connected, the primary port is always made
+		the active port.
 
 	Changing the primary_reselect policy via sysfs will cause an
-	immediate selection of the best active slave according to the new
+	immediate selection of the best active port according to the new
 	policy.  This may or may not result in a change of the active
-	slave, depending upon the circumstances.
+	port, depending upon the circumstances.
 
 	This option was added for bonding version 3.6.0.
 
@@ -803,7 +815,7 @@ tlb_dynamic_lb
 	mode. The value has no effect on any other modes.
 
 	The default behavior of tlb mode is to shuffle active flows across
-	slaves based on the load in that interval. This gives nice lb
+	ports based on the load in that interval. This gives nice lb
 	characteristics but can cause packet reordering. If re-ordering is
 	a concern use this variable to disable flow shuffling and rely on
 	load balancing provided solely by the hash distribution.
@@ -822,7 +834,7 @@ tlb_dynamic_lb
 updelay
 
 	Specifies the time, in milliseconds, to wait before enabling a
-	slave after a link recovery has been detected.  This option is
+	port after a link recovery has been detected.  This option is
 	only valid for the miimon link monitor.  The updelay value
 	should be a multiple of the miimon value; if not, it will be
 	rounded down to the nearest multiple.  The default value is 0.
@@ -851,7 +863,7 @@ use_carrier
 
 xmit_hash_policy
 
-	Selects the transmit hash policy to use for slave selection in
+	Selects the transmit hash policy to use for port selection in
 	balance-xor, 802.3ad, and tlb modes.  Possible values are:
 
 	layer2
@@ -860,10 +872,10 @@ xmit_hash_policy
 		field to generate the hash. The formula is
 
 		hash = source MAC XOR destination MAC XOR packet type ID
-		slave number = hash modulo slave count
+		port number = hash modulo port count
 
 		This algorithm will place all traffic to a particular
-		network peer on the same slave.
+		network peer on the same port.
 
 		This algorithm is 802.3ad compliant.
 
@@ -879,13 +891,13 @@ xmit_hash_policy
 		hash = hash XOR source IP XOR destination IP
 		hash = hash XOR (hash RSHIFT 16)
 		hash = hash XOR (hash RSHIFT 8)
-		And then hash is reduced modulo slave count.
+		And then hash is reduced modulo port count.
 
 		If the protocol is IPv6 then the source and destination
 		addresses are first hashed using ipv6_addr_hash.
 
 		This algorithm will place all traffic to a particular
-		network peer on the same slave.  For non-IP traffic,
+		network peer on the same port.  For non-IP traffic,
 		the formula is the same as for the layer2 transmit
 		hash policy.
 
@@ -901,8 +913,8 @@ xmit_hash_policy
 		This policy uses upper layer protocol information,
 		when available, to generate the hash.  This allows for
 		traffic to a particular network peer to span multiple
-		slaves, although a single connection will not span
-		multiple slaves.
+		ports, although a single connection will not span
+		multiple ports.
 
 		The formula for unfragmented TCP and UDP packets is
 
@@ -910,7 +922,7 @@ xmit_hash_policy
 		hash = hash XOR source IP XOR destination IP
 		hash = hash XOR (hash RSHIFT 16)
 		hash = hash XOR (hash RSHIFT 8)
-		And then hash is reduced modulo slave count.
+		And then hash is reduced modulo port count.
 
 		If the protocol is IPv6 then the source and destination
 		addresses are first hashed using ipv6_addr_hash.
@@ -968,16 +980,16 @@ resend_igmp
 
 	This option is useful for bonding modes balance-rr (0), active-backup
 	(1), balance-tlb (5) and balance-alb (6), in which a failover can
-	switch the IGMP traffic from one slave to another.  Therefore a fresh
+	switch the IGMP traffic from one port to another.  Therefore a fresh
 	IGMP report must be issued to cause the switch to forward the incoming
-	IGMP traffic over the newly selected slave.
+	IGMP traffic over the newly selected port.
 
 	This option was added for bonding version 3.7.0.
 
 lp_interval
 
 	Specifies the number of seconds between instances where the bonding
-	driver sends learning packets to each slaves peer switch.
+	driver sends learning packets to each ports peer switch.
 
 	The valid range is 1 - 0x7fffffff; the default value is 1. This Option
 	has effect only in balance-tlb and balance-alb modes.
@@ -986,11 +998,11 @@ lp_interval
 ==============================
 
 You can configure bonding using either your distro's network
-initialization scripts, or manually using either iproute2 or the
-sysfs interface.  Distros generally use one of three packages for the
-network initialization scripts: initscripts, sysconfig or interfaces.
-Recent versions of these packages have support for bonding, while older
-versions do not.
+initialization scripts, or manually using either iproute2, NetworkManager,
+or the sysfs interface.  Distros generally use one of four packages for
+the network initialization scripts: initscripts, sysconfig, interfaces, or
+NetworkManager. Any remotely modern version of these packages should have
+support for bonding, but very old versions may not.
 
 We will first describe the options for configuring bonding for
 distros using versions of initscripts, sysconfig and interfaces with full
@@ -1004,15 +1016,18 @@ Determining this is fairly straightforward.
 
 First, look for a file called interfaces in /etc/network directory.
 If this file is present in your system, then your system use interfaces. See
-Configuration with Interfaces Support.
+Configuration with Interfaces Support. Many modern distros now use
+NetworkManager, for which you should find the directory /etc/NetworkManager
+on your system, the NetworkManager GUI, and nmcli for command-line based
+configuration of network components, including bonds.
 
 Else, issue the command::
 
 	$ rpm -qf /sbin/ifup
 
 It will respond with a line of text starting with either
-"initscripts" or "sysconfig," followed by some numbers.  This is the
-package that provides your network initialization scripts.
+"initscripts", "sysconfig" or "NetworkManager", followed by some numbers.
+This is the package that provides your network initialization scripts.
 
 Next, to determine if your installation supports bonding,
 issue the command::
@@ -1020,7 +1035,14 @@ issue the command::
     $ grep ifenslave /sbin/ifup
 
 If this returns any matches, then your initscripts or
-sysconfig has support for bonding.
+sysconfig has support for bonding. Note however, that ifenslave has been
+deprecated for quite some time, any many distributions no longer use it
+as a primary means of configuring bonds. In some cases, ifup is simply a
+wrapper script that calls NetworkManager's nmcli, which has had support
+for bonding since it's earliest days being deployed as a distribution
+default network management infrastructure.
+
+Note: classic ifenslave binaries are considered deprecated.
 
 3.1 Configuration with Sysconfig Support
 ----------------------------------------
@@ -1034,9 +1056,9 @@ front end does not provide any means to work with bonding devices.
 Bonding devices can be managed by hand, however, as follows.
 
 First, if they have not already been configured, configure the
-slave devices.  On SLES 9, this is most easily done by running the
+port devices.  On SLES 9, this is most easily done by running the
 yast2 sysconfig configuration utility.  The goal is for to create an
-ifcfg-id file for each slave device.  The simplest way to accomplish
+ifcfg-id file for each port device.  The simplest way to accomplish
 this is to configure the devices for DHCP (this is only to get the
 file ifcfg-id file created; see below for some issues with DHCP).  The
 name of the configuration file for each device will be of the form::
@@ -1047,8 +1069,8 @@ Where the "xx" portion will be replaced with the digits from
 the device's permanent MAC address.
 
 Once the set of ifcfg-id-xx:xx:xx:xx:xx:xx files has been
-created, it is necessary to edit the configuration files for the slave
-devices (the MAC addresses correspond to those of the slave devices).
+created, it is necessary to edit the configuration files for the port
+devices (the MAC addresses correspond to those of the port devices).
 Before editing, the file will contain multiple lines, and will look
 something like this::
 
@@ -1111,7 +1133,7 @@ The possible values are:
 	======== ======================================================
 
 The line BONDING_MASTER='yes' indicates that the device is a
-bonding master device.  The only useful value is "yes."
+bonding aggregator device.  The only useful value is "yes."
 
 The contents of BONDING_MODULE_OPTS are supplied to the
 instance of the bonding module for this device.  Specify the options
@@ -1119,9 +1141,9 @@ for the bonding mode, link monitoring, and so on here.  Do not include
 the max_bonds bonding parameter; this will confuse the configuration
 system if you have multiple bonding devices.
 
-Finally, supply one BONDING_SLAVEn="slave device" for each
-slave.  where "n" is an increasing value, one for each slave.  The
-"slave device" is either an interface name, e.g., "eth0", or a device
+Finally, supply one BONDING_SLAVEn="port device" for each
+port.  where "n" is an increasing value, one for each port.  The
+"port device" is either an interface name, e.g., "eth0", or a device
 specifier for the network device.  The interface name is easier to
 find, but the ethN names are subject to change at boot time if, e.g.,
 a device early in the sequence has failed.  The device specifiers
@@ -1129,7 +1151,7 @@ a device early in the sequence has failed.  The device specifiers
 network device, and will not change unless the device's bus location
 changes (for example, it is moved from one PCI slot to another).  The
 example above uses one of each type for demonstration purposes; most
-configurations will choose one or the other for all slave devices.
+configurations will choose one or the other for all port devices.
 
 When all configuration files have been modified or created,
 networking must be restarted for the configuration changes to take
@@ -1162,7 +1184,7 @@ Under sysconfig, configuring a device with BOOTPROTO='dhcp'
 will cause it to query DHCP for its IP address information.  At this
 writing, this does not function for bonding devices; the scripts
 attempt to obtain the device address from DHCP prior to adding any of
-the slave devices.  Without active slaves, the DHCP requests are not
+the port devices.  Without active ports, the DHCP requests are not
 sent to the network.
 
 3.1.2 Configuring Multiple Bonds with Sysconfig
@@ -1237,6 +1259,14 @@ place the following text::
 Be sure to change the networking specific lines (IPADDR,
 NETMASK, NETWORK and BROADCAST) to match your network configuration.
 
+Note that recent Red Hat and Fedora releases (at least Red Hat Enterprise
+Linux 8 and Fedora 30 or newer) prefer NetworkManager over the network
+initscripts, but the two can coexist on a system. By default, NetworkManager
+will try to handle all ifcfg-* files, including bonding ones, unless the
+following line is added to tell classis initscripts to handle them::
+
+        NM_CONTROLLED=no
+
 For later versions of initscripts, such as that found with Fedora
 7 (or later) and Red Hat Enterprise Linux version 5 (or later), it is possible,
 and, indeed, preferable, to specify the bonding options in the ifcfg-bond0
@@ -1319,11 +1349,11 @@ devices (presumed to be eth0 and eth1), and have it persist across
 reboots, edit the appropriate file (/etc/init.d/boot.local or
 /etc/rc.d/rc.local), and add the following::
 
-	modprobe bonding mode=balance-alb miimon=100
-	modprobe e100
-	ifconfig bond0 192.168.1.1 netmask 255.255.255.0 up
-	ip link set eth0 master bond0
-	ip link set eth1 master bond0
+	# modprobe bonding mode=balance-alb miimon=100
+	# modprobe e100
+	# ifconfig bond0 192.168.1.1 netmask 255.255.255.0 up
+	# ip link set eth0 master bond0
+	# ip link set eth1 master bond0
 
 Replace the example bonding module parameters and bond0
 network configuration (IP address, netmask, etc) with the appropriate
@@ -1416,8 +1446,85 @@ RHEL 4 as well.  On kernels exhibiting this problem, it will be impossible
 to configure multiple bonds with differing parameters (as they are older
 kernels, and also lack sysfs support).
 
-3.4 Configuring Bonding Manually via Sysfs
-------------------------------------------
+3.4 Configuring Bonding Manually via iproute2
+---------------------------------------------
+
+The iproute2 utility can manage bonding devices over the bonding driver's
+netlink interface. This is the officially endorsed and current method via
+which any bonding device interactions from userspace should be done. The
+iproute2 v4.x and later are known to fully support bonding.
+
+This interface allows dynamic configuration of all bonds in the system
+without unloading the module.  It also allows for adding and removing
+bonds at runtime. The ifenslave utility is no longer relevant, though it
+may still exist in some distributions as a wrapper script simply calling
+various "ip link ..." invocations underneath.
+
+Use of the netlink/iproute2 interface allows you to use multiple bonds
+with different configurations without having to reload the module. It also
+allows you to use multiple, differently configured bonds when bonding
+is compiled into the kernel.
+
+Creating and Destroying Bonds
+-----------------------------
+To add a new bond foo::
+
+	# ip link add foo type bond
+
+To remove an existing bond bar::
+
+	# ip link del bar
+
+To show all existing bonds::
+
+	# ip link show type bond
+
+Adding and Removing Ports
+-------------------------
+Bond component port interfaces must be in a down state to be added to a
+bond.
+
+To connect interface eth0 to bond bond0::
+
+	# ip link set eth0 down
+	# ip link set eth0 master bond0
+
+To free port eth0 from bond bond0::
+
+	# ip link set eth0 nomaster
+
+Once ports are added to the bond, bring it up::
+
+	# ip link set bond0 up
+
+When an interface eth1 is connected to a bond, among its flags in "ip link
+show" output::
+
+	# ip link show eth1
+	3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
+	    link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff
+
+...we see SLAVE, indicating this interface is part of another aggregate
+device (also present for team and brige ports), and we see 'master bond0',
+which lets us know that it's part of the device named bond0, which is
+presumably, a bonding device. We can confirm this by looking for bond0
+in the output of::
+
+	# ip link show type bond
+
+All current components of bond0 can quickly be identified by::
+
+	# ip link show master bond0
+
+Further iproute2 enhancements may be in order to give a more detailed
+overview of bonds in the system, similar to /proc/net/bonding/<bond>.
+
+
+3.5 Configuring Bonding Manually via Sysfs (DEPRECATED)
+-------------------------------------------------------
+
+The bonding sysfs interface is deprecated, all users are urged to use
+iproute2 which manages bonds via netlink.
 
 Starting with version 3.0.0, Channel Bonding may be configured
 via the sysfs interface.  This interface allows dynamic configuration
@@ -1444,7 +1551,7 @@ To add a new bond foo::
 
 To remove an existing bond bar::
 
-	# echo -bar > /sys/class/net/bonding_masters
+	# echo -bar > /sys/class/net/bonding_master
 
 To show all existing bonds::
 
@@ -1456,30 +1563,30 @@ To show all existing bonds::
    truncated if you have more than a few hundred bonds.  This is unlikely
    to occur under normal operating conditions.
 
-Adding and Removing Slaves
---------------------------
-Interfaces may be enslaved to a bond using the file
+Adding and Removing Ports
+-------------------------
+Interfaces may be connected to a bond using the file
 /sys/class/net/<bond>/bonding/slaves.  The semantics for this file
 are the same as for the bonding_masters file.
 
-To enslave interface eth0 to bond bond0::
+To connect interface eth0 to bond bond0::
 
 	# ifconfig bond0 up
 	# echo +eth0 > /sys/class/net/bond0/bonding/slaves
 
-To free slave eth0 from bond bond0::
+To free port eth0 from bond bond0::
 
 	# echo -eth0 > /sys/class/net/bond0/bonding/slaves
 
-When an interface is enslaved to a bond, symlinks between the
+When an interface is connected to a bond, symlinks between the
 two are created in the sysfs filesystem.  In this case, you would get
-/sys/class/net/bond0/slave_eth0 pointing to /sys/class/net/eth0, and
+/sys/class/net/bond0/lower_eth0 pointing to /sys/class/net/eth0, and
 /sys/class/net/eth0/master pointing to /sys/class/net/bond0.
 
 This means that you can tell quickly whether or not an
-interface is enslaved by looking for the master symlink.  Thus:
+interface is connected by looking for the master symlink.  Thus:
 # echo -eth0 > /sys/class/net/eth0/master/bonding/slaves
-will free eth0 from whatever bond it is enslaved to, regardless of
+will free eth0 from whatever bond it is connected to, regardless of
 the name of the bond interface.
 
 Changing a Bond's Configuration
@@ -1536,7 +1643,7 @@ To configure the interval between learning packet transmits::
 .. note::
 
    the lp_interval is the number of seconds between instances where
-   the bonding driver sends learning packets to each slaves peer switch.  The
+   the bonding driver sends learning packets to each port's peer switch.  The
    default interval is 1 second.
 
 Example Configuration
@@ -1570,7 +1677,7 @@ your init script::
 	echo +eth2 > /sys/class/net/bond1/bonding/slaves
 	echo +eth3 > /sys/class/net/bond1/bonding/slaves
 
-3.5 Configuration with Interfaces Support
+3.6 Configuration with Interfaces Support
 -----------------------------------------
 
 This section applies to distros which use /etc/network/interfaces file
@@ -1589,7 +1696,7 @@ Example Configurations
 ----------------------
 
 In /etc/network/interfaces, the following stanza will configure bond0, in
-active-backup mode, with eth0 and eth1 as slaves::
+active-backup mode, with eth0 and eth1 as ports::
 
 	auto bond0
 	iface bond0 inet dhcp
@@ -1623,7 +1730,7 @@ For a full list of ``bond-*`` supported options in /etc/network/interfaces and
 some more advanced examples tailored to you particular distros, see the files in
 /usr/share/doc/ifenslave-2.6.
 
-3.6 Overriding Configuration for Special Cases
+3.7 Overriding Configuration for Special Cases
 ----------------------------------------------
 
 When using the bonding driver, the physical port which transmits a frame is
@@ -1645,7 +1752,7 @@ tx_queues can be used to change this value.  There is no sysfs parameter
 available as the allocation is done at module init time.
 
 The output of the file /proc/net/bonding/bondX has changed so the output Queue
-ID is now printed for each slave::
+ID is now printed for each slave port::
 
 	Bonding Mode: fault-tolerance (active-backup)
 	Primary Slave: None
@@ -1667,18 +1774,20 @@ ID is now printed for each slave::
 	Permanent HW addr: 00:1a:a0:12:8f:cc
 	Slave queue ID: 2
 
-The queue_id for a slave can be set using the command::
+Note: the procfs interface is considered deprecated.
+
+The queue_id for a port can be set using the command::
 
 	# echo "eth1:2" > /sys/class/net/bond0/bonding/queue_id
 
 Any interface that needs a queue_id set should set it with multiple calls
 like the one above until proper priorities are set for all interfaces.  On
 distributions that allow configuration via initscripts, multiple 'queue_id'
-arguments can be added to BONDING_OPTS to set all needed slave queues.
+arguments can be added to BONDING_OPTS to set all needed port queues.
 
 These queue id's can be used in conjunction with the tc utility to configure
 a multiqueue qdisc and filters to bias certain traffic to transmit on certain
-slave devices.  For instance, say we wanted, in the above configuration to
+port devices.  For instance, say we wanted, in the above configuration to
 force all traffic bound to 192.168.1.100 to use eth1 in the bond as its output
 device. The following commands would accomplish this::
 
@@ -1695,16 +1804,16 @@ selection policy to be overridden, selecting instead qid 2, which maps to eth1.
 
 Note that qid values begin at 1.  Qid 0 is reserved to initiate to the driver
 that normal output policy selection should take place.  One benefit to simply
-leaving the qid for a slave to 0 is the multiqueue awareness in the bonding
+leaving the qid for a port to 0 is the multiqueue awareness in the bonding
 driver that is now present.  This awareness allows tc filters to be placed on
-slave devices as well as bond devices and the bonding driver will simply act as
-a pass-through for selecting output queues on the slave device rather than
+port devices as well as bond devices and the bonding driver will simply act as
+a pass-through for selecting output queues on the port device rather than
 output port selection.
 
 This feature first appeared in bonding driver version 3.7.0 and support for
-output slave selection was limited to round-robin and active-backup modes.
+output port selection was limited to round-robin and active-backup modes.
 
-3.7 Configuring LACP for 802.3ad mode in a more secure way
+3.8 Configuring LACP for 802.3ad mode in a more secure way
 ----------------------------------------------------------
 
 When using 802.3ad bonding mode, the Actor (host) and Partner (switch)
@@ -1759,7 +1868,8 @@ few bonding parameters:
 
 Each bonding device has a read-only file residing in the
 /proc/net/bonding directory.  The file contents include information
-about the bonding configuration, options and state of each slave.
+about the bonding configuration, options and state of each port.
+However, note that the procfs interface is considered deprecated.
 
 For example, the contents of /proc/net/bonding/bond0 after the
 driver is loaded with parameters of mode=0 and miimon=1000 is
@@ -1788,14 +1898,14 @@ bonding configuration, state, and version of the bonding driver.
 -------------------------
 
 The network configuration can be inspected using the ifconfig
-command.  Bonding devices will have the MASTER flag set; Bonding slave
+command.  Bonding devices will have the MASTER flag set; Bonding port
 devices will have the SLAVE flag set.  The ifconfig output does not
-contain information on which slaves are associated with which masters.
+contain information on which ports are associated with which bonds.
 
-In the example below, the bond0 interface is the master
-(MASTER) while eth0 and eth1 are slaves (SLAVE). Notice all slaves of
+In the example below, the bond0 interface is the bond device
+(MASTER) while eth0 and eth1 are ports (SLAVE). Notice all ports of
 bond0 have the same MAC address (HWaddr) as bond0 for all modes except
-TLB and ALB that require a unique MAC address for each slave::
+TLB and ALB that require a unique MAC address for each port::
 
   # /sbin/ifconfig
   bond0     Link encap:Ethernet  HWaddr 00:C0:F0:1F:37:B4
@@ -1868,29 +1978,29 @@ For reasons of simplicity, and to support the use of adapters
 that can do VLAN hardware acceleration offloading, the bonding
 interface declares itself as fully hardware offloading capable, it gets
 the add_vid/kill_vid notifications to gather the necessary
-information, and it propagates those actions to the slaves.  In case
+information, and it propagates those actions to the ports.  In case
 of mixed adapter types, hardware accelerated tagged packets that
 should go through an adapter that is not offloading capable are
 "un-accelerated" by the bonding driver so the VLAN tag sits in the
 regular location.
 
 VLAN interfaces *must* be added on top of a bonding interface
-only after enslaving at least one slave.  The bonding interface has a
-hardware address of 00:00:00:00:00:00 until the first slave is added.
-If the VLAN interface is created prior to the first enslavement, it
-would pick up the all-zeroes hardware address.  Once the first slave
+only after enslaving at least one port.  The bonding interface has a
+hardware address of 00:00:00:00:00:00 until the first port is added.
+If the VLAN interface is created prior to the first port binding, it
+would pick up the all-zeroes hardware address.  Once the first port
 is attached to the bond, the bond device itself will pick up the
-slave's hardware address, which is then available for the VLAN device.
+port's hardware address, which is then available for the VLAN device.
 
-Also, be aware that a similar problem can occur if all slaves
+Also, be aware that a similar problem can occur if all ports
 are released from a bond that still has one or more VLAN interfaces on
-top of it.  When a new slave is added, the bonding interface will
-obtain its hardware address from the first slave, which might not
+top of it.  When a new port is added, the bonding interface will
+obtain its hardware address from the first port, which might not
 match the hardware address of the VLAN interfaces (which was
-ultimately copied from an earlier slave).
+ultimately copied from an earlier port).
 
 There are two methods to insure that the VLAN device operates
-with the correct hardware address if all slaves are removed from a
+with the correct hardware address if all ports are removed from a
 bond interface:
 
 1. Remove all VLAN interfaces then recreate them
@@ -1907,7 +2017,7 @@ mode, which might not be what you want.
 ==================
 
 The bonding driver at present supports two schemes for
-monitoring a slave device's link state: the ARP monitor and the MII
+monitoring a port device's link state: the ARP monitor and the MII
 monitor.
 
 At the present time, due to implementation restrictions in the
@@ -1927,8 +2037,8 @@ The ARP monitor relies on the device driver itself to verify
 that traffic is flowing.  In particular, the driver must keep up to
 date the last receive time, dev->last_rx.  Drivers that use NETIF_F_LLTX
 flag must also update netdev_queue->trans_start.  If they do not, then the
-ARP monitor will immediately fail any slaves using that driver, and
-those slaves will stay down.  If networking monitoring (tcpdump, etc)
+ARP monitor will immediately fail any ports using that driver, and
+those ports will stay down.  If networking monitoring (tcpdump, etc)
 shows the ARP requests and replies on the network, then it may be that
 your device driver is not updating last_rx and trans_start.
 
@@ -1987,10 +2097,10 @@ up.
 8.1 Adventures in Routing
 -------------------------
 
-When bonding is configured, it is important that the slave
-devices not have routes that supersede routes of the master (or,
+When bonding is configured, it is important that the port
+devices not have routes that supersede routes of the bond (or,
 generally, not have routes at all).  For example, suppose the bonding
-device bond0 has two slaves, eth0 and eth1, and the routing table is
+device bond0 has two ports, eth0 and eth1, and the routing table is
 as follows::
 
   Kernel IP routing table
@@ -2013,9 +2123,9 @@ as an unsolicited ARP reply (because ARP matches replies on an
 interface basis), and is discarded.  The MII monitor is not affected
 by the state of the routing table.
 
-The solution here is simply to insure that slaves do not have
+The solution here is simply to insure that ports do not have
 routes of their own, and if for some reason they must, those routes do
-not supersede routes of their master.  This should generally be the
+not supersede routes of their bond.  This should generally be the
 case, but unusual configurations or errant manual or automatic static
 route additions may cause trouble.
 
@@ -2037,12 +2147,12 @@ For example, given a modules.conf containing the following::
 	alias eth2 e1000
 	alias eth3 e1000
 
-If neither eth0 and eth1 are slaves to bond0, then when the
+If neither eth0 and eth1 are ports to bond0, then when the
 bond0 interface comes up, the devices may end up reordered.  This
-happens because bonding is loaded first, then its slave device's
+happens because bonding is loaded first, then its port device's
 drivers are loaded next.  Since no other drivers have been loaded,
 when the e1000 driver loads, it will receive eth0 and eth1 for its
-devices, but the bonding configuration tries to enslave eth2 and eth3
+devices, but the bonding configuration tries to connect eth2 and eth3
 (which may later be assigned to the tg3 devices).
 
 Adding the following::
@@ -2099,7 +2209,7 @@ before any network drivers participating in a bond.  This requirement
 is due to the interface index (ipAdEntIfIndex) being associated to
 the first interface found with a given IP address.  That is, there is
 only one ipAdEntIfIndex for each IP address.  For example, if eth0 and
-eth1 are slaves of bond0 and the driver for eth0 is loaded before the
+eth1 are ports of bond0 and the driver for eth0 is loaded before the
 bonding driver, the interface for the IP address will be associated
 with the eth0 interface.  This configuration is shown below, the IP
 address 192.168.1.1 has an interface index of 2 which indexes to eth0
@@ -2146,25 +2256,25 @@ When running network monitoring tools, e.g., tcpdump, it is
 common to enable promiscuous mode on the device, so that all traffic
 is seen (instead of seeing only traffic destined for the local host).
 The bonding driver handles promiscuous mode changes to the bonding
-master device (e.g., bond0), and propagates the setting to the slave
+bond device (e.g., bond0), and propagates the setting to the port
 devices.
 
 For the balance-rr, balance-xor, broadcast, and 802.3ad modes,
-the promiscuous mode setting is propagated to all slaves.
+the promiscuous mode setting is propagated to all ports.
 
 For the active-backup, balance-tlb and balance-alb modes, the
-promiscuous mode setting is propagated only to the active slave.
+promiscuous mode setting is propagated only to the active port.
 
-For balance-tlb mode, the active slave is the slave currently
+For balance-tlb mode, the active port is the port currently
 receiving inbound traffic.
 
-For balance-alb mode, the active slave is the slave used as a
-"primary."  This slave is used for mode-specific control traffic, for
+For balance-alb mode, the active port is the port used as a
+"primary."  This port is used for mode-specific control traffic, for
 sending to peers that are unassigned or if the load is unbalanced.
 
 For the active-backup, balance-tlb and balance-alb modes, when
-the active slave changes (e.g., due to a link failure), the
-promiscuous setting will be propagated to the new active slave.
+the active port changes (e.g., due to a link failure), the
+promiscuous setting will be propagated to the new active port.
 
 11. Configuring Bonding for High Availability
 =============================================
@@ -2464,7 +2574,7 @@ balance-tlb:
 	special switch configuration is required.  On the down side,
 	in this mode all incoming traffic arrives over a single
 	interface, this mode requires certain ethtool support in the
-	network device driver of the slave interfaces, and the ARP
+	network device driver of the port interfaces, and the ARP
 	monitor is not available.
 
 balance-alb:
@@ -2571,7 +2681,7 @@ help.
 Note that when a bonding interface has no active links, the
 driver will immediately reuse the first link that goes up, even if the
 updelay parameter has been specified (the updelay is ignored in this
-case).  If there are slave interfaces waiting for the updelay timeout
+case).  If there are port interfaces waiting for the updelay timeout
 to expire, the interface that first went into that state will be
 immediately reused.  This reduces down time of the network if the
 value of updelay has been overestimated, and since this occurs only in
@@ -2594,9 +2704,9 @@ It is not uncommon to observe a short burst of duplicated
 traffic when the bonding device is first used, or after it has been
 idle for some period of time.  This is most easily observed by issuing
 a "ping" to some other host on the network, and noticing that the
-output from ping flags duplicates (typically one per slave).
+output from ping flags duplicates (typically one per port).
 
-For example, on a bond in active-backup mode with five slaves
+For example, on a bond in active-backup mode with five ports
 all connected to one switch, the output may appear as follows::
 
 	# ping -n 10.0.4.2
@@ -2618,7 +2728,7 @@ traffic to all ports until its MAC forwarding table is updated.  Since
 the interfaces attached to the bond may occupy multiple ports on a
 single switch, when the switch (temporarily) floods the traffic to all
 ports, the bond device receives multiple copies of the same packet
-(one per slave device).
+(one per port device).
 
 The duplicated packet behavior is switch dependent, some
 switches exhibit this, and some do not.  On switches that display this
@@ -2752,22 +2862,22 @@ Any Ethernet type cards (you can even mix cards - a Intel
 EtherExpress PRO/100 and a 3com 3c905b, for example).  For most modes,
 devices need not be of the same speed.
 
-Starting with version 3.2.1, bonding also supports Infiniband
-slaves in active-backup mode.
+Starting with version 3.2.1, bonding also supports Infiniband ports,
+but only in active-backup mode and with exactly 2 ports per bond.
 
 3.  How many bonding devices can I have?
 ----------------------------------------
 
 There is no limit.
 
-4.  How many slaves can a bonding device have?
+4.  How many ports can a bonding device have?
 ----------------------------------------------
 
 This is limited only by the number of network interfaces Linux
 supports and/or the number of network cards you can place in your
-system.
+system, outside of the Infiniband case.
 
-5.  What happens when a slave link dies?
+5.  What happens when a port link dies?
 ----------------------------------------
 
 If link monitoring is enabled, then the failing device will be
@@ -2819,14 +2929,14 @@ The active-backup mode should work with any Layer-II switch.
 8.  Where does a bonding device get its MAC address from?
 ---------------------------------------------------------
 
-When using slave devices that have fixed MAC addresses, or when
+When using port devices that have fixed MAC addresses, or when
 the fail_over_mac option is enabled, the bonding device's MAC address is
-the MAC address of the active slave.
+the MAC address of the active port.
 
 For other configurations, if not explicitly configured (with
 ifconfig or ip link), the MAC address of the bonding device is taken from
-its first slave device.  This MAC address is then passed to all following
-slaves and remains persistent (even if the first slave is removed) until
+its first port device.  This MAC address is then passed to all following
+ports and remains persistent (even if the first port is removed) until
 the bonding device is brought down or reconfigured.
 
 If you wish to change the MAC address, you can set it with
@@ -2837,19 +2947,23 @@ ifconfig or ip link::
 	# ip link set bond0 address 66:77:88:99:aa:bb
 
 The MAC address can be also changed by bringing down/up the
-device and then changing its slaves (or their order)::
+device and then changing its ports (or their order)::
 
 	# ifconfig bond0 down ; modprobe -r bonding
 	# ifconfig bond0 .... up
 	# ifenslave bond0 eth...
+	-- or --
+	# ip link set bond0 down ; modprobe -r bonding
+	# ip link set bond0 .... up
+	# ip link set eth... master bond0
 
 This method will automatically take the address from the next
-slave that is added.
+port that is added.
 
-To restore your slaves' MAC addresses, you need to detach them
-from the bond (``ifenslave -d bond0 eth0``). The bonding driver will
-then restore the MAC addresses that the slaves had before they were
-enslaved.
+To restore your ports' MAC addresses, you need to detach them
+from the bond (``ifenslave -d bond0 eth0`` or ``ip link set eth0 nomaster``).
+The bonding driver will then restore the MAC addresses that the ports had
+before they were connected.
 
 16. Resources and Links
 =======================
Signature · 1 line
2.27.0
#6 lore raw

Re: [PATCH net-next v3 5/5] bonding: update Documentation for port/bond terminology

Quoted 6 lines · Jarod Wilson

Swap in port/bond terminology where appropriate, leaving all legacy sysfs and procfs interface mentions in place, but marked as deprecated. Additionally, add more netlink/iproute2 documentation, and note that this is the preferred method of interfacing with the bonding driver. While we're at it, also make some mention of NetworkManager's existence.

I neglected to update the ToC and put in some leading #'s that I should have, so there will be at least one more revision of this set, but would appreciate feedback on this version of the Documentation update with respect to preservation of existing interface names, explaining the changes, and deprecation.

Signature · 2 lines
Jarod Wilson
[email protected]