Skip to content

Commit c02f530

Browse files
yekai123123herbertx
authored andcommitted
crypto: hisilicon/hpre - adds the max shaper type rate
The HPRE driver support configure each function's QoS in the Host for Kunpeng930. The HPRE driver needs to configure the maximum shaper type rate. Signed-off-by: Kai Ye <yekai13@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 3d2a429 commit c02f530

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/crypto/hisilicon/hpre/hpre_main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
#define HPRE_QM_PM_FLR BIT(11)
9393
#define HPRE_QM_SRIOV_FLR BIT(12)
9494

95+
#define HPRE_SHAPER_TYPE_RATE 128
9596
#define HPRE_VIA_MSI_DSM 1
9697
#define HPRE_SQE_MASK_OFFSET 8
9798
#define HPRE_SQE_MASK_LEN 24
@@ -947,13 +948,19 @@ static int hpre_pf_probe_init(struct hpre *hpre)
947948

948949
static int hpre_probe_init(struct hpre *hpre)
949950
{
951+
u32 type_rate = HPRE_SHAPER_TYPE_RATE;
950952
struct hisi_qm *qm = &hpre->qm;
951953
int ret;
952954

953955
if (qm->fun_type == QM_HW_PF) {
954956
ret = hpre_pf_probe_init(hpre);
955957
if (ret)
956958
return ret;
959+
/* Enable shaper type 0 */
960+
if (qm->ver >= QM_HW_V3) {
961+
type_rate |= QM_SHAPER_ENABLE;
962+
qm->type_rate = type_rate;
963+
}
957964
}
958965

959966
return 0;

0 commit comments

Comments
 (0)