[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200624135447.3261002-4-olteanv@gmail.com>
Date: Wed, 24 Jun 2020 16:54:46 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: netdev@...r.kernel.org, davem@...emloft.net
Cc: andrew@...n.ch, f.fainelli@...il.com, vivien.didelot@...il.com,
po.liu@....com, xiaoliang.yang_1@....com, kuba@...nel.org
Subject: [PATCH net 3/4] net: dsa: sja1105: recalculate gating subschedule after deleting tc-gate rules
From: Vladimir Oltean <vladimir.oltean@....com>
Currently, tas_data->enabled would remain true even after deleting all
tc-gate rules from the switch ports, which would cause the
sja1105_tas_state_machine to get unnecessarily scheduled.
Also, if there were any errors which would prevent the hardware from
enabling the gating schedule, the sja1105_tas_state_machine would
continuously detect and print that, spamming the kernel log, even if the
rules were subsequently deleted.
The rules themselves are _not_ active, because sja1105_init_scheduling
does enough of a job to not install the gating schedule in the static
config. But the virtual link rules themselves are still present.
So call the functions that remove the tc-gate configuration from
priv->tas_data.gating_cfg, so that tas_data->enabled can be set to
false, and sja1105_tas_state_machine will stop from being scheduled.
Fixes: 834f8933d5dd ("net: dsa: sja1105: implement tc-gate using time-triggered virtual links")
Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
---
drivers/net/dsa/sja1105/sja1105_vl.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/dsa/sja1105/sja1105_vl.c b/drivers/net/dsa/sja1105/sja1105_vl.c
index 936b14cbb45d..8524e15fdc4f 100644
--- a/drivers/net/dsa/sja1105/sja1105_vl.c
+++ b/drivers/net/dsa/sja1105/sja1105_vl.c
@@ -550,10 +550,18 @@ int sja1105_vl_delete(struct sja1105_private *priv, int port,
kfree(rule);
}
+ rc = sja1105_compose_gating_subschedule(priv, extack);
+ if (rc)
+ return rc;
+
rc = sja1105_init_virtual_links(priv, extack);
if (rc)
return rc;
+ rc = sja1105_init_scheduling(priv);
+ if (rc < 0)
+ return rc;
+
return sja1105_static_config_reload(priv, SJA1105_VIRTUAL_LINKS);
}
--
2.25.1
Powered by blists - more mailing lists