Lines Matching refs:mlxsw_sp

153 static int mlxsw_sp_erif_entry_get(struct mlxsw_sp *mlxsw_sp,  in mlxsw_sp_erif_entry_get()  argument
180 err = mlxsw_sp_rif_counter_value_get(mlxsw_sp, rif, in mlxsw_sp_erif_entry_get()
198 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_erif_entries_dump() local
212 rif_count = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); in mlxsw_sp_dpipe_table_erif_entries_dump()
221 struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); in mlxsw_sp_dpipe_table_erif_entries_dump()
225 err = mlxsw_sp_erif_entry_get(mlxsw_sp, &entry, rif, in mlxsw_sp_dpipe_table_erif_entries_dump()
257 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_erif_counters_update() local
261 for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { in mlxsw_sp_dpipe_table_erif_counters_update()
262 struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); in mlxsw_sp_dpipe_table_erif_counters_update()
267 mlxsw_sp_rif_counter_alloc(mlxsw_sp, rif, in mlxsw_sp_dpipe_table_erif_counters_update()
270 mlxsw_sp_rif_counter_free(mlxsw_sp, rif, in mlxsw_sp_dpipe_table_erif_counters_update()
279 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_erif_size_get() local
281 return MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); in mlxsw_sp_dpipe_table_erif_size_get()
292 static int mlxsw_sp_dpipe_erif_table_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_dpipe_erif_table_init() argument
294 struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); in mlxsw_sp_dpipe_erif_table_init()
299 mlxsw_sp, false); in mlxsw_sp_dpipe_erif_table_init()
302 static void mlxsw_sp_dpipe_erif_table_fini(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_dpipe_erif_table_fini() argument
304 struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); in mlxsw_sp_dpipe_erif_table_fini()
508 mlxsw_sp_dpipe_table_host_entry_fill(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_dpipe_table_host_entry_fill() argument
528 err = mlxsw_sp_neigh_counter_get(mlxsw_sp, neigh_entry, in mlxsw_sp_dpipe_table_host_entry_fill()
535 mlxsw_sp_dpipe_table_host_entries_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_dpipe_table_host_entries_get() argument
550 rif_count = MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); in mlxsw_sp_dpipe_table_host_entries_get()
557 for (; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { in mlxsw_sp_dpipe_table_host_entries_get()
558 struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); in mlxsw_sp_dpipe_table_host_entries_get()
578 mlxsw_sp_dpipe_table_host_entry_fill(mlxsw_sp, entry, in mlxsw_sp_dpipe_table_host_entries_get()
614 mlxsw_sp_dpipe_table_host_entries_dump(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_dpipe_table_host_entries_dump() argument
639 err = mlxsw_sp_dpipe_table_host_entries_get(mlxsw_sp, &entry, in mlxsw_sp_dpipe_table_host_entries_dump()
651 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_host4_entries_dump() local
653 return mlxsw_sp_dpipe_table_host_entries_dump(mlxsw_sp, in mlxsw_sp_dpipe_table_host4_entries_dump()
659 mlxsw_sp_dpipe_table_host_counters_update(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_dpipe_table_host_counters_update() argument
665 for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { in mlxsw_sp_dpipe_table_host_counters_update()
666 struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); in mlxsw_sp_dpipe_table_host_counters_update()
681 mlxsw_sp_neigh_entry_counter_update(mlxsw_sp, in mlxsw_sp_dpipe_table_host_counters_update()
691 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_host4_counters_update() local
693 mlxsw_sp_dpipe_table_host_counters_update(mlxsw_sp, enable, AF_INET); in mlxsw_sp_dpipe_table_host4_counters_update()
698 mlxsw_sp_dpipe_table_host_size_get(struct mlxsw_sp *mlxsw_sp, int type) in mlxsw_sp_dpipe_table_host_size_get() argument
704 for (i = 0; i < MLXSW_CORE_RES_GET(mlxsw_sp->core, MAX_RIFS); i++) { in mlxsw_sp_dpipe_table_host_size_get()
705 struct mlxsw_sp_rif *rif = mlxsw_sp_rif_by_index(mlxsw_sp, i); in mlxsw_sp_dpipe_table_host_size_get()
730 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_host4_size_get() local
732 return mlxsw_sp_dpipe_table_host_size_get(mlxsw_sp, AF_INET); in mlxsw_sp_dpipe_table_host4_size_get()
745 static int mlxsw_sp_dpipe_host4_table_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_dpipe_host4_table_init() argument
747 struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); in mlxsw_sp_dpipe_host4_table_init()
753 mlxsw_sp, false); in mlxsw_sp_dpipe_host4_table_init()
772 static void mlxsw_sp_dpipe_host4_table_fini(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_dpipe_host4_table_fini() argument
774 struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); in mlxsw_sp_dpipe_host4_table_fini()
790 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_host6_entries_dump() local
792 return mlxsw_sp_dpipe_table_host_entries_dump(mlxsw_sp, in mlxsw_sp_dpipe_table_host6_entries_dump()
799 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_host6_counters_update() local
801 mlxsw_sp_dpipe_table_host_counters_update(mlxsw_sp, enable, AF_INET6); in mlxsw_sp_dpipe_table_host6_counters_update()
807 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_host6_size_get() local
809 return mlxsw_sp_dpipe_table_host_size_get(mlxsw_sp, AF_INET6); in mlxsw_sp_dpipe_table_host6_size_get()
822 static int mlxsw_sp_dpipe_host6_table_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_dpipe_host6_table_init() argument
824 struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); in mlxsw_sp_dpipe_host6_table_init()
830 mlxsw_sp, false); in mlxsw_sp_dpipe_host6_table_init()
849 static void mlxsw_sp_dpipe_host6_table_fini(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_dpipe_host6_table_fini() argument
851 struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); in mlxsw_sp_dpipe_host6_table_fini()
907 static u64 mlxsw_sp_dpipe_table_adj_size(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_dpipe_table_adj_size() argument
912 mlxsw_sp_nexthop_for_each(nh, mlxsw_sp->router) in mlxsw_sp_dpipe_table_adj_size()
1062 static void mlxsw_sp_dpipe_table_adj_entry_fill(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_dpipe_table_adj_entry_fill() argument
1076 err = mlxsw_sp_nexthop_counter_get(mlxsw_sp, nh, &entry->counter); in mlxsw_sp_dpipe_table_adj_entry_fill()
1082 mlxsw_sp_dpipe_table_adj_entries_get(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_dpipe_table_adj_entries_get() argument
1096 nh_count_max = mlxsw_sp_dpipe_table_adj_size(mlxsw_sp); in mlxsw_sp_dpipe_table_adj_entries_get()
1104 mlxsw_sp_nexthop_for_each(nh, mlxsw_sp->router) { in mlxsw_sp_dpipe_table_adj_entries_get()
1112 mlxsw_sp_dpipe_table_adj_entry_fill(mlxsw_sp, nh, entry); in mlxsw_sp_dpipe_table_adj_entries_get()
1151 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_adj_entries_dump() local
1170 err = mlxsw_sp_dpipe_table_adj_entries_get(mlxsw_sp, &entry, in mlxsw_sp_dpipe_table_adj_entries_dump()
1179 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_adj_counters_update() local
1185 mlxsw_sp_nexthop_for_each(nh, mlxsw_sp->router) { in mlxsw_sp_dpipe_table_adj_counters_update()
1193 mlxsw_sp_nexthop_counter_alloc(mlxsw_sp, nh); in mlxsw_sp_dpipe_table_adj_counters_update()
1195 mlxsw_sp_nexthop_counter_free(mlxsw_sp, nh); in mlxsw_sp_dpipe_table_adj_counters_update()
1196 mlxsw_sp_nexthop_update(mlxsw_sp, in mlxsw_sp_dpipe_table_adj_counters_update()
1205 struct mlxsw_sp *mlxsw_sp = priv; in mlxsw_sp_dpipe_table_adj_size_get() local
1209 size = mlxsw_sp_dpipe_table_adj_size(mlxsw_sp); in mlxsw_sp_dpipe_table_adj_size_get()
1225 static int mlxsw_sp_dpipe_adj_table_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_dpipe_adj_table_init() argument
1227 struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); in mlxsw_sp_dpipe_adj_table_init()
1233 mlxsw_sp, false); in mlxsw_sp_dpipe_adj_table_init()
1252 static void mlxsw_sp_dpipe_adj_table_fini(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_dpipe_adj_table_fini() argument
1254 struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); in mlxsw_sp_dpipe_adj_table_fini()
1260 int mlxsw_sp_dpipe_init(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_dpipe_init() argument
1262 struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); in mlxsw_sp_dpipe_init()
1269 err = mlxsw_sp_dpipe_erif_table_init(mlxsw_sp); in mlxsw_sp_dpipe_init()
1273 err = mlxsw_sp_dpipe_host4_table_init(mlxsw_sp); in mlxsw_sp_dpipe_init()
1277 err = mlxsw_sp_dpipe_host6_table_init(mlxsw_sp); in mlxsw_sp_dpipe_init()
1281 err = mlxsw_sp_dpipe_adj_table_init(mlxsw_sp); in mlxsw_sp_dpipe_init()
1287 mlxsw_sp_dpipe_host6_table_fini(mlxsw_sp); in mlxsw_sp_dpipe_init()
1289 mlxsw_sp_dpipe_host4_table_fini(mlxsw_sp); in mlxsw_sp_dpipe_init()
1291 mlxsw_sp_dpipe_erif_table_fini(mlxsw_sp); in mlxsw_sp_dpipe_init()
1293 devlink_dpipe_headers_unregister(priv_to_devlink(mlxsw_sp->core)); in mlxsw_sp_dpipe_init()
1297 void mlxsw_sp_dpipe_fini(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_dpipe_fini() argument
1299 struct devlink *devlink = priv_to_devlink(mlxsw_sp->core); in mlxsw_sp_dpipe_fini()
1301 mlxsw_sp_dpipe_adj_table_fini(mlxsw_sp); in mlxsw_sp_dpipe_fini()
1302 mlxsw_sp_dpipe_host6_table_fini(mlxsw_sp); in mlxsw_sp_dpipe_fini()
1303 mlxsw_sp_dpipe_host4_table_fini(mlxsw_sp); in mlxsw_sp_dpipe_fini()
1304 mlxsw_sp_dpipe_erif_table_fini(mlxsw_sp); in mlxsw_sp_dpipe_fini()