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 D88F4A04F1 for ; Wed, 11 Dec 2019 06:29:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B95721BEC4; Wed, 11 Dec 2019 06:29:30 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id DC6B691; Wed, 11 Dec 2019 06:29:25 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5EC261A0033; Wed, 11 Dec 2019 06:29:25 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C81C01A0028; Wed, 11 Dec 2019 06:29:22 +0100 (CET) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3522740296; Wed, 11 Dec 2019 13:29:19 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org Cc: cristian.dumitrescu@intel.com, stable@dpdk.org, Jun Yang , Hemant Agrawal Date: Wed, 11 Dec 2019 10:55:33 +0530 Message-Id: <20191211052534.14600-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-stable] [PATCH 1/2] examples/ip_pipeline: fix crypto queue config 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" queue_conf need to have mempool details before pair setup. Fixes: 261bbff75e34 ("examples: use separate crypto session mempools") Cc: stable@dpdk.org Signed-off-by: Jun Yang Signed-off-by: Hemant Agrawal --- examples/ip_pipeline/cryptodev.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/ip_pipeline/cryptodev.c b/examples/ip_pipeline/cryptodev.c index b0d9f3d217..ae65a90859 100644 --- a/examples/ip_pipeline/cryptodev.c +++ b/examples/ip_pipeline/cryptodev.c @@ -99,17 +99,6 @@ cryptodev_create(const char *name, struct cryptodev_params *params) if (status < 0) return NULL; - queue_conf.nb_descriptors = params->queue_size; - for (i = 0; i < params->n_queues; i++) { - status = rte_cryptodev_queue_pair_setup(dev_id, i, - &queue_conf, socket_id); - if (status < 0) - return NULL; - } - - if (rte_cryptodev_start(dev_id) < 0) - return NULL; - cryptodev = calloc(1, sizeof(struct cryptodev)); if (cryptodev == NULL) { rte_cryptodev_stop(dev_id); @@ -149,6 +138,19 @@ cryptodev_create(const char *name, struct cryptodev_params *params) TAILQ_INSERT_TAIL(&cryptodev_list, cryptodev, node); + queue_conf.nb_descriptors = params->queue_size; + queue_conf.mp_session = cryptodev->mp_create; + queue_conf.mp_session_private = cryptodev->mp_init; + for (i = 0; i < params->n_queues; i++) { + status = rte_cryptodev_queue_pair_setup(dev_id, i, + &queue_conf, socket_id); + if (status < 0) + goto error_exit; + } + + if (rte_cryptodev_start(dev_id) < 0) + goto error_exit; + return cryptodev; error_exit: -- 2.17.1