[v3,5/5] eventdev/crypto: fix failed events

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

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS

Commit Message

Ganapati Kundapura Dec. 7, 2022, 6:49 a.m. UTC
  Circular buffer stores events failed to enqueue to eventdev for
retrying later. Current implementation adds the same crypto op
to circular buffer instead of pointing all the ops in a batch.

This fix updates the pointer to pointing to correct ops in the batch.

Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")

Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
---
v3:
* Updated commit message

v2:
* Updated subject line commit message
  

Comments

Gujjar, Abhinandan S Dec. 7, 2022, 6:56 a.m. UTC | #1
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

> -----Original Message-----
> From: Kundapura, Ganapati <ganapati.kundapura@intel.com>
> Sent: Wednesday, December 7, 2022 12:20 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>; vfialko@marvell.com
> Subject: [PATCH v3 5/5] eventdev/crypto: fix failed events
> 
> Circular buffer stores events failed to enqueue to eventdev for retrying later.
> Current implementation adds the same crypto op to circular buffer instead of
> pointing all the ops in a batch.
> 
> This fix updates the pointer to pointing to correct ops in the batch.
> 
> Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")
> 
> Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
> ---
> v3:
> * Updated commit message
> 
> v2:
> * Updated subject line commit message
> 
> diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> b/lib/eventdev/rte_event_crypto_adapter.c
> index 31b8255..5d962a1 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.c
> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> @@ -753,7 +753,7 @@ eca_crypto_adapter_deq_run(struct
> event_crypto_adapter *adapter,
>  				for (i = nb_enqueued; i < n; i++)
>  					eca_circular_buffer_add(
>  						&adapter->ebuf,
> -						ops[nb_enqueued]);
> +						ops[i]);
> 
>  check:
>  				nb_deq += n;
> --
> 2.6.4
  
Jerin Jacob Jan. 12, 2023, 12:59 p.m. UTC | #2
On Wed, Dec 7, 2022 at 12:26 PM Gujjar, Abhinandan S
<abhinandan.gujjar@intel.com> wrote:
>
> Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
>
> > -----Original Message-----
> > From: Kundapura, Ganapati <ganapati.kundapura@intel.com>
> > Sent: Wednesday, December 7, 2022 12:20 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>; vfialko@marvell.com
> > Subject: [PATCH v3 5/5] eventdev/crypto: fix failed events
> >
> > Circular buffer stores events failed to enqueue to eventdev for retrying later.
> > Current implementation adds the same crypto op to circular buffer instead of
> > pointing all the ops in a batch.
> >
> > This fix updates the pointer to pointing to correct ops in the batch.
> >
> > Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")
> >
> > Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>

Updated the git commit as follows and series applied to
dpdk-next-net-eventdev/for-main. Thanks

ommit 948973d20dbd465f8fcc502f9e3af3b0de3db1e6 (HEAD -> for-main)
Author: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date:   Wed Dec 7 00:49:45 2022 -0600

    eventdev/crypto: fix failed events

    Circular buffer stores events failed to enqueue to eventdev for
    retrying later. Current implementation adds the same crypto op
    to circular buffer instead of pointing all the ops in a batch.

    This fix updates the pointer to pointing to correct ops in the batch.

    Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")
    Cc: stable@dpdk.org

    Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
    Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

commit 32fb46e8e37e4cd6f965c9e577243693b99c02d4
Author: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date:   Wed Dec 7 00:49:44 2022 -0600

    eventdev/crypto: fix overflow in circular buffer

    In case of crypto enqueue failures, even though back pressure
    flag is set to stop further dequeue from eventdev, the current
    logic does not stop dequeueing events for max_nb events.

    This is fixed by checking the back pressure just before
    dequeuing events from event device.

    Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")
    Cc: stable@dpdk.org

    Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
    Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

commit 74bf35c7b2510e9d3da409607a13b5887ceeb590
Author: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date:   Wed Dec 7 00:49:43 2022 -0600

    eventdev/crypto: fix wrong offset used while flushing events

    Events enqueued to eventdev from the beginning of the circular buffer.
    This leads to invalid or already freed events getting enqueued to eventdev
    from the circular buffer.

    Fixed by enqueuing the events to eventdev from the head pointer of
    circular buffer.

    Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")
    Cc: stable@dpdk.org

    Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
    Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

commit 1597b6602c3d90887c2ec65031377c2dba0aacf1
Author: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date:   Wed Dec 7 00:49:42 2022 -0600

    eventdev/crypto: fix wrong crypto enqueue count stats

    crypto_enq_count is updated on failure to enqueue ops to cryptodev.
    Updated crypto_enq_count on successful enqueue of ops to cryptodev.

    Fixes: 7901eac3409a ("eventdev: add crypto adapter implementation")
    Cc: stable@dpdk.org

    Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
    Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

commit 2b3049e5e61cff02488e402358854ae5e9b0279d
Author: Ganapati Kundapura <ganapati.kundapura@intel.com>
Date:   Wed Dec 7 00:49:41 2022 -0600

    eventdev/crypto: select enqueue mode based on implicit release capability

    In the current implementation adapter queries event device's capability for
    implicit release support.

    This information is used to decide whether events are enqueued back as
    NEW or FWD events.

    This patch updates the adapter to query the port caps for implicit release
    to decide on events enqueuing back as NEW/FWD events.

    Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>
    Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>


> > ---
> > v3:
> > * Updated commit message
> >
> > v2:
> > * Updated subject line commit message
> >
> > diff --git a/lib/eventdev/rte_event_crypto_adapter.c
> > b/lib/eventdev/rte_event_crypto_adapter.c
> > index 31b8255..5d962a1 100644
> > --- a/lib/eventdev/rte_event_crypto_adapter.c
> > +++ b/lib/eventdev/rte_event_crypto_adapter.c
> > @@ -753,7 +753,7 @@ eca_crypto_adapter_deq_run(struct
> > event_crypto_adapter *adapter,
> >                               for (i = nb_enqueued; i < n; i++)
> >                                       eca_circular_buffer_add(
> >                                               &adapter->ebuf,
> > -                                             ops[nb_enqueued]);
> > +                                             ops[i]);
> >
> >  check:
> >                               nb_deq += n;
> > --
> > 2.6.4
>
  

Patch

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index 31b8255..5d962a1 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -753,7 +753,7 @@  eca_crypto_adapter_deq_run(struct event_crypto_adapter *adapter,
 				for (i = nb_enqueued; i < n; i++)
 					eca_circular_buffer_add(
 						&adapter->ebuf,
-						ops[nb_enqueued]);
+						ops[i]);
 
 check:
 				nb_deq += n;