All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: mscc: ocelot: fix address ageing time (again)
@ 2020-05-21 21:31 Vladimir Oltean
  2020-05-22 23:16 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2020-05-21 21:31 UTC (permalink / raw)
  To: davem, netdev
  Cc: allan.nielsen, horatiu.vultur, andrew, f.fainelli,
	vivien.didelot, joergen.andreasen, claudiu.manoil,
	UNGLinuxDriver, alexandru.marginean, xiaoliang.yang_1, yangbo.lu,
	po.liu

From: Vladimir Oltean <vladimir.oltean@nxp.com>

ocelot_set_ageing_time has 2 callers:
 - felix_set_ageing_time: from drivers/net/dsa/ocelot/felix.c
 - ocelot_port_attr_ageing_set: from drivers/net/ethernet/mscc/ocelot.c

The issue described in the fixed commit below actually happened for the
felix_set_ageing_time code path only, since ocelot_port_attr_ageing_set
was already dividing by 1000. So to make both paths symmetrical (and to
fix addresses getting aged way too fast on Ocelot), stop dividing by
1000 at caller side altogether.

Fixes: c0d7eccbc761 ("net: mscc: ocelot: ANA_AUTOAGE_AGE_PERIOD holds a value in seconds, not ms")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 drivers/net/ethernet/mscc/ocelot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index e200af736b10..468c83a4c557 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -1478,7 +1478,7 @@ static void ocelot_port_attr_ageing_set(struct ocelot *ocelot, int port,
 					unsigned long ageing_clock_t)
 {
 	unsigned long ageing_jiffies = clock_t_to_jiffies(ageing_clock_t);
-	u32 ageing_time = jiffies_to_msecs(ageing_jiffies) / 1000;
+	u32 ageing_time = jiffies_to_msecs(ageing_jiffies);
 
 	ocelot_set_ageing_time(ocelot, ageing_time);
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net: mscc: ocelot: fix address ageing time (again)
  2020-05-21 21:31 [PATCH net] net: mscc: ocelot: fix address ageing time (again) Vladimir Oltean
@ 2020-05-22 23:16 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-22 23:16 UTC (permalink / raw)
  To: olteanv
  Cc: netdev, allan.nielsen, horatiu.vultur, andrew, f.fainelli,
	vivien.didelot, joergen.andreasen, claudiu.manoil,
	UNGLinuxDriver, alexandru.marginean, xiaoliang.yang_1, yangbo.lu,
	po.liu

From: Vladimir Oltean <olteanv@gmail.com>
Date: Fri, 22 May 2020 00:31:23 +0300

> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> ocelot_set_ageing_time has 2 callers:
>  - felix_set_ageing_time: from drivers/net/dsa/ocelot/felix.c
>  - ocelot_port_attr_ageing_set: from drivers/net/ethernet/mscc/ocelot.c
> 
> The issue described in the fixed commit below actually happened for the
> felix_set_ageing_time code path only, since ocelot_port_attr_ageing_set
> was already dividing by 1000. So to make both paths symmetrical (and to
> fix addresses getting aged way too fast on Ocelot), stop dividing by
> 1000 at caller side altogether.
> 
> Fixes: c0d7eccbc761 ("net: mscc: ocelot: ANA_AUTOAGE_AGE_PERIOD holds a value in seconds, not ms")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-22 23:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 21:31 [PATCH net] net: mscc: ocelot: fix address ageing time (again) Vladimir Oltean
2020-05-22 23:16 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.