From patchwork Mon Jan 2 11:46:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 121502 X-Patchwork-Delegate: gakhil@marvell.com 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 0E2D4A00C2; Mon, 2 Jan 2023 12:47:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6B2040693; Mon, 2 Jan 2023 12:47:05 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id B55FB40689 for ; Mon, 2 Jan 2023 12:47:03 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3022wXmr005542; Mon, 2 Jan 2023 03:47:03 -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=byPAoXBjMp7XnhdP4oHaPTUQ+yZc1+05DDvlUbN/buA=; b=huj5VE927L3cz3oK2nHXWt19zFmn4/+bIjmwY4hrYeBj0NoxOELXbFFHcBaoZzWuL+T0 nL5g63dmL4bTbBGbn8SSvmqsatEKxqCulp+XPM0TogunoSjexf0c1vIypxaaz+Z2/nFS mPA8daxFnX8hJUWbkRcffHXG/1EV2LZdcIk4Te5twE0B1ZTIrA++EaG6xbL3c+jCwMyX AtDE5nHr0uK0CQ2AL8RUBhyT325KRCa3fhysuab32uWk/kvw21Y40coaxRyAraRZGa76 0O4aqOSUF5C7+D7tjVdgWzrvHDhAlodYDl05s9ux3tDWAFvnOZ5JiMFQacsxlOsvmfNb gQ== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3mtnftbuwk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 02 Jan 2023 03:47:02 -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; Mon, 2 Jan 2023 03:47:00 -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; Mon, 2 Jan 2023 03:47:00 -0800 Received: from BG-LT92004.corp.innovium.com (unknown [10.193.74.65]) by maili.marvell.com (Postfix) with ESMTP id 95ECE3F7082; Mon, 2 Jan 2023 03:46:56 -0800 (PST) From: Anoob Joseph To: Ciara Power , Akhil Goyal CC: Gagandeep Singh , Hemant Agrawal , Jerin Jacob , Tejasree Kondoj , Subject: [PATCH 1/3] app/crypto-perf: use right API to free session Date: Mon, 2 Jan 2023 17:16:53 +0530 Message-ID: <20230102114655.300-1-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Proofpoint-GUID: 0Heh_H8mF6ffK3nFx1h_DkyilytSwuJa X-Proofpoint-ORIG-GUID: 0Heh_H8mF6ffK3nFx1h_DkyilytSwuJa 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=2023-01-02_06,2022-12-30_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 Use the right API for session freeing. Sessions can be asymmetric, symmetric or security. Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec") Fixes: a538d1d2d01e ("test/crypto-perf: extend asymmetric crypto throughput test") Signed-off-by: Anoob Joseph --- app/test-crypto-perf/cperf_test_latency.c | 27 +++++++++++++++++------ app/test-crypto-perf/cperf_test_verify.c | 25 ++++++++++++++++----- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/app/test-crypto-perf/cperf_test_latency.c b/app/test-crypto-perf/cperf_test_latency.c index 49bf421c01..406e082e4e 100644 --- a/app/test-crypto-perf/cperf_test_latency.c +++ b/app/test-crypto-perf/cperf_test_latency.c @@ -43,15 +43,28 @@ struct priv_op_data { static void cperf_latency_test_free(struct cperf_latency_ctx *ctx) { - if (ctx) { - if (ctx->sess) - rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess); - - rte_mempool_free(ctx->pool); + if (ctx == NULL) + return; - rte_free(ctx->res); - rte_free(ctx); + if (ctx->sess != NULL) { + if (ctx->options->op_type == CPERF_ASYM_MODEX) + rte_cryptodev_asym_session_free(ctx->dev_id, ctx->sess); +#ifdef RTE_LIB_SECURITY + else if (ctx->options->op_type == CPERF_PDCP || + ctx->options->op_type == CPERF_DOCSIS || + ctx->options->op_type == CPERF_IPSEC) { + struct rte_security_ctx *sec_ctx = + rte_cryptodev_get_sec_ctx(ctx->dev_id); + rte_security_session_destroy(sec_ctx, ctx->sess); + } +#endif + else + rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess); } + + rte_mempool_free(ctx->pool); + rte_free(ctx->res); + rte_free(ctx); } void * diff --git a/app/test-crypto-perf/cperf_test_verify.c b/app/test-crypto-perf/cperf_test_verify.c index c03e1d5ba5..8042c94e04 100644 --- a/app/test-crypto-perf/cperf_test_verify.c +++ b/app/test-crypto-perf/cperf_test_verify.c @@ -38,14 +38,27 @@ struct cperf_op_result { static void cperf_verify_test_free(struct cperf_verify_ctx *ctx) { - if (ctx) { - if (ctx->sess) - rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess); - - rte_mempool_free(ctx->pool); + if (ctx == NULL) + return; - rte_free(ctx); + if (ctx->sess != NULL) { + if (ctx->options->op_type == CPERF_ASYM_MODEX) + rte_cryptodev_asym_session_free(ctx->dev_id, ctx->sess); +#ifdef RTE_LIB_SECURITY + else if (ctx->options->op_type == CPERF_PDCP || + ctx->options->op_type == CPERF_DOCSIS || + ctx->options->op_type == CPERF_IPSEC) { + struct rte_security_ctx *sec_ctx = + rte_cryptodev_get_sec_ctx(ctx->dev_id); + rte_security_session_destroy(sec_ctx, ctx->sess); + } +#endif + else + rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess); } + + rte_mempool_free(ctx->pool); + rte_free(ctx); } void * From patchwork Mon Jan 2 11:46:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 121503 X-Patchwork-Delegate: gakhil@marvell.com 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 D7322A00C2; Mon, 2 Jan 2023 12:47:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7DB1942D1D; Mon, 2 Jan 2023 12:47:09 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 01BB742BC9 for ; Mon, 2 Jan 2023 12:47:07 +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 3026uiC5005113; Mon, 2 Jan 2023 03:47:07 -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=I7tcyxpuq3y3x2lYKYvkimGpAftWEZFtkjeAH6jFDKs=; b=CC9RfDFlcBWR7o/aG/xNbFGaLDtwWYob2yqju+pYLoBNDHD1NTVp0eQsxq38253xGIX/ /A57x8htpWsVR/GQDJS1d7Hhd2KTcX0lxQ4VmWNH4eSQHaIsnaNyRWYWx4VDCrrtr4HE UECZKbjRdIKCoBgSsWHzPVuG1G677HQIykdyv77b75XEAF9PmkU31W7QB6U1qCw8xqBs sQCmunkWH1NMT4BYQe8NqNWDxP/52YjW6KgNR+ex6YtFsLHwD2ZS9xokvp8m9ICuxUsH Xz4JXKUKU36bYjClIUXC7jbMveZ99K/kziUM4oani1kfBR4KrfsFhLTjjay4WoJEAT5e 7g== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3mtkauu20t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 02 Jan 2023 03:47:06 -0800 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.42; Mon, 2 Jan 2023 03:47:05 -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.42 via Frontend Transport; Mon, 2 Jan 2023 03:47:05 -0800 Received: from BG-LT92004.corp.innovium.com (unknown [10.193.74.65]) by maili.marvell.com (Postfix) with ESMTP id 7C0E53F7085; Mon, 2 Jan 2023 03:47:01 -0800 (PST) From: Anoob Joseph To: Ciara Power , Akhil Goyal CC: Gagandeep Singh , Hemant Agrawal , Jerin Jacob , Tejasree Kondoj , Subject: [PATCH 2/3] app/crypto-perf: fix invalid SPI Date: Mon, 2 Jan 2023 17:16:54 +0530 Message-ID: <20230102114655.300-2-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230102114655.300-1-anoobj@marvell.com> References: <20230102114655.300-1-anoobj@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: ec_xf-U1qJ6ejNegPh_RdjrbS9jqarmx X-Proofpoint-ORIG-GUID: ec_xf-U1qJ6ejNegPh_RdjrbS9jqarmx 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=2023-01-02_06,2022-12-30_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 As per IPsec specification (RFC 4303) SPI zero is reserved. Using lcore_id directly would mean SPI 0 would also be attempted. This may lead to failure on an otherwise compliant implementation. Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec") Signed-off-by: Anoob Joseph --- app/test-crypto-perf/cperf_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c index 61a3967697..4a1c9feb1c 100644 --- a/app/test-crypto-perf/cperf_ops.c +++ b/app/test-crypto-perf/cperf_ops.c @@ -722,7 +722,7 @@ create_ipsec_session(struct rte_mempool *sess_mp, .action_type = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL, .protocol = RTE_SECURITY_PROTOCOL_IPSEC, {.ipsec = { - .spi = rte_lcore_id(), + .spi = rte_lcore_id() + 1, /**< For testing sake, lcore_id is taken as SPI so that * for every core a different session is created. */ From patchwork Mon Jan 2 11:46:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anoob Joseph X-Patchwork-Id: 121504 X-Patchwork-Delegate: gakhil@marvell.com 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 3C1D4A00C2; Mon, 2 Jan 2023 12:47:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D01642D21; Mon, 2 Jan 2023 12:47:12 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 46C9642D21 for ; Mon, 2 Jan 2023 12:47:11 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3023Nv1n003683; Mon, 2 Jan 2023 03:47:10 -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=nk2ttb4eJl77NPFn0OlFHCqy+gS4XDP224W0RVaAcYM=; b=BOZCQODOncsvDPaucGjmNKXhOBJgv3yqzYEDGwpzUFalQqtYL8jJgwsm9JwN5C7gJzvX si4DYJev7PWyrWXuXNzc/uHx2jJMzu0RXbq3/f57g91795tCAAVotQcNK8L//D/P/buf ViTKG5mGvoaet1570P/bx+wIsc8XFbyMaDqToelS9asJb/T8BZsqvp/a5zCVybQNIGzR ptosLbYypPtO3LpKofF6SuKGPhj5hr1RujubGJkZod8FpozfmNYYpWnMDsV2tKNL3nhq 4yUYZ6bZCNLDmPEahAhUCctB1XaqGEIPzK+D+x7VFfUfiCLm1sO9fey2Kk3Z68cu3/A2 7g== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3mtnftbuwx-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 02 Jan 2023 03:47:10 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 2 Jan 2023 03:47:09 -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.42 via Frontend Transport; Mon, 2 Jan 2023 03:47:09 -0800 Received: from BG-LT92004.corp.innovium.com (unknown [10.193.74.65]) by maili.marvell.com (Postfix) with ESMTP id 1A6793F708C; Mon, 2 Jan 2023 03:47:05 -0800 (PST) From: Anoob Joseph To: Ciara Power , Akhil Goyal CC: Gagandeep Singh , Hemant Agrawal , Jerin Jacob , Tejasree Kondoj , Subject: [PATCH 3/3] app/crypto-perf: fix IPsec direction Date: Mon, 2 Jan 2023 17:16:55 +0530 Message-ID: <20230102114655.300-3-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230102114655.300-1-anoobj@marvell.com> References: <20230102114655.300-1-anoobj@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: DBnJu0_vyUu54R5rUEJAWC0O29fzQUXR X-Proofpoint-ORIG-GUID: DBnJu0_vyUu54R5rUEJAWC0O29fzQUXR 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=2023-01-02_06,2022-12-30_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 The default value of options->auth_op & options->cipher_op are such that an unconditional check for the same would always return true. Hence, the direction is always determined to be outbound/egress. The field options->aead_algo should be checked prior to checking above fields. Since the same check would be required in datapath, introduce a new flag in options for the same. Fixes: 28dde5da503e ("app/crypto-perf: support lookaside IPsec") Signed-off-by: Anoob Joseph --- app/test-crypto-perf/cperf_ops.c | 35 +++++++++++--------- app/test-crypto-perf/cperf_options.h | 1 + app/test-crypto-perf/cperf_options_parsing.c | 15 +++++++++ 3 files changed, 35 insertions(+), 16 deletions(-) diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c index 4a1c9feb1c..93b9bfb240 100644 --- a/app/test-crypto-perf/cperf_ops.c +++ b/app/test-crypto-perf/cperf_ops.c @@ -42,8 +42,7 @@ test_ipsec_vec_populate(struct rte_mbuf *m, const struct cperf_options *options, { struct rte_ipv4_hdr *ip = rte_pktmbuf_mtod(m, struct rte_ipv4_hdr *); - if ((options->aead_op == RTE_CRYPTO_AEAD_OP_ENCRYPT) || - (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT)) { + if (options->is_outbound) { memcpy(ip, test_vector->plaintext.data, sizeof(struct rte_ipv4_hdr)); @@ -645,8 +644,9 @@ create_ipsec_session(struct rte_mempool *sess_mp, const struct cperf_test_vector *test_vector, uint16_t iv_offset) { - struct rte_crypto_sym_xform xform = {0}; struct rte_crypto_sym_xform auth_xform = {0}; + struct rte_crypto_sym_xform *crypto_xform; + struct rte_crypto_sym_xform xform = {0}; if (options->aead_algo != 0) { /* Setup AEAD Parameters */ @@ -660,10 +660,10 @@ create_ipsec_session(struct rte_mempool *sess_mp, xform.aead.iv.length = test_vector->aead_iv.length; xform.aead.digest_length = options->digest_sz; xform.aead.aad_length = options->aead_aad_sz; + crypto_xform = &xform; } else if (options->cipher_algo != 0 && options->auth_algo != 0) { /* Setup Cipher Parameters */ xform.type = RTE_CRYPTO_SYM_XFORM_CIPHER; - xform.next = NULL; xform.cipher.algo = options->cipher_algo; xform.cipher.op = options->cipher_op; xform.cipher.iv.offset = iv_offset; @@ -680,7 +680,6 @@ create_ipsec_session(struct rte_mempool *sess_mp, /* Setup Auth Parameters */ auth_xform.type = RTE_CRYPTO_SYM_XFORM_AUTH; - auth_xform.next = NULL; auth_xform.auth.algo = options->auth_algo; auth_xform.auth.op = options->auth_op; auth_xform.auth.iv.offset = iv_offset + @@ -699,7 +698,15 @@ create_ipsec_session(struct rte_mempool *sess_mp, auth_xform.auth.iv.length = 0; } - xform.next = &auth_xform; + if (options->is_outbound) { + crypto_xform = &xform; + xform.next = &auth_xform; + auth_xform.next = NULL; + } else { + crypto_xform = &auth_xform; + auth_xform.next = &xform; + xform.next = NULL; + } } else { return NULL; } @@ -729,23 +736,19 @@ create_ipsec_session(struct rte_mempool *sess_mp, .salt = CPERF_IPSEC_SALT, .options = { 0 }, .replay_win_sz = 0, - .direction = - ((options->cipher_op == - RTE_CRYPTO_CIPHER_OP_ENCRYPT) && - (options->auth_op == - RTE_CRYPTO_AUTH_OP_GENERATE)) || - (options->aead_op == - RTE_CRYPTO_AEAD_OP_ENCRYPT) ? - RTE_SECURITY_IPSEC_SA_DIR_EGRESS : - RTE_SECURITY_IPSEC_SA_DIR_INGRESS, .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP, .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL, .tunnel = tunnel, } }, .userdata = NULL, - .crypto_xform = &xform + .crypto_xform = crypto_xform, }; + if (options->is_outbound) + sess_conf.ipsec.direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS; + else + sess_conf.ipsec.direction = RTE_SECURITY_IPSEC_SA_DIR_INGRESS; + struct rte_security_ctx *ctx = (struct rte_security_ctx *) rte_cryptodev_get_sec_ctx(dev_id); diff --git a/app/test-crypto-perf/cperf_options.h b/app/test-crypto-perf/cperf_options.h index 613d6d31e2..6966e0b286 100644 --- a/app/test-crypto-perf/cperf_options.h +++ b/app/test-crypto-perf/cperf_options.h @@ -105,6 +105,7 @@ struct cperf_options { uint32_t out_of_place:1; uint32_t silent:1; uint32_t csv:1; + uint32_t is_outbound:1; enum rte_crypto_cipher_algorithm cipher_algo; enum rte_crypto_cipher_operation cipher_op; diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c index bc5e312c81..cb91bcc3c5 100644 --- a/app/test-crypto-perf/cperf_options_parsing.c +++ b/app/test-crypto-perf/cperf_options_parsing.c @@ -1318,6 +1318,21 @@ cperf_options_check(struct cperf_options *options) if (check_docsis_buffer_length(options) < 0) return -EINVAL; } + + if (options->op_type == CPERF_IPSEC) { + if (options->aead_algo) { + if (options->aead_op == RTE_CRYPTO_AEAD_OP_ENCRYPT) + options->is_outbound = 1; + else + options->is_outbound = 0; + } else { + if (options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT && + options->auth_op == RTE_CRYPTO_AUTH_OP_GENERATE) + options->is_outbound = 1; + else + options->is_outbound = 0; + } + } #endif return 0;