From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id D1451438E9;
	Wed, 17 Jan 2024 11:32:04 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id B7E0F40E96;
	Wed, 17 Jan 2024 11:31:31 +0100 (CET)
Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com
 [67.231.148.174])
 by mails.dpdk.org (Postfix) with ESMTP id 516E540E96
 for <dev@dpdk.org>; Wed, 17 Jan 2024 11:31:30 +0100 (CET)
Received: from pps.filterd (m0045849.ppops.net [127.0.0.1])
 by mx0a-0016f401.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id
 40H7jh7n028705 for <dev@dpdk.org>; Wed, 17 Jan 2024 02:31:29 -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=3T+J0XDAPcFQvougORyVAxOLCI8Yx7Ki2u20vKyJsxA=; b=fvP
 HNbUhBNS5Q53eoBcp1VWbizgsS0txiScnH1glCkzN8L2uLunDNId5cul432ShiN2
 0uFoYizcAxfCKFKJpcLDjko4HK9RXeA1fTlefZo7/dQzyOqemZWksm+AFPxRCGmL
 2XFeLjLIP2CdeGfpRi/COYi50v55eaOQ6bng399QcSBRMAQEzdMnO4/vkI+5d0ly
 SGqoEWPEni85vA+9fqVt9e7TmQibisV3kd1mC/DJAu6H/8C1C47PmVy7Tnq2tVmY
 cozeHUlnD3yRqy00qlPUoOVGnMIlEaMC4AQy3neJqPvxiR7hhodqP2nRGIM6YSto
 jVDbcA1qamAmpf579jQ==
Received: from dc5-exch01.marvell.com ([199.233.59.181])
 by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3vpask8f6b-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)
 for <dev@dpdk.org>; Wed, 17 Jan 2024 02:31:29 -0800 (PST)
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.48;
 Wed, 17 Jan 2024 02:31:27 -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.48 via Frontend
 Transport; Wed, 17 Jan 2024 02:31:27 -0800
Received: from BG-LT92004.corp.innovium.com (unknown [10.28.22.179])
 by maili.marvell.com (Postfix) with ESMTP id A5A375B6931;
 Wed, 17 Jan 2024 02:31:25 -0800 (PST)
From: Anoob Joseph <anoobj@marvell.com>
To: Akhil Goyal <gakhil@marvell.com>
CC: Aakash Sasidharan <asasidharan@marvell.com>, Jerin Jacob
 <jerinj@marvell.com>, Vidya Sagar Velumuri <vvelumuri@marvell.com>,
 "Tejasree Kondoj" <ktejasree@marvell.com>, <dev@dpdk.org>
Subject: [PATCH v3 06/24] crypto/cnxk: enable digest gen for zero len input
Date: Wed, 17 Jan 2024 16:00:51 +0530
Message-ID: <20240117103109.922-7-anoobj@marvell.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240117103109.922-1-anoobj@marvell.com>
References: <20240102045417.115-1-anoobj@marvell.com>
 <20240117103109.922-1-anoobj@marvell.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Proofpoint-ORIG-GUID: bctuFdWwEsh42qDGGzr-FrfHbHRwz194
X-Proofpoint-GUID: bctuFdWwEsh42qDGGzr-FrfHbHRwz194
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26
 definitions=2024-01-17_05,2024-01-17_01,2023-05-22_02
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

From: Aakash Sasidharan <asasidharan@marvell.com>

With zero length input, digest generation fails with incorrect
value. Fix this by completely avoiding the gather component
when the input packet has zero data length.

Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com>
---
 drivers/crypto/cnxk/cnxk_se.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h
index c2a807fa94..1aec7dea9f 100644
--- a/drivers/crypto/cnxk/cnxk_se.h
+++ b/drivers/crypto/cnxk/cnxk_se.h
@@ -2479,7 +2479,7 @@ prepare_iov_from_pkt(struct rte_mbuf *pkt, struct roc_se_iov_ptr *iovec, uint32_
 	void *seg_data = NULL;
 	int32_t seg_size = 0;
 
-	if (!pkt) {
+	if (!pkt || pkt->data_len == 0) {
 		iovec->buf_cnt = 0;
 		return 0;
 	}
-- 
2.25.1