Lines Matching refs:pfvf

110 	struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc);  in is_nixlf_attached()  local
114 if (!pfvf->nixlf || blkaddr < 0) in is_nixlf_attached()
135 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_get_nixlf() local
140 if (!pfvf->nixlf || blkaddr < 0) in nix_get_nixlf()
156 struct rvu_pfvf *pfvf; in nix_get_struct_ptrs() local
158 pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_get_struct_ptrs()
160 if (!pfvf->nixlf || *blkaddr < 0) in nix_get_struct_ptrs()
333 struct rvu_pfvf *parent_pf, *pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_interface_init() local
349 pfvf->cgx_lmac = rvu->pf2cgxlmac_map[pf]; in nix_interface_init()
350 rvu_get_cgx_lmac_id(pfvf->cgx_lmac, &cgx_id, &lmac_id); in nix_interface_init()
358 pfvf->rx_chan_base = rvu_nix_chan_cgx(rvu, cgx_id, lmac_id, 0); in nix_interface_init()
359 pfvf->tx_chan_base = pfvf->rx_chan_base; in nix_interface_init()
360 pfvf->rx_chan_cnt = 1; in nix_interface_init()
361 pfvf->tx_chan_cnt = 1; in nix_interface_init()
365 rvu_npc_set_pkind(rvu, pkind, pfvf); in nix_interface_init()
403 pfvf->rx_chan_base = rvu_nix_chan_lbk(rvu, lbkid, vf); in nix_interface_init()
404 pfvf->tx_chan_base = vf & 0x1 ? in nix_interface_init()
407 pfvf->rx_chan_cnt = 1; in nix_interface_init()
408 pfvf->tx_chan_cnt = 1; in nix_interface_init()
410 pfvf->lbkid = lbkid; in nix_interface_init()
411 rvu_npc_set_pkind(rvu, NPC_RX_LBK_PKIND, pfvf); in nix_interface_init()
413 pfvf->rx_chan_base, in nix_interface_init()
414 pfvf->rx_chan_cnt); in nix_interface_init()
445 pfvf->rx_chan_base = req_chan_base; in nix_interface_init()
446 pfvf->rx_chan_cnt = req_chan_cnt; in nix_interface_init()
447 pfvf->tx_chan_base = pfvf->rx_chan_base; in nix_interface_init()
448 pfvf->tx_chan_cnt = pfvf->rx_chan_cnt; in nix_interface_init()
452 pfvf->rx_chan_base, in nix_interface_init()
453 pfvf->rx_chan_cnt); in nix_interface_init()
461 pfvf->rx_chan_base, pfvf->mac_addr); in nix_interface_init()
473 nixlf, pfvf->rx_chan_base); in nix_interface_init()
475 pfvf->maxlen = NIC_HW_MIN_FRS; in nix_interface_init()
476 pfvf->minlen = NIC_HW_MIN_FRS; in nix_interface_init()
483 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_interface_deinit() local
486 pfvf->maxlen = 0; in nix_interface_deinit()
487 pfvf->minlen = 0; in nix_interface_deinit()
587 struct rvu_pfvf *pfvf; in nix_bp_disable() local
604 pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_bp_disable()
610 chan_base = pfvf->rx_chan_base + req->chan_base; in nix_bp_disable()
652 struct rvu_pfvf *pfvf; in rvu_nix_get_bpid() local
657 pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in rvu_nix_get_bpid()
679 rvu_get_cgx_lmac_id(pfvf->cgx_lmac, &cgx_id, &lmac_id); in rvu_nix_get_bpid()
709 sdp_chan_base = pfvf->rx_chan_base - NIX_CHAN_SDP_CH_START; in rvu_nix_get_bpid()
711 sdp_chan_base = pfvf->rx_chan_base - hw->sdp_chan_base; in rvu_nix_get_bpid()
733 struct rvu_pfvf *pfvf; in nix_bp_enable() local
752 pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_bp_enable()
756 chan_base = pfvf->rx_chan_base + req->chan_base; in nix_bp_enable()
900 static void nix_ctx_free(struct rvu *rvu, struct rvu_pfvf *pfvf) in nix_ctx_free() argument
902 kfree(pfvf->rq_bmap); in nix_ctx_free()
903 kfree(pfvf->sq_bmap); in nix_ctx_free()
904 kfree(pfvf->cq_bmap); in nix_ctx_free()
905 if (pfvf->rq_ctx) in nix_ctx_free()
906 qmem_free(rvu->dev, pfvf->rq_ctx); in nix_ctx_free()
907 if (pfvf->sq_ctx) in nix_ctx_free()
908 qmem_free(rvu->dev, pfvf->sq_ctx); in nix_ctx_free()
909 if (pfvf->cq_ctx) in nix_ctx_free()
910 qmem_free(rvu->dev, pfvf->cq_ctx); in nix_ctx_free()
911 if (pfvf->rss_ctx) in nix_ctx_free()
912 qmem_free(rvu->dev, pfvf->rss_ctx); in nix_ctx_free()
913 if (pfvf->nix_qints_ctx) in nix_ctx_free()
914 qmem_free(rvu->dev, pfvf->nix_qints_ctx); in nix_ctx_free()
915 if (pfvf->cq_ints_ctx) in nix_ctx_free()
916 qmem_free(rvu->dev, pfvf->cq_ints_ctx); in nix_ctx_free()
918 pfvf->rq_bmap = NULL; in nix_ctx_free()
919 pfvf->cq_bmap = NULL; in nix_ctx_free()
920 pfvf->sq_bmap = NULL; in nix_ctx_free()
921 pfvf->rq_ctx = NULL; in nix_ctx_free()
922 pfvf->sq_ctx = NULL; in nix_ctx_free()
923 pfvf->cq_ctx = NULL; in nix_ctx_free()
924 pfvf->rss_ctx = NULL; in nix_ctx_free()
925 pfvf->nix_qints_ctx = NULL; in nix_ctx_free()
926 pfvf->cq_ints_ctx = NULL; in nix_ctx_free()
930 struct rvu_pfvf *pfvf, int nixlf, in nixlf_rss_ctx_init() argument
943 err = qmem_alloc(rvu->dev, &pfvf->rss_ctx, num_indices, hwctx_size); in nixlf_rss_ctx_init()
948 (u64)pfvf->rss_ctx->iova); in nixlf_rss_ctx_init()
1041 struct rvu_pfvf *pfvf; in rvu_nix_blk_aq_enq_inst() local
1055 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_nix_blk_aq_enq_inst()
1063 if (!pfvf->nixlf || nixlf < 0) in rvu_nix_blk_aq_enq_inst()
1070 if (!pfvf->rq_ctx || req->qidx >= pfvf->rq_ctx->qsize) in rvu_nix_blk_aq_enq_inst()
1074 if (!pfvf->sq_ctx || req->qidx >= pfvf->sq_ctx->qsize) in rvu_nix_blk_aq_enq_inst()
1078 if (!pfvf->cq_ctx || req->qidx >= pfvf->cq_ctx->qsize) in rvu_nix_blk_aq_enq_inst()
1084 if (!(cfg & BIT_ULL(4)) || !pfvf->rss_ctx || in rvu_nix_blk_aq_enq_inst()
1203 __set_bit(req->qidx, pfvf->rq_bmap); in rvu_nix_blk_aq_enq_inst()
1205 __set_bit(req->qidx, pfvf->sq_bmap); in rvu_nix_blk_aq_enq_inst()
1207 __set_bit(req->qidx, pfvf->cq_bmap); in rvu_nix_blk_aq_enq_inst()
1213 (test_bit(req->qidx, pfvf->rq_bmap) & in rvu_nix_blk_aq_enq_inst()
1216 __set_bit(req->qidx, pfvf->rq_bmap); in rvu_nix_blk_aq_enq_inst()
1218 __clear_bit(req->qidx, pfvf->rq_bmap); in rvu_nix_blk_aq_enq_inst()
1222 (test_bit(req->qidx, pfvf->sq_bmap) & in rvu_nix_blk_aq_enq_inst()
1225 __set_bit(req->qidx, pfvf->sq_bmap); in rvu_nix_blk_aq_enq_inst()
1227 __clear_bit(req->qidx, pfvf->sq_bmap); in rvu_nix_blk_aq_enq_inst()
1231 (test_bit(req->qidx, pfvf->cq_bmap) & in rvu_nix_blk_aq_enq_inst()
1234 __set_bit(req->qidx, pfvf->cq_bmap); in rvu_nix_blk_aq_enq_inst()
1236 __clear_bit(req->qidx, pfvf->cq_bmap); in rvu_nix_blk_aq_enq_inst()
1377 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, req->hdr.pcifunc); in nix_lf_hwctx_disable() local
1383 if (!pfvf->cq_ctx || !pfvf->sq_ctx || !pfvf->rq_ctx) in nix_lf_hwctx_disable()
1394 q_cnt = pfvf->cq_ctx->qsize; in nix_lf_hwctx_disable()
1395 bmap = pfvf->cq_bmap; in nix_lf_hwctx_disable()
1400 q_cnt = pfvf->sq_ctx->qsize; in nix_lf_hwctx_disable()
1401 bmap = pfvf->sq_bmap; in nix_lf_hwctx_disable()
1406 q_cnt = pfvf->rq_ctx->qsize; in nix_lf_hwctx_disable()
1407 bmap = pfvf->rq_bmap; in nix_lf_hwctx_disable()
1499 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_lf_alloc() local
1509 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_lf_alloc()
1511 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_lf_alloc()
1562 err = qmem_alloc(rvu->dev, &pfvf->rq_ctx, req->rq_cnt, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
1566 pfvf->rq_bmap = kcalloc(req->rq_cnt, sizeof(long), GFP_KERNEL); in rvu_mbox_handler_nix_lf_alloc()
1567 if (!pfvf->rq_bmap) in rvu_mbox_handler_nix_lf_alloc()
1571 (u64)pfvf->rq_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
1579 err = qmem_alloc(rvu->dev, &pfvf->sq_ctx, req->sq_cnt, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
1583 pfvf->sq_bmap = kcalloc(req->sq_cnt, sizeof(long), GFP_KERNEL); in rvu_mbox_handler_nix_lf_alloc()
1584 if (!pfvf->sq_bmap) in rvu_mbox_handler_nix_lf_alloc()
1588 (u64)pfvf->sq_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
1595 err = qmem_alloc(rvu->dev, &pfvf->cq_ctx, req->cq_cnt, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
1599 pfvf->cq_bmap = kcalloc(req->cq_cnt, sizeof(long), GFP_KERNEL); in rvu_mbox_handler_nix_lf_alloc()
1600 if (!pfvf->cq_bmap) in rvu_mbox_handler_nix_lf_alloc()
1604 (u64)pfvf->cq_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
1611 err = nixlf_rss_ctx_init(rvu, blkaddr, pfvf, nixlf, req->rss_sz, in rvu_mbox_handler_nix_lf_alloc()
1621 err = qmem_alloc(rvu->dev, &pfvf->cq_ints_ctx, qints, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
1626 (u64)pfvf->cq_ints_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
1635 err = qmem_alloc(rvu->dev, &pfvf->nix_qints_ctx, qints, hwctx_size); in rvu_mbox_handler_nix_lf_alloc()
1640 (u64)pfvf->nix_qints_ctx->iova); in rvu_mbox_handler_nix_lf_alloc()
1671 pfvf->tx_chan_base = RVU_SWITCH_LBK_CHAN; in rvu_mbox_handler_nix_lf_alloc()
1672 pfvf->tx_chan_cnt = 1; in rvu_mbox_handler_nix_lf_alloc()
1696 nix_ctx_free(rvu, pfvf); in rvu_mbox_handler_nix_lf_alloc()
1701 ether_addr_copy(rsp->mac_addr, pfvf->mac_addr); in rvu_mbox_handler_nix_lf_alloc()
1706 rsp->rx_chan_base = pfvf->rx_chan_base; in rvu_mbox_handler_nix_lf_alloc()
1707 rsp->tx_chan_base = pfvf->tx_chan_base; in rvu_mbox_handler_nix_lf_alloc()
1708 rsp->rx_chan_cnt = pfvf->rx_chan_cnt; in rvu_mbox_handler_nix_lf_alloc()
1709 rsp->tx_chan_cnt = pfvf->tx_chan_cnt; in rvu_mbox_handler_nix_lf_alloc()
1734 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_lf_free() local
1736 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_lf_free()
1738 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_lf_free()
1769 nix_ctx_free(rvu, pfvf); in rvu_mbox_handler_nix_lf_free()
1780 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_mark_format_cfg() local
1784 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_mark_format_cfg()
1786 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_mark_format_cfg()
3510 struct rvu_pfvf *pfvf; in nix_get_mce_list() local
3520 pfvf = rvu_get_pfvf(rvu, pcifunc & ~RVU_PFVF_FUNC_MASK); in nix_get_mce_list()
3523 *mce_list = &pfvf->bcast_mce_list; in nix_get_mce_list()
3524 *mce_idx = pfvf->bcast_mce_idx; in nix_get_mce_list()
3526 *mce_list = &pfvf->mcast_mce_list; in nix_get_mce_list()
3527 *mce_idx = pfvf->mcast_mce_idx; in nix_get_mce_list()
3529 *mce_list = &pfvf->promisc_mce_list; in nix_get_mce_list()
3530 *mce_idx = pfvf->promisc_mce_idx; in nix_get_mce_list()
3589 struct rvu_pfvf *pfvf; in nix_setup_mce_tables() local
3602 pfvf = &rvu->pf[pf]; in nix_setup_mce_tables()
3605 if (pfvf->nix_blkaddr != nix_hw->blkaddr) in nix_setup_mce_tables()
3609 pfvf->bcast_mce_idx = nix_alloc_mce_list(mcast, numvfs + 1, NIX_MCAST_INGRESS); in nix_setup_mce_tables()
3610 nix_mce_list_init(&pfvf->bcast_mce_list, numvfs + 1); in nix_setup_mce_tables()
3613 pfvf->mcast_mce_idx = nix_alloc_mce_list(mcast, numvfs + 1, NIX_MCAST_INGRESS); in nix_setup_mce_tables()
3614 nix_mce_list_init(&pfvf->mcast_mce_list, numvfs + 1); in nix_setup_mce_tables()
3617 pfvf->promisc_mce_idx = nix_alloc_mce_list(mcast, numvfs + 1, NIX_MCAST_INGRESS); in nix_setup_mce_tables()
3618 nix_mce_list_init(&pfvf->promisc_mce_list, numvfs + 1); in nix_setup_mce_tables()
3630 pfvf->bcast_mce_idx + idx, in nix_setup_mce_tables()
3638 pfvf->mcast_mce_idx + idx, in nix_setup_mce_tables()
3646 pfvf->promisc_mce_idx + idx, in nix_setup_mce_tables()
4436 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_set_mac_addr() local
4442 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_set_mac_addr()
4445 if (!test_bit(PF_SET_VF_TRUSTED, &pfvf->flags) && in rvu_mbox_handler_nix_set_mac_addr()
4446 (from_vf && test_bit(PF_SET_VF_MAC, &pfvf->flags))) { in rvu_mbox_handler_nix_set_mac_addr()
4452 ether_addr_copy(pfvf->mac_addr, req->mac_addr); in rvu_mbox_handler_nix_set_mac_addr()
4455 pfvf->rx_chan_base, req->mac_addr); in rvu_mbox_handler_nix_set_mac_addr()
4457 if (test_bit(PF_SET_VF_TRUSTED, &pfvf->flags) && from_vf) in rvu_mbox_handler_nix_set_mac_addr()
4458 ether_addr_copy(pfvf->default_mac, req->mac_addr); in rvu_mbox_handler_nix_set_mac_addr()
4468 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_get_mac_addr() local
4473 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_get_mac_addr()
4475 ether_addr_copy(rsp->mac_addr, pfvf->mac_addr); in rvu_mbox_handler_nix_get_mac_addr()
4485 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_set_rx_mode() local
4488 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_set_rx_mode()
4491 pfvf->use_mce_list = req->mode & NIX_RX_MODE_USE_MCE ? true : false; in rvu_mbox_handler_nix_set_rx_mode()
4493 nix_rx_multicast = rvu->hw->cap.nix_rx_multicast & pfvf->use_mce_list; in rvu_mbox_handler_nix_set_rx_mode()
4503 if (is_vf(pcifunc) && !test_bit(PF_SET_VF_TRUSTED, &pfvf->flags) && in rvu_mbox_handler_nix_set_rx_mode()
4536 pfvf->rx_chan_base); in rvu_mbox_handler_nix_set_rx_mode()
4545 pfvf->rx_chan_base, in rvu_mbox_handler_nix_set_rx_mode()
4546 pfvf->rx_chan_cnt); in rvu_mbox_handler_nix_set_rx_mode()
4558 struct rvu_pfvf *pfvf; in nix_find_link_frs() local
4564 pfvf = rvu_get_pfvf(rvu, pcifunc); in nix_find_link_frs()
4565 pfvf->maxlen = req->maxlen; in nix_find_link_frs()
4567 pfvf->minlen = req->minlen; in nix_find_link_frs()
4577 pfvf = &rvu->hwvf[hwvf + vf]; in nix_find_link_frs()
4578 if (pfvf->maxlen > maxlen) in nix_find_link_frs()
4579 maxlen = pfvf->maxlen; in nix_find_link_frs()
4581 pfvf->minlen && pfvf->minlen < minlen) in nix_find_link_frs()
4582 minlen = pfvf->minlen; in nix_find_link_frs()
4586 pfvf = &rvu->pf[pf]; in nix_find_link_frs()
4587 if (pfvf->maxlen > maxlen) in nix_find_link_frs()
4588 maxlen = pfvf->maxlen; in nix_find_link_frs()
4590 pfvf->minlen && pfvf->minlen < minlen) in nix_find_link_frs()
4591 minlen = pfvf->minlen; in nix_find_link_frs()
4607 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_set_hw_frs() local
4646 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_set_hw_frs()
4647 link = hw->cgx_links + pfvf->lbkid; in rvu_mbox_handler_nix_set_hw_frs()
5235 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_lf_start_rx() local
5249 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_lf_start_rx()
5250 set_bit(NIXLF_INITIALIZED, &pfvf->flags); in rvu_mbox_handler_nix_lf_start_rx()
5265 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_lf_stop_rx() local
5277 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_lf_stop_rx()
5278 clear_bit(NIXLF_INITIALIZED, &pfvf->flags); in rvu_mbox_handler_nix_lf_stop_rx()
5297 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_nix_lf_teardown() local
5315 clear_bit(NIXLF_INITIALIZED, &pfvf->flags); in rvu_nix_lf_teardown()
5322 if (pfvf->sq_ctx) { in rvu_nix_lf_teardown()
5329 if (pfvf->rq_ctx) { in rvu_nix_lf_teardown()
5336 if (pfvf->cq_ctx) { in rvu_nix_lf_teardown()
5348 if (pfvf->hw_rx_tstamp_en) { in rvu_nix_lf_teardown()
5356 pfvf->hw_rx_tstamp_en = false; in rvu_nix_lf_teardown()
5365 nix_ctx_free(rvu, pfvf); in rvu_nix_lf_teardown()
5431 struct rvu_pfvf *pfvf; in rvu_mbox_handler_nix_lso_format_cfg() local
5435 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_nix_lso_format_cfg()
5437 if (!pfvf->nixlf || blkaddr < 0) in rvu_mbox_handler_nix_lso_format_cfg()
5627 void rvu_nix_reset_mac(struct rvu_pfvf *pfvf, int pcifunc) in rvu_nix_reset_mac() argument
5633 ether_addr_copy(pfvf->mac_addr, pfvf->default_mac); in rvu_nix_reset_mac()