提交 8a0b7275 编写于 作者: I Ido Schimmel 提交者: David S. Miller

mlxsw: spectrum_router: Remove redundant check

We only add neighbour entries that are also used for nexthops to
'nexthop_neighs_list', so when iterating over this list there's no need
to check that the entry is indeed used for nexthops.

Remove the redundant check.
Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
Signed-off-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a8eca326
...@@ -847,13 +847,11 @@ static void mlxsw_sp_router_neighs_update_nh(struct mlxsw_sp *mlxsw_sp) ...@@ -847,13 +847,11 @@ static void mlxsw_sp_router_neighs_update_nh(struct mlxsw_sp *mlxsw_sp)
/* Take RTNL mutex here to prevent lists from changes */ /* Take RTNL mutex here to prevent lists from changes */
rtnl_lock(); rtnl_lock();
list_for_each_entry(neigh_entry, &mlxsw_sp->router.nexthop_neighs_list, list_for_each_entry(neigh_entry, &mlxsw_sp->router.nexthop_neighs_list,
nexthop_neighs_list_node) { nexthop_neighs_list_node)
/* If this neigh have nexthops, make the kernel think this neigh /* If this neigh have nexthops, make the kernel think this neigh
* is active regardless of the traffic. * is active regardless of the traffic.
*/ */
if (!list_empty(&neigh_entry->nexthop_list)) neigh_event_send(neigh_entry->key.n, NULL);
neigh_event_send(neigh_entry->key.n, NULL);
}
rtnl_unlock(); rtnl_unlock();
} }
...@@ -897,11 +895,9 @@ static void mlxsw_sp_router_probe_unresolved_nexthops(struct work_struct *work) ...@@ -897,11 +895,9 @@ static void mlxsw_sp_router_probe_unresolved_nexthops(struct work_struct *work)
*/ */
rtnl_lock(); rtnl_lock();
list_for_each_entry(neigh_entry, &mlxsw_sp->router.nexthop_neighs_list, list_for_each_entry(neigh_entry, &mlxsw_sp->router.nexthop_neighs_list,
nexthop_neighs_list_node) { nexthop_neighs_list_node)
if (!(neigh_entry->key.n->nud_state & NUD_VALID) && if (!(neigh_entry->key.n->nud_state & NUD_VALID))
!list_empty(&neigh_entry->nexthop_list))
neigh_event_send(neigh_entry->key.n, NULL); neigh_event_send(neigh_entry->key.n, NULL);
}
rtnl_unlock(); rtnl_unlock();
mlxsw_core_schedule_dw(&mlxsw_sp->router.nexthop_probe_dw, mlxsw_core_schedule_dw(&mlxsw_sp->router.nexthop_probe_dw,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册