From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7DB85A0546; Fri, 14 Feb 2020 07:38:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 560C84C99; Fri, 14 Feb 2020 07:38:31 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 53B11100C for ; Fri, 14 Feb 2020 07:38:29 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01E6V1qs018069 for ; Thu, 13 Feb 2020 22:38:28 -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-type; s=pfpt0818; bh=dc6m0ufBBPQCVXRfaHkUELixBBen+/RHTJsGrQcSXP8=; b=wUqWiXnxqm9lBIFOHYHqg+f+unY00q64GLFfiuCVE6FYZMf0i0KrKJ6hFSTCuGIlQsQQ WRHfkWHw5B27beBvaFBX0z3lFkBJD6PqnTD3Db7uYlKlKTiR02FTK90D9YbN1nK6TO/O D0RRcq1UH3+6qTajwJtZhKqVdNSrydZsz8I6SuoMyd3KrZNkVCoxC4j6/BdMy9dEpRfz wblFd2EgUMH47oIdfF1E6S8zx1Q5M/cBRjmrSP7S4zl8hCY2kk2dRujc9NB117oEvicb ovurho4r700u2uKos4uUC2dyQCWgqElLZ2lirCPRGJPAcHd9OYPQ5I2zM71Ny1CY9Rux OQ== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2y4j5k1sd2-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 13 Feb 2020 22:38:28 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 13 Feb 2020 22:38:24 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 13 Feb 2020 22:38:24 -0800 Received: from hyd1349.t110.caveonetworks.com (unknown [10.29.45.13]) by maili.marvell.com (Postfix) with ESMTP id CFDB23F7040; Thu, 13 Feb 2020 22:38:23 -0800 (PST) From: Ankur Dwivedi To: CC: Ankur Dwivedi Date: Fri, 14 Feb 2020 12:08:18 +0530 Message-ID: <1581662298-12565-1-git-send-email-adwivedi@marvell.com> X-Mailer: git-send-email 1.9.3 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-14_01:2020-02-12, 2020-02-14 signatures=0 Subject: [dpdk-dev] [PATCH] examples/ipsec-secgw: extend inline session to non AES-GCM X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" This patch extends creation of inline session to all the algorithms. Previously the inline session was enabled only for AES-GCM cipher. Fixes: 3a690d5a65e2 ("examples/ipsec-secgw: fix first packet with inline crypto") Signed-off-by: Ankur Dwivedi --- examples/ipsec-secgw/sa.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index e75b687..4822d6b 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -1057,7 +1057,6 @@ struct sa_ctx { } if (sa->aead_algo == RTE_CRYPTO_AEAD_AES_GCM) { - struct rte_ipsec_session *ips; iv_length = 12; sa_ctx->xf[idx].a.type = RTE_CRYPTO_SYM_XFORM_AEAD; @@ -1077,19 +1076,6 @@ struct sa_ctx { sa->digest_len; sa->xforms = &sa_ctx->xf[idx].a; - - ips = ipsec_get_primary_session(sa); - if (ips->type == - RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL || - ips->type == - RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO) { - rc = create_inline_session(skt_ctx, sa, ips); - if (rc != 0) { - RTE_LOG(ERR, IPSEC_ESP, - "create_inline_session() failed\n"); - return -EINVAL; - } - } } else { switch (sa->cipher_algo) { case RTE_CRYPTO_CIPHER_NULL: @@ -1156,6 +1142,18 @@ struct sa_ctx { sa->xforms = &sa_ctx->xf[idx].a; } + if (ips->type == + RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL || + ips->type == + RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO) { + rc = create_inline_session(skt_ctx, sa, ips); + if (rc != 0) { + RTE_LOG(ERR, IPSEC_ESP, + "create_inline_session() failed\n"); + return -EINVAL; + } + } + print_one_sa_rule(sa, inbound); } -- 1.9.3