Lines Matching refs:alink

45 nfp_abm_stats_update_red(struct nfp_abm_link *alink, struct nfp_qdisc *qdisc,  in nfp_abm_stats_update_red()  argument
48 struct nfp_cpp *cpp = alink->abm->app->cpp; in nfp_abm_stats_update_red()
56 err = nfp_abm_ctrl_read_q_stats(alink, i, queue, in nfp_abm_stats_update_red()
62 err = nfp_abm_ctrl_read_q_xstats(alink, i, queue, in nfp_abm_stats_update_red()
71 nfp_abm_stats_update_mq(struct nfp_abm_link *alink, struct nfp_qdisc *qdisc) in nfp_abm_stats_update_mq() argument
78 for (i = 0; i < alink->total_queues; i++) in nfp_abm_stats_update_mq()
80 nfp_abm_stats_update_red(alink, qdisc->children[i], i); in nfp_abm_stats_update_mq()
83 static void __nfp_abm_stats_update(struct nfp_abm_link *alink, u64 time_now) in __nfp_abm_stats_update() argument
85 alink->last_stats_update = time_now; in __nfp_abm_stats_update()
86 if (alink->root_qdisc) in __nfp_abm_stats_update()
87 nfp_abm_stats_update_mq(alink, alink->root_qdisc); in __nfp_abm_stats_update()
90 static void nfp_abm_stats_update(struct nfp_abm_link *alink) in nfp_abm_stats_update() argument
99 if (now - alink->last_stats_update < NFP_ABM_STATS_REFRESH_IVAL) in nfp_abm_stats_update()
102 __nfp_abm_stats_update(alink, now); in nfp_abm_stats_update()
119 nfp_abm_qdisc_offload_stop(struct nfp_abm_link *alink, struct nfp_qdisc *qdisc) in nfp_abm_qdisc_offload_stop() argument
125 nfp_warn(alink->abm->app->cpp, "Offload of '%08x' stopped\n", in nfp_abm_qdisc_offload_stop()
138 __nfp_abm_stats_init(struct nfp_abm_link *alink, unsigned int band, in __nfp_abm_stats_init() argument
151 err = nfp_abm_ctrl_read_q_stats(alink, band, queue, prev_stats); in __nfp_abm_stats_init()
153 nfp_err(alink->abm->app->cpp, in __nfp_abm_stats_init()
159 err = nfp_abm_ctrl_read_q_xstats(alink, band, queue, prev_xstats); in __nfp_abm_stats_init()
161 nfp_err(alink->abm->app->cpp, in __nfp_abm_stats_init()
173 nfp_abm_stats_init(struct nfp_abm_link *alink, struct nfp_qdisc *qdisc, in nfp_abm_stats_init() argument
180 err = __nfp_abm_stats_init(alink, i, queue, in nfp_abm_stats_init()
191 nfp_abm_offload_compile_red(struct nfp_abm_link *alink, struct nfp_qdisc *qdisc, in nfp_abm_offload_compile_red() argument
200 !alink->has_prio && in nfp_abm_offload_compile_red()
209 if (nfp_abm_stats_init(alink, qdisc, queue)) in nfp_abm_offload_compile_red()
215 for (i = 0; i < alink->abm->num_bands; i++) { in nfp_abm_offload_compile_red()
218 nfp_abm_ctrl_set_q_lvl(alink, i, queue, in nfp_abm_offload_compile_red()
222 nfp_abm_ctrl_set_q_act(alink, i, queue, act); in nfp_abm_offload_compile_red()
227 nfp_abm_offload_compile_mq(struct nfp_abm_link *alink, struct nfp_qdisc *qdisc) in nfp_abm_offload_compile_mq() argument
235 for (i = 0; i < alink->total_queues; i++) { in nfp_abm_offload_compile_mq()
241 nfp_abm_offload_compile_red(alink, child, i); in nfp_abm_offload_compile_mq()
245 void nfp_abm_qdisc_offload_update(struct nfp_abm_link *alink) in nfp_abm_qdisc_offload_update() argument
247 struct nfp_abm *abm = alink->abm; in nfp_abm_qdisc_offload_update()
256 i * NFP_NET_MAX_RX_RINGS + alink->queue_base, in nfp_abm_qdisc_offload_update()
257 alink->total_queues); in nfp_abm_qdisc_offload_update()
260 radix_tree_for_each_slot(slot, &alink->qdiscs, &iter, 0) { in nfp_abm_qdisc_offload_update()
265 if (alink->root_qdisc) in nfp_abm_qdisc_offload_update()
266 nfp_abm_offload_compile_mq(alink, alink->root_qdisc); in nfp_abm_qdisc_offload_update()
269 radix_tree_for_each_slot(slot, &alink->qdiscs, &iter, 0) { in nfp_abm_qdisc_offload_update()
272 nfp_abm_qdisc_offload_stop(alink, qdisc); in nfp_abm_qdisc_offload_update()
281 __nfp_abm_stats_update(alink, ktime_get()); in nfp_abm_qdisc_offload_update()
285 nfp_abm_qdisc_clear_mq(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_qdisc_clear_mq() argument
298 qdisc == alink->root_qdisc && in nfp_abm_qdisc_clear_mq()
303 radix_tree_for_each_slot(slot, &alink->qdiscs, &iter, 0) { in nfp_abm_qdisc_clear_mq()
321 nfp_abm_qdisc_free(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_qdisc_free() argument
328 nfp_abm_qdisc_clear_mq(netdev, alink, qdisc); in nfp_abm_qdisc_free()
329 WARN_ON(radix_tree_delete(&alink->qdiscs, in nfp_abm_qdisc_free()
339 nfp_abm_qdisc_alloc(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_qdisc_alloc() argument
363 err = radix_tree_insert(&alink->qdiscs, TC_H_MAJ(qdisc->handle), qdisc); in nfp_abm_qdisc_alloc()
365 nfp_err(alink->abm->app->cpp, in nfp_abm_qdisc_alloc()
381 nfp_abm_qdisc_find(struct nfp_abm_link *alink, u32 handle) in nfp_abm_qdisc_find() argument
383 return radix_tree_lookup(&alink->qdiscs, TC_H_MAJ(handle)); in nfp_abm_qdisc_find()
387 nfp_abm_qdisc_replace(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_qdisc_replace() argument
391 *qdisc = nfp_abm_qdisc_find(alink, handle); in nfp_abm_qdisc_replace()
398 *qdisc = nfp_abm_qdisc_alloc(netdev, alink, type, parent_handle, handle, in nfp_abm_qdisc_replace()
404 nfp_abm_qdisc_destroy(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_qdisc_destroy() argument
409 qdisc = nfp_abm_qdisc_find(alink, handle); in nfp_abm_qdisc_destroy()
414 if (alink->root_qdisc == qdisc) in nfp_abm_qdisc_destroy()
418 nfp_abm_qdisc_free(netdev, alink, qdisc); in nfp_abm_qdisc_destroy()
420 if (alink->root_qdisc == qdisc) { in nfp_abm_qdisc_destroy()
421 alink->root_qdisc = NULL; in nfp_abm_qdisc_destroy()
425 nfp_abm_qdisc_offload_update(alink); in nfp_abm_qdisc_destroy()
430 nfp_abm_qdisc_graft(struct nfp_abm_link *alink, u32 handle, u32 child_handle, in nfp_abm_qdisc_graft() argument
435 parent = nfp_abm_qdisc_find(alink, handle); in nfp_abm_qdisc_graft()
446 child = nfp_abm_qdisc_find(alink, child_handle); in nfp_abm_qdisc_graft()
453 nfp_abm_qdisc_offload_update(alink); in nfp_abm_qdisc_graft()
482 nfp_abm_gred_stats(struct nfp_abm_link *alink, u32 handle, in nfp_abm_gred_stats() argument
488 nfp_abm_stats_update(alink); in nfp_abm_gred_stats()
490 qdisc = nfp_abm_qdisc_find(alink, handle); in nfp_abm_gred_stats()
516 nfp_abm_gred_check_params(struct nfp_abm_link *alink, in nfp_abm_gred_check_params() argument
519 struct nfp_cpp *cpp = alink->abm->app->cpp; in nfp_abm_gred_check_params()
520 struct nfp_abm *abm = alink->abm; in nfp_abm_gred_check_params()
528 if (opt->set.dp_def != alink->def_band) { in nfp_abm_gred_check_params()
530 alink->def_band, opt->parent, opt->handle); in nfp_abm_gred_check_params()
576 nfp_abm_gred_replace(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_gred_replace() argument
583 ret = nfp_abm_qdisc_replace(netdev, alink, NFP_QDISC_GRED, opt->parent, in nfp_abm_gred_replace()
588 qdisc->params_ok = nfp_abm_gred_check_params(alink, opt); in nfp_abm_gred_replace()
598 nfp_abm_qdisc_offload_update(alink); in nfp_abm_gred_replace()
603 int nfp_abm_setup_tc_gred(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_setup_tc_gred() argument
608 return nfp_abm_gred_replace(netdev, alink, opt); in nfp_abm_setup_tc_gred()
610 nfp_abm_qdisc_destroy(netdev, alink, opt->handle); in nfp_abm_setup_tc_gred()
613 return nfp_abm_gred_stats(alink, opt->handle, &opt->stats); in nfp_abm_setup_tc_gred()
620 nfp_abm_red_xstats(struct nfp_abm_link *alink, struct tc_red_qopt_offload *opt) in nfp_abm_red_xstats() argument
624 nfp_abm_stats_update(alink); in nfp_abm_red_xstats()
626 qdisc = nfp_abm_qdisc_find(alink, opt->handle); in nfp_abm_red_xstats()
638 nfp_abm_red_stats(struct nfp_abm_link *alink, u32 handle, in nfp_abm_red_stats() argument
643 nfp_abm_stats_update(alink); in nfp_abm_red_stats()
645 qdisc = nfp_abm_qdisc_find(alink, handle); in nfp_abm_red_stats()
661 nfp_abm_red_check_params(struct nfp_abm_link *alink, in nfp_abm_red_check_params() argument
664 struct nfp_cpp *cpp = alink->abm->app->cpp; in nfp_abm_red_check_params()
665 struct nfp_abm *abm = alink->abm; in nfp_abm_red_check_params()
698 nfp_abm_red_replace(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_red_replace() argument
704 ret = nfp_abm_qdisc_replace(netdev, alink, NFP_QDISC_RED, opt->parent, in nfp_abm_red_replace()
722 qdisc->params_ok = nfp_abm_red_check_params(alink, opt); in nfp_abm_red_replace()
730 nfp_abm_qdisc_offload_update(alink); in nfp_abm_red_replace()
735 int nfp_abm_setup_tc_red(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_setup_tc_red() argument
740 return nfp_abm_red_replace(netdev, alink, opt); in nfp_abm_setup_tc_red()
742 nfp_abm_qdisc_destroy(netdev, alink, opt->handle); in nfp_abm_setup_tc_red()
745 return nfp_abm_red_stats(alink, opt->handle, &opt->stats); in nfp_abm_setup_tc_red()
747 return nfp_abm_red_xstats(alink, opt); in nfp_abm_setup_tc_red()
749 return nfp_abm_qdisc_graft(alink, opt->handle, in nfp_abm_setup_tc_red()
757 nfp_abm_mq_create(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_mq_create() argument
763 ret = nfp_abm_qdisc_replace(netdev, alink, NFP_QDISC_MQ, in nfp_abm_mq_create()
764 TC_H_ROOT, opt->handle, alink->total_queues, in nfp_abm_mq_create()
771 nfp_abm_qdisc_offload_update(alink); in nfp_abm_mq_create()
776 nfp_abm_mq_stats(struct nfp_abm_link *alink, u32 handle, in nfp_abm_mq_stats() argument
782 qdisc = nfp_abm_qdisc_find(alink, handle); in nfp_abm_mq_stats()
786 nfp_abm_stats_update(alink); in nfp_abm_mq_stats()
816 int nfp_abm_setup_tc_mq(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_setup_tc_mq() argument
821 return nfp_abm_mq_create(netdev, alink, opt); in nfp_abm_setup_tc_mq()
823 nfp_abm_qdisc_destroy(netdev, alink, opt->handle); in nfp_abm_setup_tc_mq()
826 return nfp_abm_mq_stats(alink, opt->handle, &opt->stats); in nfp_abm_setup_tc_mq()
828 return nfp_abm_qdisc_graft(alink, opt->handle, in nfp_abm_setup_tc_mq()
836 int nfp_abm_setup_root(struct net_device *netdev, struct nfp_abm_link *alink, in nfp_abm_setup_root() argument
841 if (alink->root_qdisc) in nfp_abm_setup_root()
842 alink->root_qdisc->use_cnt--; in nfp_abm_setup_root()
843 alink->root_qdisc = nfp_abm_qdisc_find(alink, opt->handle); in nfp_abm_setup_root()
844 if (alink->root_qdisc) in nfp_abm_setup_root()
845 alink->root_qdisc->use_cnt++; in nfp_abm_setup_root()
847 nfp_abm_qdisc_offload_update(alink); in nfp_abm_setup_root()