DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] eventdev/crypto: flush ops when circ buffer is full
@ 2023-08-01  5:44 Ganapati Kundapura
  2023-08-02 16:17 ` Jerin Jacob
  2023-08-03  8:32 ` [PATCH v2] eventdev/crypto: fix circular buffer full case Ganapati Kundapura
  0 siblings, 2 replies; 5+ messages in thread
From: Ganapati Kundapura @ 2023-08-01  5:44 UTC (permalink / raw)
  To: jerinj, jay.jayatheerthan, s.v.naga.harish.k, abhinandan.gujjar, dev

crypto ops from the circ buffer are not getting flushed
to crypto dev when crypto dev becomes busy and circ buffer
gets full.

This patch flushes ops from circ buffer when circ buffer is full
instead of returning without flushing.

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 52a28e5..1b435c9 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -248,9 +248,18 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp,
 		n = *tailp - *headp;
 	else if (*tailp < *headp)
 		n = bufp->size - *headp;
-	else {
-		*nb_ops_flushed = 0;
-		return 0;  /* buffer empty */
+	else { /* head == tail case */
+		/* when head == tail,
+		 * circ buff is either full(tail pointer roll over) or empty
+		 */
+		if (bufp->count != 0) {
+			/* circ buffer is full */
+			n = bufp->count;
+		} else {
+			/* circ buffer is empty */
+			*nb_ops_flushed = 0;
+			return 0;  /* buffer empty */
+		}
 	}
 
 	*nb_ops_flushed = rte_cryptodev_enqueue_burst(cdev_id, qp_id,
-- 
2.6.4


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

* Re: [PATCH v1] eventdev/crypto: flush ops when circ buffer is full
  2023-08-01  5:44 [PATCH v1] eventdev/crypto: flush ops when circ buffer is full Ganapati Kundapura
@ 2023-08-02 16:17 ` Jerin Jacob
  2023-08-03  8:34   ` Kundapura, Ganapati
  2023-08-03  8:32 ` [PATCH v2] eventdev/crypto: fix circular buffer full case Ganapati Kundapura
  1 sibling, 1 reply; 5+ messages in thread
From: Jerin Jacob @ 2023-08-02 16:17 UTC (permalink / raw)
  To: Ganapati Kundapura
  Cc: jerinj, jay.jayatheerthan, s.v.naga.harish.k, abhinandan.gujjar, dev

On Tue, Aug 1, 2023 at 11:15 AM Ganapati Kundapura
<ganapati.kundapura@intel.com> wrote:
>
> crypto ops from the circ buffer are not getting flushed
> to crypto dev when crypto dev becomes busy and circ buffer
> gets full.
>
> This patch flushes ops from circ buffer when circ buffer is full
> instead of returning without flushing.


Since it is bug, Please add Fixes: tag , Also change description accordingly.

> 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 52a28e5..1b435c9 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.c
> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> @@ -248,9 +248,18 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp,
>                 n = *tailp - *headp;
>         else if (*tailp < *headp)
>                 n = bufp->size - *headp;
> -       else {
> -               *nb_ops_flushed = 0;
> -               return 0;  /* buffer empty */
> +       else { /* head == tail case */
> +               /* when head == tail,
> +                * circ buff is either full(tail pointer roll over) or empty
> +                */
> +               if (bufp->count != 0) {
> +                       /* circ buffer is full */
> +                       n = bufp->count;
> +               } else {
> +                       /* circ buffer is empty */
> +                       *nb_ops_flushed = 0;
> +                       return 0;  /* buffer empty */
> +               }
>         }
>
>         *nb_ops_flushed = rte_cryptodev_enqueue_burst(cdev_id, qp_id,
> --
> 2.6.4
>

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

* [PATCH v2] eventdev/crypto: fix circular buffer full case
  2023-08-01  5:44 [PATCH v1] eventdev/crypto: flush ops when circ buffer is full Ganapati Kundapura
  2023-08-02 16:17 ` Jerin Jacob
@ 2023-08-03  8:32 ` Ganapati Kundapura
  2023-08-08 12:59   ` Jerin Jacob
  1 sibling, 1 reply; 5+ messages in thread
From: Ganapati Kundapura @ 2023-08-03  8:32 UTC (permalink / raw)
  To: jerinj, jay.jayatheerthan, s.v.naga.harish.k, abhinandan.gujjar, dev

crypto ops from the circular buffer are not getting flushed
to crypto dev when crypto dev becomes busy and circular buffer
gets full.

Fix it by flushing ops from circular buffer when circ buffer is full
instead of returning without flushing.

Fixes: 2ae84b39ae7b ("eventdev/crypto: store operations in circular buffer")
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 52a28e5..1b435c9 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -248,9 +248,18 @@ eca_circular_buffer_flush_to_cdev(struct crypto_ops_circular_buffer *bufp,
 		n = *tailp - *headp;
 	else if (*tailp < *headp)
 		n = bufp->size - *headp;
-	else {
-		*nb_ops_flushed = 0;
-		return 0;  /* buffer empty */
+	else { /* head == tail case */
+		/* when head == tail,
+		 * circ buff is either full(tail pointer roll over) or empty
+		 */
+		if (bufp->count != 0) {
+			/* circ buffer is full */
+			n = bufp->count;
+		} else {
+			/* circ buffer is empty */
+			*nb_ops_flushed = 0;
+			return 0;  /* buffer empty */
+		}
 	}
 
 	*nb_ops_flushed = rte_cryptodev_enqueue_burst(cdev_id, qp_id,
-- 
2.6.4


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

* RE: [PATCH v1] eventdev/crypto: flush ops when circ buffer is full
  2023-08-02 16:17 ` Jerin Jacob
@ 2023-08-03  8:34   ` Kundapura, Ganapati
  0 siblings, 0 replies; 5+ messages in thread
From: Kundapura, Ganapati @ 2023-08-03  8:34 UTC (permalink / raw)
  To: Jerin Jacob
  Cc: jerinj, Jayatheerthan, Jay, Naga Harish K, S V, Gujjar,
	Abhinandan S, dev

Hi Jerin,

> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Wednesday, August 2, 2023 9:47 PM
> To: Kundapura, Ganapati <ganapati.kundapura@intel.com>
> Cc: jerinj@marvell.com; Jayatheerthan, Jay <jay.jayatheerthan@intel.com>;
> Naga Harish K, S V <s.v.naga.harish.k@intel.com>; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; dev@dpdk.org
> Subject: Re: [PATCH v1] eventdev/crypto: flush ops when circ buffer is full
> 
> On Tue, Aug 1, 2023 at 11:15 AM Ganapati Kundapura
> <ganapati.kundapura@intel.com> wrote:
> >
> > crypto ops from the circ buffer are not getting flushed to crypto dev
> > when crypto dev becomes busy and circ buffer gets full.
> >
> > This patch flushes ops from circ buffer when circ buffer is full
> > instead of returning without flushing.
> 
> 
> Since it is bug, Please add Fixes: tag , Also change description accordingly.
> 
Updated in v2
> > 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 52a28e5..1b435c9 100644
> > --- a/lib/eventdev/rte_event_crypto_adapter.c
> > +++ b/lib/eventdev/rte_event_crypto_adapter.c
> > @@ -248,9 +248,18 @@ eca_circular_buffer_flush_to_cdev(struct
> crypto_ops_circular_buffer *bufp,
> >                 n = *tailp - *headp;
> >         else if (*tailp < *headp)
> >                 n = bufp->size - *headp;
> > -       else {
> > -               *nb_ops_flushed = 0;
> > -               return 0;  /* buffer empty */
> > +       else { /* head == tail case */
> > +               /* when head == tail,
> > +                * circ buff is either full(tail pointer roll over) or empty
> > +                */
> > +               if (bufp->count != 0) {
> > +                       /* circ buffer is full */
> > +                       n = bufp->count;
> > +               } else {
> > +                       /* circ buffer is empty */
> > +                       *nb_ops_flushed = 0;
> > +                       return 0;  /* buffer empty */
> > +               }
> >         }
> >
> >         *nb_ops_flushed = rte_cryptodev_enqueue_burst(cdev_id, qp_id,
> > --
> > 2.6.4
> >

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

* Re: [PATCH v2] eventdev/crypto: fix circular buffer full case
  2023-08-03  8:32 ` [PATCH v2] eventdev/crypto: fix circular buffer full case Ganapati Kundapura
@ 2023-08-08 12:59   ` Jerin Jacob
  0 siblings, 0 replies; 5+ messages in thread
From: Jerin Jacob @ 2023-08-08 12:59 UTC (permalink / raw)
  To: Ganapati Kundapura
  Cc: jerinj, jay.jayatheerthan, s.v.naga.harish.k, abhinandan.gujjar, dev

On Thu, Aug 3, 2023 at 2:03 PM Ganapati Kundapura
<ganapati.kundapura@intel.com> wrote:
>
> crypto ops from the circular buffer are not getting flushed
> to crypto dev when crypto dev becomes busy and circular buffer
> gets full.
>
> Fix it by flushing ops from circular buffer when circ buffer is full
> instead of returning without flushing.
>
> Fixes: 2ae84b39ae7b ("eventdev/crypto: store operations in circular buffer")
> Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>

Applied to dpdk-next-net-eventdev/for-main. Thanks

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

end of thread, other threads:[~2023-08-08 12:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-01  5:44 [PATCH v1] eventdev/crypto: flush ops when circ buffer is full Ganapati Kundapura
2023-08-02 16:17 ` Jerin Jacob
2023-08-03  8:34   ` Kundapura, Ganapati
2023-08-03  8:32 ` [PATCH v2] eventdev/crypto: fix circular buffer full case Ganapati Kundapura
2023-08-08 12:59   ` Jerin Jacob

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