Lines Matching refs:pfvf
26 int cn10k_lmtst_init(struct otx2_nic *pfvf) in cn10k_lmtst_init() argument
33 if (!test_bit(CN10K_LMTST, &pfvf->hw.cap_flag)) { in cn10k_lmtst_init()
34 pfvf->hw_ops = &otx2_hw_ops; in cn10k_lmtst_init()
38 pfvf->hw_ops = &cn10k_hw_ops; in cn10k_lmtst_init()
40 pfvf->tot_lmt_lines = (num_online_cpus() * LMT_BURST_SIZE); in cn10k_lmtst_init()
41 pfvf->hw.lmt_info = alloc_percpu(struct otx2_lmt_info); in cn10k_lmtst_init()
43 mutex_lock(&pfvf->mbox.lock); in cn10k_lmtst_init()
44 req = otx2_mbox_alloc_msg_lmtst_tbl_setup(&pfvf->mbox); in cn10k_lmtst_init()
46 mutex_unlock(&pfvf->mbox.lock); in cn10k_lmtst_init()
52 err = qmem_alloc(pfvf->dev, &pfvf->dync_lmt, pfvf->tot_lmt_lines, in cn10k_lmtst_init()
55 mutex_unlock(&pfvf->mbox.lock); in cn10k_lmtst_init()
58 pfvf->hw.lmt_base = (u64 *)pfvf->dync_lmt->base; in cn10k_lmtst_init()
59 req->lmt_iova = (u64)pfvf->dync_lmt->iova; in cn10k_lmtst_init()
61 err = otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_lmtst_init()
62 mutex_unlock(&pfvf->mbox.lock); in cn10k_lmtst_init()
65 lmt_info = per_cpu_ptr(pfvf->hw.lmt_info, cpu); in cn10k_lmtst_init()
66 lmt_info->lmt_addr = ((u64)pfvf->hw.lmt_base + in cn10k_lmtst_init()
78 struct otx2_nic *pfvf = dev; in cn10k_sq_aq_init() local
81 aq = otx2_mbox_alloc_msg_nix_cn10k_aq_enq(&pfvf->mbox); in cn10k_sq_aq_init()
85 aq->sq.cq = pfvf->hw.rx_queues + qidx; in cn10k_sq_aq_init()
89 aq->sq.smq = otx2_get_smq_idx(pfvf, qidx); in cn10k_sq_aq_init()
90 aq->sq.smq_rr_weight = mtu_to_dwrr_weight(pfvf, pfvf->tx_max_pktlen); in cn10k_sq_aq_init()
91 aq->sq.default_chan = pfvf->hw.tx_chan_base; in cn10k_sq_aq_init()
99 aq->sq.cq_limit = ((SEND_CQ_SKID * 256) / (pfvf->qset.sqe_cnt)); in cn10k_sq_aq_init()
106 return otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_sq_aq_init()
112 struct otx2_nic *pfvf = dev; in cn10k_refill_pool_ptrs() local
120 if (otx2_alloc_buffer(pfvf, cq, &bufptr)) { in cn10k_refill_pool_ptrs()
122 __cn10k_aura_freeptr(pfvf, cq->cq_idx, ptrs, in cn10k_refill_pool_ptrs()
130 __cn10k_aura_freeptr(pfvf, cq->cq_idx, ptrs, in cn10k_refill_pool_ptrs()
141 struct otx2_nic *pfvf = dev; in cn10k_sqe_flush() local
144 lmt_info = per_cpu_ptr(pfvf->hw.lmt_info, smp_processor_id()); in cn10k_sqe_flush()
163 int cn10k_free_all_ipolicers(struct otx2_nic *pfvf) in cn10k_free_all_ipolicers() argument
168 if (is_dev_otx2(pfvf->pdev)) in cn10k_free_all_ipolicers()
171 mutex_lock(&pfvf->mbox.lock); in cn10k_free_all_ipolicers()
173 req = otx2_mbox_alloc_msg_nix_bandprof_free(&pfvf->mbox); in cn10k_free_all_ipolicers()
182 rc = otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_free_all_ipolicers()
184 mutex_unlock(&pfvf->mbox.lock); in cn10k_free_all_ipolicers()
188 int cn10k_alloc_leaf_profile(struct otx2_nic *pfvf, u16 *leaf) in cn10k_alloc_leaf_profile() argument
194 req = otx2_mbox_alloc_msg_nix_bandprof_alloc(&pfvf->mbox); in cn10k_alloc_leaf_profile()
200 rc = otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_alloc_leaf_profile()
205 otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); in cn10k_alloc_leaf_profile()
214 dev_warn(pfvf->dev, in cn10k_alloc_leaf_profile()
221 int cn10k_alloc_matchall_ipolicer(struct otx2_nic *pfvf) in cn10k_alloc_matchall_ipolicer() argument
223 struct otx2_hw *hw = &pfvf->hw; in cn10k_alloc_matchall_ipolicer()
226 mutex_lock(&pfvf->mbox.lock); in cn10k_alloc_matchall_ipolicer()
228 ret = cn10k_alloc_leaf_profile(pfvf, &hw->matchall_ipolicer); in cn10k_alloc_matchall_ipolicer()
230 mutex_unlock(&pfvf->mbox.lock); in cn10k_alloc_matchall_ipolicer()
301 int cn10k_map_unmap_rq_policer(struct otx2_nic *pfvf, int rq_idx, in cn10k_map_unmap_rq_policer() argument
306 aq = otx2_mbox_alloc_msg_nix_cn10k_aq_enq(&pfvf->mbox); in cn10k_map_unmap_rq_policer()
325 return otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_map_unmap_rq_policer()
328 int cn10k_free_leaf_profile(struct otx2_nic *pfvf, u16 leaf) in cn10k_free_leaf_profile() argument
332 req = otx2_mbox_alloc_msg_nix_bandprof_free(&pfvf->mbox); in cn10k_free_leaf_profile()
339 return otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_free_leaf_profile()
342 int cn10k_free_matchall_ipolicer(struct otx2_nic *pfvf) in cn10k_free_matchall_ipolicer() argument
344 struct otx2_hw *hw = &pfvf->hw; in cn10k_free_matchall_ipolicer()
347 mutex_lock(&pfvf->mbox.lock); in cn10k_free_matchall_ipolicer()
351 cn10k_map_unmap_rq_policer(pfvf, qidx, in cn10k_free_matchall_ipolicer()
354 rc = cn10k_free_leaf_profile(pfvf, hw->matchall_ipolicer); in cn10k_free_matchall_ipolicer()
356 mutex_unlock(&pfvf->mbox.lock); in cn10k_free_matchall_ipolicer()
360 int cn10k_set_ipolicer_rate(struct otx2_nic *pfvf, u16 profile, in cn10k_set_ipolicer_rate() argument
373 aq = otx2_mbox_alloc_msg_nix_cn10k_aq_enq(&pfvf->mbox); in cn10k_set_ipolicer_rate()
461 return otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_set_ipolicer_rate()
464 int cn10k_set_matchall_ipolicer_rate(struct otx2_nic *pfvf, in cn10k_set_matchall_ipolicer_rate() argument
467 struct otx2_hw *hw = &pfvf->hw; in cn10k_set_matchall_ipolicer_rate()
470 mutex_lock(&pfvf->mbox.lock); in cn10k_set_matchall_ipolicer_rate()
472 rc = cn10k_set_ipolicer_rate(pfvf, hw->matchall_ipolicer, burst, in cn10k_set_matchall_ipolicer_rate()
478 rc = cn10k_map_unmap_rq_policer(pfvf, qidx, in cn10k_set_matchall_ipolicer_rate()
485 mutex_unlock(&pfvf->mbox.lock); in cn10k_set_matchall_ipolicer_rate()