From patchwork Tue Apr 18 14:22:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "O'Donovan, Saoirse" X-Patchwork-Id: 126243 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 CEDD84297D; Tue, 18 Apr 2023 16:23:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57DFF410EA; Tue, 18 Apr 2023 16:23:00 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 56D2B4014F for ; Tue, 18 Apr 2023 16:22:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681827778; x=1713363778; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2JWX8y2Me5mHM4aWDSpZfUp44Iz5ccx1TGJBG3EZZXI=; b=NbeJc201BOKj8rLp1H5qwcfVtOlXySA3NQXFBc84oVkW/cYBUR6fPjb0 dWqQeTo2GoHFut1N4Px7uftebbfp03mW/BW5XuQouMaSL1gADMc+LbIVr avJoQbZT0FfuilZChnlK8SxgEiPAxbF3XoYwNeNFHR9QZbG71Ge5Iz8Sa VuZMGfvTjTf14FnSwmJK8/eQW5GLJQy1DzviNq//6+5LFJyO435fyLqy1 UyKfwI4o+yeCdBxaoVNjzV99zpFMfvNtqhMctYJIuRfghSd6tlfxQrgHc eSEwVy4tQkPEcVDHPeDeUOeOO96dC3hLiGkQpGSOpxs6rrNQ062AICklO w==; X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="333986462" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="333986462" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2023 07:22:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10684"; a="641388493" X-IronPort-AV: E=Sophos;i="5.99,207,1677571200"; d="scan'208";a="641388493" Received: from unknown (HELO silpixa00400902.ir.intel.com) ([10.243.23.123]) by orsmga003.jf.intel.com with ESMTP; 18 Apr 2023 07:22:55 -0700 From: Saoirse O'Donovan To: Kai Ji , Pablo de Lara Cc: dev@dpdk.org, luca.boccassi@gmail.com, Saoirse O'Donovan , piotrx.bronowski@intel.com Subject: [PATCH] crypto/ipsec_mb: enqueue counter fix Date: Tue, 18 Apr 2023 14:22:49 +0000 Message-Id: <20230418142249.38447-1-saoirse.odonovan@intel.com> X-Mailer: git-send-email 2.25.1 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 This patch removes enqueue op counter update from the process_op_bit function where the process is now done in dequeue stage. The original stats increment was incorrect as they shouldn't have been updated at all in this function. Fixes: 4f1cfda59ad3 ("crypto/ipsec_mb: move snow3g PMD") Cc: piotrx.bronowski@intel.com Signed-off-by: Saoirse O'Donovan Acked-by: Ciara Power --- A similar fix has been sent to 20.11 LTS stable, in the interest of time. In that fix, the enqueued stat is still in use, therefore only the fix to the count increment was necessary. Here is the mail archive link: https://mails.dpdk.org/archives/stable/2023-April/043550.html --- drivers/crypto/ipsec_mb/pmd_snow3g.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/ipsec_mb/pmd_snow3g.c b/drivers/crypto/ipsec_mb/pmd_snow3g.c index 8ed069f428..e64df1a462 100644 --- a/drivers/crypto/ipsec_mb/pmd_snow3g.c +++ b/drivers/crypto/ipsec_mb/pmd_snow3g.c @@ -372,9 +372,10 @@ process_ops(struct rte_crypto_op **ops, struct snow3g_session *session, /** Process a crypto op with length/offset in bits. */ static int process_op_bit(struct rte_crypto_op *op, struct snow3g_session *session, - struct ipsec_mb_qp *qp, uint16_t *accumulated_enqueued_ops) + struct ipsec_mb_qp *qp) { - uint32_t enqueued_op, processed_op; + unsigned int processed_op; + int ret; switch (session->op) { case IPSEC_MB_OP_ENCRYPT_ONLY: @@ -421,9 +422,10 @@ process_op_bit(struct rte_crypto_op *op, struct snow3g_session *session, if (unlikely(processed_op != 1)) return 0; - enqueued_op = rte_ring_enqueue(qp->ingress_queue, op); - qp->stats.enqueued_count += enqueued_op; - *accumulated_enqueued_ops += enqueued_op; + + ret = rte_ring_enqueue(qp->ingress_queue, op); + if (ret != 0) + return ret; return 1; } @@ -439,7 +441,6 @@ snow3g_pmd_dequeue_burst(void *queue_pair, struct snow3g_session *prev_sess = NULL, *curr_sess = NULL; uint32_t i; uint8_t burst_size = 0; - uint16_t enqueued_ops = 0; uint8_t processed_ops; uint32_t nb_dequeued; @@ -479,8 +480,7 @@ snow3g_pmd_dequeue_burst(void *queue_pair, prev_sess = NULL; } - processed_ops = process_op_bit(curr_c_op, curr_sess, - qp, &enqueued_ops); + processed_ops = process_op_bit(curr_c_op, curr_sess, qp); if (processed_ops != 1) break;