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 3F9D54296F for ; Mon, 17 Apr 2023 18:10:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3969640DFB; Mon, 17 Apr 2023 18:10:43 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 675F440698 for ; Mon, 17 Apr 2023 18:10:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681747842; x=1713283842; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=K/Dxo1gkWX7I9jR2XnYjzc9o3uPpIFnKnLfOV8uW3Gc=; b=K/fciqME7ux8JQCjsDJAw4ZWPB3fr85n7LjE1qg/4HiZB+vnvNh/bMqV ecx5w4eY4ZsftulTiIlLEkMojQ1y0/le0kxGAmffRJZBpsTLmlnjA3odL sXX7PRNWILqCzCbmrfq50o+Nxc17WicoEPLbQ0K5y5rnAZiADIACJcIs5 2CSbQ9Eg0HjMSwfVrtTDpQWzZ3Oq/pj8mFgXEzQL9OjbOGa+wXizdEEFE pir4xajcPPJ69X8RlD2ecMnn3Xut08qeep5rQTPo/SiNtWwX7naK2Sgzs jA/SIARuKJOMG+2y0WTumSCNbV+q3f4WPB8XyOIGGD1+dwo1eUf0zOJje Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10683"; a="372809601" X-IronPort-AV: E=Sophos;i="5.99,204,1677571200"; d="scan'208";a="372809601" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2023 09:08:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10683"; a="690720709" X-IronPort-AV: E=Sophos;i="5.99,204,1677571200"; d="scan'208";a="690720709" Received: from unknown (HELO silpixa00400902.ir.intel.com) ([10.243.23.123]) by orsmga002.jf.intel.com with ESMTP; 17 Apr 2023 09:08:49 -0700 From: Saoirse O'Donovan To: Pablo de Lara Cc: stable@dpdk.org, Saoirse O'Donovan , david.marchand@redhat.com Subject: [PATCH 20.11] crypto/snow3g: fix snow3g enqueue stat increment Date: Mon, 17 Apr 2023 16:08:47 +0000 Message-Id: <20230417160847.19857-1-saoirse.odonovan@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 The two functions rte_ring_enqueue and rte_ring_enqueue_burst have different return values which weren't accounted for when updating enqueue stats. This meant that on success, the enqueued count and accumulated_enqueued_ops were being incremented by 0. Fixes: 49abc602fa65 ("crypto/ipsec_mb: fix build with GCC 12") Cc: david.marchand@redhat.com Signed-off-by: Saoirse O'Donovan --- Upstream commit: Fixes: 468f31eb71c4 ("crypto/ipsec_mb: fix build with GCC 12") --- drivers/crypto/snow3g/rte_snow3g_pmd.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c b/drivers/crypto/snow3g/rte_snow3g_pmd.c index 2e2c8412ae..8dfc8b3945 100644 --- a/drivers/crypto/snow3g/rte_snow3g_pmd.c +++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c @@ -371,7 +371,8 @@ static int process_op_bit(struct rte_crypto_op *op, struct snow3g_session *session, struct snow3g_qp *qp, uint16_t *accumulated_enqueued_ops) { - unsigned enqueued_op, processed_op; + unsigned int processed_op; + int ret; switch (session->op) { case SNOW3G_OP_ONLY_CIPHER: @@ -412,9 +413,13 @@ 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->processed_ops, op); - qp->qp_stats.enqueued_count += enqueued_op; - *accumulated_enqueued_ops += enqueued_op; + + ret = rte_ring_enqueue(qp->processed_ops, op); + if (ret != 0) + return ret; + + qp->qp_stats.enqueued_count += 1; + *accumulated_enqueued_ops += 1; return 1; } -- 2.25.1