Lines Matching refs:pfvf
73 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in is_nixlf_attached() local
77 if (!pfvf->nixlf || blkaddr < 0) in is_nixlf_attached()
172 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_interface_init() local
183 pfvf->cgx_lmac = rvu->pf2cgxlmac_map[pf]; in nix_interface_init()
184 rvu_get_cgx_lmac_id(pfvf->cgx_lmac, &cgx_id, &lmac_id); in nix_interface_init()
192 pfvf->rx_chan_base = NIX_CHAN_CGX_LMAC_CHX(cgx_id, lmac_id, 0); in nix_interface_init()
193 pfvf->tx_chan_base = pfvf->rx_chan_base; in nix_interface_init()
194 pfvf->rx_chan_cnt = 1; in nix_interface_init()
195 pfvf->tx_chan_cnt = 1; in nix_interface_init()
197 rvu_npc_set_pkind(rvu, pkind, pfvf); in nix_interface_init()
201 pfvf->rx_chan_base = NIX_CHAN_LBK_CHX(0, vf); in nix_interface_init()
202 pfvf->tx_chan_base = vf & 0x1 ? NIX_CHAN_LBK_CHX(0, vf - 1) : in nix_interface_init()
204 pfvf->rx_chan_cnt = 1; in nix_interface_init()
205 pfvf->tx_chan_cnt = 1; in nix_interface_init()
207 pfvf->rx_chan_base, false); in nix_interface_init()
215 pfvf->rx_chan_base, pfvf->mac_addr); in nix_interface_init()
227 nixlf, pfvf->rx_chan_base); in nix_interface_init()
228 pfvf->maxlen = NIC_HW_MIN_FRS; in nix_interface_init()
229 pfvf->minlen = NIC_HW_MIN_FRS; in nix_interface_init()
236 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_interface_deinit() local
239 pfvf->maxlen = 0; in nix_interface_deinit()
240 pfvf->minlen = 0; in nix_interface_deinit()
241 pfvf->rxvlan = false; in nix_interface_deinit()
354 static void nix_ctx_free(struct rvu *rvu, struct rvu_pfvf *pfvf) in nix_ctx_free() argument
356 kfree(pfvf->rq_bmap); in nix_ctx_free()
357 kfree(pfvf->sq_bmap); in nix_ctx_free()
358 kfree(pfvf->cq_bmap); in nix_ctx_free()
359 if (pfvf->rq_ctx) in nix_ctx_free()
360 qmem_free(rvu->dev, pfvf->rq_ctx); in nix_ctx_free()
361 if (pfvf->sq_ctx) in nix_ctx_free()
362 qmem_free(rvu->dev, pfvf->sq_ctx); in nix_ctx_free()
363 if (pfvf->cq_ctx) in nix_ctx_free()
364 qmem_free(rvu->dev, pfvf->cq_ctx); in nix_ctx_free()
365 if (pfvf->rss_ctx) in nix_ctx_free()
366 qmem_free(rvu->dev, pfvf->rss_ctx); in nix_ctx_free()
367 if (pfvf->nix_qints_ctx) in nix_ctx_free()
368 qmem_free(rvu->dev, pfvf->nix_qints_ctx); in nix_ctx_free()
369 if (pfvf->cq_ints_ctx) in nix_ctx_free()
370 qmem_free(rvu->dev, pfvf->cq_ints_ctx); in nix_ctx_free()
372 pfvf->rq_bmap = NULL; in nix_ctx_free()
373 pfvf->cq_bmap = NULL; in nix_ctx_free()
374 pfvf->sq_bmap = NULL; in nix_ctx_free()
375 pfvf->rq_ctx = NULL; in nix_ctx_free()
376 pfvf->sq_ctx = NULL; in nix_ctx_free()
377 pfvf->cq_ctx = NULL; in nix_ctx_free()
378 pfvf->rss_ctx = NULL; in nix_ctx_free()
379 pfvf->nix_qints_ctx = NULL; in nix_ctx_free()
380 pfvf->cq_ints_ctx = NULL; in nix_ctx_free()
384 struct rvu_pfvf *pfvf, int nixlf, in nixlf_rss_ctx_init() argument
395 err = qmem_alloc(rvu->dev, &pfvf->rss_ctx, num_indices, hwctx_size); in nixlf_rss_ctx_init()
400 (u64)pfvf->rss_ctx->iova); in nixlf_rss_ctx_init()
459 struct rvu_pfvf *pfvf; in rvu_nix_aq_enq_inst() local
475 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_nix_aq_enq_inst()
480 if (!pfvf->nixlf || nixlf < 0) in rvu_nix_aq_enq_inst()
487 if (!pfvf->rq_ctx || req->qidx >= pfvf->rq_ctx->qsize) in rvu_nix_aq_enq_inst()
491 if (!pfvf->sq_ctx || req->qidx >= pfvf->sq_ctx->qsize) in rvu_nix_aq_enq_inst()
495 if (!pfvf->cq_ctx || req->qidx >= pfvf->cq_ctx->qsize) in rvu_nix_aq_enq_inst()
501 if (!(cfg & BIT_ULL(4)) || !pfvf->rss_ctx || in rvu_nix_aq_enq_inst()
604 __set_bit(req->qidx, pfvf->rq_bmap); in rvu_nix_aq_enq_inst()
606 __set_bit(req->qidx, pfvf->sq_bmap); in rvu_nix_aq_enq_inst()
608 __set_bit(req->qidx, pfvf->cq_bmap); in rvu_nix_aq_enq_inst()
614 (test_bit(req->qidx, pfvf->rq_bmap) & in rvu_nix_aq_enq_inst()
617 __set_bit(req->qidx, pfvf->rq_bmap); in rvu_nix_aq_enq_inst()
619 __clear_bit(req->qidx, pfvf->rq_bmap); in rvu_nix_aq_enq_inst()
623 (test_bit(req->qidx, pfvf->sq_bmap) & in rvu_nix_aq_enq_inst()
626 __set_bit(req->qidx, pfvf->sq_bmap); in rvu_nix_aq_enq_inst()
628 __clear_bit(req->qidx, pfvf->sq_bmap); in rvu_nix_aq_enq_inst()
632 (test_bit(req->qidx, pfvf->cq_bmap) & in rvu_nix_aq_enq_inst()
635 __set_bit(req->qidx, pfvf->cq_bmap); in rvu_nix_aq_enq_inst()
637 __clear_bit(req->qidx, pfvf->cq_bmap); in rvu_nix_aq_enq_inst()
668 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in nix_lf_hwctx_disable() local
674 if (!pfvf->cq_ctx || !pfvf->sq_ctx || !pfvf->rq_ctx) in nix_lf_hwctx_disable()
683 q_cnt = pfvf->cq_ctx->qsize; in nix_lf_hwctx_disable()
684 bmap = pfvf->cq_bmap; in nix_lf_hwctx_disable()
689 q_cnt = pfvf->sq_ctx->qsize; in nix_lf_hwctx_disable()
690 bmap = pfvf->sq_bmap; in nix_lf_hwctx_disable()
695 q_cnt = pfvf->rq_ctx->qsize; in nix_lf_hwctx_disable()
696 bmap = pfvf->rq_bmap; in nix_lf_hwctx_disable()
741 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_lf_alloc() local
748 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_lf_alloc()
750 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_lf_alloc()
801 err = qmem_alloc(rvu->dev, &pfvf->rq_ctx, req->rq_cnt, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
805 pfvf->rq_bmap = kcalloc(req->rq_cnt, sizeof(long), GFP_KERNEL); in rvu_mbox_handler_nix_lf_alloc()
806 if (!pfvf->rq_bmap) in rvu_mbox_handler_nix_lf_alloc()
810 (u64)pfvf->rq_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
818 err = qmem_alloc(rvu->dev, &pfvf->sq_ctx, req->sq_cnt, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
822 pfvf->sq_bmap = kcalloc(req->sq_cnt, sizeof(long), GFP_KERNEL); in rvu_mbox_handler_nix_lf_alloc()
823 if (!pfvf->sq_bmap) in rvu_mbox_handler_nix_lf_alloc()
827 (u64)pfvf->sq_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
833 err = qmem_alloc(rvu->dev, &pfvf->cq_ctx, req->cq_cnt, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
837 pfvf->cq_bmap = kcalloc(req->cq_cnt, sizeof(long), GFP_KERNEL); in rvu_mbox_handler_nix_lf_alloc()
838 if (!pfvf->cq_bmap) in rvu_mbox_handler_nix_lf_alloc()
842 (u64)pfvf->cq_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
848 err = nixlf_rss_ctx_init(rvu, blkaddr, pfvf, nixlf, in rvu_mbox_handler_nix_lf_alloc()
857 err = qmem_alloc(rvu->dev, &pfvf->cq_ints_ctx, qints, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
862 (u64)pfvf->cq_ints_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
869 err = qmem_alloc(rvu->dev, &pfvf->nix_qints_ctx, qints, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
874 (u64)pfvf->nix_qints_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
910 nix_ctx_free(rvu, pfvf); in rvu_mbox_handler_nix_lf_alloc()
915 ether_addr_copy(rsp->mac_addr, pfvf->mac_addr); in rvu_mbox_handler_nix_lf_alloc()
920 rsp->rx_chan_base = pfvf->rx_chan_base; in rvu_mbox_handler_nix_lf_alloc()
921 rsp->tx_chan_base = pfvf->tx_chan_base; in rvu_mbox_handler_nix_lf_alloc()
922 rsp->rx_chan_cnt = pfvf->rx_chan_cnt; in rvu_mbox_handler_nix_lf_alloc()
923 rsp->tx_chan_cnt = pfvf->tx_chan_cnt; in rvu_mbox_handler_nix_lf_alloc()
944 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_lf_free() local
946 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_lf_free()
948 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_lf_free()
966 nix_ctx_free(rvu, pfvf); in rvu_mbox_handler_nix_lf_free()
977 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_mark_format_cfg() local
981 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_mark_format_cfg()
983 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_mark_format_cfg()
1070 struct rvu_pfvf *pfvf; in rvu_get_tl1_schqs() local
1080 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_get_tl1_schqs()
1090 rvu_get_cgx_lmac_id(pfvf->cgx_lmac, &cgx_id, &lmac_id); in rvu_get_tl1_schqs()
1138 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_txsch_alloc() local
1144 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_txsch_alloc()
1146 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_txsch_alloc()
1699 struct rvu_pfvf *pfvf; in nix_update_bcast_mce_list() local
1717 pfvf = rvu_get_pfvf(rvu, pcifunc & ~RVU_PFVF_FUNC_MASK); in nix_update_bcast_mce_list()
1718 idx = pfvf->bcast_mce_idx + (pcifunc & RVU_PFVF_FUNC_MASK); in nix_update_bcast_mce_list()
1720 mce_list = &pfvf->bcast_mce_list; in nix_update_bcast_mce_list()
1721 if (idx > (pfvf->bcast_mce_idx + mce_list->max)) { in nix_update_bcast_mce_list()
1767 struct rvu_pfvf *pfvf; in nix_setup_bcast_tables() local
1780 pfvf = &rvu->pf[pf]; in nix_setup_bcast_tables()
1782 pfvf->bcast_mce_idx = nix_alloc_mce_list(mcast, numvfs + 1); in nix_setup_bcast_tables()
1784 nix_mce_list_init(&pfvf->bcast_mce_list, numvfs + 1); in nix_setup_bcast_tables()
1795 err = nix_setup_mce(rvu, pfvf->bcast_mce_idx + idx, in nix_setup_bcast_tables()
2264 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_set_mac_addr() local
2267 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_set_mac_addr()
2269 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_set_mac_addr()
2276 ether_addr_copy(pfvf->mac_addr, req->mac_addr); in rvu_mbox_handler_nix_set_mac_addr()
2279 pfvf->rx_chan_base, req->mac_addr); in rvu_mbox_handler_nix_set_mac_addr()
2292 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_set_rx_mode() local
2295 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_set_rx_mode()
2297 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_set_rx_mode()
2315 pfvf->rx_chan_base, allmulti); in rvu_mbox_handler_nix_set_rx_mode()
2326 struct rvu_pfvf *pfvf; in nix_find_link_frs() local
2332 pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_find_link_frs()
2333 pfvf->maxlen = req->maxlen; in nix_find_link_frs()
2335 pfvf->minlen = req->minlen; in nix_find_link_frs()
2345 pfvf = &rvu->hwvf[hwvf + vf]; in nix_find_link_frs()
2346 if (pfvf->maxlen > maxlen) in nix_find_link_frs()
2347 maxlen = pfvf->maxlen; in nix_find_link_frs()
2349 pfvf->minlen && pfvf->minlen < minlen) in nix_find_link_frs()
2350 minlen = pfvf->minlen; in nix_find_link_frs()
2354 pfvf = &rvu->pf[pf]; in nix_find_link_frs()
2355 if (pfvf->maxlen > maxlen) in nix_find_link_frs()
2356 maxlen = pfvf->maxlen; in nix_find_link_frs()
2358 pfvf->minlen && pfvf->minlen < minlen) in nix_find_link_frs()
2359 minlen = pfvf->minlen; in nix_find_link_frs()
2465 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_rxvlan_alloc() local
2473 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_rxvlan_alloc()
2474 if (pfvf->rxvlan) in rvu_mbox_handler_nix_rxvlan_alloc()
2499 pfvf->rxvlan_index = alloc_rsp.entry_list[0]; in rvu_mbox_handler_nix_rxvlan_alloc()
2501 pfvf->rxvlan = true; in rvu_mbox_handler_nix_rxvlan_alloc()
2512 pfvf->rxvlan = false; in rvu_mbox_handler_nix_rxvlan_alloc()
2522 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_set_rx_cfg() local
2526 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_set_rx_cfg()
2528 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_set_rx_cfg()
2830 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_get_nixlf() local
2835 if (!pfvf->nixlf || blkaddr < 0) in nix_get_nixlf()
2875 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_nix_lf_teardown() local
2886 if (pfvf->sq_ctx) { in rvu_nix_lf_teardown()
2893 if (pfvf->rq_ctx) { in rvu_nix_lf_teardown()
2900 if (pfvf->cq_ctx) { in rvu_nix_lf_teardown()
2907 nix_ctx_free(rvu, pfvf); in rvu_nix_lf_teardown()
2916 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_lso_format_cfg() local
2920 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_lso_format_cfg()
2922 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_lso_format_cfg()