From patchwork Wed Sep 11 16:06:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yong Liang <1269690261@qq.com> X-Patchwork-Id: 143959 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 3846E45962; Wed, 11 Sep 2024 18:06:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D42C43245; Wed, 11 Sep 2024 18:06:32 +0200 (CEST) Received: from out203-205-221-191.mail.qq.com (out203-205-221-191.mail.qq.com [203.205.221.191]) by mails.dpdk.org (Postfix) with UTF8SMTP id 0592142F6F for ; Wed, 11 Sep 2024 18:06:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1726070782; bh=rxXI8p+6V/8E/OCGydE0XxFmXBpJkV4XFJ8j4GRI+ak=; h=From:To:Cc:Subject:Date; b=QcfwUhwY8V6/ryp/kfLNMXTHJXG2rVK3XUNFvmJUM66dhy/5ubqS7ULqaXXW36nGT 0/6JbIgbihxf/RamKn+fFultDXW1Kyi3EC3KDzQh+FDw/H33784XxYPh91nB0/Vvv5 cfFl2wEAuuFMk/tlwr8vUsLnTYYKlmlD95zLR2j8= Received: from liangyong-System-Product-Name.. ([113.104.214.72]) by newxmesmtplogicsvrszc5-2.qq.com (NewEsmtp) with SMTP id 18CBA0A8; Thu, 12 Sep 2024 00:06:12 +0800 X-QQ-mid: xmsmtpt1726070772twhdpkb08 Message-ID: X-QQ-XMAILINFO: Nl0S2HjMbZsFcYxIomdUYzdyoYhjx6MkMiVYailvlbXF2DOIanQxb3nQqz1OQV WYdSzYLNO0UYIa8Hs/AV18MJIU6xClNXKOy+4FUxSDUAVDkib87q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y.fan.zhang@intel.com Subject: [PATCH] crypto/scheduler: fix crashes in scheduler_multicore due to incorrect variable usage Date: Thu, 12 Sep 2024 00:06:10 +0800 X-OQ-MSGID: <20240911160610.19714-1-1269690261@qq.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 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 variable `pending_deq_ops` was incorrectly used instead of `pending_enq_ops`. This causes the program to crash when the worker PMD accesses the session Bugzilla ID: 1537 Fixes: 6812b9bf470e ("crypto/scheduler: use unified session") Cc: roy.fan.zhang@intel.com Signed-off-by: Yong Liang <1269690261@qq.com> --- drivers/crypto/scheduler/scheduler_multicore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/scheduler/scheduler_multicore.c b/drivers/crypto/scheduler/scheduler_multicore.c index a21b522f9f..70f8a25b70 100644 --- a/drivers/crypto/scheduler/scheduler_multicore.c +++ b/drivers/crypto/scheduler/scheduler_multicore.c @@ -191,11 +191,11 @@ mc_scheduler_worker(struct rte_cryptodev *dev) worker->qp_id, &enq_ops[pending_enq_ops_idx], pending_enq_ops); - if (processed_ops < pending_deq_ops) + if (processed_ops < pending_enq_ops) scheduler_retrieve_sessions( &enq_ops[pending_enq_ops_idx + processed_ops], - pending_deq_ops - processed_ops); + pending_enq_ops - processed_ops); pending_enq_ops -= processed_ops; pending_enq_ops_idx += processed_ops; inflight_ops += processed_ops;