Lines Matching refs:pfvf
30 static void rvu_set_msix_offset(struct rvu *rvu, struct rvu_pfvf *pfvf,
32 static void rvu_clear_msix_offset(struct rvu *rvu, struct rvu_pfvf *pfvf,
283 static void rvu_update_rsrc_map(struct rvu *rvu, struct rvu_pfvf *pfvf, in rvu_update_rsrc_map() argument
311 pfvf->npalf = attach ? true : false; in rvu_update_rsrc_map()
312 num_lfs = pfvf->npalf; in rvu_update_rsrc_map()
315 pfvf->nixlf = attach ? true : false; in rvu_update_rsrc_map()
316 num_lfs = pfvf->nixlf; in rvu_update_rsrc_map()
319 attach ? pfvf->sso++ : pfvf->sso--; in rvu_update_rsrc_map()
320 num_lfs = pfvf->sso; in rvu_update_rsrc_map()
323 attach ? pfvf->ssow++ : pfvf->ssow--; in rvu_update_rsrc_map()
324 num_lfs = pfvf->ssow; in rvu_update_rsrc_map()
327 attach ? pfvf->timlfs++ : pfvf->timlfs--; in rvu_update_rsrc_map()
328 num_lfs = pfvf->timlfs; in rvu_update_rsrc_map()
331 attach ? pfvf->cptlfs++ : pfvf->cptlfs--; in rvu_update_rsrc_map()
332 num_lfs = pfvf->cptlfs; in rvu_update_rsrc_map()
480 struct rvu_pfvf *pfvf; in rvu_scan_block() local
494 pfvf = rvu_get_pfvf(rvu, (cfg >> 8) & 0xFFFF); in rvu_scan_block()
495 rvu_update_rsrc_map(rvu, pfvf, block, in rvu_scan_block()
499 rvu_set_msix_offset(rvu, pfvf, block, lf); in rvu_scan_block()
535 struct rvu_pfvf *pfvf; in rvu_setup_msix_resources() local
547 pfvf = &rvu->pf[pf]; in rvu_setup_msix_resources()
550 pfvf->msix.max = ((cfg >> 32) & 0xFFF) + 1; in rvu_setup_msix_resources()
551 rvu_check_min_msix_vec(rvu, pfvf->msix.max, pf, 0); in rvu_setup_msix_resources()
554 err = rvu_alloc_bitmap(&pfvf->msix); in rvu_setup_msix_resources()
559 pfvf->msix_lfmap = devm_kcalloc(rvu->dev, pfvf->msix.max, in rvu_setup_msix_resources()
561 if (!pfvf->msix_lfmap) in rvu_setup_msix_resources()
577 offset = rvu_alloc_rsrc_contig(&pfvf->msix, nvecs); in rvu_setup_msix_resources()
583 pfvf = &rvu->hwvf[hwvf + vf]; in rvu_setup_msix_resources()
587 pfvf->msix.max = (cfg & 0xFFF) + 1; in rvu_setup_msix_resources()
588 rvu_check_min_msix_vec(rvu, pfvf->msix.max, pf, vf + 1); in rvu_setup_msix_resources()
591 err = rvu_alloc_bitmap(&pfvf->msix); in rvu_setup_msix_resources()
595 pfvf->msix_lfmap = in rvu_setup_msix_resources()
596 devm_kcalloc(rvu->dev, pfvf->msix.max, in rvu_setup_msix_resources()
598 if (!pfvf->msix_lfmap) in rvu_setup_msix_resources()
609 offset = rvu_alloc_rsrc_contig(&pfvf->msix, nvecs); in rvu_setup_msix_resources()
652 struct rvu_pfvf *pfvf; in rvu_free_hw_resources() local
668 pfvf = &rvu->pf[id]; in rvu_free_hw_resources()
669 kfree(pfvf->msix.bmap); in rvu_free_hw_resources()
673 pfvf = &rvu->hwvf[id]; in rvu_free_hw_resources()
674 kfree(pfvf->msix.bmap); in rvu_free_hw_resources()
694 struct rvu_pfvf *pfvf; in rvu_setup_pfvf_macaddress() local
701 pfvf = &rvu->pf[pf]; in rvu_setup_pfvf_macaddress()
705 u64_to_ether_addr(*mac, pfvf->mac_addr); in rvu_setup_pfvf_macaddress()
707 eth_random_addr(pfvf->mac_addr); in rvu_setup_pfvf_macaddress()
709 eth_random_addr(pfvf->mac_addr); in rvu_setup_pfvf_macaddress()
715 pfvf = &rvu->hwvf[hwvf]; in rvu_setup_pfvf_macaddress()
719 u64_to_ether_addr(*mac, pfvf->mac_addr); in rvu_setup_pfvf_macaddress()
721 eth_random_addr(pfvf->mac_addr); in rvu_setup_pfvf_macaddress()
723 eth_random_addr(pfvf->mac_addr); in rvu_setup_pfvf_macaddress()
1028 static u16 rvu_get_rsrc_mapcount(struct rvu_pfvf *pfvf, int blktype) in rvu_get_rsrc_mapcount() argument
1032 return pfvf->npalf ? 1 : 0; in rvu_get_rsrc_mapcount()
1034 return pfvf->nixlf ? 1 : 0; in rvu_get_rsrc_mapcount()
1036 return pfvf->sso; in rvu_get_rsrc_mapcount()
1038 return pfvf->ssow; in rvu_get_rsrc_mapcount()
1040 return pfvf->timlfs; in rvu_get_rsrc_mapcount()
1042 return pfvf->cptlfs; in rvu_get_rsrc_mapcount()
1049 struct rvu_pfvf *pfvf; in is_pffunc_map_valid() local
1054 pfvf = rvu_get_pfvf(rvu, pcifunc); in is_pffunc_map_valid()
1057 if (!rvu_get_rsrc_mapcount(pfvf, blktype)) in is_pffunc_map_valid()
1086 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_detach_block() local
1098 num_lfs = rvu_get_rsrc_mapcount(pfvf, block->type); in rvu_detach_block()
1112 rvu_update_rsrc_map(rvu, pfvf, block, in rvu_detach_block()
1119 rvu_clear_msix_offset(rvu, pfvf, block, lf); in rvu_detach_block()
1175 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_attach_block() local
1202 rvu_update_rsrc_map(rvu, pfvf, block, in rvu_attach_block()
1206 rvu_set_msix_offset(rvu, pfvf, block, lf); in rvu_attach_block()
1213 struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_check_rsrc_availability() local
1219 if (req->npalf && !rvu_get_rsrc_mapcount(pfvf, BLKTYPE_NPA)) { in rvu_check_rsrc_availability()
1232 if (req->nixlf && !rvu_get_rsrc_mapcount(pfvf, BLKTYPE_NIX)) { in rvu_check_rsrc_availability()
1253 mappedlfs = rvu_get_rsrc_mapcount(pfvf, block->type); in rvu_check_rsrc_availability()
1269 mappedlfs = rvu_get_rsrc_mapcount(pfvf, block->type); in rvu_check_rsrc_availability()
1284 mappedlfs = rvu_get_rsrc_mapcount(pfvf, block->type); in rvu_check_rsrc_availability()
1299 mappedlfs = rvu_get_rsrc_mapcount(pfvf, block->type); in rvu_check_rsrc_availability()
1372 static u16 rvu_get_msix_offset(struct rvu *rvu, struct rvu_pfvf *pfvf, in rvu_get_msix_offset() argument
1380 for (vec = 0; vec < pfvf->msix.max; vec++) { in rvu_get_msix_offset()
1381 if (pfvf->msix_lfmap[vec] == MSIX_BLKLF(blkaddr, lf)) in rvu_get_msix_offset()
1387 static void rvu_set_msix_offset(struct rvu *rvu, struct rvu_pfvf *pfvf, in rvu_set_msix_offset() argument
1398 if (!rvu_rsrc_check_contig(&pfvf->msix, nvecs)) in rvu_set_msix_offset()
1401 offset = rvu_alloc_rsrc_contig(&pfvf->msix, nvecs); in rvu_set_msix_offset()
1409 pfvf->msix_lfmap[offset + vec] = MSIX_BLKLF(block->addr, lf); in rvu_set_msix_offset()
1412 static void rvu_clear_msix_offset(struct rvu *rvu, struct rvu_pfvf *pfvf, in rvu_clear_msix_offset() argument
1426 offset = rvu_get_msix_offset(rvu, pfvf, block->addr, lf); in rvu_clear_msix_offset()
1430 pfvf->msix_lfmap[offset + vec] = 0; in rvu_clear_msix_offset()
1433 rvu_free_rsrc_contig(&pfvf->msix, nvecs, offset); in rvu_clear_msix_offset()
1441 struct rvu_pfvf *pfvf; in rvu_mbox_handler_msix_offset() local
1444 pfvf = rvu_get_pfvf(rvu, pcifunc); in rvu_mbox_handler_msix_offset()
1445 if (!pfvf->msix.bmap) in rvu_mbox_handler_msix_offset()
1450 rsp->npa_msixoff = rvu_get_msix_offset(rvu, pfvf, BLKADDR_NPA, lf); in rvu_mbox_handler_msix_offset()
1453 rsp->nix_msixoff = rvu_get_msix_offset(rvu, pfvf, BLKADDR_NIX0, lf); in rvu_mbox_handler_msix_offset()
1455 rsp->sso = pfvf->sso; in rvu_mbox_handler_msix_offset()
1459 rvu_get_msix_offset(rvu, pfvf, BLKADDR_SSO, lf); in rvu_mbox_handler_msix_offset()
1462 rsp->ssow = pfvf->ssow; in rvu_mbox_handler_msix_offset()
1466 rvu_get_msix_offset(rvu, pfvf, BLKADDR_SSOW, lf); in rvu_mbox_handler_msix_offset()
1469 rsp->timlfs = pfvf->timlfs; in rvu_mbox_handler_msix_offset()
1473 rvu_get_msix_offset(rvu, pfvf, BLKADDR_TIM, lf); in rvu_mbox_handler_msix_offset()
1476 rsp->cptlfs = pfvf->cptlfs; in rvu_mbox_handler_msix_offset()
1480 rvu_get_msix_offset(rvu, pfvf, BLKADDR_CPT0, lf); in rvu_mbox_handler_msix_offset()
2164 struct rvu_pfvf *pfvf = &rvu->pf[0]; in rvu_afvf_msix_vectors_num_ok() local
2167 pfvf = &rvu->pf[0]; in rvu_afvf_msix_vectors_num_ok()
2174 return (pfvf->msix.max >= RVU_AF_INT_VEC_CNT + RVU_PF_INT_VEC_CNT) && in rvu_afvf_msix_vectors_num_ok()