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
119 if (otx2_alloc_buffer(pfvf, cq, &bufptr)) { in cn10k_refill_pool_ptrs()
121 __cn10k_aura_freeptr(pfvf, cq->cq_idx, ptrs, in cn10k_refill_pool_ptrs()
129 __cn10k_aura_freeptr(pfvf, cq->cq_idx, ptrs, in cn10k_refill_pool_ptrs()
139 struct otx2_nic *pfvf = dev; in cn10k_sqe_flush() local
142 lmt_info = per_cpu_ptr(pfvf->hw.lmt_info, smp_processor_id()); in cn10k_sqe_flush()
161 int cn10k_free_all_ipolicers(struct otx2_nic *pfvf) in cn10k_free_all_ipolicers() argument
166 if (is_dev_otx2(pfvf->pdev)) in cn10k_free_all_ipolicers()
169 mutex_lock(&pfvf->mbox.lock); in cn10k_free_all_ipolicers()
171 req = otx2_mbox_alloc_msg_nix_bandprof_free(&pfvf->mbox); in cn10k_free_all_ipolicers()
180 rc = otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_free_all_ipolicers()
182 mutex_unlock(&pfvf->mbox.lock); in cn10k_free_all_ipolicers()
186 int cn10k_alloc_leaf_profile(struct otx2_nic *pfvf, u16 *leaf) in cn10k_alloc_leaf_profile() argument
192 req = otx2_mbox_alloc_msg_nix_bandprof_alloc(&pfvf->mbox); in cn10k_alloc_leaf_profile()
198 rc = otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_alloc_leaf_profile()
203 otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr); in cn10k_alloc_leaf_profile()
212 dev_warn(pfvf->dev, in cn10k_alloc_leaf_profile()
219 int cn10k_alloc_matchall_ipolicer(struct otx2_nic *pfvf) in cn10k_alloc_matchall_ipolicer() argument
221 struct otx2_hw *hw = &pfvf->hw; in cn10k_alloc_matchall_ipolicer()
224 mutex_lock(&pfvf->mbox.lock); in cn10k_alloc_matchall_ipolicer()
226 ret = cn10k_alloc_leaf_profile(pfvf, &hw->matchall_ipolicer); in cn10k_alloc_matchall_ipolicer()
228 mutex_unlock(&pfvf->mbox.lock); in cn10k_alloc_matchall_ipolicer()
299 int cn10k_map_unmap_rq_policer(struct otx2_nic *pfvf, int rq_idx, in cn10k_map_unmap_rq_policer() argument
304 aq = otx2_mbox_alloc_msg_nix_cn10k_aq_enq(&pfvf->mbox); in cn10k_map_unmap_rq_policer()
323 return otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_map_unmap_rq_policer()
326 int cn10k_free_leaf_profile(struct otx2_nic *pfvf, u16 leaf) in cn10k_free_leaf_profile() argument
330 req = otx2_mbox_alloc_msg_nix_bandprof_free(&pfvf->mbox); in cn10k_free_leaf_profile()
337 return otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_free_leaf_profile()
340 int cn10k_free_matchall_ipolicer(struct otx2_nic *pfvf) in cn10k_free_matchall_ipolicer() argument
342 struct otx2_hw *hw = &pfvf->hw; in cn10k_free_matchall_ipolicer()
345 mutex_lock(&pfvf->mbox.lock); in cn10k_free_matchall_ipolicer()
349 cn10k_map_unmap_rq_policer(pfvf, qidx, in cn10k_free_matchall_ipolicer()
352 rc = cn10k_free_leaf_profile(pfvf, hw->matchall_ipolicer); in cn10k_free_matchall_ipolicer()
354 mutex_unlock(&pfvf->mbox.lock); in cn10k_free_matchall_ipolicer()
358 int cn10k_set_ipolicer_rate(struct otx2_nic *pfvf, u16 profile, in cn10k_set_ipolicer_rate() argument
371 aq = otx2_mbox_alloc_msg_nix_cn10k_aq_enq(&pfvf->mbox); in cn10k_set_ipolicer_rate()
456 return otx2_sync_mbox_msg(&pfvf->mbox); in cn10k_set_ipolicer_rate()
459 int cn10k_set_matchall_ipolicer_rate(struct otx2_nic *pfvf, in cn10k_set_matchall_ipolicer_rate() argument
462 struct otx2_hw *hw = &pfvf->hw; in cn10k_set_matchall_ipolicer_rate()
465 mutex_lock(&pfvf->mbox.lock); in cn10k_set_matchall_ipolicer_rate()
467 rc = cn10k_set_ipolicer_rate(pfvf, hw->matchall_ipolicer, burst, in cn10k_set_matchall_ipolicer_rate()
473 rc = cn10k_map_unmap_rq_policer(pfvf, qidx, in cn10k_set_matchall_ipolicer_rate()
480 mutex_unlock(&pfvf->mbox.lock); in cn10k_set_matchall_ipolicer_rate()