Skip to content

Commit 0407910

Browse files
Bharat Bhushanherbertx
authored andcommitted
crypto: octeontx2 - By default allocate one CPT LF per CPT VF
There are limited number CPT LFs (example 64 LFs on cn10k) and these LFs are allocated/attached to CPT VF on its creation. cptpf sysfs parameter "kvf_limits" defines number of CPT LFs per CPT VF. Default "kvf_limits" is initialized to zero and if kvf_limits is zero then number of LF allocated are equal to online cpus in system. For example on 24 core system, 24 CPT LFs will be attached per VF. That means no CPT LF available when creating more than 2 CPT VFs on system which have total 64 LFs. Although VFs gets created but no LF attached to it. There seems no reason to default allocate as many LFs as many online cpus in system. This patch initializes "kvf_limits" to one to limit one LF allocated per CPT VF. "kvf_limits" can be changed in range of 1 to number-of-online-cpus via sysfs. Signed-off-by: Bharat Bhushan <bbhushan2@marvell.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent a643212 commit 0407910

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/crypto/marvell/octeontx2/otx2_cptpf_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,7 @@ static int otx2_cptpf_probe(struct pci_dev *pdev,
797797
goto destroy_afpf_mbox;
798798

799799
cptpf->max_vfs = pci_sriov_get_totalvfs(pdev);
800+
cptpf->kvf_limits = 1;
800801

801802
err = cn10k_cptpf_lmtst_init(cptpf);
802803
if (err)

drivers/crypto/marvell/octeontx2/otx2_cptvf_main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ static int cptvf_lf_init(struct otx2_cptvf_dev *cptvf)
277277
if (ret)
278278
return ret;
279279

280-
lfs_num = cptvf->lfs.kvf_limits ? cptvf->lfs.kvf_limits :
281-
num_online_cpus();
280+
lfs_num = cptvf->lfs.kvf_limits;
282281

283282
otx2_cptlf_set_dev_info(lfs, cptvf->pdev, cptvf->reg_base,
284283
&cptvf->pfvf_mbox, cptvf->blkaddr);

0 commit comments

Comments
 (0)