Skip to content

Commit

Permalink
crypto/ipsec_mb: fix enqueue counter for SNOW3G
Browse files Browse the repository at this point in the history
[ upstream commit dd6b0a910ff32b2b367c18ad97b045c8dc5aa882 ]

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: 4f1cfda ("crypto/ipsec_mb: move snow3g PMD")

Signed-off-by: Saoirse O'Donovan <saoirse.odonovan@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
  • Loading branch information
saoirseod authored and kevintraynor committed Jul 11, 2023
1 parent 0428cfa commit 2487cb3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/crypto/ipsec_mb/pmd_snow3g.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,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:
Expand Down Expand Up @@ -424,9 +425,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;
}
Expand All @@ -442,7 +444,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;

Expand Down Expand Up @@ -482,8 +483,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;

Expand Down

0 comments on commit 2487cb3

Please sign in to comment.