[v1] eventdev/crypto_adapter: remove logically dead code

Message ID 20220223073443.647695-1-ganapati.kundapura@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v1] eventdev/crypto_adapter: remove logically dead code |

Checks

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

Commit Message

Ganapati Kundapura Feb. 23, 2022, 7:34 a.m. UTC
  eca_cryptodev_cdev_flush() is internal function and called with
valid range of cdevs.

crypto_cdev_info structure is allocated at adapter creation time
and retrieved from the adapter for a valid cdevs which cannot be NULL
and hence no need for NULL check.

Fixes: 2ae84b39ae7b ("eventdev/crypto: store operations in circular buffer")

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

Comments

Jerin Jacob Feb. 23, 2022, 4:58 p.m. UTC | #1
On Wed, Feb 23, 2022 at 1:04 PM Ganapati Kundapura
<ganapati.kundapura@intel.com> wrote:
>
> eca_cryptodev_cdev_flush() is internal function and called with
> valid range of cdevs.
>
> crypto_cdev_info structure is allocated at adapter creation time
> and retrieved from the adapter for a valid cdevs which cannot be NULL
> and hence no need for NULL check.
>
> Fixes: 2ae84b39ae7b ("eventdev/crypto: store operations in circular buffer")
>
> Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com>

@Jayatheerthan, Jay  @Gujjar, Abhinandan S

Could you review this?
  
Gujjar, Abhinandan S Feb. 24, 2022, 3:11 a.m. UTC | #2
Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

> -----Original Message-----
> From: Kundapura, Ganapati <ganapati.kundapura@intel.com>
> Sent: Wednesday, February 23, 2022 1:05 PM
> To: Jayatheerthan, Jay <jay.jayatheerthan@intel.com>;
> jerinjacobk@gmail.com; Gujjar, Abhinandan S
> <abhinandan.gujjar@intel.com>; dev@dpdk.org
> Subject: [PATCH v1] eventdev/crypto_adapter: remove logically dead code
> 
> eca_cryptodev_cdev_flush() is internal function and called with valid range
> of cdevs.
> 
> crypto_cdev_info structure is allocated at adapter creation time and
> retrieved from the adapter for a valid cdevs which cannot be NULL and
> hence no need for NULL check.
> 
> 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 0b484f3..f624f50 100644
> --- a/lib/eventdev/rte_event_crypto_adapter.c
> +++ b/lib/eventdev/rte_event_crypto_adapter.c
> @@ -529,10 +529,8 @@ eca_crypto_cdev_flush(struct
> event_crypto_adapter *adapter,
>  	uint16_t qp;
> 
>  	curr_dev = &adapter->cdevs[cdev_id];
> -	if (unlikely(curr_dev == NULL))
> -		return 0;
> -
>  	dev = rte_cryptodev_pmd_get_dev(cdev_id);
> +
>  	for (qp = 0; qp < dev->data->nb_queue_pairs; qp++) {
> 
>  		curr_queue = &curr_dev->qpairs[qp];
> --
> 2.6.4
  
Jerin Jacob Feb. 24, 2022, 5:22 a.m. UTC | #3
On Thu, Feb 24, 2022 at 8:41 AM Gujjar, Abhinandan S
<abhinandan.gujjar@intel.com> wrote:
>
> Acked-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>

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

>
> > -----Original Message-----
> > From: Kundapura, Ganapati <ganapati.kundapura@intel.com>
> > Sent: Wednesday, February 23, 2022 1:05 PM
> > To: Jayatheerthan, Jay <jay.jayatheerthan@intel.com>;
> > jerinjacobk@gmail.com; Gujjar, Abhinandan S
> > <abhinandan.gujjar@intel.com>; dev@dpdk.org
> > Subject: [PATCH v1] eventdev/crypto_adapter: remove logically dead code
> >
> > eca_cryptodev_cdev_flush() is internal function and called with valid range
> > of cdevs.
> >
> > crypto_cdev_info structure is allocated at adapter creation time and
> > retrieved from the adapter for a valid cdevs which cannot be NULL and
> > hence no need for NULL check.
> >
> > 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 0b484f3..f624f50 100644
> > --- a/lib/eventdev/rte_event_crypto_adapter.c
> > +++ b/lib/eventdev/rte_event_crypto_adapter.c
> > @@ -529,10 +529,8 @@ eca_crypto_cdev_flush(struct
> > event_crypto_adapter *adapter,
> >       uint16_t qp;
> >
> >       curr_dev = &adapter->cdevs[cdev_id];
> > -     if (unlikely(curr_dev == NULL))
> > -             return 0;
> > -
> >       dev = rte_cryptodev_pmd_get_dev(cdev_id);
> > +
> >       for (qp = 0; qp < dev->data->nb_queue_pairs; qp++) {
> >
> >               curr_queue = &curr_dev->qpairs[qp];
> > --
> > 2.6.4
>
  

Patch

diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c
index 0b484f3..f624f50 100644
--- a/lib/eventdev/rte_event_crypto_adapter.c
+++ b/lib/eventdev/rte_event_crypto_adapter.c
@@ -529,10 +529,8 @@  eca_crypto_cdev_flush(struct event_crypto_adapter *adapter,
 	uint16_t qp;
 
 	curr_dev = &adapter->cdevs[cdev_id];
-	if (unlikely(curr_dev == NULL))
-		return 0;
-
 	dev = rte_cryptodev_pmd_get_dev(cdev_id);
+
 	for (qp = 0; qp < dev->data->nb_queue_pairs; qp++) {
 
 		curr_queue = &curr_dev->qpairs[qp];