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 C57D1A0543; Thu, 15 Dec 2022 06:42:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 737C640684; Thu, 15 Dec 2022 06:42:20 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id BBB1540223 for ; Thu, 15 Dec 2022 06:42:18 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BF3Md6R013730; Wed, 14 Dec 2022 21:42: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=/fePLD0AIMFy1ytGR4STXdG20LwFnO7lNIQAz1bijpc=; b=EvrSXtZRW2tZZHmCaYS3Kl4Hdw60pabhXcorFkK+/mPsgbVjCoPtuXUNx29267U1ejIL 6leBT5cR8cl5iD15vcfIdD6TI0fO17HRHsaG2ED1Z2btSzteEJJB9+bePmzBlAuHkfGw lFD6JOu7ZRh7r4cYg3y3UPcTBkxJFir2/cGjg37GDRwfkGOi7ei2EgZRyf3TpXz4dQ68 nauyiClxpRyAPWfnJYgkySpSjXjk5JcVtEDQLNI5icQVMTavsa6XNKS+SNr5N47zhQ0m XTwzmExOcSyoJwgkw48L2kH95Oo4HQcbHVvCX9G06OHMPdONXsEoAx3KoCfbKioUw0FS 2g== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3mf6tj7f5m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 14 Dec 2022 21:42:17 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 14 Dec 2022 21:42:14 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Wed, 14 Dec 2022 21:42:14 -0800 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 802DE3F7055; Wed, 14 Dec 2022 21:42:12 -0800 (PST) From: Tejasree Kondoj To: Akhil Goyal , Radu Nicolau CC: Anoob Joseph , Subject: [PATCH v2] examples/ipsec-secgw: set AES-CTR IV length to 16 Date: Thu, 15 Dec 2022 11:12:11 +0530 Message-ID: <20221215054211.1919093-1-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221215035805.1777924-1-ktejasree@marvell.com> References: <20221215035805.1777924-1-ktejasree@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: LzhHzh5h-Pko4PrG-LnCWJtwD0HGoiKk X-Proofpoint-GUID: LzhHzh5h-Pko4PrG-LnCWJtwD0HGoiKk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-15_02,2022-12-14_01,2022-06-22_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 Set AES-CTR IV length as 16 instead of taking from SA config option since the application populates 16B IV in the datapath. AES-CTR requires 16B IV constructed from nonce and counter. Signed-off-by: Tejasree Kondoj --- v2: * Rebased v1 examples/ipsec-secgw/sa.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index 7da9444a7b..5bb73a9137 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -1328,9 +1328,14 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[], case RTE_CRYPTO_CIPHER_DES_CBC: case RTE_CRYPTO_CIPHER_3DES_CBC: case RTE_CRYPTO_CIPHER_AES_CBC: - case RTE_CRYPTO_CIPHER_AES_CTR: iv_length = sa->iv_len; break; + case RTE_CRYPTO_CIPHER_AES_CTR: + /* Length includes 8B per packet IV, 4B nonce and + * 4B counter as populated in datapath. + */ + iv_length = 16; + break; default: RTE_LOG(ERR, IPSEC_ESP, "unsupported cipher algorithm %u\n", -- 2.25.1