mlxsw: spectrum_router: Remove unnecessary checks
authorIdo Schimmel <idosch@mellanox.com>
Thu, 26 Dec 2019 16:41:13 +0000 (18:41 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Dec 2019 21:13:22 +0000 (13:13 -0800)
Now that the networking stack takes care of only notifying the routes of
interest, we do not need to maintain a list of identical routes.

Remove the check that tests if the route is the first route in the FIB
node.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c

index f62e8d67348cfb5834923e8e7322a506f4149ef3..87a010cb43b1b8a8ad7501bb1a3c97c5e2a505c9 100644 (file)
@@ -3231,10 +3231,6 @@ mlxsw_sp_nexthop_group_update(struct mlxsw_sp *mlxsw_sp,
        return 0;
 }
 
-static bool
-mlxsw_sp_fib_node_entry_is_first(const struct mlxsw_sp_fib_node *fib_node,
-                                const struct mlxsw_sp_fib_entry *fib_entry);
-
 static int
 mlxsw_sp_nexthop_fib_entries_update(struct mlxsw_sp *mlxsw_sp,
                                    struct mlxsw_sp_nexthop_group *nh_grp)
@@ -3243,9 +3239,6 @@ mlxsw_sp_nexthop_fib_entries_update(struct mlxsw_sp *mlxsw_sp,
        int err;
 
        list_for_each_entry(fib_entry, &nh_grp->fib_list, nexthop_group_node) {
-               if (!mlxsw_sp_fib_node_entry_is_first(fib_entry->fib_node,
-                                                     fib_entry))
-                       continue;
                err = mlxsw_sp_fib_entry_update(mlxsw_sp, fib_entry);
                if (err)
                        return err;
@@ -3263,12 +3256,8 @@ mlxsw_sp_nexthop_fib_entries_refresh(struct mlxsw_sp_nexthop_group *nh_grp)
        enum mlxsw_reg_ralue_op op = MLXSW_REG_RALUE_OP_WRITE_WRITE;
        struct mlxsw_sp_fib_entry *fib_entry;
 
-       list_for_each_entry(fib_entry, &nh_grp->fib_list, nexthop_group_node) {
-               if (!mlxsw_sp_fib_node_entry_is_first(fib_entry->fib_node,
-                                                     fib_entry))
-                       continue;
+       list_for_each_entry(fib_entry, &nh_grp->fib_list, nexthop_group_node)
                mlxsw_sp_fib_entry_offload_refresh(fib_entry, op, 0);
-       }
 }
 
 static void mlxsw_sp_adj_grp_size_round_up(u16 *p_adj_grp_size)
@@ -4785,9 +4774,6 @@ static int mlxsw_sp_fib_node_entry_add(struct mlxsw_sp *mlxsw_sp,
 {
        struct mlxsw_sp_fib_node *fib_node = fib_entry->fib_node;
 
-       if (!mlxsw_sp_fib_node_entry_is_first(fib_node, fib_entry))
-               return 0;
-
        /* To prevent packet loss, overwrite the previously offloaded
         * entry.
         */