[v1,2/5] eventdev/crypto: wrong crypto enqueue count stats

Message ID 20221130171014.1723899-2-ganapati.kundapura@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series [v1,1/5] eventdev/event_crypto: process event port's impl rel cap |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ganapati Kundapura Nov. 30, 2022, 5:10 p.m. UTC
  crypto_enq_count is updated on failure to enqueue ops to cryptodev.

Updated crypto_enq_count on successful enqueue of ops to cryptodev.

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
  

Comments

Naga Harish K, S V Dec. 1, 2022, 6:07 a.m. UTC | #1
Hi Ganapti,

> -----Original Message-----
> From: Kundapura, Ganapati <ganapati.kundapura@intel.com>
> Sent: Wednesday, November 30, 2022 10:40 PM
> To: dev@dpdk.org; jerinj@marvell.com; Naga Harish K, S V
> <s.v.naga.harish.k@intel.com>; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>
> Cc: Jayatheerthan, Jay <jay.jayatheerthan@intel.com>
> Subject: [PATCH v1 2/5] eventdev/crypto: wrong crypto enqueue count stats

As per the DPDK contribute guidelines, the subject line should use the imperative of the verb (like instructions to the code base).
http://doc.dpdk.org/guides/contributing/patches.html
Please change the subject lines for all patches in the patch set wherever it is required.

Also is it optimizing the stats update or fixing wrong stats update?

> 
> crypto_enq_count is updated on failure to enqueue ops to cryptodev.
> 
> Updated crypto_enq_count on successful enqueue of ops to cryptodev.
> 
> Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
> 
> diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> b/lib/eventdev/rte_event_crypto_adapter.c
> index 1c0a22b..ef3dbe9 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.c
> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> @@ -485,6 +485,9 @@ eca_enq_to_cryptodev(struct event_crypto_adapter
> *adapter, struct rte_event *ev,
>  								cdev_id,
>  								qp_id,
> 
> 	&nb_enqueued);
> +			stats->crypto_enq_count += nb_enqueued;
> +			n += nb_enqueued;
> +
>  			/**
>  			 * If some crypto ops failed to flush to cdev and
>  			 * space for another batch is not available, stop @@ -
> 495,9 +498,6 @@ eca_enq_to_cryptodev(struct event_crypto_adapter
> *adapter, struct rte_event *ev,
>  							&qp_info->cbuf)))
>  				adapter->stop_enq_to_cryptodev = true;
>  		}
> -
> -		stats->crypto_enq_count += nb_enqueued;
> -		n += nb_enqueued;
>  	}
> 
>  	return n;
> --
> 2.6.4
  
Ganapati Kundapura Dec. 1, 2022, 6:56 a.m. UTC | #2
Hi Harish,

> -----Original Message-----
> From: Naga Harish K, S V <s.v.naga.harish.k@intel.com>
> Sent: Thursday, December 1, 2022 11:38 AM
> To: Kundapura, Ganapati <ganapati.kundapura@intel.com>; dev@dpdk.org;
> jerinj@marvell.com; Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>
> Cc: Jayatheerthan, Jay <jay.jayatheerthan@intel.com>
> Subject: RE: [PATCH v1 2/5] eventdev/crypto: wrong crypto enqueue count
> stats
> 
> Hi Ganapti,
> 
> > -----Original Message-----
> > From: Kundapura, Ganapati <ganapati.kundapura@intel.com>
> > Sent: Wednesday, November 30, 2022 10:40 PM
> > To: dev@dpdk.org; jerinj@marvell.com; Naga Harish K, S V
> > <s.v.naga.harish.k@intel.com>; Gujjar, Abhinandan S
> > <abhinandan.gujjar@intel.com>
> > Cc: Jayatheerthan, Jay <jay.jayatheerthan@intel.com>
> > Subject: [PATCH v1 2/5] eventdev/crypto: wrong crypto enqueue count
> > stats
> 
> As per the DPDK contribute guidelines, the subject line should use the
> imperative of the verb (like instructions to the code base).
> http://doc.dpdk.org/guides/contributing/patches.html
> Please change the subject lines for all patches in the patch set wherever it is
> required.
> 
Updated the subject line and reposted

> Also is it optimizing the stats update or fixing wrong stats update?
> 
It's fixing of wrong stats
> >
> > crypto_enq_count is updated on failure to enqueue ops to cryptodev.
> >
> > Updated crypto_enq_count on successful enqueue of ops to cryptodev.
> >
> > Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
> >
> > diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> > b/lib/eventdev/rte_event_crypto_adapter.c
> > index 1c0a22b..ef3dbe9 100644
> > --- a/lib/eventdev/rte_event_crypto_adapter.c
> > +++ b/lib/eventdev/rte_event_crypto_adapter.c
> > @@ -485,6 +485,9 @@ eca_enq_to_cryptodev(struct
> event_crypto_adapter
> > *adapter, struct rte_event *ev,
> >  								cdev_id,
> >  								qp_id,
> >
> > 	&nb_enqueued);
> > +			stats->crypto_enq_count += nb_enqueued;
> > +			n += nb_enqueued;
> > +
> >  			/**
> >  			 * If some crypto ops failed to flush to cdev and
> >  			 * space for another batch is not available, stop @@ -
> > 495,9 +498,6 @@ eca_enq_to_cryptodev(struct event_crypto_adapter
> > *adapter, struct rte_event *ev,
> >  							&qp_info->cbuf)))
> >  				adapter->stop_enq_to_cryptodev = true;
> >  		}
> > -
> > -		stats->crypto_enq_count += nb_enqueued;
> > -		n += nb_enqueued;
> >  	}
> >
> >  	return n;
> > --
> > 2.6.4
  

Patch

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index 1c0a22b..ef3dbe9 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -485,6 +485,9 @@  eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,
 								cdev_id,
 								qp_id,
 								&nb_enqueued);
+			stats->crypto_enq_count += nb_enqueued;
+			n += nb_enqueued;
+
 			/**
 			 * If some crypto ops failed to flush to cdev and
 			 * space for another batch is not available, stop
@@ -495,9 +498,6 @@  eca_enq_to_cryptodev(struct event_crypto_adapter *adapter, struct rte_event *ev,
 							&qp_info->cbuf)))
 				adapter->stop_enq_to_cryptodev = true;
 		}
-
-		stats->crypto_enq_count += nb_enqueued;
-		n += nb_enqueued;
 	}
 
 	return n;