From patchwork Mon Oct 18 07:51:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 101939 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5ECA2A0C43; Mon, 18 Oct 2021 09:51:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F163340141; Mon, 18 Oct 2021 09:51:55 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id DA5224003C for ; Mon, 18 Oct 2021 09:51:53 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19I3o0n3024862 for ; Mon, 18 Oct 2021 00:51:52 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=DWeoVZDzdSWHUt2NZScCebk9/xbViCdg18XWUrr6xzw=; b=IB4FWvWcA0X924sd8wjNY0BCSvtnToeLp/Ad/CUuSojYPMiQJFMJ/wxxbzVm4izLGcRE VQOwTlGDxEc+waPFAGQO1ITC0mrTHtPfI8W9vdzcrRg3zP+iBGXNHiX6yZwU3xW4ckr8 aUIp0Dl2VkJfU98HuDtRoPQfhUfC6oUXnoA14rZroiJFTPcs7ZueQCdef0oFDp45GTbq U/Ry7GI67jRnSE+oZ9c2n3Niyrzogdj74YvxGJG1pwf4Exn+oIoShBvVJphjWhZctL5M 7s4ObCFL7S5YJ612JfHxH1WJ3oSgq9b3Rwlq/ielsdNA2zlAwdZggjjJkWceFuRg8qb+ hQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com with ESMTP id 3bs1bugr49-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 18 Oct 2021 00:51:52 -0700 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.18; Mon, 18 Oct 2021 00:51:51 -0700 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.18 via Frontend Transport; Mon, 18 Oct 2021 00:51:51 -0700 Received: from HY-LT1002.marvell.com (HY-LT1002.marvell.com [10.28.176.218]) by maili.marvell.com (Postfix) with ESMTP id D8D015E6865; Mon, 18 Oct 2021 00:51:48 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Jerin Jacob CC: Anoob Joseph , Archana Muniganti , Tejasree Kondoj , Date: Mon, 18 Oct 2021 13:21:39 +0530 Message-ID: <1634543500-128-1-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Proofpoint-GUID: tt0pNHce1foGcpU7G-g_WNN2dtsL-W0r X-Proofpoint-ORIG-GUID: tt0pNHce1foGcpU7G-g_WNN2dtsL-W0r X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-18_02,2021-10-14_02,2020-04-07_01 Subject: [dpdk-dev] [PATCH 1/2] common/cnxk: align CPT queue depth to power of 2 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use CPT LF queue depth as power of 2 to aid in masked checks for pending queue. Signed-off-by: Anoob Joseph Acked-by: Jerin Jacob Kollanukkaran --- drivers/common/cnxk/roc_cpt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/common/cnxk/roc_cpt.c b/drivers/common/cnxk/roc_cpt.c index 74ada6e..5674418 100644 --- a/drivers/common/cnxk/roc_cpt.c +++ b/drivers/common/cnxk/roc_cpt.c @@ -568,6 +568,9 @@ cpt_lf_init(struct roc_cpt_lf *lf) if (lf->nb_desc == 0 || lf->nb_desc > CPT_LF_MAX_NB_DESC) lf->nb_desc = CPT_LF_DEFAULT_NB_DESC; + /* Update nb_desc to next power of 2 to aid in pending queue checks */ + lf->nb_desc = plt_align32pow2(lf->nb_desc); + /* Allocate memory for instruction queue for CPT LF. */ iq_mem = plt_zmalloc(cpt_lf_iq_mem_calc(lf->nb_desc), ROC_ALIGN); if (iq_mem == NULL)