patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH v2] crypto/ipsec_mb: enqueue counter fix
       [not found] <20230418142249.38447-1-saoirse.odonovan@intel.com>
@ 2023-04-20 10:31 ` Saoirse O'Donovan
  2023-04-20 10:49   ` Kevin Traynor
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Saoirse O'Donovan @ 2023-04-20 10:31 UTC (permalink / raw)
  To: Kai Ji, Pablo de Lara
  Cc: dev, Saoirse O'Donovan, piotrx.bronowski, stable

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

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] crypto/ipsec_mb: enqueue counter fix
  2023-04-20 10:31 ` [PATCH v2] crypto/ipsec_mb: enqueue counter fix Saoirse O'Donovan
@ 2023-04-20 10:49   ` Kevin Traynor
  2023-04-20 11:05   ` Power, Ciara
  2023-05-24 12:22   ` [EXT] " Akhil Goyal
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Traynor @ 2023-04-20 10:49 UTC (permalink / raw)
  To: Saoirse O'Donovan, Kai Ji, Pablo de Lara
  Cc: dev, piotrx.bronowski, stable, Xueming(Steven) Li

On 20/04/2023 11:31, Saoirse O'Donovan wrote:
> 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 <saoirse.odonovan@intel.com>
> 
> ---
> 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.
> 

Thanks for the explanation. As it has the correct tags, we will pick 
this up for 21.11 and 22.11 LTS releases in the normal workflow, which 
is after it has been released as part of a DPDK main branch release.

thanks,
Kevin.

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v2] crypto/ipsec_mb: enqueue counter fix
  2023-04-20 10:31 ` [PATCH v2] crypto/ipsec_mb: enqueue counter fix Saoirse O'Donovan
  2023-04-20 10:49   ` Kevin Traynor
@ 2023-04-20 11:05   ` Power, Ciara
  2023-05-24 12:22   ` [EXT] " Akhil Goyal
  2 siblings, 0 replies; 4+ messages in thread
From: Power, Ciara @ 2023-04-20 11:05 UTC (permalink / raw)
  To: O'Donovan, Saoirse, Ji, Kai, De Lara Guarch, Pablo
  Cc: dev, O'Donovan, Saoirse, Bronowski, PiotrX, stable



> -----Original Message-----
> From: Saoirse O'Donovan <saoirse.odonovan@intel.com>
> Sent: Thursday 20 April 2023 11:32
> To: Ji, Kai <kai.ji@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; O'Donovan, Saoirse <saoirse.odonovan@intel.com>;
> Bronowski, PiotrX <piotrx.bronowski@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] crypto/ipsec_mb: enqueue counter fix
> 
> 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 <saoirse.odonovan@intel.com>
> 
> ---
> 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(-)

Acked-by: Ciara Power <ciara.power@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [EXT] [PATCH v2] crypto/ipsec_mb: enqueue counter fix
  2023-04-20 10:31 ` [PATCH v2] crypto/ipsec_mb: enqueue counter fix Saoirse O'Donovan
  2023-04-20 10:49   ` Kevin Traynor
  2023-04-20 11:05   ` Power, Ciara
@ 2023-05-24 12:22   ` Akhil Goyal
  2 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2023-05-24 12:22 UTC (permalink / raw)
  To: Saoirse O'Donovan, Kai Ji, Pablo de Lara
  Cc: dev, piotrx.bronowski, stable

> 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 <saoirse.odonovan@intel.com>
> 
> ---
Applied to dpdk-next-crypto

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-05-24 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230418142249.38447-1-saoirse.odonovan@intel.com>
2023-04-20 10:31 ` [PATCH v2] crypto/ipsec_mb: enqueue counter fix Saoirse O'Donovan
2023-04-20 10:49   ` Kevin Traynor
2023-04-20 11:05   ` Power, Ciara
2023-05-24 12:22   ` [EXT] " Akhil Goyal

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