From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CD6A4454A7; Mon, 24 Jun 2024 08:32:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 372B640E19; Mon, 24 Jun 2024 08:31:44 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id F18694027B for ; Mon, 24 Jun 2024 08:24:37 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45NM04HT029847 for ; Sun, 23 Jun 2024 23:24:37 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pfpt0220; bh=i WsZa4iTDKKcLOq8Shg4aYZyv7gy1i9kJjjJ8c7eOxk=; b=Xq5Qu8BVo2HpQZ+ZB xDSCXzazPbISwHufNf5Tf21hGli40TJCivS1brjaCw8BGWKgTGY5VaXP8Lr90btg NLLiKN1zRVNpLNDvj8LQzvdGAzK6FvuUCJdo1orLRuqSpx3TFXIMyQ66/vKTJ+Hl nIEjBInIV0c5Tho/+x1RTgXscR3ZcBIo8z8IgZGVO+oYAzRVg1gcBK/twanGiCZ8 VwXliYvjznHBjNvytYNLyDg3TVf+XmYKHMv0YbkA+uUVNmU81Vm9gXKxhtHYJcC+ IKqiG6spvQWUfxOz44Ixcg4tOalWbHLVgeRn+mJ2xPwFfy3EZSm1aToXnvwk4gom +MOxw== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ywx4gbp7q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 23 Jun 2024 23:24:36 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 23 Jun 2024 23:24:35 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Sun, 23 Jun 2024 23:24:35 -0700 Received: from localhost.localdomain (unknown [10.28.36.177]) by maili.marvell.com (Postfix) with ESMTP id D313B3F7040; Sun, 23 Jun 2024 23:24:32 -0700 (PDT) From: Aakash Sasidharan To: Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj CC: , , , , Subject: [PATCH v2 09/12] crypto/cnxk: update sess pointer for next iteration Date: Mon, 24 Jun 2024 11:53:58 +0530 Message-ID: <20240624062401.4143606-10-asasidharan@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240624062401.4143606-1-asasidharan@marvell.com> References: <20240620145848.3461844-1-asasidharan@marvell.com> <20240624062401.4143606-1-asasidharan@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: jM43u270IBOZqBxnyQNqYu_mEDtBaVa0 X-Proofpoint-ORIG-GUID: jM43u270IBOZqBxnyQNqYu_mEDtBaVa0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-24_05,2024-06-21_01,2024-05-17_01 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 From: Anoob Joseph Update sess pointer while working on next set of packets. Signed-off-by: Anoob Joseph --- drivers/crypto/cnxk/cn10k_cryptodev_ops.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c index a3a13c032e..0d5a9ab5ef 100644 --- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c +++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c @@ -1460,6 +1460,8 @@ cn10k_cryptodev_sec_inb_rx_inject(void *dev, struct rte_mbuf **pkts, vf = cdev->data->dev_private; + const int nb_pkts_per_loop = 2 * CN10K_PKTS_PER_LOOP; + lmt_base = vf->rx_inj_lmtline.lmt_base; io_addr = vf->rx_inj_lmtline.io_addr; fc_addr = vf->rx_inj_lmtline.fc_addr; @@ -1479,7 +1481,7 @@ cn10k_cryptodev_sec_inb_rx_inject(void *dev, struct rte_mbuf **pkts, if (unlikely(fc.s.qsize > fc_thresh)) goto exit; - for (; i < RTE_MIN(2 * CN10K_PKTS_PER_LOOP, nb_pkts); i++) { + for (; i < RTE_MIN(nb_pkts_per_loop, nb_pkts); i++) { m = pkts[i]; sec_sess = (struct cn10k_sec_session *)sess[i]; @@ -1540,10 +1542,11 @@ cn10k_cryptodev_sec_inb_rx_inject(void *dev, struct rte_mbuf **pkts, cn10k_cpt_lmtst_dual_submit(&io_addr, lmt_id, &i); - if (nb_pkts - i > 0 && i == 2 * CN10K_PKTS_PER_LOOP) { - nb_pkts -= i; - pkts += i; - count += i; + if (nb_pkts - i > 0 && i == nb_pkts_per_loop) { + nb_pkts -= nb_pkts_per_loop; + pkts += nb_pkts_per_loop; + count += nb_pkts_per_loop; + sess += nb_pkts_per_loop; goto again; } -- 2.25.1