• Home
  • Raw
  • Download

Lines Matching refs:abm

114 		port->pf_id = alink->abm->pf_id;  in nfp_abm_spawn_repr()
167 nfp_abm_kill_reprs(struct nfp_abm *abm, struct nfp_abm_link *alink) in nfp_abm_kill_reprs() argument
169 nfp_abm_kill_repr(abm->app, alink, NFP_REPR_TYPE_PF); in nfp_abm_kill_reprs()
170 nfp_abm_kill_repr(abm->app, alink, NFP_REPR_TYPE_PHYS_PORT); in nfp_abm_kill_reprs()
173 static void nfp_abm_kill_reprs_all(struct nfp_abm *abm) in nfp_abm_kill_reprs_all() argument
175 struct nfp_pf *pf = abm->app->pf; in nfp_abm_kill_reprs_all()
179 nfp_abm_kill_reprs(abm, (struct nfp_abm_link *)nn->app_priv); in nfp_abm_kill_reprs_all()
184 struct nfp_abm *abm = app->priv; in nfp_abm_eswitch_mode_get() local
186 return abm->eswitch_mode; in nfp_abm_eswitch_mode_get()
189 static int nfp_abm_eswitch_set_legacy(struct nfp_abm *abm) in nfp_abm_eswitch_set_legacy() argument
191 nfp_abm_kill_reprs_all(abm); in nfp_abm_eswitch_set_legacy()
192 nfp_abm_ctrl_qm_disable(abm); in nfp_abm_eswitch_set_legacy()
194 abm->eswitch_mode = DEVLINK_ESWITCH_MODE_LEGACY; in nfp_abm_eswitch_set_legacy()
198 static void nfp_abm_eswitch_clean_up(struct nfp_abm *abm) in nfp_abm_eswitch_clean_up() argument
200 if (abm->eswitch_mode != DEVLINK_ESWITCH_MODE_LEGACY) in nfp_abm_eswitch_clean_up()
201 WARN_ON(nfp_abm_eswitch_set_legacy(abm)); in nfp_abm_eswitch_clean_up()
204 static int nfp_abm_eswitch_set_switchdev(struct nfp_abm *abm) in nfp_abm_eswitch_set_switchdev() argument
206 struct nfp_app *app = abm->app; in nfp_abm_eswitch_set_switchdev()
211 if (!abm->red_support) in nfp_abm_eswitch_set_switchdev()
214 err = nfp_abm_ctrl_qm_enable(abm); in nfp_abm_eswitch_set_switchdev()
230 abm->eswitch_mode = DEVLINK_ESWITCH_MODE_SWITCHDEV; in nfp_abm_eswitch_set_switchdev()
234 nfp_abm_kill_reprs_all(abm); in nfp_abm_eswitch_set_switchdev()
235 nfp_abm_ctrl_qm_disable(abm); in nfp_abm_eswitch_set_switchdev()
241 struct nfp_abm *abm = app->priv; in nfp_abm_eswitch_mode_set() local
243 if (abm->eswitch_mode == mode) in nfp_abm_eswitch_mode_set()
248 return nfp_abm_eswitch_set_legacy(abm); in nfp_abm_eswitch_mode_set()
250 return nfp_abm_eswitch_set_switchdev(abm); in nfp_abm_eswitch_mode_set()
257 nfp_abm_vnic_set_mac(struct nfp_pf *pf, struct nfp_abm *abm, struct nfp_net *nn, in nfp_abm_vnic_set_mac() argument
273 eth_port->eth_index, abm->pf_id); in nfp_abm_vnic_set_mac()
316 struct nfp_abm *abm = app->priv; in nfp_abm_vnic_alloc() local
324 alink->abm = abm; in nfp_abm_vnic_alloc()
335 alink->prio_map = kzalloc(abm->prio_map_len, GFP_KERNEL); in nfp_abm_vnic_alloc()
350 nfp_abm_vnic_set_mac(app->pf, abm, nn, id); in nfp_abm_vnic_alloc()
366 nfp_abm_kill_reprs(alink->abm, alink); in nfp_abm_vnic_free()
376 if (nfp_abm_has_prio(alink->abm)) in nfp_abm_vnic_init()
428 static int nfp_abm_fw_init_reset(struct nfp_abm *abm) in nfp_abm_fw_init_reset() argument
432 if (!abm->red_support) in nfp_abm_fw_init_reset()
435 for (i = 0; i < abm->num_bands * NFP_NET_MAX_RX_RINGS; i++) { in nfp_abm_fw_init_reset()
436 __nfp_abm_ctrl_set_q_lvl(abm, i, NFP_ABM_LVL_INFINITY); in nfp_abm_fw_init_reset()
437 __nfp_abm_ctrl_set_q_act(abm, i, NFP_ABM_ACT_DROP); in nfp_abm_fw_init_reset()
440 return nfp_abm_ctrl_qm_disable(abm); in nfp_abm_fw_init_reset()
447 struct nfp_abm *abm; in nfp_abm_init() local
464 abm = kzalloc(sizeof(*abm), GFP_KERNEL); in nfp_abm_init()
465 if (!abm) in nfp_abm_init()
467 app->priv = abm; in nfp_abm_init()
468 abm->app = app; in nfp_abm_init()
470 err = nfp_abm_ctrl_find_addrs(abm); in nfp_abm_init()
475 abm->num_thresholds = array_size(abm->num_bands, NFP_NET_MAX_RX_RINGS); in nfp_abm_init()
476 abm->threshold_undef = bitmap_zalloc(abm->num_thresholds, GFP_KERNEL); in nfp_abm_init()
477 if (!abm->threshold_undef) in nfp_abm_init()
480 abm->thresholds = kvcalloc(abm->num_thresholds, in nfp_abm_init()
481 sizeof(*abm->thresholds), GFP_KERNEL); in nfp_abm_init()
482 if (!abm->thresholds) in nfp_abm_init()
485 abm->actions = kvcalloc(abm->num_thresholds, sizeof(*abm->actions), in nfp_abm_init()
487 if (!abm->actions) in nfp_abm_init()
491 err = nfp_abm_fw_init_reset(abm); in nfp_abm_init()
511 kvfree(abm->actions); in nfp_abm_init()
513 kvfree(abm->thresholds); in nfp_abm_init()
515 bitmap_free(abm->threshold_undef); in nfp_abm_init()
517 kfree(abm); in nfp_abm_init()
524 struct nfp_abm *abm = app->priv; in nfp_abm_clean() local
526 nfp_abm_eswitch_clean_up(abm); in nfp_abm_clean()
529 bitmap_free(abm->threshold_undef); in nfp_abm_clean()
530 kvfree(abm->actions); in nfp_abm_clean()
531 kvfree(abm->thresholds); in nfp_abm_clean()
532 kfree(abm); in nfp_abm_clean()