Commit 7ea2e423 authored by Jarod Wilson's avatar Jarod Wilson Committed by David S. Miller

bonding/alb: convert to using slave printk macros

All of these printk instances benefit from having both master and slave
device information included, so convert to using a standardized macro
format and remove redundant information.
Suggested-by: default avatarJoe Perches <joe@perches.com>
CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Veaceslav Falico <vfalico@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: netdev@vger.kernel.org
Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 17720981
...@@ -300,7 +300,7 @@ static int rlb_arp_recv(const struct sk_buff *skb, struct bonding *bond, ...@@ -300,7 +300,7 @@ static int rlb_arp_recv(const struct sk_buff *skb, struct bonding *bond,
if (arp->op_code == htons(ARPOP_REPLY)) { if (arp->op_code == htons(ARPOP_REPLY)) {
/* update rx hash table for this ARP */ /* update rx hash table for this ARP */
rlb_update_entry_from_arp(bond, arp); rlb_update_entry_from_arp(bond, arp);
netdev_dbg(bond->dev, "Server received an ARP Reply from client\n"); slave_dbg(bond->dev, slave->dev, "Server received an ARP Reply from client\n");
} }
out: out:
return RX_HANDLER_ANOTHER; return RX_HANDLER_ANOTHER;
...@@ -442,8 +442,9 @@ static void rlb_update_client(struct rlb_client_info *client_info) ...@@ -442,8 +442,9 @@ static void rlb_update_client(struct rlb_client_info *client_info)
client_info->slave->dev->dev_addr, client_info->slave->dev->dev_addr,
client_info->mac_dst); client_info->mac_dst);
if (!skb) { if (!skb) {
netdev_err(client_info->slave->bond->dev, slave_err(client_info->slave->bond->dev,
"failed to create an ARP packet\n"); client_info->slave->dev,
"failed to create an ARP packet\n");
continue; continue;
} }
...@@ -667,14 +668,15 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) ...@@ -667,14 +668,15 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
if (tx_slave) if (tx_slave)
bond_hw_addr_copy(arp->mac_src, tx_slave->dev->dev_addr, bond_hw_addr_copy(arp->mac_src, tx_slave->dev->dev_addr,
tx_slave->dev->addr_len); tx_slave->dev->addr_len);
netdev_dbg(bond->dev, "Server sent ARP Reply packet\n"); netdev_dbg(bond->dev, "(slave %s): Server sent ARP Reply packet\n",
tx_slave ? tx_slave->dev->name : "NULL");
} else if (arp->op_code == htons(ARPOP_REQUEST)) { } else if (arp->op_code == htons(ARPOP_REQUEST)) {
/* Create an entry in the rx_hashtbl for this client as a /* Create an entry in the rx_hashtbl for this client as a
* place holder. * place holder.
* When the arp reply is received the entry will be updated * When the arp reply is received the entry will be updated
* with the correct unicast address of the client. * with the correct unicast address of the client.
*/ */
rlb_choose_channel(skb, bond); tx_slave = rlb_choose_channel(skb, bond);
/* The ARP reply packets must be delayed so that /* The ARP reply packets must be delayed so that
* they can cancel out the influence of the ARP request. * they can cancel out the influence of the ARP request.
...@@ -687,7 +689,8 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) ...@@ -687,7 +689,8 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
* updated with their assigned mac. * updated with their assigned mac.
*/ */
rlb_req_update_subnet_clients(bond, arp->ip_src); rlb_req_update_subnet_clients(bond, arp->ip_src);
netdev_dbg(bond->dev, "Server sent ARP Request packet\n"); netdev_dbg(bond->dev, "(slave %s): Server sent ARP Request packet\n",
tx_slave ? tx_slave->dev->name : "NULL");
} }
return tx_slave; return tx_slave;
...@@ -923,9 +926,8 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[], ...@@ -923,9 +926,8 @@ static void alb_send_lp_vid(struct slave *slave, u8 mac_addr[],
skb->priority = TC_PRIO_CONTROL; skb->priority = TC_PRIO_CONTROL;
skb->dev = slave->dev; skb->dev = slave->dev;
netdev_dbg(slave->bond->dev, slave_dbg(slave->bond->dev, slave->dev,
"Send learning packet: dev %s mac %pM vlan %d\n", "Send learning packet: mac %pM vlan %d\n", mac_addr, vid);
slave->dev->name, mac_addr, vid);
if (vid) if (vid)
__vlan_hwaccel_put_tag(skb, vlan_proto, vid); __vlan_hwaccel_put_tag(skb, vlan_proto, vid);
...@@ -1016,8 +1018,7 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[], ...@@ -1016,8 +1018,7 @@ static int alb_set_slave_mac_addr(struct slave *slave, u8 addr[],
memcpy(ss.__data, addr, len); memcpy(ss.__data, addr, len);
ss.ss_family = dev->type; ss.ss_family = dev->type;
if (dev_set_mac_address(dev, (struct sockaddr *)&ss, NULL)) { if (dev_set_mac_address(dev, (struct sockaddr *)&ss, NULL)) {
netdev_err(slave->bond->dev, "dev_set_mac_address of dev %s failed! ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n", slave_err(slave->bond->dev, dev, "dev_set_mac_address on slave failed! ALB mode requires that the base driver support setting the hw address also when the network device's interface is open\n");
dev->name);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
return 0; return 0;
...@@ -1192,12 +1193,11 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav ...@@ -1192,12 +1193,11 @@ static int alb_handle_addr_collision_on_attach(struct bonding *bond, struct slav
alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr, alb_set_slave_mac_addr(slave, free_mac_slave->perm_hwaddr,
free_mac_slave->dev->addr_len); free_mac_slave->dev->addr_len);
netdev_warn(bond->dev, "the hw address of slave %s is in use by the bond; giving it the hw address of %s\n", slave_warn(bond->dev, slave->dev, "the slave hw address is in use by the bond; giving it the hw address of %s\n",
slave->dev->name, free_mac_slave->dev->name); free_mac_slave->dev->name);
} else if (has_bond_addr) { } else if (has_bond_addr) {
netdev_err(bond->dev, "the hw address of slave %s is in use by the bond; couldn't find a slave with a free hw address to give it (this should not have happened)\n", slave_err(bond->dev, slave->dev, "the slave hw address is in use by the bond; couldn't find a slave with a free hw address to give it (this should not have happened)\n");
slave->dev->name);
return -EFAULT; return -EFAULT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment