aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_3ad.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bonding/bond_3ad.c')
-rw-r--r--drivers/net/bonding/bond_3ad.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index dcde56057fe1..b667a51ed215 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -768,11 +768,11 @@ static int ad_lacpdu_send(struct port *port)
768 768
769 lacpdu_header = (struct lacpdu_header *)skb_put(skb, length); 769 lacpdu_header = (struct lacpdu_header *)skb_put(skb, length);
770 770
771 memcpy(lacpdu_header->hdr.h_dest, lacpdu_mcast_addr, ETH_ALEN); 771 ether_addr_copy(lacpdu_header->hdr.h_dest, lacpdu_mcast_addr);
772 /* Note: source address is set to be the member's PERMANENT address, 772 /* Note: source address is set to be the member's PERMANENT address,
773 * because we use it to identify loopback lacpdus in receive. 773 * because we use it to identify loopback lacpdus in receive.
774 */ 774 */
775 memcpy(lacpdu_header->hdr.h_source, slave->perm_hwaddr, ETH_ALEN); 775 ether_addr_copy(lacpdu_header->hdr.h_source, slave->perm_hwaddr);
776 lacpdu_header->hdr.h_proto = PKT_TYPE_LACPDU; 776 lacpdu_header->hdr.h_proto = PKT_TYPE_LACPDU;
777 777
778 lacpdu_header->lacpdu = port->lacpdu; 778 lacpdu_header->lacpdu = port->lacpdu;
@@ -810,11 +810,11 @@ static int ad_marker_send(struct port *port, struct bond_marker *marker)
810 810
811 marker_header = (struct bond_marker_header *)skb_put(skb, length); 811 marker_header = (struct bond_marker_header *)skb_put(skb, length);
812 812
813 memcpy(marker_header->hdr.h_dest, lacpdu_mcast_addr, ETH_ALEN); 813 ether_addr_copy(marker_header->hdr.h_dest, lacpdu_mcast_addr);
814 /* Note: source address is set to be the member's PERMANENT address, 814 /* Note: source address is set to be the member's PERMANENT address,
815 * because we use it to identify loopback MARKERs in receive. 815 * because we use it to identify loopback MARKERs in receive.
816 */ 816 */
817 memcpy(marker_header->hdr.h_source, slave->perm_hwaddr, ETH_ALEN); 817 ether_addr_copy(marker_header->hdr.h_source, slave->perm_hwaddr);
818 marker_header->hdr.h_proto = PKT_TYPE_LACPDU; 818 marker_header->hdr.h_proto = PKT_TYPE_LACPDU;
819 819
820 marker_header->marker = *marker; 820 marker_header->marker = *marker;
@@ -1079,7 +1079,8 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
1079 /* detect loopback situation */ 1079 /* detect loopback situation */
1080 if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system), 1080 if (MAC_ADDRESS_EQUAL(&(lacpdu->actor_system),
1081 &(port->actor_system))) { 1081 &(port->actor_system))) {
1082 pr_err("%s: An illegal loopback occurred on adapter (%s).\nCheck the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n", 1082 pr_err("%s: An illegal loopback occurred on adapter (%s)\n"
1083 "Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n",
1083 port->slave->bond->dev->name, 1084 port->slave->bond->dev->name,
1084 port->slave->dev->name); 1085 port->slave->dev->name);
1085 return; 1086 return;
@@ -1283,11 +1284,11 @@ static void ad_port_selection_logic(struct port *port)
1283 /* meaning: the port was related to an aggregator 1284 /* meaning: the port was related to an aggregator
1284 * but was not on the aggregator port list 1285 * but was not on the aggregator port list
1285 */ 1286 */
1286 pr_warn("%s: Warning: Port %d (on %s) was related to aggregator %d but was not on its port list\n", 1287 pr_warn_ratelimited("%s: Warning: Port %d (on %s) was related to aggregator %d but was not on its port list\n",
1287 port->slave->bond->dev->name, 1288 port->slave->bond->dev->name,
1288 port->actor_port_number, 1289 port->actor_port_number,
1289 port->slave->dev->name, 1290 port->slave->dev->name,
1290 port->aggregator->aggregator_identifier); 1291 port->aggregator->aggregator_identifier);
1291 } 1292 }
1292 } 1293 }
1293 /* search on all aggregators for a suitable aggregator for this port */ 1294 /* search on all aggregators for a suitable aggregator for this port */
@@ -1444,9 +1445,9 @@ static struct aggregator *ad_agg_selection_test(struct aggregator *best,
1444 break; 1445 break;
1445 1446
1446 default: 1447 default:
1447 pr_warn("%s: Impossible agg select mode %d\n", 1448 pr_warn_ratelimited("%s: Impossible agg select mode %d\n",
1448 curr->slave->bond->dev->name, 1449 curr->slave->bond->dev->name,
1449 __get_agg_selection_mode(curr->lag_ports)); 1450 __get_agg_selection_mode(curr->lag_ports));
1450 break; 1451 break;
1451 } 1452 }
1452 1453
@@ -1559,9 +1560,9 @@ static void ad_agg_selection_logic(struct aggregator *agg)
1559 1560
1560 /* check if any partner replys */ 1561 /* check if any partner replys */
1561 if (best->is_individual) { 1562 if (best->is_individual) {
1562 pr_warn("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n", 1563 pr_warn_ratelimited("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n",
1563 best->slave ? 1564 best->slave ?
1564 best->slave->bond->dev->name : "NULL"); 1565 best->slave->bond->dev->name : "NULL");
1565 } 1566 }
1566 1567
1567 best->is_active = 1; 1568 best->is_active = 1;
@@ -1948,7 +1949,7 @@ void bond_3ad_unbind_slave(struct slave *slave)
1948 * new aggregator 1949 * new aggregator
1949 */ 1950 */
1950 if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) { 1951 if ((new_aggregator) && ((!new_aggregator->lag_ports) || ((new_aggregator->lag_ports == port) && !new_aggregator->lag_ports->next_port_in_aggregator))) {
1951 pr_debug("Some port(s) related to LAG %d - replaceing with LAG %d\n", 1952 pr_debug("Some port(s) related to LAG %d - replacing with LAG %d\n",
1952 aggregator->aggregator_identifier, 1953 aggregator->aggregator_identifier,
1953 new_aggregator->aggregator_identifier); 1954 new_aggregator->aggregator_identifier);
1954 1955
@@ -2080,8 +2081,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
2080 /* select the active aggregator for the bond */ 2081 /* select the active aggregator for the bond */
2081 if (port) { 2082 if (port) {
2082 if (!port->slave) { 2083 if (!port->slave) {
2083 pr_warn("%s: Warning: bond's first port is uninitialized\n", 2084 pr_warn_ratelimited("%s: Warning: bond's first port is uninitialized\n",
2084 bond->dev->name); 2085 bond->dev->name);
2085 goto re_arm; 2086 goto re_arm;
2086 } 2087 }
2087 2088
@@ -2095,8 +2096,8 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
2095 bond_for_each_slave_rcu(bond, slave, iter) { 2096 bond_for_each_slave_rcu(bond, slave, iter) {
2096 port = &(SLAVE_AD_INFO(slave).port); 2097 port = &(SLAVE_AD_INFO(slave).port);
2097 if (!port->slave) { 2098 if (!port->slave) {
2098 pr_warn("%s: Warning: Found an uninitialized port\n", 2099 pr_warn_ratelimited("%s: Warning: Found an uninitialized port\n",
2099 bond->dev->name); 2100 bond->dev->name);
2100 goto re_arm; 2101 goto re_arm;
2101 } 2102 }
2102 2103
@@ -2157,8 +2158,8 @@ static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave,
2157 port = &(SLAVE_AD_INFO(slave).port); 2158 port = &(SLAVE_AD_INFO(slave).port);
2158 2159
2159 if (!port->slave) { 2160 if (!port->slave) {
2160 pr_warn("%s: Warning: port of slave %s is uninitialized\n", 2161 pr_warn_ratelimited("%s: Warning: port of slave %s is uninitialized\n",
2161 slave->dev->name, slave->bond->dev->name); 2162 slave->dev->name, slave->bond->dev->name);
2162 return ret; 2163 return ret;
2163 } 2164 }
2164 2165
@@ -2310,9 +2311,9 @@ void bond_3ad_handle_link_change(struct slave *slave, char link)
2310 port->actor_oper_port_key = (port->actor_admin_port_key &= 2311 port->actor_oper_port_key = (port->actor_admin_port_key &=
2311 ~AD_SPEED_KEY_BITS); 2312 ~AD_SPEED_KEY_BITS);
2312 } 2313 }
2313 pr_debug("Port %d changed link status to %s", 2314 pr_debug("Port %d changed link status to %s\n",
2314 port->actor_port_number, 2315 port->actor_port_number,
2315 (link == BOND_LINK_UP) ? "UP" : "DOWN"); 2316 link == BOND_LINK_UP ? "UP" : "DOWN");
2316 /* there is no need to reselect a new aggregator, just signal the 2317 /* there is no need to reselect a new aggregator, just signal the
2317 * state machines to reinitialize 2318 * state machines to reinitialize
2318 */ 2319 */
@@ -2390,17 +2391,16 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond,
2390 } 2391 }
2391 } 2392 }
2392 2393
2393 if (aggregator) { 2394 if (!aggregator)
2394 ad_info->aggregator_id = aggregator->aggregator_identifier; 2395 return -1;
2395 ad_info->ports = aggregator->num_of_ports;
2396 ad_info->actor_key = aggregator->actor_oper_aggregator_key;
2397 ad_info->partner_key = aggregator->partner_oper_aggregator_key;
2398 memcpy(ad_info->partner_system,
2399 aggregator->partner_system.mac_addr_value, ETH_ALEN);
2400 return 0;
2401 }
2402 2396
2403 return -1; 2397 ad_info->aggregator_id = aggregator->aggregator_identifier;
2398 ad_info->ports = aggregator->num_of_ports;
2399 ad_info->actor_key = aggregator->actor_oper_aggregator_key;
2400 ad_info->partner_key = aggregator->partner_oper_aggregator_key;
2401 ether_addr_copy(ad_info->partner_system,
2402 aggregator->partner_system.mac_addr_value);
2403 return 0;
2404} 2404}
2405 2405
2406/* Wrapper used to hold bond->lock so no slave manipulation can occur */ 2406/* Wrapper used to hold bond->lock so no slave manipulation can occur */
@@ -2479,7 +2479,7 @@ out:
2479 return NETDEV_TX_OK; 2479 return NETDEV_TX_OK;
2480err_free: 2480err_free:
2481 /* no suitable interface, frame not sent */ 2481 /* no suitable interface, frame not sent */
2482 kfree_skb(skb); 2482 dev_kfree_skb_any(skb);
2483 goto out; 2483 goto out;
2484} 2484}
2485 2485