Skip to content

Commit eac306b

Browse files
Michael Dilmoredavem330
authored andcommitted
Bonding: Convert multiple netdev_info messages to netdev_dbg
The bond_options.c file contains multiple netdev_info statements that clutter kernel output. This patch replaces all netdev_info with netdev_dbg and adds a netdev_dbg statement for the packets per slave parameter. Also fixes misalignment at line 467. Suggested-by: Joe Perches <[email protected]> Signed-off-by: Michael J Dilmore <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2ee87db commit eac306b

File tree

1 file changed

+67
-65
lines changed

1 file changed

+67
-65
lines changed

drivers/net/bonding/bond_options.c

Lines changed: 67 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ const struct bond_opt_value *bond_opt_get_val(unsigned int option, u64 val)
464464

465465
/* Searches for a value in opt's values[] table which matches the flagmask */
466466
static const struct bond_opt_value *bond_opt_get_flags(const struct bond_option *opt,
467-
u32 flagmask)
467+
u32 flagmask)
468468
{
469469
int i;
470470

@@ -744,14 +744,14 @@ static int bond_option_mode_set(struct bonding *bond,
744744
const struct bond_opt_value *newval)
745745
{
746746
if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) {
747-
netdev_info(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n",
748-
newval->string);
747+
netdev_dbg(bond->dev, "%s mode is incompatible with arp monitoring, start mii monitoring\n",
748+
newval->string);
749749
/* disable arp monitoring */
750750
bond->params.arp_interval = 0;
751751
/* set miimon to default value */
752752
bond->params.miimon = BOND_DEFAULT_MIIMON;
753-
netdev_info(bond->dev, "Setting MII monitoring interval to %d\n",
754-
bond->params.miimon);
753+
netdev_dbg(bond->dev, "Setting MII monitoring interval to %d\n",
754+
bond->params.miimon);
755755
}
756756

757757
/* don't cache arp_validate between modes */
@@ -794,7 +794,7 @@ static int bond_option_active_slave_set(struct bonding *bond,
794794
block_netpoll_tx();
795795
/* check to see if we are clearing active */
796796
if (!slave_dev) {
797-
netdev_info(bond->dev, "Clearing current active slave\n");
797+
netdev_dbg(bond->dev, "Clearing current active slave\n");
798798
RCU_INIT_POINTER(bond->curr_active_slave, NULL);
799799
bond_select_active_slave(bond);
800800
} else {
@@ -805,13 +805,13 @@ static int bond_option_active_slave_set(struct bonding *bond,
805805

806806
if (new_active == old_active) {
807807
/* do nothing */
808-
netdev_info(bond->dev, "%s is already the current active slave\n",
809-
new_active->dev->name);
808+
netdev_dbg(bond->dev, "%s is already the current active slave\n",
809+
new_active->dev->name);
810810
} else {
811811
if (old_active && (new_active->link == BOND_LINK_UP) &&
812812
bond_slave_is_up(new_active)) {
813-
netdev_info(bond->dev, "Setting %s as active slave\n",
814-
new_active->dev->name);
813+
netdev_dbg(bond->dev, "Setting %s as active slave\n",
814+
new_active->dev->name);
815815
bond_change_active_slave(bond, new_active);
816816
} else {
817817
netdev_err(bond->dev, "Could not set %s as active slave; either %s is down or the link is down\n",
@@ -833,17 +833,17 @@ static int bond_option_active_slave_set(struct bonding *bond,
833833
static int bond_option_miimon_set(struct bonding *bond,
834834
const struct bond_opt_value *newval)
835835
{
836-
netdev_info(bond->dev, "Setting MII monitoring interval to %llu\n",
837-
newval->value);
836+
netdev_dbg(bond->dev, "Setting MII monitoring interval to %llu\n",
837+
newval->value);
838838
bond->params.miimon = newval->value;
839839
if (bond->params.updelay)
840-
netdev_info(bond->dev, "Note: Updating updelay (to %d) since it is a multiple of the miimon value\n",
841-
bond->params.updelay * bond->params.miimon);
840+
netdev_dbg(bond->dev, "Note: Updating updelay (to %d) since it is a multiple of the miimon value\n",
841+
bond->params.updelay * bond->params.miimon);
842842
if (bond->params.downdelay)
843-
netdev_info(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n",
844-
bond->params.downdelay * bond->params.miimon);
843+
netdev_dbg(bond->dev, "Note: Updating downdelay (to %d) since it is a multiple of the miimon value\n",
844+
bond->params.downdelay * bond->params.miimon);
845845
if (newval->value && bond->params.arp_interval) {
846-
netdev_info(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n");
846+
netdev_dbg(bond->dev, "MII monitoring cannot be used with ARP monitoring - disabling ARP monitoring...\n");
847847
bond->params.arp_interval = 0;
848848
if (bond->params.arp_validate)
849849
bond->params.arp_validate = BOND_ARP_VALIDATE_NONE;
@@ -885,8 +885,8 @@ static int bond_option_updelay_set(struct bonding *bond,
885885
bond->params.miimon);
886886
}
887887
bond->params.updelay = value / bond->params.miimon;
888-
netdev_info(bond->dev, "Setting up delay to %d\n",
889-
bond->params.updelay * bond->params.miimon);
888+
netdev_dbg(bond->dev, "Setting up delay to %d\n",
889+
bond->params.updelay * bond->params.miimon);
890890

891891
return 0;
892892
}
@@ -907,17 +907,17 @@ static int bond_option_downdelay_set(struct bonding *bond,
907907
bond->params.miimon);
908908
}
909909
bond->params.downdelay = value / bond->params.miimon;
910-
netdev_info(bond->dev, "Setting down delay to %d\n",
911-
bond->params.downdelay * bond->params.miimon);
910+
netdev_dbg(bond->dev, "Setting down delay to %d\n",
911+
bond->params.downdelay * bond->params.miimon);
912912

913913
return 0;
914914
}
915915

916916
static int bond_option_use_carrier_set(struct bonding *bond,
917917
const struct bond_opt_value *newval)
918918
{
919-
netdev_info(bond->dev, "Setting use_carrier to %llu\n",
920-
newval->value);
919+
netdev_dbg(bond->dev, "Setting use_carrier to %llu\n",
920+
newval->value);
921921
bond->params.use_carrier = newval->value;
922922

923923
return 0;
@@ -930,16 +930,16 @@ static int bond_option_use_carrier_set(struct bonding *bond,
930930
static int bond_option_arp_interval_set(struct bonding *bond,
931931
const struct bond_opt_value *newval)
932932
{
933-
netdev_info(bond->dev, "Setting ARP monitoring interval to %llu\n",
934-
newval->value);
933+
netdev_dbg(bond->dev, "Setting ARP monitoring interval to %llu\n",
934+
newval->value);
935935
bond->params.arp_interval = newval->value;
936936
if (newval->value) {
937937
if (bond->params.miimon) {
938-
netdev_info(bond->dev, "ARP monitoring cannot be used with MII monitoring. Disabling MII monitoring\n");
938+
netdev_dbg(bond->dev, "ARP monitoring cannot be used with MII monitoring. Disabling MII monitoring\n");
939939
bond->params.miimon = 0;
940940
}
941941
if (!bond->params.arp_targets[0])
942-
netdev_info(bond->dev, "ARP monitoring has been set up, but no ARP targets have been specified\n");
942+
netdev_dbg(bond->dev, "ARP monitoring has been set up, but no ARP targets have been specified\n");
943943
}
944944
if (bond->dev->flags & IFF_UP) {
945945
/* If the interface is up, we may need to fire off
@@ -1000,7 +1000,7 @@ static int _bond_option_arp_ip_target_add(struct bonding *bond, __be32 target)
10001000
return -EINVAL;
10011001
}
10021002

1003-
netdev_info(bond->dev, "Adding ARP target %pI4\n", &target);
1003+
netdev_dbg(bond->dev, "Adding ARP target %pI4\n", &target);
10041004

10051005
_bond_options_arp_ip_target_set(bond, ind, target, jiffies);
10061006

@@ -1036,7 +1036,7 @@ static int bond_option_arp_ip_target_rem(struct bonding *bond, __be32 target)
10361036
if (ind == 0 && !targets[1] && bond->params.arp_interval)
10371037
netdev_warn(bond->dev, "Removing last arp target with arp_interval on\n");
10381038

1039-
netdev_info(bond->dev, "Removing ARP target %pI4\n", &target);
1039+
netdev_dbg(bond->dev, "Removing ARP target %pI4\n", &target);
10401040

10411041
bond_for_each_slave(bond, slave, iter) {
10421042
targets_rx = slave->target_last_arp_rx;
@@ -1088,8 +1088,8 @@ static int bond_option_arp_ip_targets_set(struct bonding *bond,
10881088
static int bond_option_arp_validate_set(struct bonding *bond,
10891089
const struct bond_opt_value *newval)
10901090
{
1091-
netdev_info(bond->dev, "Setting arp_validate to %s (%llu)\n",
1092-
newval->string, newval->value);
1091+
netdev_dbg(bond->dev, "Setting arp_validate to %s (%llu)\n",
1092+
newval->string, newval->value);
10931093

10941094
if (bond->dev->flags & IFF_UP) {
10951095
if (!newval->value)
@@ -1105,8 +1105,8 @@ static int bond_option_arp_validate_set(struct bonding *bond,
11051105
static int bond_option_arp_all_targets_set(struct bonding *bond,
11061106
const struct bond_opt_value *newval)
11071107
{
1108-
netdev_info(bond->dev, "Setting arp_all_targets to %s (%llu)\n",
1109-
newval->string, newval->value);
1108+
netdev_dbg(bond->dev, "Setting arp_all_targets to %s (%llu)\n",
1109+
newval->string, newval->value);
11101110
bond->params.arp_all_targets = newval->value;
11111111

11121112
return 0;
@@ -1126,7 +1126,7 @@ static int bond_option_primary_set(struct bonding *bond,
11261126
*p = '\0';
11271127
/* check to see if we are clearing primary */
11281128
if (!strlen(primary)) {
1129-
netdev_info(bond->dev, "Setting primary slave to None\n");
1129+
netdev_dbg(bond->dev, "Setting primary slave to None\n");
11301130
RCU_INIT_POINTER(bond->primary_slave, NULL);
11311131
memset(bond->params.primary, 0, sizeof(bond->params.primary));
11321132
bond_select_active_slave(bond);
@@ -1135,8 +1135,8 @@ static int bond_option_primary_set(struct bonding *bond,
11351135

11361136
bond_for_each_slave(bond, slave, iter) {
11371137
if (strncmp(slave->dev->name, primary, IFNAMSIZ) == 0) {
1138-
netdev_info(bond->dev, "Setting %s as primary slave\n",
1139-
slave->dev->name);
1138+
netdev_dbg(bond->dev, "Setting %s as primary slave\n",
1139+
slave->dev->name);
11401140
rcu_assign_pointer(bond->primary_slave, slave);
11411141
strcpy(bond->params.primary, slave->dev->name);
11421142
bond_select_active_slave(bond);
@@ -1145,15 +1145,15 @@ static int bond_option_primary_set(struct bonding *bond,
11451145
}
11461146

11471147
if (rtnl_dereference(bond->primary_slave)) {
1148-
netdev_info(bond->dev, "Setting primary slave to None\n");
1148+
netdev_dbg(bond->dev, "Setting primary slave to None\n");
11491149
RCU_INIT_POINTER(bond->primary_slave, NULL);
11501150
bond_select_active_slave(bond);
11511151
}
11521152
strncpy(bond->params.primary, primary, IFNAMSIZ);
11531153
bond->params.primary[IFNAMSIZ - 1] = 0;
11541154

1155-
netdev_info(bond->dev, "Recording %s as primary, but it has not been enslaved to %s yet\n",
1156-
primary, bond->dev->name);
1155+
netdev_dbg(bond->dev, "Recording %s as primary, but it has not been enslaved to %s yet\n",
1156+
primary, bond->dev->name);
11571157

11581158
out:
11591159
unblock_netpoll_tx();
@@ -1164,8 +1164,8 @@ static int bond_option_primary_set(struct bonding *bond,
11641164
static int bond_option_primary_reselect_set(struct bonding *bond,
11651165
const struct bond_opt_value *newval)
11661166
{
1167-
netdev_info(bond->dev, "Setting primary_reselect to %s (%llu)\n",
1168-
newval->string, newval->value);
1167+
netdev_dbg(bond->dev, "Setting primary_reselect to %s (%llu)\n",
1168+
newval->string, newval->value);
11691169
bond->params.primary_reselect = newval->value;
11701170

11711171
block_netpoll_tx();
@@ -1178,8 +1178,8 @@ static int bond_option_primary_reselect_set(struct bonding *bond,
11781178
static int bond_option_fail_over_mac_set(struct bonding *bond,
11791179
const struct bond_opt_value *newval)
11801180
{
1181-
netdev_info(bond->dev, "Setting fail_over_mac to %s (%llu)\n",
1182-
newval->string, newval->value);
1181+
netdev_dbg(bond->dev, "Setting fail_over_mac to %s (%llu)\n",
1182+
newval->string, newval->value);
11831183
bond->params.fail_over_mac = newval->value;
11841184

11851185
return 0;
@@ -1188,8 +1188,8 @@ static int bond_option_fail_over_mac_set(struct bonding *bond,
11881188
static int bond_option_xmit_hash_policy_set(struct bonding *bond,
11891189
const struct bond_opt_value *newval)
11901190
{
1191-
netdev_info(bond->dev, "Setting xmit hash policy to %s (%llu)\n",
1192-
newval->string, newval->value);
1191+
netdev_dbg(bond->dev, "Setting xmit hash policy to %s (%llu)\n",
1192+
newval->string, newval->value);
11931193
bond->params.xmit_policy = newval->value;
11941194

11951195
return 0;
@@ -1198,8 +1198,8 @@ static int bond_option_xmit_hash_policy_set(struct bonding *bond,
11981198
static int bond_option_resend_igmp_set(struct bonding *bond,
11991199
const struct bond_opt_value *newval)
12001200
{
1201-
netdev_info(bond->dev, "Setting resend_igmp to %llu\n",
1202-
newval->value);
1201+
netdev_dbg(bond->dev, "Setting resend_igmp to %llu\n",
1202+
newval->value);
12031203
bond->params.resend_igmp = newval->value;
12041204

12051205
return 0;
@@ -1237,8 +1237,8 @@ static int bond_option_all_slaves_active_set(struct bonding *bond,
12371237
static int bond_option_min_links_set(struct bonding *bond,
12381238
const struct bond_opt_value *newval)
12391239
{
1240-
netdev_info(bond->dev, "Setting min links value to %llu\n",
1241-
newval->value);
1240+
netdev_dbg(bond->dev, "Setting min links value to %llu\n",
1241+
newval->value);
12421242
bond->params.min_links = newval->value;
12431243
bond_set_carrier(bond);
12441244

@@ -1256,6 +1256,8 @@ static int bond_option_lp_interval_set(struct bonding *bond,
12561256
static int bond_option_pps_set(struct bonding *bond,
12571257
const struct bond_opt_value *newval)
12581258
{
1259+
netdev_dbg(bond->dev, "Setting packets per slave to %llu\n",
1260+
newval->value);
12591261
bond->params.packets_per_slave = newval->value;
12601262
if (newval->value > 0) {
12611263
bond->params.reciprocal_packets_per_slave =
@@ -1274,8 +1276,8 @@ static int bond_option_pps_set(struct bonding *bond,
12741276
static int bond_option_lacp_rate_set(struct bonding *bond,
12751277
const struct bond_opt_value *newval)
12761278
{
1277-
netdev_info(bond->dev, "Setting LACP rate to %s (%llu)\n",
1278-
newval->string, newval->value);
1279+
netdev_dbg(bond->dev, "Setting LACP rate to %s (%llu)\n",
1280+
newval->string, newval->value);
12791281
bond->params.lacp_fast = newval->value;
12801282
bond_3ad_update_lacp_rate(bond);
12811283

@@ -1285,8 +1287,8 @@ static int bond_option_lacp_rate_set(struct bonding *bond,
12851287
static int bond_option_ad_select_set(struct bonding *bond,
12861288
const struct bond_opt_value *newval)
12871289
{
1288-
netdev_info(bond->dev, "Setting ad_select to %s (%llu)\n",
1289-
newval->string, newval->value);
1290+
netdev_dbg(bond->dev, "Setting ad_select to %s (%llu)\n",
1291+
newval->string, newval->value);
12901292
bond->params.ad_select = newval->value;
12911293

12921294
return 0;
@@ -1347,7 +1349,7 @@ static int bond_option_queue_id_set(struct bonding *bond,
13471349
return ret;
13481350

13491351
err_no_cmd:
1350-
netdev_info(bond->dev, "invalid input for queue_id set\n");
1352+
netdev_dbg(bond->dev, "invalid input for queue_id set\n");
13511353
ret = -EPERM;
13521354
goto out;
13531355

@@ -1369,20 +1371,20 @@ static int bond_option_slaves_set(struct bonding *bond,
13691371

13701372
dev = __dev_get_by_name(dev_net(bond->dev), ifname);
13711373
if (!dev) {
1372-
netdev_info(bond->dev, "interface %s does not exist!\n",
1373-
ifname);
1374+
netdev_dbg(bond->dev, "interface %s does not exist!\n",
1375+
ifname);
13741376
ret = -ENODEV;
13751377
goto out;
13761378
}
13771379

13781380
switch (command[0]) {
13791381
case '+':
1380-
netdev_info(bond->dev, "Adding slave %s\n", dev->name);
1382+
netdev_dbg(bond->dev, "Adding slave %s\n", dev->name);
13811383
ret = bond_enslave(bond->dev, dev);
13821384
break;
13831385

13841386
case '-':
1385-
netdev_info(bond->dev, "Removing slave %s\n", dev->name);
1387+
netdev_dbg(bond->dev, "Removing slave %s\n", dev->name);
13861388
ret = bond_release(bond->dev, dev);
13871389
break;
13881390

@@ -1402,8 +1404,8 @@ static int bond_option_slaves_set(struct bonding *bond,
14021404
static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
14031405
const struct bond_opt_value *newval)
14041406
{
1405-
netdev_info(bond->dev, "Setting dynamic-lb to %s (%llu)\n",
1406-
newval->string, newval->value);
1407+
netdev_dbg(bond->dev, "Setting dynamic-lb to %s (%llu)\n",
1408+
newval->string, newval->value);
14071409
bond->params.tlb_dynamic_lb = newval->value;
14081410

14091411
return 0;
@@ -1412,8 +1414,8 @@ static int bond_option_tlb_dynamic_lb_set(struct bonding *bond,
14121414
static int bond_option_ad_actor_sys_prio_set(struct bonding *bond,
14131415
const struct bond_opt_value *newval)
14141416
{
1415-
netdev_info(bond->dev, "Setting ad_actor_sys_prio to %llu\n",
1416-
newval->value);
1417+
netdev_dbg(bond->dev, "Setting ad_actor_sys_prio to %llu\n",
1418+
newval->value);
14171419

14181420
bond->params.ad_actor_sys_prio = newval->value;
14191421
bond_3ad_update_ad_actor_settings(bond);
@@ -1442,7 +1444,7 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
14421444
if (!is_valid_ether_addr(mac))
14431445
goto err;
14441446

1445-
netdev_info(bond->dev, "Setting ad_actor_system to %pM\n", mac);
1447+
netdev_dbg(bond->dev, "Setting ad_actor_system to %pM\n", mac);
14461448
ether_addr_copy(bond->params.ad_actor_system, mac);
14471449
bond_3ad_update_ad_actor_settings(bond);
14481450

@@ -1456,8 +1458,8 @@ static int bond_option_ad_actor_system_set(struct bonding *bond,
14561458
static int bond_option_ad_user_port_key_set(struct bonding *bond,
14571459
const struct bond_opt_value *newval)
14581460
{
1459-
netdev_info(bond->dev, "Setting ad_user_port_key to %llu\n",
1460-
newval->value);
1461+
netdev_dbg(bond->dev, "Setting ad_user_port_key to %llu\n",
1462+
newval->value);
14611463

14621464
bond->params.ad_user_port_key = newval->value;
14631465
return 0;

0 commit comments

Comments
 (0)