mlxsw: spectrum: Fix ageing time value
authorJiri Pirko <jiri@mellanox.com>
Wed, 28 Oct 2015 09:17:02 +0000 (10:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Oct 2015 03:26:52 +0000 (12:26 +0900)
The value passed through switchdev attr set is not in jiffies, but in
clock_t, so fix the convert.

Reported-by: Sagi Rotem <sagir@mellanox.com>
Fixes: 56ade8fe3f ("mlxsw: spectrum: Add initial support for Spectrum ASIC")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c

index 1f3b12e8dfb40593f4181d4f7610251cf9413528..c2d09699b6daf92f346b7e7ab994cce2168f3d9e 100644 (file)
@@ -225,9 +225,10 @@ static int mlxsw_sp_ageing_set(struct mlxsw_sp *mlxsw_sp, u32 ageing_time)
 
 static int mlxsw_sp_port_attr_br_ageing_set(struct mlxsw_sp_port *mlxsw_sp_port,
                                            struct switchdev_trans *trans,
-                                           unsigned long ageing_jiffies)
+                                           unsigned long ageing_clock_t)
 {
        struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp;
+       unsigned long ageing_jiffies = clock_t_to_jiffies(ageing_clock_t);
        u32 ageing_time = jiffies_to_msecs(ageing_jiffies) / 1000;
 
        if (switchdev_trans_ph_prepare(trans))