DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/mlx5: remove unneeded SQ null checking
@ 2022-10-26  6:33 Suanming Mou
  2022-10-26  9:58 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Suanming Mou @ 2022-10-26  6:33 UTC (permalink / raw)
  To: Matan Azrad, Viacheslav Ovsiienko; +Cc: dev, rasland

The ASO SQ is a dynamic array in the ASO pool struct. That means
the checking of the SQ pointer is incorrect and not needed. And
the mlx5_aso_destroy_sq() function internally also checks if inside
the SQ any resources need to be released or not. There is no need
to have that extra checking.

This commit removes the redundant checking code.

Fixes: aa90929cd5db ("net/mlx5: add HW steering connection tracking support")

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_aso.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow_aso.c b/drivers/net/mlx5/mlx5_flow_aso.c
index 1ddf71e44e..29bd7ce9e8 100644
--- a/drivers/net/mlx5/mlx5_flow_aso.c
+++ b/drivers/net/mlx5/mlx5_flow_aso.c
@@ -328,8 +328,7 @@ mlx5_aso_mtr_queue_init(struct mlx5_dev_ctx_shared *sh,
 	return 0;
 error:
 	do {
-		if (&hws_pool->sq[i])
-			mlx5_aso_destroy_sq(hws_pool->sq + i);
+		mlx5_aso_destroy_sq(hws_pool->sq + i);
 	} while (i--);
 	return -1;
 }
@@ -1149,8 +1148,7 @@ mlx5_aso_ct_queue_init(struct mlx5_dev_ctx_shared *sh,
 	do {
 		if (ct_mng->aso_sqs[i].mr.addr)
 			mlx5_aso_dereg_mr(sh->cdev, &ct_mng->aso_sqs[i].mr);
-		if (&ct_mng->aso_sqs[i])
-			mlx5_aso_destroy_sq(&ct_mng->aso_sqs[i]);
+		mlx5_aso_destroy_sq(&ct_mng->aso_sqs[i]);
 	} while (i--);
 	ct_mng->nb_sq = 0;
 	return -1;
-- 
2.25.1


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

* RE: [PATCH] net/mlx5: remove unneeded SQ null checking
  2022-10-26  6:33 [PATCH] net/mlx5: remove unneeded SQ null checking Suanming Mou
@ 2022-10-26  9:58 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2022-10-26  9:58 UTC (permalink / raw)
  To: Suanming Mou, Matan Azrad, Slava Ovsiienko; +Cc: dev

Hi,

> -----Original Message-----
> From: Suanming Mou <suanmingm@nvidia.com>
> Sent: Wednesday, October 26, 2022 9:33 AM
> To: Matan Azrad <matan@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>
> Subject: [PATCH] net/mlx5: remove unneeded SQ null checking
> 
> The ASO SQ is a dynamic array in the ASO pool struct. That means
> the checking of the SQ pointer is incorrect and not needed. And
> the mlx5_aso_destroy_sq() function internally also checks if inside
> the SQ any resources need to be released or not. There is no need
> to have that extra checking.
> 
> This commit removes the redundant checking code.
> 
> Fixes: aa90929cd5db ("net/mlx5: add HW steering connection tracking
> support")
> 
> Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Squashed into relevant commit into next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2022-10-26  9:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26  6:33 [PATCH] net/mlx5: remove unneeded SQ null checking Suanming Mou
2022-10-26  9:58 ` Raslan Darawsheh

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