Lines Matching refs:lf
28 struct rvu_block *block, int lf);
30 struct rvu_block *block, int lf);
228 int lf; in rvu_get_lf() local
231 for (lf = 0; lf < block->lf.max; lf++) { in rvu_get_lf()
232 if (block->fn_map[lf] == pcifunc) { in rvu_get_lf()
235 return lf; in rvu_get_lf()
343 u16 lf, bool attach) in rvu_update_rsrc_map() argument
349 if (lf >= block->lf.max) { in rvu_update_rsrc_map()
352 __func__, lf, block->name, block->lf.max); in rvu_update_rsrc_map()
365 block->fn_map[lf] = attach ? pcifunc : 0; in rvu_update_rsrc_map()
505 int rvu_lf_reset(struct rvu *rvu, struct rvu_block *block, int lf) in rvu_lf_reset() argument
512 rvu_write64(rvu, block->addr, block->lfreset_reg, lf | BIT_ULL(12)); in rvu_lf_reset()
557 int lf; in rvu_scan_block() local
559 for (lf = 0; lf < block->lf.max; lf++) { in rvu_scan_block()
561 block->lfcfg_reg | (lf << block->lfshift)); in rvu_scan_block()
566 __set_bit(lf, block->lf.bmap); in rvu_scan_block()
571 (cfg >> 8) & 0xFFFF, lf, true); in rvu_scan_block()
574 rvu_set_msix_offset(rvu, pfvf, block, lf); in rvu_scan_block()
738 kfree(block->lf.bmap); in rvu_free_hw_resources()
855 block->lf.max = cfg & 0xFFF; in rvu_setup_nix_hw_resource()
868 return rvu_alloc_bitmap(&block->lf); in rvu_setup_nix_hw_resource()
884 block->lf.max = cfg & 0xFF; in rvu_setup_cpt_hw_resource()
897 return rvu_alloc_bitmap(&block->lf); in rvu_setup_cpt_hw_resource()
943 block->lf.max = (cfg >> 16) & 0xFFF; in rvu_setup_hw_resources()
955 err = rvu_alloc_bitmap(&block->lf); in rvu_setup_hw_resources()
982 block->lf.max = cfg & 0xFFFF; in rvu_setup_hw_resources()
995 err = rvu_alloc_bitmap(&block->lf); in rvu_setup_hw_resources()
1007 block->lf.max = (cfg >> 56) & 0xFF; in rvu_setup_hw_resources()
1020 err = rvu_alloc_bitmap(&block->lf); in rvu_setup_hw_resources()
1033 block->lf.max = cfg & 0xFFFF; in rvu_setup_hw_resources()
1046 err = rvu_alloc_bitmap(&block->lf); in rvu_setup_hw_resources()
1097 if (!block->lf.bmap) in rvu_setup_hw_resources()
1101 block->fn_map = devm_kcalloc(rvu->dev, block->lf.max, in rvu_setup_hw_resources()
1375 int slot, lf, num_lfs; in rvu_detach_block() local
1392 lf = rvu_lookup_rsrc(rvu, block, pcifunc, slot); in rvu_detach_block()
1393 if (lf < 0) /* This should never happen */ in rvu_detach_block()
1398 (lf << block->lfshift), 0x00ULL); in rvu_detach_block()
1402 pcifunc, lf, false); in rvu_detach_block()
1405 rvu_free_rsrc(&block->lf, lf); in rvu_detach_block()
1408 rvu_clear_msix_offset(rvu, pfvf, block, lf); in rvu_detach_block()
1431 if (!block->lf.bmap) in rvu_detach_rsrcs()
1541 int slot, lf; in rvu_attach_block() local
1553 if (!block->lf.bmap) in rvu_attach_block()
1558 lf = rvu_alloc_rsrc(&block->lf); in rvu_attach_block()
1559 if (lf < 0) in rvu_attach_block()
1564 (lf << block->lfshift), cfg); in rvu_attach_block()
1566 pcifunc, lf, true); in rvu_attach_block()
1569 rvu_set_msix_offset(rvu, pfvf, block, lf); in rvu_attach_block()
1584 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1601 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1614 if (req->sso > block->lf.max) { in rvu_check_rsrc_availability()
1617 pcifunc, req->sso, block->lf.max); in rvu_check_rsrc_availability()
1621 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1630 if (req->ssow > block->lf.max) { in rvu_check_rsrc_availability()
1633 pcifunc, req->sso, block->lf.max); in rvu_check_rsrc_availability()
1637 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1645 if (req->timlfs > block->lf.max) { in rvu_check_rsrc_availability()
1648 pcifunc, req->timlfs, block->lf.max); in rvu_check_rsrc_availability()
1652 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1664 if (req->cptlfs > block->lf.max) { in rvu_check_rsrc_availability()
1667 pcifunc, req->cptlfs, block->lf.max); in rvu_check_rsrc_availability()
1671 free_lfs = rvu_rsrc_free_count(&block->lf); in rvu_check_rsrc_availability()
1765 int blkaddr, int lf) in rvu_get_msix_offset() argument
1769 if (lf < 0) in rvu_get_msix_offset()
1773 if (pfvf->msix_lfmap[vec] == MSIX_BLKLF(blkaddr, lf)) in rvu_get_msix_offset()
1780 struct rvu_block *block, int lf) in rvu_set_msix_offset() argument
1786 (lf << block->lfshift)); in rvu_set_msix_offset()
1797 (lf << block->lfshift), (cfg & ~0x7FFULL) | offset); in rvu_set_msix_offset()
1801 pfvf->msix_lfmap[offset + vec] = MSIX_BLKLF(block->addr, lf); in rvu_set_msix_offset()
1805 struct rvu_block *block, int lf) in rvu_clear_msix_offset() argument
1811 (lf << block->lfshift)); in rvu_clear_msix_offset()
1816 (lf << block->lfshift), cfg & ~0x7FFULL); in rvu_clear_msix_offset()
1818 offset = rvu_get_msix_offset(rvu, pfvf, block->addr, lf); in rvu_clear_msix_offset()
1834 int lf, slot, blkaddr; in rvu_mbox_handler_msix_offset() local
1841 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_NPA], pcifunc, 0); in rvu_mbox_handler_msix_offset()
1842 rsp->npa_msixoff = rvu_get_msix_offset(rvu, pfvf, BLKADDR_NPA, lf); in rvu_mbox_handler_msix_offset()
1849 lf = rvu_get_lf(rvu, &hw->block[blkaddr], pcifunc, 0); in rvu_mbox_handler_msix_offset()
1850 rsp->nix_msixoff = rvu_get_msix_offset(rvu, pfvf, blkaddr, lf); in rvu_mbox_handler_msix_offset()
1855 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_SSO], pcifunc, slot); in rvu_mbox_handler_msix_offset()
1857 rvu_get_msix_offset(rvu, pfvf, BLKADDR_SSO, lf); in rvu_mbox_handler_msix_offset()
1862 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_SSOW], pcifunc, slot); in rvu_mbox_handler_msix_offset()
1864 rvu_get_msix_offset(rvu, pfvf, BLKADDR_SSOW, lf); in rvu_mbox_handler_msix_offset()
1869 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_TIM], pcifunc, slot); in rvu_mbox_handler_msix_offset()
1871 rvu_get_msix_offset(rvu, pfvf, BLKADDR_TIM, lf); in rvu_mbox_handler_msix_offset()
1876 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_CPT0], pcifunc, slot); in rvu_mbox_handler_msix_offset()
1878 rvu_get_msix_offset(rvu, pfvf, BLKADDR_CPT0, lf); in rvu_mbox_handler_msix_offset()
1883 lf = rvu_get_lf(rvu, &hw->block[BLKADDR_CPT1], pcifunc, slot); in rvu_mbox_handler_msix_offset()
1885 rvu_get_msix_offset(rvu, pfvf, BLKADDR_CPT1, lf); in rvu_mbox_handler_msix_offset()
1902 rsp->npa = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1905 rsp->nix = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1908 rsp->nix1 = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1911 rsp->sso = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1914 rsp->ssow = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1917 rsp->tim = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1920 rsp->cpt = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
1923 rsp->cpt1 = rvu_rsrc_free_count(&block->lf); in rvu_mbox_handler_free_rsrc_cnt()
2536 int slot, lf, num_lfs; in rvu_blklf_teardown() local
2545 lf = rvu_get_lf(rvu, block, pcifunc, slot); in rvu_blklf_teardown()
2546 if (lf < 0) in rvu_blklf_teardown()
2551 rvu_nix_lf_teardown(rvu, pcifunc, block->addr, lf); in rvu_blklf_teardown()
2553 rvu_npa_lf_teardown(rvu, pcifunc, lf); in rvu_blklf_teardown()
2556 rvu_cpt_lf_teardown(rvu, pcifunc, block->addr, lf, in rvu_blklf_teardown()
2559 err = rvu_lf_reset(rvu, block, lf); in rvu_blklf_teardown()
2562 block->addr, lf); in rvu_blklf_teardown()