event/cnxk: fix SSO return code at fini

Message ID 20230302105832.3955684-1-vfialko@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series event/cnxk: fix SSO return code at fini |

Checks

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

Commit Message

Volodymyr Fialko March 2, 2023, 10:58 a.m. UTC
  dev_fini() can return EAGAIN in case if LF is active(used by other
devices). Ignoring return code leads to early free of resources that are
still in use.

Fixes: 8558dcaa05b8 ("event/cnxk: add build infra and device setup")
Cc: stable@dpdk.org

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
---
 drivers/event/cnxk/cnxk_eventdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Jerin Jacob March 3, 2023, 3:34 p.m. UTC | #1
On Thu, Mar 2, 2023 at 4:30 PM Volodymyr Fialko <vfialko@marvell.com> wrote:
>
> dev_fini() can return EAGAIN in case if LF is active(used by other
> devices). Ignoring return code leads to early free of resources that are
> still in use.
>
> Fixes: 8558dcaa05b8 ("event/cnxk: add build infra and device setup")
> Cc: stable@dpdk.org
>
> Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>

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


> ---
>  drivers/event/cnxk/cnxk_eventdev.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/event/cnxk/cnxk_eventdev.c b/drivers/event/cnxk/cnxk_eventdev.c
> index 9815e84c24..6aecccb45d 100644
> --- a/drivers/event/cnxk/cnxk_eventdev.c
> +++ b/drivers/event/cnxk/cnxk_eventdev.c
> @@ -670,9 +670,8 @@ cnxk_sso_fini(struct rte_eventdev *event_dev)
>
>         cnxk_tim_fini();
>         roc_sso_rsrc_fini(&dev->sso);
> -       roc_sso_dev_fini(&dev->sso);
>
> -       return 0;
> +       return roc_sso_dev_fini(&dev->sso);
>  }
>
>  int
> --
> 2.34.1
>
  

Patch

diff --git a/drivers/event/cnxk/cnxk_eventdev.c b/drivers/event/cnxk/cnxk_eventdev.c
index 9815e84c24..6aecccb45d 100644
--- a/drivers/event/cnxk/cnxk_eventdev.c
+++ b/drivers/event/cnxk/cnxk_eventdev.c
@@ -670,9 +670,8 @@  cnxk_sso_fini(struct rte_eventdev *event_dev)
 
 	cnxk_tim_fini();
 	roc_sso_rsrc_fini(&dev->sso);
-	roc_sso_dev_fini(&dev->sso);
 
-	return 0;
+	return roc_sso_dev_fini(&dev->sso);
 }
 
 int