[1/2] common/cnxk: revert check on bitmap for tm

Message ID 20220303070042.29075-1-ndabilpuram@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [1/2] common/cnxk: revert check on bitmap for tm |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Nithin Dabilpuram March 3, 2022, 7 a.m. UTC
  Revert change to return error on case where no slab of free
resources is found. That error check break's a case where
there is a spare schq to be reused that was just allocated
for sake of contiguous static TM nodes.

Fixes: 14f7e5d4bf2d ("common/cnxk: add missing checks of return values")
Cc: gmuthukrishn@marvell.com

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/common/cnxk/roc_nix_tm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Comments

Jerin Jacob March 3, 2022, 5:33 p.m. UTC | #1
On Thu, Mar 3, 2022 at 12:30 PM Nithin Dabilpuram
<ndabilpuram@marvell.com> wrote:
>
> Revert change to return error on case where no slab of free
> resources is found. That error check break's a case where
> there is a spare schq to be reused that was just allocated
> for sake of contiguous static TM nodes.
>
> Fixes: 14f7e5d4bf2d ("common/cnxk: add missing checks of return values")
> Cc: gmuthukrishn@marvell.com
>
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>

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

    common/cnxk: fix bitmap usage for TM

    Revert change [1] to return error on case where no slab of free
    resources is found. That error check break's a case where
    there is a spare schedule queue to be reused that was just
    allocated for sake of contiguous static TM nodes.

    [1]
    Fixes: 14f7e5d4bf2d ("common/cnxk: add missing checks of return values")

    Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
    Acked-by: Jerin Jacob <jerinj@marvell.com>

> ---
>  drivers/common/cnxk/roc_nix_tm.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/common/cnxk/roc_nix_tm.c b/drivers/common/cnxk/roc_nix_tm.c
> index 7a17780..5b70c7b 100644
> --- a/drivers/common/cnxk/roc_nix_tm.c
> +++ b/drivers/common/cnxk/roc_nix_tm.c
> @@ -1042,10 +1042,8 @@ nix_tm_assign_hw_id(struct nix *nix, struct nix_tm_node *parent,
>                         return -EFAULT;
>                 }
>
> -               if (!slab) {
> -                       if (!plt_bitmap_scan(bmp, &pos, &slab))
> -                               return -ENOENT;
> -               }
> +               if (!slab)
> +                       plt_bitmap_scan(bmp, &pos, &slab);
>
>                 if (child->priority == parent->rr_prio && spare_schq != -1) {
>                         /* Use spare schq first if present */
> --
> 2.8.4
>
  

Patch

diff --git a/drivers/common/cnxk/roc_nix_tm.c b/drivers/common/cnxk/roc_nix_tm.c
index 7a17780..5b70c7b 100644
--- a/drivers/common/cnxk/roc_nix_tm.c
+++ b/drivers/common/cnxk/roc_nix_tm.c
@@ -1042,10 +1042,8 @@  nix_tm_assign_hw_id(struct nix *nix, struct nix_tm_node *parent,
 			return -EFAULT;
 		}
 
-		if (!slab) {
-			if (!plt_bitmap_scan(bmp, &pos, &slab))
-				return -ENOENT;
-		}
+		if (!slab)
+			plt_bitmap_scan(bmp, &pos, &slab);
 
 		if (child->priority == parent->rr_prio && spare_schq != -1) {
 			/* Use spare schq first if present */