Commit 0b252316 authored by Kai Ye's avatar Kai Ye Committed by Zheng Zengkai
Browse files

crypto: hisilicon/sec - adds the max shaper type rate

mainline inclusion
from mainline-master
commit 3d2a4292
category: feature
bugzilla: 173981
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3d2a429271bb622da48983631625c20de3b5f1e5



----------------------------------------------------------------------

The SEC driver support configure each function's QoS in the Host
for Kunpeng930. The SEC driver needs to configure the maximum shaper
type rate.

Signed-off-by: default avatarKai Ye <yekai13@huawei.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarMingqiang Ling <lingmingqiang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 2efaae0d
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -98,6 +98,7 @@


#define SEC_SQE_MASK_OFFSET		64
#define SEC_SQE_MASK_OFFSET		64
#define SEC_SQE_MASK_LEN		48
#define SEC_SQE_MASK_LEN		48
#define SEC_SHAPER_TYPE_RATE		128


struct sec_hw_error {
struct sec_hw_error {
	u32 int_msk;
	u32 int_msk;
@@ -874,6 +875,7 @@ static void sec_qm_uninit(struct hisi_qm *qm)


static int sec_probe_init(struct sec_dev *sec)
static int sec_probe_init(struct sec_dev *sec)
{
{
	u32 type_rate = SEC_SHAPER_TYPE_RATE;
	struct hisi_qm *qm = &sec->qm;
	struct hisi_qm *qm = &sec->qm;
	int ret;
	int ret;


@@ -881,6 +883,11 @@ static int sec_probe_init(struct sec_dev *sec)
		ret = sec_pf_probe_init(sec);
		ret = sec_pf_probe_init(sec);
		if (ret)
		if (ret)
			return ret;
			return ret;
		/* enable shaper type 0 */
		if (qm->ver >= QM_HW_V3) {
			type_rate |= QM_SHAPER_ENABLE;
			qm->type_rate = type_rate;
		}
	}
	}


	return 0;
	return 0;