Commit a4634aa7 authored by Praveen Kumar Kannoju's avatar Praveen Kumar Kannoju Committed by Jakub Kicinski

bonding: rate-limit bonding driver inspect messages

Through the routine bond_mii_monitor(), bonding driver inspects and commits
the slave state changes. During the times when slave state change and
failure in aqcuiring rtnl lock happen at the same time, the routine
bond_mii_monitor() reschedules itself to come around after 1 msec to commit
the new state.

During this, it executes the routine bond_miimon_inspect() to re-inspect
the state chane and prints the corresponding slave state on to the console.
Hence we do see a message at every 1 msec till the rtnl lock is acquired
and state chage is committed.

This patch doesn't change how bond functions. It only simply limits this
kind of log flood.
Signed-off-by: default avatarPraveen Kumar Kannoju <praveen.kannoju@oracle.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Reviewed-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Acked-by: default avatarJay Vosburgh <jay.vosburgh@canonical.com>
Link: https://lore.kernel.org/r/20240221082752.4660-1-praveen.kannoju@oracle.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4679f4f1
...@@ -2611,7 +2611,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -2611,7 +2611,7 @@ static int bond_miimon_inspect(struct bonding *bond)
bond_propose_link_state(slave, BOND_LINK_FAIL); bond_propose_link_state(slave, BOND_LINK_FAIL);
commit++; commit++;
slave->delay = bond->params.downdelay; slave->delay = bond->params.downdelay;
if (slave->delay) { if (slave->delay && net_ratelimit()) {
slave_info(bond->dev, slave->dev, "link status down for %sinterface, disabling it in %d ms\n", slave_info(bond->dev, slave->dev, "link status down for %sinterface, disabling it in %d ms\n",
(BOND_MODE(bond) == (BOND_MODE(bond) ==
BOND_MODE_ACTIVEBACKUP) ? BOND_MODE_ACTIVEBACKUP) ?
...@@ -2625,6 +2625,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -2625,6 +2625,7 @@ static int bond_miimon_inspect(struct bonding *bond)
/* recovered before downdelay expired */ /* recovered before downdelay expired */
bond_propose_link_state(slave, BOND_LINK_UP); bond_propose_link_state(slave, BOND_LINK_UP);
slave->last_link_up = jiffies; slave->last_link_up = jiffies;
if (net_ratelimit())
slave_info(bond->dev, slave->dev, "link status up again after %d ms\n", slave_info(bond->dev, slave->dev, "link status up again after %d ms\n",
(bond->params.downdelay - slave->delay) * (bond->params.downdelay - slave->delay) *
bond->params.miimon); bond->params.miimon);
...@@ -2649,7 +2650,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -2649,7 +2650,7 @@ static int bond_miimon_inspect(struct bonding *bond)
commit++; commit++;
slave->delay = bond->params.updelay; slave->delay = bond->params.updelay;
if (slave->delay) { if (slave->delay && net_ratelimit()) {
slave_info(bond->dev, slave->dev, "link status up, enabling it in %d ms\n", slave_info(bond->dev, slave->dev, "link status up, enabling it in %d ms\n",
ignore_updelay ? 0 : ignore_updelay ? 0 :
bond->params.updelay * bond->params.updelay *
...@@ -2659,6 +2660,7 @@ static int bond_miimon_inspect(struct bonding *bond) ...@@ -2659,6 +2660,7 @@ static int bond_miimon_inspect(struct bonding *bond)
case BOND_LINK_BACK: case BOND_LINK_BACK:
if (!link_state) { if (!link_state) {
bond_propose_link_state(slave, BOND_LINK_DOWN); bond_propose_link_state(slave, BOND_LINK_DOWN);
if (net_ratelimit())
slave_info(bond->dev, slave->dev, "link status down again after %d ms\n", slave_info(bond->dev, slave->dev, "link status down again after %d ms\n",
(bond->params.updelay - slave->delay) * (bond->params.updelay - slave->delay) *
bond->params.miimon); bond->params.miimon);
......
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