Lines Matching refs:mr
254 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_route_write() local
264 mr_route->route_priv = kzalloc(mr->mr_ops->route_priv_size, in mlxsw_sp_mr_route_write()
274 err = mr->mr_ops->route_create(mlxsw_sp, mr->priv, in mlxsw_sp_mr_route_write()
280 err = mr->mr_ops->route_update(mlxsw_sp, mr_route->route_priv, in mlxsw_sp_mr_route_write()
292 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_route_erase() local
294 mr->mr_ops->route_destroy(mlxsw_sp, mr->priv, mr_route->route_priv); in mlxsw_sp_mr_route_erase()
485 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_route_ivif_resolve() local
495 err = mr->mr_ops->route_irif_update(mlxsw_sp, rve->mr_route->route_priv, in mlxsw_sp_mr_route_ivif_resolve()
500 err = mr->mr_ops->route_action_update(mlxsw_sp, in mlxsw_sp_mr_route_ivif_resolve()
519 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_route_ivif_unresolve() local
521 mr->mr_ops->route_action_update(mlxsw_sp, rve->mr_route->route_priv, in mlxsw_sp_mr_route_ivif_unresolve()
534 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_route_evif_resolve() local
541 err = mr->mr_ops->route_erif_add(mlxsw_sp, in mlxsw_sp_mr_route_evif_resolve()
553 err = mr->mr_ops->route_action_update(mlxsw_sp, in mlxsw_sp_mr_route_evif_resolve()
563 err = mr->mr_ops->route_min_mtu_update(mlxsw_sp, in mlxsw_sp_mr_route_evif_resolve()
576 mr->mr_ops->route_action_update(mlxsw_sp, in mlxsw_sp_mr_route_evif_resolve()
581 mr->mr_ops->route_erif_del(mlxsw_sp, rve->mr_route->route_priv, in mlxsw_sp_mr_route_evif_resolve()
593 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_route_evif_unresolve() local
610 mr->mr_ops->route_action_update(mlxsw_sp, in mlxsw_sp_mr_route_evif_unresolve()
616 mr->mr_ops->route_erif_del(mlxsw_sp, rve->mr_route->route_priv, rifi); in mlxsw_sp_mr_route_evif_unresolve()
751 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_rif_mtu_update() local
766 mr->mr_ops->route_min_mtu_update(mlxsw_sp, in mlxsw_sp_mr_rif_mtu_update()
906 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_table_create() local
911 mr_table = kzalloc(sizeof(*mr_table) + mr->mr_ops->route_priv_size, in mlxsw_sp_mr_table_create()
934 err = mr->mr_ops->route_create(mlxsw_sp, mr->priv, in mlxsw_sp_mr_table_create()
939 mutex_lock(&mr->table_list_lock); in mlxsw_sp_mr_table_create()
940 list_add_tail(&mr_table->node, &mr->table_list); in mlxsw_sp_mr_table_create()
941 mutex_unlock(&mr->table_list_lock); in mlxsw_sp_mr_table_create()
955 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_table_destroy() local
958 mutex_lock(&mr->table_list_lock); in mlxsw_sp_mr_table_destroy()
960 mutex_unlock(&mr->table_list_lock); in mlxsw_sp_mr_table_destroy()
961 mr->mr_ops->route_destroy(mlxsw_sp, mr->priv, in mlxsw_sp_mr_table_destroy()
997 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_route_stats_update() local
1003 mr->mr_ops->route_stats(mlxsw_sp, mr_route->route_priv, &packets, in mlxsw_sp_mr_route_stats_update()
1014 struct mlxsw_sp_mr *mr = container_of(work, struct mlxsw_sp_mr, in mlxsw_sp_mr_stats_update() local
1020 mutex_lock(&mr->table_list_lock); in mlxsw_sp_mr_stats_update()
1021 list_for_each_entry(mr_table, &mr->table_list, node) { in mlxsw_sp_mr_stats_update()
1028 mutex_unlock(&mr->table_list_lock); in mlxsw_sp_mr_stats_update()
1031 mlxsw_core_schedule_dw(&mr->stats_update_dw, interval); in mlxsw_sp_mr_stats_update()
1037 struct mlxsw_sp_mr *mr; in mlxsw_sp_mr_init() local
1041 mr = kzalloc(sizeof(*mr) + mr_ops->priv_size, GFP_KERNEL); in mlxsw_sp_mr_init()
1042 if (!mr) in mlxsw_sp_mr_init()
1044 mr->mr_ops = mr_ops; in mlxsw_sp_mr_init()
1045 mlxsw_sp->mr = mr; in mlxsw_sp_mr_init()
1046 INIT_LIST_HEAD(&mr->table_list); in mlxsw_sp_mr_init()
1047 mutex_init(&mr->table_list_lock); in mlxsw_sp_mr_init()
1049 err = mr_ops->init(mlxsw_sp, mr->priv); in mlxsw_sp_mr_init()
1054 INIT_DELAYED_WORK(&mr->stats_update_dw, mlxsw_sp_mr_stats_update); in mlxsw_sp_mr_init()
1056 mlxsw_core_schedule_dw(&mr->stats_update_dw, interval); in mlxsw_sp_mr_init()
1059 mutex_destroy(&mr->table_list_lock); in mlxsw_sp_mr_init()
1060 kfree(mr); in mlxsw_sp_mr_init()
1066 struct mlxsw_sp_mr *mr = mlxsw_sp->mr; in mlxsw_sp_mr_fini() local
1068 cancel_delayed_work_sync(&mr->stats_update_dw); in mlxsw_sp_mr_fini()
1069 mr->mr_ops->fini(mlxsw_sp, mr->priv); in mlxsw_sp_mr_fini()
1070 mutex_destroy(&mr->table_list_lock); in mlxsw_sp_mr_fini()
1071 kfree(mr); in mlxsw_sp_mr_fini()