From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 064E042996; Thu, 20 Apr 2023 12:32:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CCF2542D0E; Thu, 20 Apr 2023 12:32:45 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 6413A41156; Thu, 20 Apr 2023 12:32:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681986764; x=1713522764; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cEaLp4NAL0G3rWZuXOnavOYB1iS/j58SGr9L6WP0YSk=; b=Kc2lcNwJSWhYWkHx9D5icYwIOzeDk/fze0Py9PHCLG/XVskaWjvsOo7n oc4yqWfhvKbH4rvwSGWDQiX1Yx19M4BkF+Chihk4/GYmWrgBxKuCJ1tNp oQWI1+m/fNdWFQOdiyTykLbuZazUw6D4tlu9OWCU6D+sXkfGGzcT4hgG4 FSDLdnSu/m9NwHdMiZAYqdvZ9+Q1Fh7kQfTwGCipOldUnuxXx7Y5tafoQ B2gKHy0VGPnW2Bb7cywA8ar0EhOma+A10nwMS7Bm16oRn50dXVGN9dIvK EP+oTMTLFo0wg7YLFDwgQtU15Cjx9gry9OzKnaFS+mERaXZ42XCwhUgsz w==; X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="334525682" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="334525682" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2023 03:32:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="761115680" X-IronPort-AV: E=Sophos;i="5.99,212,1677571200"; d="scan'208";a="761115680" Received: from unknown (HELO silpixa00400902.ir.intel.com) ([10.243.23.123]) by fmsmga004.fm.intel.com with ESMTP; 20 Apr 2023 03:32:41 -0700 From: Saoirse O'Donovan To: Kai Ji , Pablo de Lara Cc: dev@dpdk.org, Saoirse O'Donovan , piotrx.bronowski@intel.com, stable@dpdk.org Subject: [PATCH v2] crypto/ipsec_mb: enqueue counter fix Date: Thu, 20 Apr 2023 10:31:41 +0000 Message-Id: <20230420103141.8770-1-saoirse.odonovan@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230418142249.38447-1-saoirse.odonovan@intel.com> References: <20230418142249.38447-1-saoirse.odonovan@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: stable@dpdk.org Signed-off-by: Saoirse O'Donovan --- v2: Added cc stable for 21.11 and 22.11 backport. 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; -- 2.25.1