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 EDEA4A0561 for ; Fri, 28 Feb 2020 10:44:17 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AEFC92F42; Fri, 28 Feb 2020 10:44:17 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C731F2F42 for ; Fri, 28 Feb 2020 10:44:15 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01S9ftW4030706 for ; Fri, 28 Feb 2020 01:44:14 -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=5UDmRGENoStUEJmoJATogeazb+1t77SIVn4BRUNTbkI=; b=JZnfZeJTe7s0uvvdSDox48rAeoSl+5aORpIC2zCQNYcDMc7f+plnj3ZH4bBM4EG84n1b 8HfUSIiafFU/pxuaZvGEvIo/uMoLa7HHGMtLp0J/MmveQ4SFx7xKV5BiKg65VWlL63Ad BSrjpA06Lqjohd4kYnLTaHqq5QWEox77Oz4q4QOMjOal/4WwX/KeoxybSTh57OpTrTtG z81LxzjNfHNqpcWx4jkiJ40tfVuzAYI53Nn+1gqpbH1XfczUu8yaUdTMdy1tq6IFphAa NW9mw+Hdh9qFPWSwfRzaxqw/8YlTdqwdkQcD/xXY6d1xpRGZMCfwkOmMLNjCOtdYGNXT hQ== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2yepv1q4hh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Fri, 28 Feb 2020 01:44:14 -0800 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 28 Feb 2020 01:44:13 -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; Fri, 28 Feb 2020 01:44:13 -0800 Received: from hyd1349.t110.caveonetworks.com (unknown [10.29.45.13]) by maili.marvell.com (Postfix) with ESMTP id 75AFC3F703F; Fri, 28 Feb 2020 01:44:12 -0800 (PST) From: Ankur Dwivedi To: CC: Ankur Dwivedi Date: Fri, 28 Feb 2020 15:13:43 +0530 Message-ID: <1582883023-20406-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-28_02:2020-02-26, 2020-02-28 signatures=0 Subject: [dpdk-stable] [PATCH 19.11] examples/ipsec-secgw: extend inline session to non AES-GCM X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" [ upstream commit b685f931e1ce33d287e3891d4f19ab07f8d2aa79 ] 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 | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index c75a5a1..fcc6695 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -993,7 +993,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; @@ -1013,20 +1012,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; - } - } - print_one_sa_rule(sa, inbound); } else { switch (sa->cipher_algo) { case RTE_CRYPTO_CIPHER_NULL: @@ -1091,9 +1076,21 @@ struct sa_ctx { sa_ctx->xf[idx].a.next = &sa_ctx->xf[idx].b; sa_ctx->xf[idx].b.next = NULL; sa->xforms = &sa_ctx->xf[idx].a; + } - print_one_sa_rule(sa, inbound); + 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); } return 0; -- 1.9.3