Lines Matching refs:lf
28 struct rvu_block *block, int lf);
30 struct rvu_block *block, int lf);
223 int lf; in rvu_get_lf() local
226 for (lf = 0; lf < block->lf.max; lf++) { in rvu_get_lf()
227 if (block->fn_map[lf] == pcifunc) { in rvu_get_lf()
230 return lf; in rvu_get_lf()
338 u16 lf, bool attach) in rvu_update_rsrc_map() argument
344 if (lf >= block->lf.max) { in rvu_update_rsrc_map()
347 __func__, lf, block->name, block->lf.max); in rvu_update_rsrc_map()
360 block->fn_map[lf] = attach ? pcifunc : 0; in rvu_update_rsrc_map()
500 int rvu_lf_reset(struct rvu *rvu, struct rvu_block *block, int lf) in rvu_lf_reset() argument
507 rvu_write64(rvu, block->addr, block->lfreset_reg, lf | BIT_ULL(12)); in rvu_lf_reset()
549 int lf; in rvu_scan_block() local
551 for (lf = 0; lf < block->lf.max; lf++) { in rvu_scan_block()
553 block->lfcfg_reg | (lf << block->lfshift)); in rvu_scan_block()
558 __set_bit(lf, block->lf.bmap); in rvu_scan_block()
563 (cfg >> 8) & 0xFFFF, lf, true); in rvu_scan_block()
566 rvu_set_msix_offset(rvu, pfvf, block, lf); in rvu_scan_block()
730 kfree(block->lf.bmap); in rvu_free_hw_resources()
847 block->lf.max = cfg & 0xFFF; in rvu_setup_nix_hw_resource()
860 return rvu_alloc_bitmap(&block->lf); in rvu_setup_nix_hw_resource()
876 block->lf.max = cfg & 0xFF; in rvu_setup_cpt_hw_resource()
889 return rvu_alloc_bitmap(&block->lf); in rvu_setup_cpt_hw_resource()
935 block->lf.max = (cfg >> 16) & 0xFFF; in rvu_setup_hw_resources()
947 err = rvu_alloc_bitmap(&block->lf); in rvu_setup_hw_resources()
974 block->lf.max = cfg & 0xFFFF; in rvu_setup_hw_resources()
987 err = rvu_alloc_bitmap(&block->lf); in rvu_setup_hw_resources()
999 block->lf.max = (cfg >> 56) & 0xFF; in rvu_setup_hw_resources()
1012 err = rvu_alloc_bitmap(&block->lf); in rvu_setup_hw_resources()
1025 block->lf.max = cfg & 0xFFFF; in rvu_setup_hw_resources()
1038 err = rvu_alloc_bitmap(&block->lf); in rvu_setup_hw_resources()
1089 if (!block->lf.bmap) in rvu_setup_hw_resources()
1093 block->fn_map = devm_kcalloc(rvu->dev, block->lf.max, in rvu_setup_hw_resources()
1355 int slot, lf, num_lfs; in rvu_detach_block() local
1372 lf = rvu_lookup_rsrc(rvu, block, pcifunc, slot); in rvu_detach_block()
1373 if (lf < 0) /* This should never happen */ in rvu_detach_block()
1378 (lf << block->lfshift), 0x00ULL); in rvu_detach_block()
1382 pcifunc, lf, false); in rvu_detach_block()
1385 rvu_free_rsrc(&block->lf, lf); in rvu_detach_block()
1388 rvu_clear_msix_offset(rvu, pfvf, block, lf); in rvu_detach_block()
1411 if (!block->lf.bmap) in rvu_detach_rsrcs()
1521 int slot, lf; in rvu_attach_block() local
1533 if (!block->lf.bmap) in rvu_attach_block()
1538 lf = rvu_alloc_rsrc(&block->lf); in rvu_attach_block()
1539 if (lf < 0) in rvu_attach_block()
1544 (lf << block->lfshift), cfg); in rvu_attach_block()
1546 pcifunc, lf, true); in rvu_attach_block()
1549 rvu_set_msix_offset(rvu, pfvf, block, lf); in rvu_attach_block()
1564 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1581 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1594 if (req->sso > block->lf.max) { in rvu_check_rsrc_availability()
1597 pcifunc, req->sso, block->lf.max); in rvu_check_rsrc_availability()
1601 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1610 if (req->ssow > block->lf.max) { in rvu_check_rsrc_availability()
1613 pcifunc, req->sso, block->lf.max); in rvu_check_rsrc_availability()
1617 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1625 if (req->timlfs > block->lf.max) { in rvu_check_rsrc_availability()
1628 pcifunc, req->timlfs, block->lf.max); in rvu_check_rsrc_availability()
1632 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1644 if (req->cptlfs > block->lf.max) { in rvu_check_rsrc_availability()
1647 pcifunc, req->cptlfs, block->lf.max); in rvu_check_rsrc_availability()
1651 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1745 int blkaddr, int lf) in rvu_get_msix_offset() argument
1749 if (lf < 0) in rvu_get_msix_offset()
1753 if (pfvf->msix_lfmap[vec] == MSIX_BLKLF(blkaddr, lf)) in rvu_get_msix_offset()
1760 struct rvu_block *block, int lf) in rvu_set_msix_offset() argument
1766 (lf << block->lfshift)); in rvu_set_msix_offset()
1777 (lf << block->lfshift), (cfg & ~0x7FFULL) | offset); in rvu_set_msix_offset()
1781 pfvf->msix_lfmap[offset + vec] = MSIX_BLKLF(block->addr, lf); in rvu_set_msix_offset()
1785 struct rvu_block *block, int lf) in rvu_clear_msix_offset() argument
1791 (lf << block->lfshift)); in rvu_clear_msix_offset()
1796 (lf << block->lfshift), cfg & ~0x7FFULL); in rvu_clear_msix_offset()
1798 offset = rvu_get_msix_offset(rvu, pfvf, block->addr, lf); in rvu_clear_msix_offset()
1814 int lf, slot, blkaddr; in rvu_mbox_handler_msix_offset() local
1821 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_NPA], pcifunc, 0); in rvu_mbox_handler_msix_offset()
1822 rsp->npa_msixoff = rvu_get_msix_offset(rvu, pfvf, BLKADDR_NPA, lf); in rvu_mbox_handler_msix_offset()
1829 lf = rvu_get_lf(rvu, &hw->block[blkaddr], pcifunc, 0); in rvu_mbox_handler_msix_offset()
1830 rsp->nix_msixoff = rvu_get_msix_offset(rvu, pfvf, blkaddr, lf); in rvu_mbox_handler_msix_offset()
1835 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_SSO], pcifunc, slot); in rvu_mbox_handler_msix_offset()
1837 rvu_get_msix_offset(rvu, pfvf, BLKADDR_SSO, lf); in rvu_mbox_handler_msix_offset()
1842 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_SSOW], pcifunc, slot); in rvu_mbox_handler_msix_offset()
1844 rvu_get_msix_offset(rvu, pfvf, BLKADDR_SSOW, lf); in rvu_mbox_handler_msix_offset()
1849 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_TIM], pcifunc, slot); in rvu_mbox_handler_msix_offset()
1851 rvu_get_msix_offset(rvu, pfvf, BLKADDR_TIM, lf); in rvu_mbox_handler_msix_offset()
1856 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_CPT0], pcifunc, slot); in rvu_mbox_handler_msix_offset()
1858 rvu_get_msix_offset(rvu, pfvf, BLKADDR_CPT0, lf); in rvu_mbox_handler_msix_offset()
1863 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_CPT1], pcifunc, slot); in rvu_mbox_handler_msix_offset()
1865 rvu_get_msix_offset(rvu, pfvf, BLKADDR_CPT1, lf); in rvu_mbox_handler_msix_offset()
1882 rsp->npa = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1885 rsp->nix = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1888 rsp->nix1 = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1891 rsp->sso = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1894 rsp->ssow = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1897 rsp->tim = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1900 rsp->cpt = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1903 rsp->cpt1 = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
2515 int slot, lf, num_lfs; in rvu_blklf_teardown() local
2524 lf = rvu_get_lf(rvu, block, pcifunc, slot); in rvu_blklf_teardown()
2525 if (lf < 0) in rvu_blklf_teardown()
2530 rvu_nix_lf_teardown(rvu, pcifunc, block->addr, lf); in rvu_blklf_teardown()
2532 rvu_npa_lf_teardown(rvu, pcifunc, lf); in rvu_blklf_teardown()
2535 rvu_cpt_lf_teardown(rvu, pcifunc, block->addr, lf, in rvu_blklf_teardown()
2538 err = rvu_lf_reset(rvu, block, lf); in rvu_blklf_teardown()
2541 block->addr, lf); in rvu_blklf_teardown()