patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Saoirse O'Donovan <saoirse.odonovan@intel.com>
To: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Cc: stable@dpdk.org, Saoirse O'Donovan <saoirse.odonovan@intel.com>,
	david.marchand@redhat.com
Subject: [PATCH 20.11] crypto/snow3g: fix snow3g enqueue stat increment
Date: Mon, 17 Apr 2023 16:08:47 +0000	[thread overview]
Message-ID: <20230417160847.19857-1-saoirse.odonovan@intel.com> (raw)

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 <saoirse.odonovan@intel.com>

---
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


             reply	other threads:[~2023-04-17 16:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-17 16:08 Saoirse O'Donovan [this message]
2023-04-17 16:14 ` Power, Ciara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230417160847.19857-1-saoirse.odonovan@intel.com \
    --to=saoirse.odonovan@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).