Lines Matching refs:nix_hw

25 			       struct nix_hw *nix_hw, int blkaddr);
26 static void nix_ipolicer_freemem(struct rvu *rvu, struct nix_hw *nix_hw);
28 struct nix_hw *nix_hw, u16 pcifunc);
30 static void nix_clear_ratelimit_aggr(struct rvu *rvu, struct nix_hw *nix_hw,
145 struct nix_hw **nix_hw, int *blkaddr) in nix_get_struct_ptrs() argument
154 *nix_hw = get_nix_hw(rvu->hw, *blkaddr); in nix_get_struct_ptrs()
155 if (!*nix_hw) in nix_get_struct_ptrs()
179 struct nix_hw *get_nix_hw(struct rvu_hwinfo *hw, int blkaddr) in get_nix_hw()
262 struct nix_hw *nix_hw; in is_valid_txschq() local
265 nix_hw = get_nix_hw(rvu->hw, blkaddr); in is_valid_txschq()
266 if (!nix_hw) in is_valid_txschq()
269 txsch = &nix_hw->txsch[lvl]; in is_valid_txschq()
675 static void nix_setup_lso(struct rvu *rvu, struct nix_hw *nix_hw, int blkaddr) in nix_setup_lso() argument
681 nix_hw->lso.total = cfg; in nix_setup_lso()
705 nix_hw->lso.in_use++; in nix_setup_lso()
718 nix_hw->lso.in_use++; in nix_setup_lso()
823 static int rvu_nix_blk_aq_enq_inst(struct rvu *rvu, struct nix_hw *nix_hw, in rvu_nix_blk_aq_enq_inst() argument
838 blkaddr = nix_hw->blkaddr; in rvu_nix_blk_aq_enq_inst()
883 if (!nix_hw->mcast.mce_ctx || in rvu_nix_blk_aq_enq_inst()
895 nix_hw, pcifunc)) in rvu_nix_blk_aq_enq_inst()
1058 static int rvu_nix_verify_aq_ctx(struct rvu *rvu, struct nix_hw *nix_hw, in rvu_nix_verify_aq_ctx() argument
1068 rc = nix_aq_context_read(rvu, nix_hw, &aq_req, &aq_rsp, in rvu_nix_verify_aq_ctx()
1118 struct nix_hw *nix_hw; in rvu_nix_aq_enq_inst() local
1126 nix_hw = get_nix_hw(rvu->hw, blkaddr); in rvu_nix_aq_enq_inst()
1127 if (!nix_hw) in rvu_nix_aq_enq_inst()
1131 err = rvu_nix_blk_aq_enq_inst(rvu, nix_hw, req, rsp); in rvu_nix_aq_enq_inst()
1138 err = rvu_nix_verify_aq_ctx(rvu, nix_hw, req, NIX_AQ_CTYPE_CQ); in rvu_nix_aq_enq_inst()
1559 struct nix_hw *nix_hw; in rvu_mbox_handler_nix_mark_format_cfg() local
1569 nix_hw = get_nix_hw(rvu->hw, blkaddr); in rvu_mbox_handler_nix_mark_format_cfg()
1570 if (!nix_hw) in rvu_mbox_handler_nix_mark_format_cfg()
1578 rc = rvu_nix_reserve_mark_format(rvu, nix_hw, blkaddr, cfg); in rvu_mbox_handler_nix_mark_format_cfg()
1831 struct nix_hw *nix_hw, in nix_check_txschq_alloc_req() argument
1839 txsch = &nix_hw->txsch[lvl]; in nix_check_txschq_alloc_req()
1971 struct nix_hw *nix_hw; in rvu_mbox_handler_nix_txsch_alloc() local
1980 nix_hw = get_nix_hw(rvu->hw, blkaddr); in rvu_mbox_handler_nix_txsch_alloc()
1981 if (!nix_hw) in rvu_mbox_handler_nix_txsch_alloc()
1990 rc = nix_check_txschq_alloc_req(rvu, lvl, pcifunc, nix_hw, req); in rvu_mbox_handler_nix_txsch_alloc()
1997 txsch = &nix_hw->txsch[lvl]; in rvu_mbox_handler_nix_txsch_alloc()
2097 struct nix_hw *nix_hw; in nix_txschq_free() local
2104 nix_hw = get_nix_hw(rvu->hw, blkaddr); in nix_txschq_free()
2105 if (!nix_hw) in nix_txschq_free()
2115 txsch = &nix_hw->txsch[lvl]; in nix_txschq_free()
2134 txsch = &nix_hw->txsch[NIX_TXSCH_LVL_TL1]; in nix_txschq_free()
2144 txsch = &nix_hw->txsch[NIX_TXSCH_LVL_SMQ]; in nix_txschq_free()
2159 txsch = &nix_hw->txsch[lvl]; in nix_txschq_free()
2185 struct nix_hw *nix_hw; in nix_txschq_free_one() local
2193 nix_hw = get_nix_hw(rvu->hw, blkaddr); in nix_txschq_free_one()
2194 if (!nix_hw) in nix_txschq_free_one()
2203 txsch = &nix_hw->txsch[lvl]; in nix_txschq_free_one()
2330 static void nix_tl1_default_cfg(struct rvu *rvu, struct nix_hw *nix_hw, in nix_tl1_default_cfg() argument
2337 pfvf_map = nix_hw->txsch[NIX_TXSCH_LVL_TL1].pfvf_map; in nix_tl1_default_cfg()
2363 static int nix_txschq_cfg_read(struct rvu *rvu, struct nix_hw *nix_hw, in nix_txschq_cfg_read() argument
2422 struct nix_hw *nix_hw; in rvu_mbox_handler_nix_txschq_cfg() local
2435 nix_hw = get_nix_hw(rvu->hw, blkaddr); in rvu_mbox_handler_nix_txschq_cfg()
2436 if (!nix_hw) in rvu_mbox_handler_nix_txschq_cfg()
2440 return nix_txschq_cfg_read(rvu, nix_hw, blkaddr, req, rsp); in rvu_mbox_handler_nix_txschq_cfg()
2442 txsch = &nix_hw->txsch[req->lvl]; in rvu_mbox_handler_nix_txschq_cfg()
2449 nix_tl1_default_cfg(rvu, nix_hw, pcifunc, blkaddr); in rvu_mbox_handler_nix_txschq_cfg()
2517 &nix_hw->txsch[NIX_TXSCH_LVL_TL2]); in rvu_mbox_handler_nix_txschq_cfg()
2547 struct nix_hw *nix_hw = get_nix_hw(rvu->hw, blkaddr); in nix_tx_vtag_free() local
2550 if (!nix_hw) in nix_tx_vtag_free()
2553 vlan = &nix_hw->txvlan; in nix_tx_vtag_free()
2571 struct nix_hw *nix_hw; in nix_free_tx_vtag_entries() local
2578 nix_hw = get_nix_hw(rvu->hw, blkaddr); in nix_free_tx_vtag_entries()
2579 if (!nix_hw) in nix_free_tx_vtag_entries()
2582 vlan = &nix_hw->txvlan; in nix_free_tx_vtag_entries()
2596 struct nix_hw *nix_hw = get_nix_hw(rvu->hw, blkaddr); in nix_tx_vtag_alloc() local
2601 if (!nix_hw) in nix_tx_vtag_alloc()
2604 vlan = &nix_hw->txvlan; in nix_tx_vtag_alloc()
2629 struct nix_hw *nix_hw = get_nix_hw(rvu->hw, blkaddr); in nix_tx_vtag_decfg() local
2636 if (!nix_hw) in nix_tx_vtag_decfg()
2639 vlan = &nix_hw->txvlan; in nix_tx_vtag_decfg()
2665 struct nix_hw *nix_hw = get_nix_hw(rvu->hw, blkaddr); in nix_tx_vtag_cfg() local
2669 if (!nix_hw) in nix_tx_vtag_cfg()
2672 vlan = &nix_hw->txvlan; in nix_tx_vtag_cfg()
2736 static int nix_blk_setup_mce(struct rvu *rvu, struct nix_hw *nix_hw, in nix_blk_setup_mce() argument
2757 err = rvu_nix_blk_aq_enq_inst(rvu, nix_hw, &aq_req, NULL); in nix_blk_setup_mce()
2815 struct nix_hw *nix_hw; in nix_update_mce_list() local
2832 err = nix_get_struct_ptrs(rvu, pcifunc, &nix_hw, &blkaddr); in nix_update_mce_list()
2836 mcast = &nix_hw->mcast; in nix_update_mce_list()
2859 err = nix_blk_setup_mce(rvu, nix_hw, idx, NIX_AQ_INSTOP_WRITE, in nix_update_mce_list()
2941 static int nix_setup_mce_tables(struct rvu *rvu, struct nix_hw *nix_hw) in nix_setup_mce_tables() argument
2943 struct nix_mcast *mcast = &nix_hw->mcast; in nix_setup_mce_tables()
2961 if (pfvf->nix_blkaddr != nix_hw->blkaddr) in nix_setup_mce_tables()
2985 err = nix_blk_setup_mce(rvu, nix_hw, in nix_setup_mce_tables()
2993 err = nix_blk_setup_mce(rvu, nix_hw, in nix_setup_mce_tables()
3001 err = nix_blk_setup_mce(rvu, nix_hw, in nix_setup_mce_tables()
3012 static int nix_setup_mcast(struct rvu *rvu, struct nix_hw *nix_hw, int blkaddr) in nix_setup_mcast() argument
3014 struct nix_mcast *mcast = &nix_hw->mcast; in nix_setup_mcast()
3053 return nix_setup_mce_tables(rvu, nix_hw); in nix_setup_mcast()
3056 static int nix_setup_txvlan(struct rvu *rvu, struct nix_hw *nix_hw) in nix_setup_txvlan() argument
3058 struct nix_txvlan *vlan = &nix_hw->txvlan; in nix_setup_txvlan()
3081 static int nix_setup_txschq(struct rvu *rvu, struct nix_hw *nix_hw, int blkaddr) in nix_setup_txschq() argument
3091 txsch = &nix_hw->txsch[lvl]; in nix_setup_txschq()
3138 int rvu_nix_reserve_mark_format(struct rvu *rvu, struct nix_hw *nix_hw, in rvu_nix_reserve_mark_format() argument
3143 for (fmt_idx = 0; fmt_idx < nix_hw->mark_format.in_use; fmt_idx++) { in rvu_nix_reserve_mark_format()
3144 if (nix_hw->mark_format.cfg[fmt_idx] == cfg) in rvu_nix_reserve_mark_format()
3147 if (fmt_idx >= nix_hw->mark_format.total) in rvu_nix_reserve_mark_format()
3151 nix_hw->mark_format.cfg[fmt_idx] = cfg; in rvu_nix_reserve_mark_format()
3152 nix_hw->mark_format.in_use++; in rvu_nix_reserve_mark_format()
3156 static int nix_af_mark_format_setup(struct rvu *rvu, struct nix_hw *nix_hw, in nix_af_mark_format_setup() argument
3174 nix_hw->mark_format.total = (u8)total; in nix_af_mark_format_setup()
3175 nix_hw->mark_format.cfg = devm_kcalloc(rvu->dev, total, sizeof(u32), in nix_af_mark_format_setup()
3177 if (!nix_hw->mark_format.cfg) in nix_af_mark_format_setup()
3180 rc = rvu_nix_reserve_mark_format(rvu, nix_hw, blkaddr, cfgs[i]); in nix_af_mark_format_setup()
3267 static int get_flowkey_alg_idx(struct nix_hw *nix_hw, u32 flow_cfg) in get_flowkey_alg_idx() argument
3272 for (i = 0; i < nix_hw->flowkey.in_use; i++) in get_flowkey_alg_idx()
3273 if (nix_hw->flowkey.flowkey[i] == flow_cfg) in get_flowkey_alg_idx()
3546 struct nix_hw *hw; in reserve_flowkey_alg_idx()
3582 struct nix_hw *nix_hw; in rvu_mbox_handler_nix_rss_flowkey_cfg() local
3589 nix_hw = get_nix_hw(rvu->hw, blkaddr); in rvu_mbox_handler_nix_rss_flowkey_cfg()
3590 if (!nix_hw) in rvu_mbox_handler_nix_rss_flowkey_cfg()
3593 alg_idx = get_flowkey_alg_idx(nix_hw, req->flowkey_cfg); in rvu_mbox_handler_nix_rss_flowkey_cfg()
3864 struct nix_hw *nix_hw; in nix_config_link_credits() local
3870 nix_hw = get_nix_hw(rvu->hw, blkaddr); in nix_config_link_credits()
3871 if (!nix_hw) in nix_config_link_credits()
3874 if (tx_credits == nix_hw->tx_credits[link]) in nix_config_link_credits()
3904 } while (credits != nix_hw->tx_credits[link]); in nix_config_link_credits()
3911 nix_hw->tx_credits[link] = tx_credits; in nix_config_link_credits()
3935 struct nix_hw *nix_hw; in rvu_mbox_handler_nix_set_hw_frs() local
3944 nix_hw = get_nix_hw(rvu->hw, blkaddr); in rvu_mbox_handler_nix_set_hw_frs()
3945 if (!nix_hw) in rvu_mbox_handler_nix_set_hw_frs()
3964 txsch = &nix_hw->txsch[NIX_TXSCH_LVL_SMQ]; in rvu_mbox_handler_nix_set_hw_frs()
4066 struct nix_hw *nix_hw) in nix_link_config() argument
4125 nix_hw->tx_credits[link] = tx_credits; in nix_link_config()
4135 nix_hw->tx_credits[link] = tx_credits; in nix_link_config()
4251 static int rvu_nix_block_init(struct rvu *rvu, struct nix_hw *nix_hw) in rvu_nix_block_init() argument
4255 int blkaddr = nix_hw->blkaddr; in rvu_nix_block_init()
4309 err = nix_setup_txschq(rvu, nix_hw, blkaddr); in rvu_nix_block_init()
4313 err = nix_setup_ipolicers(rvu, nix_hw, blkaddr); in rvu_nix_block_init()
4317 err = nix_af_mark_format_setup(rvu, nix_hw, blkaddr); in rvu_nix_block_init()
4321 err = nix_setup_mcast(rvu, nix_hw, blkaddr); in rvu_nix_block_init()
4325 err = nix_setup_txvlan(rvu, nix_hw); in rvu_nix_block_init()
4330 nix_setup_lso(rvu, nix_hw, blkaddr); in rvu_nix_block_init()
4408 nix_hw->tx_credits = kcalloc(hw->cgx_links + hw->lbk_links, in rvu_nix_block_init()
4410 if (!nix_hw->tx_credits) in rvu_nix_block_init()
4414 nix_link_config(rvu, blkaddr, nix_hw); in rvu_nix_block_init()
4425 struct nix_hw *nix_hw; in rvu_nix_init() local
4429 hw->nix = devm_kcalloc(rvu->dev, MAX_NIX_BLKS, sizeof(struct nix_hw), in rvu_nix_init()
4436 nix_hw = &hw->nix[i]; in rvu_nix_init()
4437 nix_hw->rvu = rvu; in rvu_nix_init()
4438 nix_hw->blkaddr = blkaddr; in rvu_nix_init()
4439 err = rvu_nix_block_init(rvu, nix_hw); in rvu_nix_init()
4455 struct nix_hw *nix_hw; in rvu_nix_block_freemem() local
4461 nix_hw = get_nix_hw(rvu->hw, blkaddr); in rvu_nix_block_freemem()
4462 if (!nix_hw) in rvu_nix_block_freemem()
4466 txsch = &nix_hw->txsch[lvl]; in rvu_nix_block_freemem()
4470 kfree(nix_hw->tx_credits); in rvu_nix_block_freemem()
4472 nix_ipolicer_freemem(rvu, nix_hw); in rvu_nix_block_freemem()
4474 vlan = &nix_hw->txvlan; in rvu_nix_block_freemem()
4478 mcast = &nix_hw->mcast; in rvu_nix_block_freemem()
4675 struct nix_hw *nix_hw; in rvu_mbox_handler_nix_lso_format_cfg() local
4685 nix_hw = get_nix_hw(rvu->hw, blkaddr); in rvu_mbox_handler_nix_lso_format_cfg()
4686 if (!nix_hw) in rvu_mbox_handler_nix_lso_format_cfg()
4690 for (idx = 0; idx < nix_hw->lso.in_use; idx++) { in rvu_mbox_handler_nix_lso_format_cfg()
4702 if (idx < nix_hw->lso.in_use) { in rvu_mbox_handler_nix_lso_format_cfg()
4708 if (nix_hw->lso.in_use == nix_hw->lso.total) in rvu_mbox_handler_nix_lso_format_cfg()
4711 rsp->lso_format_idx = nix_hw->lso.in_use++; in rvu_mbox_handler_nix_lso_format_cfg()
4886 static int nix_init_policer_context(struct rvu *rvu, struct nix_hw *nix_hw, in nix_init_policer_context() argument
4899 rc = rvu_nix_blk_aq_enq_inst(rvu, nix_hw, in nix_init_policer_context()
4908 struct nix_hw *nix_hw, int blkaddr) in nix_setup_ipolicers() argument
4922 nix_hw->ipolicer = devm_kcalloc(rvu->dev, BAND_PROF_NUM_LAYERS, in nix_setup_ipolicers()
4924 if (!nix_hw->ipolicer) in nix_setup_ipolicers()
4930 ipolicer = &nix_hw->ipolicer[layer]; in nix_setup_ipolicers()
4972 err = nix_init_policer_context(rvu, nix_hw, in nix_setup_ipolicers()
5000 static void nix_ipolicer_freemem(struct rvu *rvu, struct nix_hw *nix_hw) in nix_ipolicer_freemem() argument
5009 ipolicer = &nix_hw->ipolicer[layer]; in nix_ipolicer_freemem()
5019 struct nix_hw *nix_hw, u16 pcifunc) in nix_verify_bandprof() argument
5028 ipolicer = &nix_hw->ipolicer[layer]; in nix_verify_bandprof()
5055 ipolicer = &nix_hw->ipolicer[hi_layer]; in nix_verify_bandprof()
5071 struct nix_hw *nix_hw; in rvu_mbox_handler_nix_bandprof_alloc() local
5076 err = nix_get_struct_ptrs(rvu, pcifunc, &nix_hw, &blkaddr); in rvu_mbox_handler_nix_bandprof_alloc()
5087 ipolicer = &nix_hw->ipolicer[layer]; in rvu_mbox_handler_nix_bandprof_alloc()
5109 struct nix_hw *nix_hw; in nix_free_all_bandprof() local
5114 err = nix_get_struct_ptrs(rvu, pcifunc, &nix_hw, &blkaddr); in nix_free_all_bandprof()
5123 ipolicer = &nix_hw->ipolicer[layer]; in nix_free_all_bandprof()
5132 nix_clear_ratelimit_aggr(rvu, nix_hw, prof_idx); in nix_free_all_bandprof()
5150 struct nix_hw *nix_hw; in rvu_mbox_handler_nix_bandprof_free() local
5158 err = nix_get_struct_ptrs(rvu, pcifunc, &nix_hw, &blkaddr); in rvu_mbox_handler_nix_bandprof_free()
5170 ipolicer = &nix_hw->ipolicer[layer]; in rvu_mbox_handler_nix_bandprof_free()
5180 nix_clear_ratelimit_aggr(rvu, nix_hw, prof_idx); in rvu_mbox_handler_nix_bandprof_free()
5193 int nix_aq_context_read(struct rvu *rvu, struct nix_hw *nix_hw, in nix_aq_context_read() argument
5204 return rvu_nix_blk_aq_enq_inst(rvu, nix_hw, in nix_aq_context_read()
5210 struct nix_hw *nix_hw, in nix_ipolicer_map_leaf_midprofs() argument
5226 return rvu_nix_blk_aq_enq_inst(rvu, nix_hw, in nix_ipolicer_map_leaf_midprofs()
5238 struct nix_hw *nix_hw; in rvu_nix_setup_ratelimit_aggr() local
5244 rc = nix_get_struct_ptrs(rvu, pcifunc, &nix_hw, &blkaddr); in rvu_nix_setup_ratelimit_aggr()
5249 rc = nix_aq_context_read(rvu, nix_hw, &aq_req, &aq_rsp, pcifunc, in rvu_nix_setup_ratelimit_aggr()
5264 ipolicer = &nix_hw->ipolicer[BAND_PROF_LEAF_LAYER]; in rvu_nix_setup_ratelimit_aggr()
5284 rc = nix_aq_context_read(rvu, nix_hw, &aq_req, &aq_rsp, 0x00, in rvu_nix_setup_ratelimit_aggr()
5293 ipolicer = &nix_hw->ipolicer[BAND_PROF_MID_LAYER]; in rvu_nix_setup_ratelimit_aggr()
5301 rc = nix_ipolicer_map_leaf_midprofs(rvu, nix_hw, in rvu_nix_setup_ratelimit_aggr()
5333 rc = nix_aq_context_read(rvu, nix_hw, &aq_req, &aq_rsp, 0x00, in rvu_nix_setup_ratelimit_aggr()
5353 rc = rvu_nix_blk_aq_enq_inst(rvu, nix_hw, in rvu_nix_setup_ratelimit_aggr()
5363 rc = nix_ipolicer_map_leaf_midprofs(rvu, nix_hw, in rvu_nix_setup_ratelimit_aggr()
5377 rc = nix_ipolicer_map_leaf_midprofs(rvu, nix_hw, in rvu_nix_setup_ratelimit_aggr()
5397 static void nix_clear_ratelimit_aggr(struct rvu *rvu, struct nix_hw *nix_hw, in nix_clear_ratelimit_aggr() argument
5408 rc = nix_aq_context_read(rvu, nix_hw, &aq_req, &aq_rsp, 0x00, in nix_clear_ratelimit_aggr()
5423 ipolicer = &nix_hw->ipolicer[BAND_PROF_MID_LAYER]; in nix_clear_ratelimit_aggr()
5437 struct nix_hw *nix_hw; in rvu_mbox_handler_nix_bandprof_get_hwinfo() local
5443 err = nix_get_struct_ptrs(rvu, req->hdr.pcifunc, &nix_hw, &blkaddr); in rvu_mbox_handler_nix_bandprof_get_hwinfo()
5453 ipolicer = &nix_hw->ipolicer[layer]; in rvu_mbox_handler_nix_bandprof_get_hwinfo()