Skip to content

Commit fee32de

Browse files
sureshredhatdavem330
authored andcommitted
net: bonding: debug: avoid printing debug logs when bond is not notifying peers
Currently "bond_should_notify_peers: slave ..." messages are printed whenever "bond_should_notify_peers" function is called. +++ Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): Received LACPDU on port 1 Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): Rx Machine: Port=1, Last State=6, Curr State=6 Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): partner sync=1 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 ... Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): Received LACPDU on port 2 Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): Rx Machine: Port=2, Last State=6, Curr State=6 Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): partner sync=1 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 +++ This is confusing and can also clutter up debug logs. Print logs only when the peer notification happens. Signed-off-by: Suresh Kumar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3cfcda2 commit fee32de

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,16 +1097,16 @@ static bool bond_should_notify_peers(struct bonding *bond)
10971097
slave = rcu_dereference(bond->curr_active_slave);
10981098
rcu_read_unlock();
10991099

1100-
netdev_dbg(bond->dev, "bond_should_notify_peers: slave %s\n",
1101-
slave ? slave->dev->name : "NULL");
1102-
11031100
if (!slave || !bond->send_peer_notif ||
11041101
bond->send_peer_notif %
11051102
max(1, bond->params.peer_notif_delay) != 0 ||
11061103
!netif_carrier_ok(bond->dev) ||
11071104
test_bit(__LINK_STATE_LINKWATCH_PENDING, &slave->dev->state))
11081105
return false;
11091106

1107+
netdev_dbg(bond->dev, "bond_should_notify_peers: slave %s\n",
1108+
slave ? slave->dev->name : "NULL");
1109+
11101110
return true;
11111111
}
11121112

0 commit comments

Comments
 (0)