Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4782196pxb; Tue, 25 Jan 2022 19:31:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJzdjNeYO9eTfZb+9RxcfYFuhn6Z6i3AvyipAsPVduJRpjAVeo00xW10xoO31E/2HezE+9QP X-Received: by 2002:a17:907:e8c:: with SMTP id ho12mr2538307ejc.296.1643167868463; Tue, 25 Jan 2022 19:31:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643167868; cv=none; d=google.com; s=arc-20160816; b=AtDRAXN3s3prqPkw8tvK2Pe68MvAyMl0KPLK5iu6k579/N3JpKD5lShl3I+BxsHLXA 0RDRYifJEmRACTXOlD13jZefYinr3WuvvytV8mfqDVgFshpu+fCi38herL6YFqbrNooU zsOyJILmbtIf2Y+nF1KCEcFyycgd0wdQre65swJXIn/h5NRZUp3XV6GO7PxIHG8KVDyd 8zYfscaV4L1D77UzPzyQAGK6hTAqA2WWu5KwtxZBZQvy+mIyaWtDwhUguQUaMXRqVgro y4xbNiF2UW+esnxrITmrNdCGUdeSjnqcpvC4+Nx7vEX/lSsRPdiMbRLDm+VRQOw+rVvp UL8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+h39RChS+0CN9mJaBI6E+sK09CmnAMsUeduNbnMVVUA=; b=LxCy3CeogeOaovwcxgLwYHnP5dJ7Q3q26HGwDodC16fPhT6mPJjiU+UAidQkfmWVwM 3diE3VrTELy7GX914QZHtTByfkeHhpXDUVM2+qgpTvVPxJgtOR9ted22DN8jkp8OA6sO awIFzGneEh7j7EgYsSalNelZXeqMMIo6lnjuKfPcg/dlfZwgFZGKK8zXrVocg6xxLYnq YD/SKxBLITh1ubYEsW8xHPgKch5NlZ7JyArpUc/JjQDebWvtOV/LZP7bRdWJK6gZZ420 VXAkFOwqUt59G9QYZzc/0eJfDir4coc24+lqFyTfI10EH1gAzDYc0lal3V1YHwMSsDT0 KNvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=SEQ7WYfG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 1si4693276ejq.942.2022.01.25.19.30.43; Tue, 25 Jan 2022 19:31:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@marvell.com header.s=pfpt0220 header.b=SEQ7WYfG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=marvell.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231685AbiAYS1c (ORCPT + 99 others); Tue, 25 Jan 2022 13:27:32 -0500 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:57442 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231579AbiAYS11 (ORCPT ); Tue, 25 Jan 2022 13:27:27 -0500 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 20PCAuXq025182; Tue, 25 Jan 2022 10:27:17 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=+h39RChS+0CN9mJaBI6E+sK09CmnAMsUeduNbnMVVUA=; b=SEQ7WYfGIhigSdDd6nnDC6icR0g56SOV6xMTxh5h3s0ds0Ad7mMR4aJrgNRHF5kOoWAd hev2nE8tk4EAVW2k2GNMwpNboJsV3/iuVJSeRVxo2QwTR/3Y+1f1tuFOtMkoub3hDvTG e67DZkmRPdnRwLWKGXUf6/SaSneh4Pkq6S6O4s38mQUBNv+J/5nmXvGRW0pY75zUB0tu OHV7790uvrZ3NIzpAmR8ZPmqPjAnao81Kw4D/uf4N1qgYdZHRxcMY8mr61ElrrlacSgn y3EhL+CcUOrlIQVElSQcoW/KMaR3yTgizZ/LGDH113KcQanmx+yUEWqZVooVV6N52Aop IA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3dt8muk0gr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 25 Jan 2022 10:27:17 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 25 Jan 2022 10:27:15 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 25 Jan 2022 10:27:15 -0800 Received: from localhost.localdomain (unknown [10.28.34.29]) by maili.marvell.com (Postfix) with ESMTP id 108EC5E6867; Tue, 25 Jan 2022 10:27:11 -0800 (PST) From: Shijith Thotton To: Arnaud Ebalard , Herbert Xu , Boris Brezillon CC: Srujana Challa , , , , Shijith Thotton , "David S. Miller" , open list Subject: [PATCH] crypto: octeontx2: increase CPT HW instruction queue length Date: Tue, 25 Jan 2022 23:56:24 +0530 Message-ID: <2088adbb37511e84b963fbcd6eff16c62610e2d2.1643134404.git.sthotton@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: i5xHCSonRquudcMAxgH8-RdPxuDR79-9 X-Proofpoint-GUID: i5xHCSonRquudcMAxgH8-RdPxuDR79-9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-25_03,2022-01-25_02,2021-12-02_01 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srujana Challa LDWB is getting incorrectly used in HW when CPT_AF_LF()_PTR_CTL[IQB_LDWB]=1 and CPT instruction queue has less than 320 free entries. So, increase HW instruction queue size by 320 and give 320 entries less for SW/NIX RX as a SW workaround. Signed-off-by: Srujana Challa Signed-off-by: Shijith Thotton --- drivers/crypto/marvell/octeontx2/otx2_cptlf.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/marvell/octeontx2/otx2_cptlf.h b/drivers/crypto/marvell/octeontx2/otx2_cptlf.h index b691b6c1d5c4..4fcaf61a70e3 100644 --- a/drivers/crypto/marvell/octeontx2/otx2_cptlf.h +++ b/drivers/crypto/marvell/octeontx2/otx2_cptlf.h @@ -26,12 +26,22 @@ */ #define OTX2_CPT_INST_QLEN_MSGS ((OTX2_CPT_SIZE_DIV40 - 1) * 40) +/* + * LDWB is getting incorrectly used when IQB_LDWB = 1 and CPT instruction + * queue has less than 320 free entries. So, increase HW instruction queue + * size by 320 and give 320 entries less for SW/NIX RX as a workaround. + */ +#define OTX2_CPT_INST_QLEN_EXTRA_BYTES (320 * OTX2_CPT_INST_SIZE) +#define OTX2_CPT_EXTRA_SIZE_DIV40 (320/40) + /* CPT instruction queue length in bytes */ -#define OTX2_CPT_INST_QLEN_BYTES (OTX2_CPT_SIZE_DIV40 * 40 * \ - OTX2_CPT_INST_SIZE) +#define OTX2_CPT_INST_QLEN_BYTES \ + ((OTX2_CPT_SIZE_DIV40 * 40 * OTX2_CPT_INST_SIZE) + \ + OTX2_CPT_INST_QLEN_EXTRA_BYTES) /* CPT instruction group queue length in bytes */ -#define OTX2_CPT_INST_GRP_QLEN_BYTES (OTX2_CPT_SIZE_DIV40 * 16) +#define OTX2_CPT_INST_GRP_QLEN_BYTES \ + ((OTX2_CPT_SIZE_DIV40 + OTX2_CPT_EXTRA_SIZE_DIV40) * 16) /* CPT FC length in bytes */ #define OTX2_CPT_Q_FC_LEN 128 @@ -179,7 +189,8 @@ static inline void otx2_cptlf_do_set_iqueue_size(struct otx2_cptlf_info *lf) { union otx2_cptx_lf_q_size lf_q_size = { .u = 0x0 }; - lf_q_size.s.size_div40 = OTX2_CPT_SIZE_DIV40; + lf_q_size.s.size_div40 = OTX2_CPT_SIZE_DIV40 + + OTX2_CPT_EXTRA_SIZE_DIV40; otx2_cpt_write64(lf->lfs->reg_base, BLKADDR_CPT0, lf->slot, OTX2_CPT_LF_Q_SIZE, lf_q_size.u); } -- 2.25.1