Commit 2de390ba authored by Veaceslav Falico's avatar Veaceslav Falico Committed by David S. Miller

bonding: convert bond_options.c to use netdev_printk instead of pr_

CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: default avatarVeaceslav Falico <vfalico@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c735ee6c
...@@ -544,9 +544,8 @@ static void bond_opt_dep_print(struct bonding *bond, ...@@ -544,9 +544,8 @@ static void bond_opt_dep_print(struct bonding *bond,
params = &bond->params; params = &bond->params;
modeval = bond_opt_get_val(BOND_OPT_MODE, params->mode); modeval = bond_opt_get_val(BOND_OPT_MODE, params->mode);
if (test_bit(params->mode, &opt->unsuppmodes)) if (test_bit(params->mode, &opt->unsuppmodes))
pr_err("%s: option %s: mode dependency failed, not supported in mode %s(%llu)\n", netdev_err(bond->dev, "option %s: mode dependency failed, not supported in mode %s(%llu)\n",
bond->dev->name, opt->name, opt->name, modeval->string, modeval->value);
modeval->string, modeval->value);
} }
static void bond_opt_error_interpret(struct bonding *bond, static void bond_opt_error_interpret(struct bonding *bond,
...@@ -564,31 +563,30 @@ static void bond_opt_error_interpret(struct bonding *bond, ...@@ -564,31 +563,30 @@ static void bond_opt_error_interpret(struct bonding *bond,
p = strchr(val->string, '\n'); p = strchr(val->string, '\n');
if (p) if (p)
*p = '\0'; *p = '\0';
pr_err("%s: option %s: invalid value (%s)\n", netdev_err(bond->dev, "option %s: invalid value (%s)\n",
bond->dev->name, opt->name, val->string); opt->name, val->string);
} else { } else {
pr_err("%s: option %s: invalid value (%llu)\n", netdev_err(bond->dev, "option %s: invalid value (%llu)\n",
bond->dev->name, opt->name, val->value); opt->name, val->value);
} }
} }
minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN); minval = bond_opt_get_flags(opt, BOND_VALFLAG_MIN);
maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX); maxval = bond_opt_get_flags(opt, BOND_VALFLAG_MAX);
if (!maxval) if (!maxval)
break; break;
pr_err("%s: option %s: allowed values %llu - %llu\n", netdev_err(bond->dev, "option %s: allowed values %llu - %llu\n",
bond->dev->name, opt->name, minval ? minval->value : 0, opt->name, minval ? minval->value : 0, maxval->value);
maxval->value);
break; break;
case -EACCES: case -EACCES:
bond_opt_dep_print(bond, opt); bond_opt_dep_print(bond, opt);
break; break;
case -ENOTEMPTY: case -ENOTEMPTY:
pr_err("%s: option %s: unable to set because the bond device has slaves\n", netdev_err(bond->dev, "option %s: unable to set because the bond device has slaves\n",
bond->dev->name, opt->name); opt->name);
break; break;
case -EBUSY: case -EBUSY:
pr_err("%s: option %s: unable to set because the bond device is up\n", netdev_err(bond->dev, "option %s: unable to set because the bond device is up\n",
bond->dev->name, opt->name); opt->name);
break; break;
default: default:
break; break;
...@@ -675,14 +673,14 @@ static int bond_option_mode_set(struct bonding *bond, ...@@ -675,14 +673,14 @@ static int bond_option_mode_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) { if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) {
pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n", netdev_info(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n",
bond->dev->name, newval->string); newval->string);
/* disable arp monitoring */ /* disable arp monitoring */
bond->params.arp_interval = 0; bond->params.arp_interval = 0;
/* set miimon to default value */ /* set miimon to default value */
bond->params.miimon = BOND_DEFAULT_MIIMON; bond->params.miimon = BOND_DEFAULT_MIIMON;
pr_info("%s: Setting MII monitoring interval to %d\n", netdev_info(bond->dev, "Setting MII monitoring interval to %d\n",
bond->dev->name, bond->params.miimon); bond->params.miimon);
} }
/* don't cache arp_validate between modes */ /* don't cache arp_validate between modes */
...@@ -723,14 +721,14 @@ static int bond_option_active_slave_set(struct bonding *bond, ...@@ -723,14 +721,14 @@ static int bond_option_active_slave_set(struct bonding *bond,
if (slave_dev) { if (slave_dev) {
if (!netif_is_bond_slave(slave_dev)) { if (!netif_is_bond_slave(slave_dev)) {
pr_err("Device %s is not bonding slave\n", netdev_err(bond->dev, "Device %s is not bonding slave\n",
slave_dev->name); slave_dev->name);
return -EINVAL; return -EINVAL;
} }
if (bond->dev != netdev_master_upper_dev_get(slave_dev)) { if (bond->dev != netdev_master_upper_dev_get(slave_dev)) {
pr_err("%s: Device %s is not our slave\n", netdev_err(bond->dev, "Device %s is not our slave\n",
bond->dev->name, slave_dev->name); slave_dev->name);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -740,7 +738,7 @@ static int bond_option_active_slave_set(struct bonding *bond, ...@@ -740,7 +738,7 @@ static int bond_option_active_slave_set(struct bonding *bond,
/* check to see if we are clearing active */ /* check to see if we are clearing active */
if (!slave_dev) { if (!slave_dev) {
pr_info("%s: Clearing current active slave\n", bond->dev->name); netdev_info(bond->dev, "Clearing current active slave\n");
RCU_INIT_POINTER(bond->curr_active_slave, NULL); RCU_INIT_POINTER(bond->curr_active_slave, NULL);
bond_select_active_slave(bond); bond_select_active_slave(bond);
} else { } else {
...@@ -751,18 +749,18 @@ static int bond_option_active_slave_set(struct bonding *bond, ...@@ -751,18 +749,18 @@ static int bond_option_active_slave_set(struct bonding *bond,
if (new_active == old_active) { if (new_active == old_active) {
/* do nothing */ /* do nothing */
pr_info("%s: %s is already the current active slave\n", netdev_info(bond->dev, "%s is already the current active slave\n",
bond->dev->name, new_active->dev->name); new_active->dev->name);
} else { } else {
if (old_active && (new_active->link == BOND_LINK_UP) && if (old_active && (new_active->link == BOND_LINK_UP) &&
bond_slave_is_up(new_active)) { bond_slave_is_up(new_active)) {
pr_info("%s: Setting %s as active slave\n", netdev_info(bond->dev, "Setting %s as active slave\n",
bond->dev->name, new_active->dev->name); new_active->dev->name);
bond_change_active_slave(bond, new_active); bond_change_active_slave(bond, new_active);
} else { } else {
pr_err("%s: Could not set %s as active slave; either %s is down or the link is down\n", netdev_err(bond->dev, "Could not set %s as active slave; either %s is down or the link is down\n",
bond->dev->name, new_active->dev->name, new_active->dev->name,
new_active->dev->name); new_active->dev->name);
ret = -EINVAL; ret = -EINVAL;
} }
} }
...@@ -781,20 +779,17 @@ static int bond_option_active_slave_set(struct bonding *bond, ...@@ -781,20 +779,17 @@ static int bond_option_active_slave_set(struct bonding *bond,
static int bond_option_miimon_set(struct bonding *bond, static int bond_option_miimon_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting MII monitoring interval to %llu\n", netdev_info(bond->dev, "Setting MII monitoring interval to %llu\n",
bond->dev->name, newval->value); newval->value);
bond->params.miimon = newval->value; bond->params.miimon = newval->value;
if (bond->params.updelay) if (bond->params.updelay)
pr_info("%s: Note: Updating updelay (to %d) since it is a multiple of the miimon value\n", netdev_info(bond->dev, "Note: Updating updelay (to %d) since it is a multiple of the miimon value\n",
bond->dev->name,
bond->params.updelay * bond->params.miimon); bond->params.updelay * bond->params.miimon);
if (bond->params.downdelay) if (bond->params.downdelay)
pr_info("%s: Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n", netdev_info(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n",
bond->dev->name, bond->params.downdelay * bond->params.miimon);
bond->params.downdelay * bond->params.miimon);
if (newval->value && bond->params.arp_interval) { if (newval->value && bond->params.arp_interval) {
pr_info("%s: MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n", netdev_info(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n");
bond->dev->name);
bond->params.arp_interval = 0; bond->params.arp_interval = 0;
if (bond->params.arp_validate) if (bond->params.arp_validate)
bond->params.arp_validate = BOND_ARP_VALIDATE_NONE; bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
...@@ -826,20 +821,18 @@ static int bond_option_updelay_set(struct bonding *bond, ...@@ -826,20 +821,18 @@ static int bond_option_updelay_set(struct bonding *bond,
int value = newval->value; int value = newval->value;
if (!bond->params.miimon) { if (!bond->params.miimon) {
pr_err("%s: Unable to set up delay as MII monitoring is disabled\n", netdev_err(bond->dev, "Unable to set up delay as MII monitoring is disabled\n");
bond->dev->name);
return -EPERM; return -EPERM;
} }
if ((value % bond->params.miimon) != 0) { if ((value % bond->params.miimon) != 0) {
pr_warn("%s: Warning: up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n", netdev_warn(bond->dev, "up delay (%d) is not a multiple of miimon (%d), updelay rounded to %d ms\n",
bond->dev->name, value, value, bond->params.miimon,
bond->params.miimon, (value / bond->params.miimon) *
(value / bond->params.miimon) * bond->params.miimon);
bond->params.miimon);
} }
bond->params.updelay = value / bond->params.miimon; bond->params.updelay = value / bond->params.miimon;
pr_info("%s: Setting up delay to %d\n", netdev_info(bond->dev, "Setting up delay to %d\n",
bond->dev->name, bond->params.updelay * bond->params.miimon); bond->params.updelay * bond->params.miimon);
return 0; return 0;
} }
...@@ -850,20 +843,18 @@ static int bond_option_downdelay_set(struct bonding *bond, ...@@ -850,20 +843,18 @@ static int bond_option_downdelay_set(struct bonding *bond,
int value = newval->value; int value = newval->value;
if (!bond->params.miimon) { if (!bond->params.miimon) {
pr_err("%s: Unable to set down delay as MII monitoring is disabled\n", netdev_err(bond->dev, "Unable to set down delay as MII monitoring is disabled\n");
bond->dev->name);
return -EPERM; return -EPERM;
} }
if ((value % bond->params.miimon) != 0) { if ((value % bond->params.miimon) != 0) {
pr_warn("%s: Warning: down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n", netdev_warn(bond->dev, "down delay (%d) is not a multiple of miimon (%d), delay rounded to %d ms\n",
bond->dev->name, value, value, bond->params.miimon,
bond->params.miimon, (value / bond->params.miimon) *
(value / bond->params.miimon) * bond->params.miimon);
bond->params.miimon);
} }
bond->params.downdelay = value / bond->params.miimon; bond->params.downdelay = value / bond->params.miimon;
pr_info("%s: Setting down delay to %d\n", netdev_info(bond->dev, "Setting down delay to %d\n",
bond->dev->name, bond->params.downdelay * bond->params.miimon); bond->params.downdelay * bond->params.miimon);
return 0; return 0;
} }
...@@ -871,8 +862,8 @@ static int bond_option_downdelay_set(struct bonding *bond, ...@@ -871,8 +862,8 @@ static int bond_option_downdelay_set(struct bonding *bond,
static int bond_option_use_carrier_set(struct bonding *bond, static int bond_option_use_carrier_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting use_carrier to %llu\n", netdev_info(bond->dev, "Setting use_carrier to %llu\n",
bond->dev->name, newval->value); newval->value);
bond->params.use_carrier = newval->value; bond->params.use_carrier = newval->value;
return 0; return 0;
...@@ -885,18 +876,16 @@ static int bond_option_use_carrier_set(struct bonding *bond, ...@@ -885,18 +876,16 @@ static int bond_option_use_carrier_set(struct bonding *bond,
static int bond_option_arp_interval_set(struct bonding *bond, static int bond_option_arp_interval_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting ARP monitoring interval to %llu\n", netdev_info(bond->dev, "Setting ARP monitoring interval to %llu\n",
bond->dev->name, newval->value); newval->value);
bond->params.arp_interval = newval->value; bond->params.arp_interval = newval->value;
if (newval->value) { if (newval->value) {
if (bond->params.miimon) { if (bond->params.miimon) {
pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring\n", netdev_info(bond->dev, "ARP monitoring cannot be used with MII monitoring. Disabling MII monitoring\n");
bond->dev->name, bond->dev->name);
bond->params.miimon = 0; bond->params.miimon = 0;
} }
if (!bond->params.arp_targets[0]) if (!bond->params.arp_targets[0])
pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified\n", netdev_info(bond->dev, "ARP monitoring has been set up, but no ARP targets have been specified\n");
bond->dev->name);
} }
if (bond->dev->flags & IFF_UP) { if (bond->dev->flags & IFF_UP) {
/* If the interface is up, we may need to fire off /* If the interface is up, we may need to fire off
...@@ -940,24 +929,24 @@ static int _bond_option_arp_ip_target_add(struct bonding *bond, __be32 target) ...@@ -940,24 +929,24 @@ static int _bond_option_arp_ip_target_add(struct bonding *bond, __be32 target)
int ind; int ind;
if (!bond_is_ip_target_ok(target)) { if (!bond_is_ip_target_ok(target)) {
pr_err("%s: invalid ARP target %pI4 specified for addition\n", netdev_err(bond->dev, "invalid ARP target %pI4 specified for addition\n",
bond->dev->name, &target); &target);
return -EINVAL; return -EINVAL;
} }
if (bond_get_targets_ip(targets, target) != -1) { /* dup */ if (bond_get_targets_ip(targets, target) != -1) { /* dup */
pr_err("%s: ARP target %pI4 is already present\n", netdev_err(bond->dev, "ARP target %pI4 is already present\n",
bond->dev->name, &target); &target);
return -EINVAL; return -EINVAL;
} }
ind = bond_get_targets_ip(targets, 0); /* first free slot */ ind = bond_get_targets_ip(targets, 0); /* first free slot */
if (ind == -1) { if (ind == -1) {
pr_err("%s: ARP target table is full!\n", bond->dev->name); netdev_err(bond->dev, "ARP target table is full!\n");
return -EINVAL; return -EINVAL;
} }
pr_info("%s: Adding ARP target %pI4\n", bond->dev->name, &target); netdev_info(bond->dev, "Adding ARP target %pI4\n", &target);
_bond_options_arp_ip_target_set(bond, ind, target, jiffies); _bond_options_arp_ip_target_set(bond, ind, target, jiffies);
...@@ -985,23 +974,22 @@ static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target) ...@@ -985,23 +974,22 @@ static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target)
int ind, i; int ind, i;
if (!bond_is_ip_target_ok(target)) { if (!bond_is_ip_target_ok(target)) {
pr_err("%s: invalid ARP target %pI4 specified for removal\n", netdev_err(bond->dev, "invalid ARP target %pI4 specified for removal\n",
bond->dev->name, &target); &target);
return -EINVAL; return -EINVAL;
} }
ind = bond_get_targets_ip(targets, target); ind = bond_get_targets_ip(targets, target);
if (ind == -1) { if (ind == -1) {
pr_err("%s: unable to remove nonexistent ARP target %pI4\n", netdev_err(bond->dev, "unable to remove nonexistent ARP target %pI4\n",
bond->dev->name, &target); &target);
return -EINVAL; return -EINVAL;
} }
if (ind == 0 && !targets[1] && bond->params.arp_interval) if (ind == 0 && !targets[1] && bond->params.arp_interval)
pr_warn("%s: Removing last arp target with arp_interval on\n", netdev_warn(bond->dev, "Removing last arp target with arp_interval on\n");
bond->dev->name);
pr_info("%s: Removing ARP target %pI4\n", bond->dev->name, &target); netdev_info(bond->dev, "Removing ARP target %pI4\n", &target);
/* not to race with bond_arp_rcv */ /* not to race with bond_arp_rcv */
write_lock_bh(&bond->lock); write_lock_bh(&bond->lock);
...@@ -1040,8 +1028,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond, ...@@ -1040,8 +1028,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
if (newval->string) { if (newval->string) {
if (!in4_pton(newval->string+1, -1, (u8 *)&target, -1, NULL)) { if (!in4_pton(newval->string+1, -1, (u8 *)&target, -1, NULL)) {
pr_err("%s: invalid ARP target %pI4 specified\n", netdev_err(bond->dev, "invalid ARP target %pI4 specified\n",
bond->dev->name, &target); &target);
return ret; return ret;
} }
if (newval->string[0] == '+') if (newval->string[0] == '+')
...@@ -1049,8 +1037,7 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond, ...@@ -1049,8 +1037,7 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
else if (newval->string[0] == '-') else if (newval->string[0] == '-')
ret = bond_option_arp_ip_target_rem(bond, target); ret = bond_option_arp_ip_target_rem(bond, target);
else else
pr_err("no command found in arp_ip_targets file for bond %s - use +<addr> or -<addr>\n", netdev_err(bond->dev, "no command found in arp_ip_targets file - use +<addr> or -<addr>\n");
bond->dev->name);
} else { } else {
target = newval->value; target = newval->value;
ret = bond_option_arp_ip_target_add(bond, target); ret = bond_option_arp_ip_target_add(bond, target);
...@@ -1062,8 +1049,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond, ...@@ -1062,8 +1049,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
static int bond_option_arp_validate_set(struct bonding *bond, static int bond_option_arp_validate_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting arp_validate to %s (%llu)\n", netdev_info(bond->dev, "Setting arp_validate to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
if (bond->dev->flags & IFF_UP) { if (bond->dev->flags & IFF_UP) {
if (!newval->value) if (!newval->value)
...@@ -1079,8 +1066,8 @@ static int bond_option_arp_validate_set(struct bonding *bond, ...@@ -1079,8 +1066,8 @@ static int bond_option_arp_validate_set(struct bonding *bond,
static int bond_option_arp_all_targets_set(struct bonding *bond, static int bond_option_arp_all_targets_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting arp_all_targets to %s (%llu)\n", netdev_info(bond->dev, "Setting arp_all_targets to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.arp_all_targets = newval->value; bond->params.arp_all_targets = newval->value;
return 0; return 0;
...@@ -1102,7 +1089,7 @@ static int bond_option_primary_set(struct bonding *bond, ...@@ -1102,7 +1089,7 @@ static int bond_option_primary_set(struct bonding *bond,
*p = '\0'; *p = '\0';
/* check to see if we are clearing primary */ /* check to see if we are clearing primary */
if (!strlen(primary)) { if (!strlen(primary)) {
pr_info("%s: Setting primary slave to None\n", bond->dev->name); netdev_info(bond->dev, "Setting primary slave to None\n");
bond->primary_slave = NULL; bond->primary_slave = NULL;
memset(bond->params.primary, 0, sizeof(bond->params.primary)); memset(bond->params.primary, 0, sizeof(bond->params.primary));
bond_select_active_slave(bond); bond_select_active_slave(bond);
...@@ -1111,8 +1098,8 @@ static int bond_option_primary_set(struct bonding *bond, ...@@ -1111,8 +1098,8 @@ static int bond_option_primary_set(struct bonding *bond,
bond_for_each_slave(bond, slave, iter) { bond_for_each_slave(bond, slave, iter) {
if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) { if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) {
pr_info("%s: Setting %s as primary slave\n", netdev_info(bond->dev, "Setting %s as primary slave\n",
bond->dev->name, slave->dev->name); slave->dev->name);
bond->primary_slave = slave; bond->primary_slave = slave;
strcpy(bond->params.primary, slave->dev->name); strcpy(bond->params.primary, slave->dev->name);
bond_select_active_slave(bond); bond_select_active_slave(bond);
...@@ -1121,15 +1108,15 @@ static int bond_option_primary_set(struct bonding *bond, ...@@ -1121,15 +1108,15 @@ static int bond_option_primary_set(struct bonding *bond,
} }
if (bond->primary_slave) { if (bond->primary_slave) {
pr_info("%s: Setting primary slave to None\n", bond->dev->name); netdev_info(bond->dev, "Setting primary slave to None\n");
bond->primary_slave = NULL; bond->primary_slave = NULL;
bond_select_active_slave(bond); bond_select_active_slave(bond);
} }
strncpy(bond->params.primary, primary, IFNAMSIZ); strncpy(bond->params.primary, primary, IFNAMSIZ);
bond->params.primary[IFNAMSIZ - 1] = 0; bond->params.primary[IFNAMSIZ - 1] = 0;
pr_info("%s: Recording %s as primary, but it has not been enslaved to %s yet\n", netdev_info(bond->dev, "Recording %s as primary, but it has not been enslaved to %s yet\n",
bond->dev->name, primary, bond->dev->name); primary, bond->dev->name);
out: out:
write_unlock_bh(&bond->curr_slave_lock); write_unlock_bh(&bond->curr_slave_lock);
...@@ -1142,8 +1129,8 @@ static int bond_option_primary_set(struct bonding *bond, ...@@ -1142,8 +1129,8 @@ static int bond_option_primary_set(struct bonding *bond,
static int bond_option_primary_reselect_set(struct bonding *bond, static int bond_option_primary_reselect_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting primary_reselect to %s (%llu)\n", netdev_info(bond->dev, "Setting primary_reselect to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.primary_reselect = newval->value; bond->params.primary_reselect = newval->value;
block_netpoll_tx(); block_netpoll_tx();
...@@ -1158,8 +1145,8 @@ static int bond_option_primary_reselect_set(struct bonding *bond, ...@@ -1158,8 +1145,8 @@ static int bond_option_primary_reselect_set(struct bonding *bond,
static int bond_option_fail_over_mac_set(struct bonding *bond, static int bond_option_fail_over_mac_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting fail_over_mac to %s (%llu)\n", netdev_info(bond->dev, "Setting fail_over_mac to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.fail_over_mac = newval->value; bond->params.fail_over_mac = newval->value;
return 0; return 0;
...@@ -1168,8 +1155,8 @@ static int bond_option_fail_over_mac_set(struct bonding *bond, ...@@ -1168,8 +1155,8 @@ static int bond_option_fail_over_mac_set(struct bonding *bond,
static int bond_option_xmit_hash_policy_set(struct bonding *bond, static int bond_option_xmit_hash_policy_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting xmit hash policy to %s (%llu)\n", netdev_info(bond->dev, "Setting xmit hash policy to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.xmit_policy = newval->value; bond->params.xmit_policy = newval->value;
return 0; return 0;
...@@ -1178,8 +1165,8 @@ static int bond_option_xmit_hash_policy_set(struct bonding *bond, ...@@ -1178,8 +1165,8 @@ static int bond_option_xmit_hash_policy_set(struct bonding *bond,
static int bond_option_resend_igmp_set(struct bonding *bond, static int bond_option_resend_igmp_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting resend_igmp to %llu\n", netdev_info(bond->dev, "Setting resend_igmp to %llu\n",
bond->dev->name, newval->value); newval->value);
bond->params.resend_igmp = newval->value; bond->params.resend_igmp = newval->value;
return 0; return 0;
...@@ -1217,8 +1204,8 @@ static int bond_option_all_slaves_active_set(struct bonding *bond, ...@@ -1217,8 +1204,8 @@ static int bond_option_all_slaves_active_set(struct bonding *bond,
static int bond_option_min_links_set(struct bonding *bond, static int bond_option_min_links_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting min links value to %llu\n", netdev_info(bond->dev, "Setting min links value to %llu\n",
bond->dev->name, newval->value); newval->value);
bond->params.min_links = newval->value; bond->params.min_links = newval->value;
return 0; return 0;
...@@ -1253,8 +1240,8 @@ static int bond_option_pps_set(struct bonding *bond, ...@@ -1253,8 +1240,8 @@ static int bond_option_pps_set(struct bonding *bond,
static int bond_option_lacp_rate_set(struct bonding *bond, static int bond_option_lacp_rate_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting LACP rate to %s (%llu)\n", netdev_info(bond->dev, "Setting LACP rate to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.lacp_fast = newval->value; bond->params.lacp_fast = newval->value;
bond_3ad_update_lacp_rate(bond); bond_3ad_update_lacp_rate(bond);
...@@ -1264,8 +1251,8 @@ static int bond_option_lacp_rate_set(struct bonding *bond, ...@@ -1264,8 +1251,8 @@ static int bond_option_lacp_rate_set(struct bonding *bond,
static int bond_option_ad_select_set(struct bonding *bond, static int bond_option_ad_select_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting ad_select to %s (%llu)\n", netdev_info(bond->dev, "Setting ad_select to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.ad_select = newval->value; bond->params.ad_select = newval->value;
return 0; return 0;
...@@ -1326,7 +1313,7 @@ static int bond_option_queue_id_set(struct bonding *bond, ...@@ -1326,7 +1313,7 @@ static int bond_option_queue_id_set(struct bonding *bond,
return ret; return ret;
err_no_cmd: err_no_cmd:
pr_info("invalid input for queue_id set for %s\n", bond->dev->name); netdev_info(bond->dev, "invalid input for queue_id set\n");
ret = -EPERM; ret = -EPERM;
goto out; goto out;
...@@ -1348,20 +1335,20 @@ static int bond_option_slaves_set(struct bonding *bond, ...@@ -1348,20 +1335,20 @@ static int bond_option_slaves_set(struct bonding *bond,
dev = __dev_get_by_name(dev_net(bond->dev), ifname); dev = __dev_get_by_name(dev_net(bond->dev), ifname);
if (!dev) { if (!dev) {
pr_info("%s: interface %s does not exist!\n", netdev_info(bond->dev, "interface %s does not exist!\n",
bond->dev->name, ifname); ifname);
ret = -ENODEV; ret = -ENODEV;
goto out; goto out;
} }
switch (command[0]) { switch (command[0]) {
case '+': case '+':
pr_info("%s: Adding slave %s\n", bond->dev->name, dev->name); netdev_info(bond->dev, "Adding slave %s\n", dev->name);
ret = bond_enslave(bond->dev, dev); ret = bond_enslave(bond->dev, dev);
break; break;
case '-': case '-':
pr_info("%s: Removing slave %s\n", bond->dev->name, dev->name); netdev_info(bond->dev, "Removing slave %s\n", dev->name);
ret = bond_release(bond->dev, dev); ret = bond_release(bond->dev, dev);
break; break;
...@@ -1373,8 +1360,7 @@ static int bond_option_slaves_set(struct bonding *bond, ...@@ -1373,8 +1360,7 @@ static int bond_option_slaves_set(struct bonding *bond,
return ret; return ret;
err_no_cmd: err_no_cmd:
pr_err("no command found in slaves file for bond %s - use +ifname or -ifname\n", netdev_err(bond->dev, "no command found in slaves file - use +ifname or -ifname\n");
bond->dev->name);
ret = -EPERM; ret = -EPERM;
goto out; goto out;
} }
...@@ -1382,8 +1368,8 @@ static int bond_option_slaves_set(struct bonding *bond, ...@@ -1382,8 +1368,8 @@ static int bond_option_slaves_set(struct bonding *bond,
static int bond_option_tlb_dynamic_lb_set(struct bonding *bond, static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
const struct bond_opt_value *newval) const struct bond_opt_value *newval)
{ {
pr_info("%s: Setting dynamic-lb to %s (%llu)\n", netdev_info(bond->dev, "Setting dynamic-lb to %s (%llu)\n",
bond->dev->name, newval->string, newval->value); newval->string, newval->value);
bond->params.tlb_dynamic_lb = newval->value; bond->params.tlb_dynamic_lb = newval->value;
return 0; return 0;
......
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