• Home
  • Raw
  • Download

Lines Matching refs:mlxsw_sp_port

31 	int (*check_params)(struct mlxsw_sp_port *mlxsw_sp_port,
33 int (*replace)(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle,
35 int (*destroy)(struct mlxsw_sp_port *mlxsw_sp_port,
37 int (*get_stats)(struct mlxsw_sp_port *mlxsw_sp_port,
40 int (*get_xstats)(struct mlxsw_sp_port *mlxsw_sp_port,
43 void (*clean_stats)(struct mlxsw_sp_port *mlxsw_sp_port,
48 void (*unoffload)(struct mlxsw_sp_port *mlxsw_sp_port,
160 mlxsw_sp_qdisc_find(struct mlxsw_sp_port *mlxsw_sp_port, u32 parent) in mlxsw_sp_qdisc_find() argument
162 struct mlxsw_sp_qdisc_state *qdisc_state = mlxsw_sp_port->qdisc; in mlxsw_sp_qdisc_find()
183 mlxsw_sp_qdisc_find_by_handle(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle) in mlxsw_sp_qdisc_find_by_handle() argument
185 struct mlxsw_sp_qdisc_state *qdisc_state = mlxsw_sp_port->qdisc; in mlxsw_sp_qdisc_find_by_handle()
203 static u8 mlxsw_sp_qdisc_get_prio_bitmap(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_get_prio_bitmap() argument
211 return mlxsw_sp_qdisc_get_prio_bitmap(mlxsw_sp_port, parent); in mlxsw_sp_qdisc_get_prio_bitmap()
217 static int mlxsw_sp_qdisc_get_tclass_num(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_get_tclass_num() argument
225 return mlxsw_sp_qdisc_get_tclass_num(mlxsw_sp_port, parent); in mlxsw_sp_qdisc_get_tclass_num()
230 mlxsw_sp_qdisc_destroy(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_destroy() argument
233 struct mlxsw_sp_qdisc *root_qdisc = &mlxsw_sp_port->qdisc->root_qdisc; in mlxsw_sp_qdisc_destroy()
242 struct mlxsw_sp_hdroom hdroom = *mlxsw_sp_port->hdroom; in mlxsw_sp_qdisc_destroy()
247 mlxsw_sp_hdroom_bufs_reset_sizes(mlxsw_sp_port, &hdroom); in mlxsw_sp_qdisc_destroy()
248 err_hdroom = mlxsw_sp_hdroom_configure(mlxsw_sp_port, &hdroom); in mlxsw_sp_qdisc_destroy()
255 mlxsw_sp_qdisc_destroy(mlxsw_sp_port, in mlxsw_sp_qdisc_destroy()
259 err = mlxsw_sp_qdisc->ops->destroy(mlxsw_sp_port, in mlxsw_sp_qdisc_destroy()
262 mlxsw_sp_qdisc->ops->clean_stats(mlxsw_sp_port, mlxsw_sp_qdisc); in mlxsw_sp_qdisc_destroy()
344 static int mlxsw_sp_qdisc_tree_validate(struct mlxsw_sp_port *mlxsw_sp_port) in mlxsw_sp_qdisc_tree_validate() argument
349 mlxsw_sp_qdisc = &mlxsw_sp_port->qdisc->root_qdisc; in mlxsw_sp_qdisc_tree_validate()
353 static int mlxsw_sp_qdisc_create(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_create() argument
358 struct mlxsw_sp_qdisc *root_qdisc = &mlxsw_sp_port->qdisc->root_qdisc; in mlxsw_sp_qdisc_create()
363 err = ops->check_params(mlxsw_sp_port, params); in mlxsw_sp_qdisc_create()
378 orig_hdroom = *mlxsw_sp_port->hdroom; in mlxsw_sp_qdisc_create()
385 mlxsw_sp_hdroom_bufs_reset_sizes(mlxsw_sp_port, &hdroom); in mlxsw_sp_qdisc_create()
387 err = mlxsw_sp_hdroom_configure(mlxsw_sp_port, &hdroom); in mlxsw_sp_qdisc_create()
395 err = mlxsw_sp_qdisc_tree_validate(mlxsw_sp_port); in mlxsw_sp_qdisc_create()
399 err = ops->replace(mlxsw_sp_port, handle, mlxsw_sp_qdisc, params); in mlxsw_sp_qdisc_create()
409 mlxsw_sp_hdroom_configure(mlxsw_sp_port, &orig_hdroom); in mlxsw_sp_qdisc_create()
417 mlxsw_sp_qdisc_change(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle, in mlxsw_sp_qdisc_change() argument
423 err = ops->check_params(mlxsw_sp_port, params); in mlxsw_sp_qdisc_change()
427 err = ops->replace(mlxsw_sp_port, handle, mlxsw_sp_qdisc, params); in mlxsw_sp_qdisc_change()
437 ops->clean_stats(mlxsw_sp_port, mlxsw_sp_qdisc); in mlxsw_sp_qdisc_change()
445 ops->unoffload(mlxsw_sp_port, mlxsw_sp_qdisc, params); in mlxsw_sp_qdisc_change()
447 mlxsw_sp_qdisc_destroy(mlxsw_sp_port, mlxsw_sp_qdisc); in mlxsw_sp_qdisc_change()
452 mlxsw_sp_qdisc_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle, in mlxsw_sp_qdisc_replace() argument
462 mlxsw_sp_qdisc_destroy(mlxsw_sp_port, mlxsw_sp_qdisc); in mlxsw_sp_qdisc_replace()
465 return mlxsw_sp_qdisc_create(mlxsw_sp_port, handle, in mlxsw_sp_qdisc_replace()
468 return mlxsw_sp_qdisc_change(mlxsw_sp_port, handle, in mlxsw_sp_qdisc_replace()
473 mlxsw_sp_qdisc_get_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_get_stats() argument
479 return mlxsw_sp_qdisc->ops->get_stats(mlxsw_sp_port, in mlxsw_sp_qdisc_get_stats()
487 mlxsw_sp_qdisc_get_xstats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_get_xstats() argument
493 return mlxsw_sp_qdisc->ops->get_xstats(mlxsw_sp_port, in mlxsw_sp_qdisc_get_xstats()
532 mlxsw_sp_qdisc_collect_tc_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_collect_tc_stats() argument
542 prio_bitmap = mlxsw_sp_qdisc_get_prio_bitmap(mlxsw_sp_port, in mlxsw_sp_qdisc_collect_tc_stats()
544 tclass_num = mlxsw_sp_qdisc_get_tclass_num(mlxsw_sp_port, in mlxsw_sp_qdisc_collect_tc_stats()
546 xstats = &mlxsw_sp_port->periodic_hw_stats.xstats; in mlxsw_sp_qdisc_collect_tc_stats()
582 mlxsw_sp_qdisc_get_tc_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_get_tc_stats() argument
591 mlxsw_sp_qdisc_collect_tc_stats(mlxsw_sp_port, mlxsw_sp_qdisc, in mlxsw_sp_qdisc_get_tc_stats()
594 mlxsw_sp_qdisc_update_stats(mlxsw_sp_port->mlxsw_sp, mlxsw_sp_qdisc, in mlxsw_sp_qdisc_get_tc_stats()
600 mlxsw_sp_tclass_congestion_enable(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_tclass_congestion_enable() argument
606 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_tclass_congestion_enable()
609 mlxsw_reg_cwtp_pack(cwtp_cmd, mlxsw_sp_port->local_port, tclass_num); in mlxsw_sp_tclass_congestion_enable()
619 mlxsw_reg_cwtpm_pack(cwtpm_cmd, mlxsw_sp_port->local_port, tclass_num, in mlxsw_sp_tclass_congestion_enable()
626 mlxsw_sp_tclass_congestion_disable(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_tclass_congestion_disable() argument
629 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_tclass_congestion_disable()
632 mlxsw_reg_cwtpm_pack(cwtpm_cmd, mlxsw_sp_port->local_port, tclass_num, in mlxsw_sp_tclass_congestion_disable()
638 mlxsw_sp_setup_tc_qdisc_red_clean_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_qdisc_red_clean_stats() argument
647 prio_bitmap = mlxsw_sp_qdisc_get_prio_bitmap(mlxsw_sp_port, in mlxsw_sp_setup_tc_qdisc_red_clean_stats()
649 tclass_num = mlxsw_sp_qdisc_get_tclass_num(mlxsw_sp_port, in mlxsw_sp_setup_tc_qdisc_red_clean_stats()
651 xstats = &mlxsw_sp_port->periodic_hw_stats.xstats; in mlxsw_sp_setup_tc_qdisc_red_clean_stats()
669 mlxsw_sp_qdisc_red_destroy(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_red_destroy() argument
672 int tclass_num = mlxsw_sp_qdisc_get_tclass_num(mlxsw_sp_port, in mlxsw_sp_qdisc_red_destroy()
675 return mlxsw_sp_tclass_congestion_disable(mlxsw_sp_port, tclass_num); in mlxsw_sp_qdisc_red_destroy()
679 mlxsw_sp_qdisc_red_check_params(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_red_check_params() argument
682 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_qdisc_red_check_params()
706 mlxsw_sp_qdisc_future_fifo_replace(struct mlxsw_sp_port *mlxsw_sp_port,
710 mlxsw_sp_qdisc_future_fifos_init(struct mlxsw_sp_port *mlxsw_sp_port,
714 mlxsw_sp_qdisc_red_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle, in mlxsw_sp_qdisc_red_replace() argument
718 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_qdisc_red_replace()
725 err = mlxsw_sp_qdisc_future_fifo_replace(mlxsw_sp_port, handle, 0, in mlxsw_sp_qdisc_red_replace()
729 mlxsw_sp_qdisc_future_fifos_init(mlxsw_sp_port, TC_H_UNSPEC); in mlxsw_sp_qdisc_red_replace()
731 tclass_num = mlxsw_sp_qdisc_get_tclass_num(mlxsw_sp_port, in mlxsw_sp_qdisc_red_replace()
741 return mlxsw_sp_tclass_congestion_enable(mlxsw_sp_port, tclass_num, in mlxsw_sp_qdisc_red_replace()
747 mlxsw_sp_qdisc_leaf_unoffload(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_leaf_unoffload() argument
753 backlog = mlxsw_sp_cells_bytes(mlxsw_sp_port->mlxsw_sp, in mlxsw_sp_qdisc_leaf_unoffload()
760 mlxsw_sp_qdisc_red_unoffload(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_red_unoffload() argument
766 mlxsw_sp_qdisc_leaf_unoffload(mlxsw_sp_port, mlxsw_sp_qdisc, p->qstats); in mlxsw_sp_qdisc_red_unoffload()
770 mlxsw_sp_qdisc_get_red_xstats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_get_red_xstats() argument
780 tclass_num = mlxsw_sp_qdisc_get_tclass_num(mlxsw_sp_port, in mlxsw_sp_qdisc_get_red_xstats()
782 xstats = &mlxsw_sp_port->periodic_hw_stats.xstats; in mlxsw_sp_qdisc_get_red_xstats()
800 mlxsw_sp_qdisc_get_red_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_get_red_stats() argument
809 tclass_num = mlxsw_sp_qdisc_get_tclass_num(mlxsw_sp_port, in mlxsw_sp_qdisc_get_red_stats()
811 xstats = &mlxsw_sp_port->periodic_hw_stats.xstats; in mlxsw_sp_qdisc_get_red_stats()
814 mlxsw_sp_qdisc_get_tc_stats(mlxsw_sp_port, mlxsw_sp_qdisc, stats_ptr); in mlxsw_sp_qdisc_get_red_stats()
847 static int mlxsw_sp_qdisc_graft(struct mlxsw_sp_port *mlxsw_sp_port,
851 static int __mlxsw_sp_setup_tc_red(struct mlxsw_sp_port *mlxsw_sp_port, in __mlxsw_sp_setup_tc_red() argument
856 mlxsw_sp_qdisc = mlxsw_sp_qdisc_find(mlxsw_sp_port, p->parent); in __mlxsw_sp_setup_tc_red()
861 return mlxsw_sp_qdisc_replace(mlxsw_sp_port, p->handle, in __mlxsw_sp_setup_tc_red()
871 return mlxsw_sp_qdisc_destroy(mlxsw_sp_port, mlxsw_sp_qdisc); in __mlxsw_sp_setup_tc_red()
873 return mlxsw_sp_qdisc_get_xstats(mlxsw_sp_port, mlxsw_sp_qdisc, in __mlxsw_sp_setup_tc_red()
876 return mlxsw_sp_qdisc_get_stats(mlxsw_sp_port, mlxsw_sp_qdisc, in __mlxsw_sp_setup_tc_red()
879 return mlxsw_sp_qdisc_graft(mlxsw_sp_port, mlxsw_sp_qdisc, 0, in __mlxsw_sp_setup_tc_red()
886 int mlxsw_sp_setup_tc_red(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_red() argument
891 mutex_lock(&mlxsw_sp_port->qdisc->lock); in mlxsw_sp_setup_tc_red()
892 err = __mlxsw_sp_setup_tc_red(mlxsw_sp_port, p); in mlxsw_sp_setup_tc_red()
893 mutex_unlock(&mlxsw_sp_port->qdisc->lock); in mlxsw_sp_setup_tc_red()
899 mlxsw_sp_setup_tc_qdisc_leaf_clean_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_qdisc_leaf_clean_stats() argument
907 mlxsw_sp_qdisc_collect_tc_stats(mlxsw_sp_port, mlxsw_sp_qdisc, in mlxsw_sp_setup_tc_qdisc_leaf_clean_stats()
918 mlxsw_sp_qdisc_tbf_hr(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_tbf_hr() argument
921 if (mlxsw_sp_qdisc == &mlxsw_sp_port->qdisc->root_qdisc) in mlxsw_sp_qdisc_tbf_hr()
936 mlxsw_sp_qdisc_tbf_destroy(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_tbf_destroy() argument
939 enum mlxsw_reg_qeec_hr hr = mlxsw_sp_qdisc_tbf_hr(mlxsw_sp_port, in mlxsw_sp_qdisc_tbf_destroy()
941 int tclass_num = mlxsw_sp_qdisc_get_tclass_num(mlxsw_sp_port, in mlxsw_sp_qdisc_tbf_destroy()
944 return mlxsw_sp_port_ets_maxrate_set(mlxsw_sp_port, hr, tclass_num, 0, in mlxsw_sp_qdisc_tbf_destroy()
949 mlxsw_sp_qdisc_tbf_bs(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_tbf_bs() argument
966 if (bs < mlxsw_sp_port->mlxsw_sp->lowest_shaper_bs || in mlxsw_sp_qdisc_tbf_bs()
990 mlxsw_sp_qdisc_tbf_check_params(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_tbf_check_params() argument
994 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_qdisc_tbf_check_params()
1000 dev_err(mlxsw_sp_port->mlxsw_sp->bus_info->dev, in mlxsw_sp_qdisc_tbf_check_params()
1006 err = mlxsw_sp_qdisc_tbf_bs(mlxsw_sp_port, p->max_size, &burst_size); in mlxsw_sp_qdisc_tbf_check_params()
1022 mlxsw_sp_qdisc_tbf_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle, in mlxsw_sp_qdisc_tbf_replace() argument
1026 enum mlxsw_reg_qeec_hr hr = mlxsw_sp_qdisc_tbf_hr(mlxsw_sp_port, in mlxsw_sp_qdisc_tbf_replace()
1034 err = mlxsw_sp_qdisc_future_fifo_replace(mlxsw_sp_port, handle, 0, in mlxsw_sp_qdisc_tbf_replace()
1038 mlxsw_sp_qdisc_future_fifos_init(mlxsw_sp_port, TC_H_UNSPEC); in mlxsw_sp_qdisc_tbf_replace()
1040 tclass_num = mlxsw_sp_qdisc_get_tclass_num(mlxsw_sp_port, in mlxsw_sp_qdisc_tbf_replace()
1043 err = mlxsw_sp_qdisc_tbf_bs(mlxsw_sp_port, p->max_size, &burst_size); in mlxsw_sp_qdisc_tbf_replace()
1048 return mlxsw_sp_port_ets_maxrate_set(mlxsw_sp_port, hr, tclass_num, 0, in mlxsw_sp_qdisc_tbf_replace()
1053 mlxsw_sp_qdisc_tbf_unoffload(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_tbf_unoffload() argument
1059 mlxsw_sp_qdisc_leaf_unoffload(mlxsw_sp_port, mlxsw_sp_qdisc, p->qstats); in mlxsw_sp_qdisc_tbf_unoffload()
1063 mlxsw_sp_qdisc_get_tbf_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_get_tbf_stats() argument
1067 mlxsw_sp_qdisc_get_tc_stats(mlxsw_sp_port, mlxsw_sp_qdisc, in mlxsw_sp_qdisc_get_tbf_stats()
1084 static int __mlxsw_sp_setup_tc_tbf(struct mlxsw_sp_port *mlxsw_sp_port, in __mlxsw_sp_setup_tc_tbf() argument
1089 mlxsw_sp_qdisc = mlxsw_sp_qdisc_find(mlxsw_sp_port, p->parent); in __mlxsw_sp_setup_tc_tbf()
1094 return mlxsw_sp_qdisc_replace(mlxsw_sp_port, p->handle, in __mlxsw_sp_setup_tc_tbf()
1104 return mlxsw_sp_qdisc_destroy(mlxsw_sp_port, mlxsw_sp_qdisc); in __mlxsw_sp_setup_tc_tbf()
1106 return mlxsw_sp_qdisc_get_stats(mlxsw_sp_port, mlxsw_sp_qdisc, in __mlxsw_sp_setup_tc_tbf()
1109 return mlxsw_sp_qdisc_graft(mlxsw_sp_port, mlxsw_sp_qdisc, 0, in __mlxsw_sp_setup_tc_tbf()
1116 int mlxsw_sp_setup_tc_tbf(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_tbf() argument
1121 mutex_lock(&mlxsw_sp_port->qdisc->lock); in mlxsw_sp_setup_tc_tbf()
1122 err = __mlxsw_sp_setup_tc_tbf(mlxsw_sp_port, p); in mlxsw_sp_setup_tc_tbf()
1123 mutex_unlock(&mlxsw_sp_port->qdisc->lock); in mlxsw_sp_setup_tc_tbf()
1129 mlxsw_sp_qdisc_fifo_check_params(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_fifo_check_params() argument
1136 mlxsw_sp_qdisc_fifo_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle, in mlxsw_sp_qdisc_fifo_replace() argument
1144 mlxsw_sp_qdisc_get_fifo_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_get_fifo_stats() argument
1148 mlxsw_sp_qdisc_get_tc_stats(mlxsw_sp_port, mlxsw_sp_qdisc, in mlxsw_sp_qdisc_get_fifo_stats()
1162 mlxsw_sp_qdisc_future_fifo_replace(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_future_fifo_replace() argument
1166 struct mlxsw_sp_qdisc_state *qdisc_state = mlxsw_sp_port->qdisc; in mlxsw_sp_qdisc_future_fifo_replace()
1170 return mlxsw_sp_qdisc_replace(mlxsw_sp_port, TC_H_UNSPEC, in mlxsw_sp_qdisc_future_fifo_replace()
1178 mlxsw_sp_qdisc_future_fifos_init(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_future_fifos_init() argument
1181 struct mlxsw_sp_qdisc_state *qdisc_state = mlxsw_sp_port->qdisc; in mlxsw_sp_qdisc_future_fifos_init()
1187 static int __mlxsw_sp_setup_tc_fifo(struct mlxsw_sp_port *mlxsw_sp_port, in __mlxsw_sp_setup_tc_fifo() argument
1190 struct mlxsw_sp_qdisc_state *qdisc_state = mlxsw_sp_port->qdisc; in __mlxsw_sp_setup_tc_fifo()
1195 mlxsw_sp_qdisc = mlxsw_sp_qdisc_find(mlxsw_sp_port, p->parent); in __mlxsw_sp_setup_tc_fifo()
1202 mlxsw_sp_qdisc_future_fifos_init(mlxsw_sp_port, in __mlxsw_sp_setup_tc_fifo()
1218 return mlxsw_sp_qdisc_replace(mlxsw_sp_port, p->handle, in __mlxsw_sp_setup_tc_fifo()
1228 return mlxsw_sp_qdisc_destroy(mlxsw_sp_port, mlxsw_sp_qdisc); in __mlxsw_sp_setup_tc_fifo()
1230 return mlxsw_sp_qdisc_get_stats(mlxsw_sp_port, mlxsw_sp_qdisc, in __mlxsw_sp_setup_tc_fifo()
1239 int mlxsw_sp_setup_tc_fifo(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_fifo() argument
1244 mutex_lock(&mlxsw_sp_port->qdisc->lock); in mlxsw_sp_setup_tc_fifo()
1245 err = __mlxsw_sp_setup_tc_fifo(mlxsw_sp_port, p); in mlxsw_sp_setup_tc_fifo()
1246 mutex_unlock(&mlxsw_sp_port->qdisc->lock); in mlxsw_sp_setup_tc_fifo()
1251 static int __mlxsw_sp_qdisc_ets_destroy(struct mlxsw_sp_port *mlxsw_sp_port, in __mlxsw_sp_qdisc_ets_destroy() argument
1257 mlxsw_sp_port_prio_tc_set(mlxsw_sp_port, i, in __mlxsw_sp_qdisc_ets_destroy()
1259 mlxsw_sp_port_ets_set(mlxsw_sp_port, in __mlxsw_sp_qdisc_ets_destroy()
1270 mlxsw_sp_qdisc_prio_destroy(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_prio_destroy() argument
1273 return __mlxsw_sp_qdisc_ets_destroy(mlxsw_sp_port, mlxsw_sp_qdisc); in mlxsw_sp_qdisc_prio_destroy()
1286 mlxsw_sp_qdisc_prio_check_params(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_prio_check_params() argument
1296 void *mlxsw_sp_port) in mlxsw_sp_qdisc_walk_cb_clean_stats() argument
1303 mlxsw_sp_qdisc->ops->clean_stats(mlxsw_sp_port, in mlxsw_sp_qdisc_walk_cb_clean_stats()
1312 mlxsw_sp_qdisc_tree_clean_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_tree_clean_stats() argument
1316 mlxsw_sp_port); in mlxsw_sp_qdisc_tree_clean_stats()
1320 __mlxsw_sp_qdisc_ets_replace(struct mlxsw_sp_port *mlxsw_sp_port, in __mlxsw_sp_qdisc_ets_replace() argument
1358 err = mlxsw_sp_port_ets_set(mlxsw_sp_port, in __mlxsw_sp_qdisc_ets_replace()
1370 err = mlxsw_sp_port_prio_tc_set(mlxsw_sp_port, in __mlxsw_sp_qdisc_ets_replace()
1380 mlxsw_sp_qdisc_tree_clean_stats(mlxsw_sp_port, in __mlxsw_sp_qdisc_ets_replace()
1383 err = mlxsw_sp_qdisc_future_fifo_replace(mlxsw_sp_port, handle, in __mlxsw_sp_qdisc_ets_replace()
1393 mlxsw_sp_qdisc_destroy(mlxsw_sp_port, child_qdisc); in __mlxsw_sp_qdisc_ets_replace()
1395 mlxsw_sp_port_ets_set(mlxsw_sp_port, in __mlxsw_sp_qdisc_ets_replace()
1400 mlxsw_sp_qdisc_future_fifos_init(mlxsw_sp_port, TC_H_UNSPEC); in __mlxsw_sp_qdisc_ets_replace()
1405 mlxsw_sp_qdisc_prio_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle, in mlxsw_sp_qdisc_prio_replace() argument
1412 return __mlxsw_sp_qdisc_ets_replace(mlxsw_sp_port, mlxsw_sp_qdisc, in mlxsw_sp_qdisc_prio_replace()
1418 __mlxsw_sp_qdisc_ets_unoffload(struct mlxsw_sp_port *mlxsw_sp_port, in __mlxsw_sp_qdisc_ets_unoffload() argument
1424 backlog = mlxsw_sp_cells_bytes(mlxsw_sp_port->mlxsw_sp, in __mlxsw_sp_qdisc_ets_unoffload()
1430 mlxsw_sp_qdisc_prio_unoffload(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_prio_unoffload() argument
1436 __mlxsw_sp_qdisc_ets_unoffload(mlxsw_sp_port, mlxsw_sp_qdisc, in mlxsw_sp_qdisc_prio_unoffload()
1441 mlxsw_sp_qdisc_get_prio_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_get_prio_stats() argument
1454 mlxsw_sp_qdisc_collect_tc_stats(mlxsw_sp_port, tc_qdisc, in mlxsw_sp_qdisc_get_prio_stats()
1459 mlxsw_sp_qdisc_update_stats(mlxsw_sp_port->mlxsw_sp, mlxsw_sp_qdisc, in mlxsw_sp_qdisc_get_prio_stats()
1466 mlxsw_sp_setup_tc_qdisc_prio_clean_stats(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_qdisc_prio_clean_stats() argument
1474 xstats = &mlxsw_sp_port->periodic_hw_stats.xstats; in mlxsw_sp_setup_tc_qdisc_prio_clean_stats()
1475 stats = &mlxsw_sp_port->periodic_hw_stats.stats; in mlxsw_sp_setup_tc_qdisc_prio_clean_stats()
1542 mlxsw_sp_qdisc_ets_check_params(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_ets_check_params() argument
1551 mlxsw_sp_qdisc_ets_replace(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle, in mlxsw_sp_qdisc_ets_replace() argument
1557 return __mlxsw_sp_qdisc_ets_replace(mlxsw_sp_port, mlxsw_sp_qdisc, in mlxsw_sp_qdisc_ets_replace()
1563 mlxsw_sp_qdisc_ets_unoffload(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_ets_unoffload() argument
1569 __mlxsw_sp_qdisc_ets_unoffload(mlxsw_sp_port, mlxsw_sp_qdisc, in mlxsw_sp_qdisc_ets_unoffload()
1574 mlxsw_sp_qdisc_ets_destroy(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_ets_destroy() argument
1577 return __mlxsw_sp_qdisc_ets_destroy(mlxsw_sp_port, mlxsw_sp_qdisc); in mlxsw_sp_qdisc_ets_destroy()
1619 static int mlxsw_sp_qdisc_graft(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qdisc_graft() argument
1640 old_qdisc = mlxsw_sp_qdisc_find_by_handle(mlxsw_sp_port, in mlxsw_sp_qdisc_graft()
1643 mlxsw_sp_qdisc_destroy(mlxsw_sp_port, old_qdisc); in mlxsw_sp_qdisc_graft()
1649 mlxsw_sp_qdisc_destroy(mlxsw_sp_port, mlxsw_sp_qdisc); in mlxsw_sp_qdisc_graft()
1654 static int __mlxsw_sp_setup_tc_prio(struct mlxsw_sp_port *mlxsw_sp_port, in __mlxsw_sp_setup_tc_prio() argument
1659 mlxsw_sp_qdisc = mlxsw_sp_qdisc_find(mlxsw_sp_port, p->parent); in __mlxsw_sp_setup_tc_prio()
1664 return mlxsw_sp_qdisc_replace(mlxsw_sp_port, p->handle, in __mlxsw_sp_setup_tc_prio()
1674 return mlxsw_sp_qdisc_destroy(mlxsw_sp_port, mlxsw_sp_qdisc); in __mlxsw_sp_setup_tc_prio()
1676 return mlxsw_sp_qdisc_get_stats(mlxsw_sp_port, mlxsw_sp_qdisc, in __mlxsw_sp_setup_tc_prio()
1679 return mlxsw_sp_qdisc_graft(mlxsw_sp_port, mlxsw_sp_qdisc, in __mlxsw_sp_setup_tc_prio()
1687 int mlxsw_sp_setup_tc_prio(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_prio() argument
1692 mutex_lock(&mlxsw_sp_port->qdisc->lock); in mlxsw_sp_setup_tc_prio()
1693 err = __mlxsw_sp_setup_tc_prio(mlxsw_sp_port, p); in mlxsw_sp_setup_tc_prio()
1694 mutex_unlock(&mlxsw_sp_port->qdisc->lock); in mlxsw_sp_setup_tc_prio()
1699 static int __mlxsw_sp_setup_tc_ets(struct mlxsw_sp_port *mlxsw_sp_port, in __mlxsw_sp_setup_tc_ets() argument
1704 mlxsw_sp_qdisc = mlxsw_sp_qdisc_find(mlxsw_sp_port, p->parent); in __mlxsw_sp_setup_tc_ets()
1709 return mlxsw_sp_qdisc_replace(mlxsw_sp_port, p->handle, in __mlxsw_sp_setup_tc_ets()
1719 return mlxsw_sp_qdisc_destroy(mlxsw_sp_port, mlxsw_sp_qdisc); in __mlxsw_sp_setup_tc_ets()
1721 return mlxsw_sp_qdisc_get_stats(mlxsw_sp_port, mlxsw_sp_qdisc, in __mlxsw_sp_setup_tc_ets()
1724 return mlxsw_sp_qdisc_graft(mlxsw_sp_port, mlxsw_sp_qdisc, in __mlxsw_sp_setup_tc_ets()
1732 int mlxsw_sp_setup_tc_ets(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_ets() argument
1737 mutex_lock(&mlxsw_sp_port->qdisc->lock); in mlxsw_sp_setup_tc_ets()
1738 err = __mlxsw_sp_setup_tc_ets(mlxsw_sp_port, p); in mlxsw_sp_setup_tc_ets()
1739 mutex_unlock(&mlxsw_sp_port->qdisc->lock); in mlxsw_sp_setup_tc_ets()
1752 struct mlxsw_sp_port *mlxsw_sp_port; member
1768 struct mlxsw_sp_port *mlxsw_sp_port = qevent_binding->mlxsw_sp_port; in mlxsw_sp_qevent_span_configure() local
1779 err = mlxsw_sp_span_analyzed_port_get(mlxsw_sp_port, ingress); in mlxsw_sp_qevent_span_configure()
1785 err = mlxsw_sp_span_agent_bind(mlxsw_sp, span_trigger, mlxsw_sp_port, in mlxsw_sp_qevent_span_configure()
1790 err = mlxsw_sp_span_trigger_enable(mlxsw_sp_port, span_trigger, in mlxsw_sp_qevent_span_configure()
1799 mlxsw_sp_span_agent_unbind(mlxsw_sp, span_trigger, mlxsw_sp_port, in mlxsw_sp_qevent_span_configure()
1802 mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, ingress); in mlxsw_sp_qevent_span_configure()
1813 struct mlxsw_sp_port *mlxsw_sp_port = qevent_binding->mlxsw_sp_port; in mlxsw_sp_qevent_span_deconfigure() local
1821 mlxsw_sp_span_trigger_disable(mlxsw_sp_port, span_trigger, in mlxsw_sp_qevent_span_deconfigure()
1823 mlxsw_sp_span_agent_unbind(mlxsw_sp, span_trigger, mlxsw_sp_port, in mlxsw_sp_qevent_span_deconfigure()
1825 mlxsw_sp_span_analyzed_port_put(mlxsw_sp_port, ingress); in mlxsw_sp_qevent_span_deconfigure()
2129 mlxsw_sp_qevent_binding_create(struct mlxsw_sp_port *mlxsw_sp_port, u32 handle, int tclass_num, in mlxsw_sp_qevent_binding_create() argument
2139 binding->mlxsw_sp_port = mlxsw_sp_port; in mlxsw_sp_qevent_binding_create()
2155 struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_qevent_binding_lookup() argument
2162 if (qevent_binding->mlxsw_sp_port == mlxsw_sp_port && in mlxsw_sp_qevent_binding_lookup()
2170 mlxsw_sp_setup_tc_block_qevent_bind(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_block_qevent_bind() argument
2175 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_setup_tc_block_qevent_bind()
2201 qdisc = mlxsw_sp_qdisc_find_by_handle(mlxsw_sp_port, f->sch->handle); in mlxsw_sp_setup_tc_block_qevent_bind()
2208 if (WARN_ON(mlxsw_sp_qevent_binding_lookup(qevent_block, mlxsw_sp_port, f->sch->handle, in mlxsw_sp_setup_tc_block_qevent_bind()
2214 tclass_num = mlxsw_sp_qdisc_get_tclass_num(mlxsw_sp_port, qdisc); in mlxsw_sp_setup_tc_block_qevent_bind()
2215 qevent_binding = mlxsw_sp_qevent_binding_create(mlxsw_sp_port, in mlxsw_sp_setup_tc_block_qevent_bind()
2249 static void mlxsw_sp_setup_tc_block_qevent_unbind(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_block_qevent_unbind() argument
2253 struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; in mlxsw_sp_setup_tc_block_qevent_unbind()
2263 qevent_binding = mlxsw_sp_qevent_binding_lookup(qevent_block, mlxsw_sp_port, f->sch->handle, in mlxsw_sp_setup_tc_block_qevent_unbind()
2279 mlxsw_sp_setup_tc_block_qevent(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_block_qevent() argument
2288 return mlxsw_sp_setup_tc_block_qevent_bind(mlxsw_sp_port, f, in mlxsw_sp_setup_tc_block_qevent()
2292 mlxsw_sp_setup_tc_block_qevent_unbind(mlxsw_sp_port, f, span_trigger); in mlxsw_sp_setup_tc_block_qevent()
2299 int mlxsw_sp_setup_tc_block_qevent_early_drop(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_block_qevent_early_drop() argument
2305 return mlxsw_sp_setup_tc_block_qevent(mlxsw_sp_port, f, in mlxsw_sp_setup_tc_block_qevent_early_drop()
2310 int mlxsw_sp_setup_tc_block_qevent_mark(struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_setup_tc_block_qevent_mark() argument
2315 return mlxsw_sp_setup_tc_block_qevent(mlxsw_sp_port, f, in mlxsw_sp_setup_tc_block_qevent_mark()
2320 int mlxsw_sp_tc_qdisc_init(struct mlxsw_sp_port *mlxsw_sp_port) in mlxsw_sp_tc_qdisc_init() argument
2329 mlxsw_sp_port->qdisc = qdisc_state; in mlxsw_sp_tc_qdisc_init()
2333 void mlxsw_sp_tc_qdisc_fini(struct mlxsw_sp_port *mlxsw_sp_port) in mlxsw_sp_tc_qdisc_fini() argument
2335 mutex_destroy(&mlxsw_sp_port->qdisc->lock); in mlxsw_sp_tc_qdisc_fini()
2336 kfree(mlxsw_sp_port->qdisc); in mlxsw_sp_tc_qdisc_fini()