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()
96 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_get_nixlf() local
101 if (!pfvf->nixlf || blkaddr < 0) in nix_get_nixlf()
189 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_interface_init() local
200 pfvf->cgx_lmac = rvu->pf2cgxlmac_map[pf]; in nix_interface_init()
201 rvu_get_cgx_lmac_id(pfvf->cgx_lmac, &cgx_id, &lmac_id); in nix_interface_init()
209 pfvf->rx_chan_base = NIX_CHAN_CGX_LMAC_CHX(cgx_id, lmac_id, 0); in nix_interface_init()
210 pfvf->tx_chan_base = pfvf->rx_chan_base; in nix_interface_init()
211 pfvf->rx_chan_cnt = 1; in nix_interface_init()
212 pfvf->tx_chan_cnt = 1; in nix_interface_init()
214 rvu_npc_set_pkind(rvu, pkind, pfvf); in nix_interface_init()
228 pfvf->rx_chan_base = NIX_CHAN_LBK_CHX(0, vf); in nix_interface_init()
229 pfvf->tx_chan_base = vf & 0x1 ? NIX_CHAN_LBK_CHX(0, vf - 1) : in nix_interface_init()
231 pfvf->rx_chan_cnt = 1; in nix_interface_init()
232 pfvf->tx_chan_cnt = 1; in nix_interface_init()
234 pfvf->rx_chan_base, false); in nix_interface_init()
242 pfvf->rx_chan_base, pfvf->mac_addr); in nix_interface_init()
254 nixlf, pfvf->rx_chan_base); in nix_interface_init()
255 pfvf->maxlen = NIC_HW_MIN_FRS; in nix_interface_init()
256 pfvf->minlen = NIC_HW_MIN_FRS; in nix_interface_init()
263 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_interface_deinit() local
266 pfvf->maxlen = 0; in nix_interface_deinit()
267 pfvf->minlen = 0; in nix_interface_deinit()
268 pfvf->rxvlan = false; in nix_interface_deinit()
287 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_bp_disable() local
297 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_bp_disable()
300 chan_base = pfvf->rx_chan_base + req->chan_base; in rvu_mbox_handler_nix_bp_disable()
315 struct rvu_pfvf *pfvf; in rvu_nix_get_bpid() local
326 pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in rvu_nix_get_bpid()
342 rvu_get_cgx_lmac_id(pfvf->cgx_lmac, &cgx_id, &lmac_id); in rvu_nix_get_bpid()
374 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_bp_enable() local
386 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_bp_enable()
390 chan_base = pfvf->rx_chan_base + req->chan_base; in rvu_mbox_handler_nix_bp_enable()
517 static void nix_ctx_free(struct rvu *rvu, struct rvu_pfvf *pfvf) in nix_ctx_free() argument
519 kfree(pfvf->rq_bmap); in nix_ctx_free()
520 kfree(pfvf->sq_bmap); in nix_ctx_free()
521 kfree(pfvf->cq_bmap); in nix_ctx_free()
522 if (pfvf->rq_ctx) in nix_ctx_free()
523 qmem_free(rvu->dev, pfvf->rq_ctx); in nix_ctx_free()
524 if (pfvf->sq_ctx) in nix_ctx_free()
525 qmem_free(rvu->dev, pfvf->sq_ctx); in nix_ctx_free()
526 if (pfvf->cq_ctx) in nix_ctx_free()
527 qmem_free(rvu->dev, pfvf->cq_ctx); in nix_ctx_free()
528 if (pfvf->rss_ctx) in nix_ctx_free()
529 qmem_free(rvu->dev, pfvf->rss_ctx); in nix_ctx_free()
530 if (pfvf->nix_qints_ctx) in nix_ctx_free()
531 qmem_free(rvu->dev, pfvf->nix_qints_ctx); in nix_ctx_free()
532 if (pfvf->cq_ints_ctx) in nix_ctx_free()
533 qmem_free(rvu->dev, pfvf->cq_ints_ctx); in nix_ctx_free()
535 pfvf->rq_bmap = NULL; in nix_ctx_free()
536 pfvf->cq_bmap = NULL; in nix_ctx_free()
537 pfvf->sq_bmap = NULL; in nix_ctx_free()
538 pfvf->rq_ctx = NULL; in nix_ctx_free()
539 pfvf->sq_ctx = NULL; in nix_ctx_free()
540 pfvf->cq_ctx = NULL; in nix_ctx_free()
541 pfvf->rss_ctx = NULL; in nix_ctx_free()
542 pfvf->nix_qints_ctx = NULL; in nix_ctx_free()
543 pfvf->cq_ints_ctx = NULL; in nix_ctx_free()
547 struct rvu_pfvf *pfvf, int nixlf, in nixlf_rss_ctx_init() argument
559 err = qmem_alloc(rvu->dev, &pfvf->rss_ctx, num_indices, hwctx_size); in nixlf_rss_ctx_init()
564 (u64)pfvf->rss_ctx->iova); in nixlf_rss_ctx_init()
624 struct rvu_pfvf *pfvf; in rvu_nix_aq_enq_inst() local
640 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_nix_aq_enq_inst()
645 if (!pfvf->nixlf || nixlf < 0) in rvu_nix_aq_enq_inst()
652 if (!pfvf->rq_ctx || req->qidx >= pfvf->rq_ctx->qsize) in rvu_nix_aq_enq_inst()
656 if (!pfvf->sq_ctx || req->qidx >= pfvf->sq_ctx->qsize) in rvu_nix_aq_enq_inst()
660 if (!pfvf->cq_ctx || req->qidx >= pfvf->cq_ctx->qsize) in rvu_nix_aq_enq_inst()
666 if (!(cfg & BIT_ULL(4)) || !pfvf->rss_ctx || in rvu_nix_aq_enq_inst()
773 __set_bit(req->qidx, pfvf->rq_bmap); in rvu_nix_aq_enq_inst()
775 __set_bit(req->qidx, pfvf->sq_bmap); in rvu_nix_aq_enq_inst()
777 __set_bit(req->qidx, pfvf->cq_bmap); in rvu_nix_aq_enq_inst()
783 (test_bit(req->qidx, pfvf->rq_bmap) & in rvu_nix_aq_enq_inst()
786 __set_bit(req->qidx, pfvf->rq_bmap); in rvu_nix_aq_enq_inst()
788 __clear_bit(req->qidx, pfvf->rq_bmap); in rvu_nix_aq_enq_inst()
792 (test_bit(req->qidx, pfvf->sq_bmap) & in rvu_nix_aq_enq_inst()
795 __set_bit(req->qidx, pfvf->sq_bmap); in rvu_nix_aq_enq_inst()
797 __clear_bit(req->qidx, pfvf->sq_bmap); in rvu_nix_aq_enq_inst()
801 (test_bit(req->qidx, pfvf->cq_bmap) & in rvu_nix_aq_enq_inst()
804 __set_bit(req->qidx, pfvf->cq_bmap); in rvu_nix_aq_enq_inst()
806 __clear_bit(req->qidx, pfvf->cq_bmap); in rvu_nix_aq_enq_inst()
852 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in nix_lf_hwctx_disable() local
858 if (!pfvf->cq_ctx || !pfvf->sq_ctx || !pfvf->rq_ctx) in nix_lf_hwctx_disable()
869 q_cnt = pfvf->cq_ctx->qsize; in nix_lf_hwctx_disable()
870 bmap = pfvf->cq_bmap; in nix_lf_hwctx_disable()
875 q_cnt = pfvf->sq_ctx->qsize; in nix_lf_hwctx_disable()
876 bmap = pfvf->sq_bmap; in nix_lf_hwctx_disable()
881 q_cnt = pfvf->rq_ctx->qsize; in nix_lf_hwctx_disable()
882 bmap = pfvf->rq_bmap; in nix_lf_hwctx_disable()
966 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_lf_alloc() local
976 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_lf_alloc()
978 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_lf_alloc()
1029 err = qmem_alloc(rvu->dev, &pfvf->rq_ctx, req->rq_cnt, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
1033 pfvf->rq_bmap = kcalloc(req->rq_cnt, sizeof(long), GFP_KERNEL); in rvu_mbox_handler_nix_lf_alloc()
1034 if (!pfvf->rq_bmap) in rvu_mbox_handler_nix_lf_alloc()
1038 (u64)pfvf->rq_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
1046 err = qmem_alloc(rvu->dev, &pfvf->sq_ctx, req->sq_cnt, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
1050 pfvf->sq_bmap = kcalloc(req->sq_cnt, sizeof(long), GFP_KERNEL); in rvu_mbox_handler_nix_lf_alloc()
1051 if (!pfvf->sq_bmap) in rvu_mbox_handler_nix_lf_alloc()
1055 (u64)pfvf->sq_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
1062 err = qmem_alloc(rvu->dev, &pfvf->cq_ctx, req->cq_cnt, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
1066 pfvf->cq_bmap = kcalloc(req->cq_cnt, sizeof(long), GFP_KERNEL); in rvu_mbox_handler_nix_lf_alloc()
1067 if (!pfvf->cq_bmap) in rvu_mbox_handler_nix_lf_alloc()
1071 (u64)pfvf->cq_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
1078 err = nixlf_rss_ctx_init(rvu, blkaddr, pfvf, nixlf, req->rss_sz, in rvu_mbox_handler_nix_lf_alloc()
1087 err = qmem_alloc(rvu->dev, &pfvf->cq_ints_ctx, qints, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
1092 (u64)pfvf->cq_ints_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
1101 err = qmem_alloc(rvu->dev, &pfvf->nix_qints_ctx, qints, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
1106 (u64)pfvf->nix_qints_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
1143 nix_ctx_free(rvu, pfvf); in rvu_mbox_handler_nix_lf_alloc()
1148 ether_addr_copy(rsp->mac_addr, pfvf->mac_addr); in rvu_mbox_handler_nix_lf_alloc()
1153 rsp->rx_chan_base = pfvf->rx_chan_base; in rvu_mbox_handler_nix_lf_alloc()
1154 rsp->tx_chan_base = pfvf->tx_chan_base; in rvu_mbox_handler_nix_lf_alloc()
1155 rsp->rx_chan_cnt = pfvf->rx_chan_cnt; in rvu_mbox_handler_nix_lf_alloc()
1156 rsp->tx_chan_cnt = pfvf->tx_chan_cnt; in rvu_mbox_handler_nix_lf_alloc()
1177 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_lf_free() local
1179 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_lf_free()
1181 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_lf_free()
1199 nix_ctx_free(rvu, pfvf); in rvu_mbox_handler_nix_lf_free()
1210 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_mark_format_cfg() local
1214 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_mark_format_cfg()
1216 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_mark_format_cfg()
1477 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_txsch_alloc() local
1482 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_txsch_alloc()
1484 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_txsch_alloc()
2028 struct rvu_pfvf *pfvf; in nix_update_bcast_mce_list() local
2047 pfvf = rvu_get_pfvf(rvu, pcifunc & ~RVU_PFVF_FUNC_MASK); in nix_update_bcast_mce_list()
2048 idx = pfvf->bcast_mce_idx + (pcifunc & RVU_PFVF_FUNC_MASK); in nix_update_bcast_mce_list()
2050 mce_list = &pfvf->bcast_mce_list; in nix_update_bcast_mce_list()
2051 if (idx > (pfvf->bcast_mce_idx + mce_list->max)) { in nix_update_bcast_mce_list()
2072 idx = pfvf->bcast_mce_idx; in nix_update_bcast_mce_list()
2097 struct rvu_pfvf *pfvf; in nix_setup_bcast_tables() local
2110 pfvf = &rvu->pf[pf]; in nix_setup_bcast_tables()
2112 pfvf->bcast_mce_idx = nix_alloc_mce_list(mcast, numvfs + 1); in nix_setup_bcast_tables()
2114 nix_mce_list_init(&pfvf->bcast_mce_list, numvfs + 1); in nix_setup_bcast_tables()
2125 err = nix_setup_mce(rvu, pfvf->bcast_mce_idx + idx, in nix_setup_bcast_tables()
2685 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_set_mac_addr() local
2691 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_set_mac_addr()
2693 ether_addr_copy(pfvf->mac_addr, req->mac_addr); in rvu_mbox_handler_nix_set_mac_addr()
2696 pfvf->rx_chan_base, req->mac_addr); in rvu_mbox_handler_nix_set_mac_addr()
2708 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_get_mac_addr() local
2713 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_get_mac_addr()
2715 ether_addr_copy(rsp->mac_addr, pfvf->mac_addr); in rvu_mbox_handler_nix_get_mac_addr()
2726 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_set_rx_mode() local
2732 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_set_rx_mode()
2745 pfvf->rx_chan_base, allmulti); in rvu_mbox_handler_nix_set_rx_mode()
2756 struct rvu_pfvf *pfvf; in nix_find_link_frs() local
2762 pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_find_link_frs()
2763 pfvf->maxlen = req->maxlen; in nix_find_link_frs()
2765 pfvf->minlen = req->minlen; in nix_find_link_frs()
2775 pfvf = &rvu->hwvf[hwvf + vf]; in nix_find_link_frs()
2776 if (pfvf->maxlen > maxlen) in nix_find_link_frs()
2777 maxlen = pfvf->maxlen; in nix_find_link_frs()
2779 pfvf->minlen && pfvf->minlen < minlen) in nix_find_link_frs()
2780 minlen = pfvf->minlen; in nix_find_link_frs()
2784 pfvf = &rvu->pf[pf]; in nix_find_link_frs()
2785 if (pfvf->maxlen > maxlen) in nix_find_link_frs()
2786 maxlen = pfvf->maxlen; in nix_find_link_frs()
2788 pfvf->minlen && pfvf->minlen < minlen) in nix_find_link_frs()
2789 minlen = pfvf->minlen; in nix_find_link_frs()
2893 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_rxvlan_alloc() local
2901 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_rxvlan_alloc()
2902 if (pfvf->rxvlan) in rvu_mbox_handler_nix_rxvlan_alloc()
2927 pfvf->rxvlan_index = alloc_rsp.entry_list[0]; in rvu_mbox_handler_nix_rxvlan_alloc()
2929 pfvf->rxvlan = true; in rvu_mbox_handler_nix_rxvlan_alloc()
2940 pfvf->rxvlan = false; in rvu_mbox_handler_nix_rxvlan_alloc()
3304 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_nix_lf_teardown() local
3317 if (pfvf->sq_ctx) { in rvu_nix_lf_teardown()
3324 if (pfvf->rq_ctx) { in rvu_nix_lf_teardown()
3331 if (pfvf->cq_ctx) { in rvu_nix_lf_teardown()
3338 nix_ctx_free(rvu, pfvf); in rvu_nix_lf_teardown()
3390 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_lso_format_cfg() local
3394 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_lso_format_cfg()
3396 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_lso_format_cfg()