From patchwork Thu Dec 15 03:58:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejasree Kondoj X-Patchwork-Id: 120908 X-Patchwork-Delegate: thomas@monjalon.net 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 1F852A0543; Thu, 15 Dec 2022 04:58:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B886F40684; Thu, 15 Dec 2022 04:58:11 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 98977400D6 for ; Thu, 15 Dec 2022 04:58:10 +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 2BELrZaM006357; Wed, 14 Dec 2022 19:58:09 -0800 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=SKN99mYjiOqtxReC8o+Fyr7EziCEKX35hIIKU+qU0r4=; b=NiV9mmtwu2pA944ai/GCPy/8iiRAQhpXrypXa+tgvnjQKFrECzVts77M8KiKT71ozmb2 tvAFtiQDRKz3OAffSjA3vMkCtCiy/sch400sZZujFd+rAXntA/H3TChWnc7ke4AP7PJa k5t3TheLJnv4h5XNub2gw+BvkK+bi10YWpUYwxfM3YEStQJB3u+CNbHwNaB6Gb471OPy +J70HujubKJr2aHfKomsWsFjtUUGx5VjCiAE6sdUcWulDQq7XhbZVrCOy+gm4GR3aZRn tQD8cVI1UOazdhgt9sMbOzXs7lFle/J02PNfLJOO3cbmtejgAN9MnzbwPnlHXE9qdeZ3 EQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3mf6tj735e-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 14 Dec 2022 19:58:09 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 14 Dec 2022 19:58:08 -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 19:58:08 -0800 Received: from hyd1554.marvell.com (unknown [10.29.57.11]) by maili.marvell.com (Postfix) with ESMTP id 54FDD3F707C; Wed, 14 Dec 2022 19:58:06 -0800 (PST) From: Tejasree Kondoj To: Akhil Goyal , Radu Nicolau CC: Anoob Joseph , Subject: [PATCH] examples/ipsec-secgw: set AES-CTR IV length to 16 Date: Thu, 15 Dec 2022 09:28:05 +0530 Message-ID: <20221215035805.1777924-1-ktejasree@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: BHK8moaPTKXBOhAUctZzYsuKhUDB16Y7 X-Proofpoint-GUID: BHK8moaPTKXBOhAUctZzYsuKhUDB16Y7 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_01,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 --- 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 024831c177..cee29008ba 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -1319,9 +1319,14 @@ sa_add_rules(struct sa_ctx *sa_ctx, const struct ipsec_sa entries[], case RTE_CRYPTO_CIPHER_NULL: 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",