From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 00DCCF95D for ; Thu, 9 Feb 2017 14:43:24 +0100 (CET) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP; 09 Feb 2017 05:43:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,349,1484035200"; d="scan'208";a="63735244" Received: from silpixa00381633.ir.intel.com (HELO silpixa00381633.ger.corp.intel.com) ([10.237.222.114]) by fmsmga006.fm.intel.com with ESMTP; 09 Feb 2017 05:43:22 -0800 From: Fan Zhang To: dev@dpdk.org Cc: pablo.de.lara.guarch@intel.com Date: Thu, 9 Feb 2017 13:44:28 +0000 Message-Id: <1486647868-159267-1-git-send-email-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] crypto/scheduler: fix initialization 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: , X-List-Received-Date: Thu, 09 Feb 2017 13:43:25 -0000 Fixes the wrong slave initialization issue on start-up Fixes: 100e4f7("add round-robin mode") Signed-off-by: Fan Zhang --- drivers/crypto/scheduler/scheduler_roundrobin.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/crypto/scheduler/scheduler_roundrobin.c b/drivers/crypto/scheduler/scheduler_roundrobin.c index 7abdd29..ef2d683 100644 --- a/drivers/crypto/scheduler/scheduler_roundrobin.c +++ b/drivers/crypto/scheduler/scheduler_roundrobin.c @@ -62,6 +62,11 @@ schedule_enqueue(void *qp_ctx, struct rte_crypto_op **ops, uint16_t nb_ops) rte_prefetch0(ops[i]->sym->session); for (i = 0; (i < (nb_ops - 8)) && (nb_ops > 8); i += 4) { + rte_prefetch0(ops[i + 4]->sym->session); + rte_prefetch0(ops[i + 5]->sym->session); + rte_prefetch0(ops[i + 6]->sym->session); + rte_prefetch0(ops[i + 7]->sym->session); + sess0 = (struct scheduler_session *) ops[i]->sym->session->_private; sess1 = (struct scheduler_session *) @@ -80,11 +85,6 @@ schedule_enqueue(void *qp_ctx, struct rte_crypto_op **ops, uint16_t nb_ops) ops[i + 1]->sym->session = sess1->sessions[slave_idx]; ops[i + 2]->sym->session = sess2->sessions[slave_idx]; ops[i + 3]->sym->session = sess3->sessions[slave_idx]; - - rte_prefetch0(ops[i + 4]->sym->session); - rte_prefetch0(ops[i + 5]->sym->session); - rte_prefetch0(ops[i + 6]->sym->session); - rte_prefetch0(ops[i + 7]->sym->session); } for (; i < nb_ops; i++) { @@ -350,7 +350,6 @@ static int scheduler_start(struct rte_cryptodev *dev) { struct scheduler_ctx *sched_ctx = dev->data->dev_private; - uint16_t i; for (i = 0; i < dev->data->nb_queue_pairs; i++) { @@ -358,14 +357,13 @@ scheduler_start(struct rte_cryptodev *dev) struct rr_scheduler_qp_ctx *rr_qp_ctx = qp_ctx->private_qp_ctx; uint32_t j; - uint16_t qp_id = rr_qp_ctx->slaves[0].qp_id; memset(rr_qp_ctx->slaves, 0, MAX_SLAVES_NUM * sizeof(struct scheduler_slave)); for (j = 0; j < sched_ctx->nb_slaves; j++) { rr_qp_ctx->slaves[j].dev_id = - sched_ctx->slaves[i].dev_id; - rr_qp_ctx->slaves[j].qp_id = qp_id; + sched_ctx->slaves[j].dev_id; + rr_qp_ctx->slaves[j].qp_id = i; } rr_qp_ctx->nb_slaves = sched_ctx->nb_slaves; -- 2.7.4