* [dpdk-dev] [PATCH 1/2] net/mlx5: fix incorrect indexed pool configurations
2020-04-20 2:34 [dpdk-dev] [PATCH 0/2] net/mlx5: fix indexed pool bugs Suanming Mou
@ 2020-04-20 2:34 ` Suanming Mou
2020-04-20 2:34 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix indexed pool incorrect trunks free Suanming Mou
2020-04-20 13:15 ` [dpdk-dev] [PATCH 0/2] net/mlx5: fix indexed pool bugs Raslan Darawsheh
2 siblings, 0 replies; 4+ messages in thread
From: Suanming Mou @ 2020-04-20 2:34 UTC (permalink / raw)
To: viacheslavo, matan; +Cc: rasland, dev
The indexed pool configurations of mark reg copy and hrxq are incorrect.
The incorrect pool trunk size which assigned the meter struct size to
mark reg copy pool will caused wrong memory entry allocated.
The incorrect pool type makes the hrxq pool seems be confusing.
Fixes: a339b088298d ("net/mlx5: convert hrxq to indexed")
Fixes: 6cb8de0a5ad0 ("net/mlx5: convert mark copy resource to indexed")
Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
---
drivers/net/mlx5/mlx5.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index a83791c..cc13e44 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -268,7 +268,7 @@ struct mlx5_dev_spawn_data {
.type = "mlx5_meter_ipool",
},
{
- .size = sizeof(struct mlx5_flow_meter),
+ .size = sizeof(struct mlx5_flow_mreg_copy_resource),
.trunk_size = 64,
.grow_trunk = 3,
.grow_shift = 2,
@@ -287,7 +287,7 @@ struct mlx5_dev_spawn_data {
.release_mem_en = 1,
.malloc = rte_malloc_socket,
.free = rte_free,
- .type = "mlx5_jump_ipool",
+ .type = "mlx5_hrxq_ipool",
},
{
.size = sizeof(struct mlx5_flow_handle),
--
1.8.3.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH 2/2] net/mlx5: fix indexed pool incorrect trunks free
2020-04-20 2:34 [dpdk-dev] [PATCH 0/2] net/mlx5: fix indexed pool bugs Suanming Mou
2020-04-20 2:34 ` [dpdk-dev] [PATCH 1/2] net/mlx5: fix incorrect indexed pool configurations Suanming Mou
@ 2020-04-20 2:34 ` Suanming Mou
2020-04-20 13:15 ` [dpdk-dev] [PATCH 0/2] net/mlx5: fix indexed pool bugs Raslan Darawsheh
2 siblings, 0 replies; 4+ messages in thread
From: Suanming Mou @ 2020-04-20 2:34 UTC (permalink / raw)
To: viacheslavo, matan; +Cc: rasland, dev
When the allocated trunks are used out, the pool trunk array will be
grown to a larger size to save more trunks.
Currently, when replace the pool trunk array to the new one. The code
wrongly frees the new trunk array.
Should free the old trunk array to fix the bug.
Fixes: 1702f7848f6a ("net/mlx5: add indexed memory pool")
Signed-off-by: Suanming Mou <suanmingm@mellanox.com>
---
drivers/net/mlx5/mlx5_utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/mlx5/mlx5_utils.c b/drivers/net/mlx5/mlx5_utils.c
index 07a6283..2146ffd 100644
--- a/drivers/net/mlx5/mlx5_utils.c
+++ b/drivers/net/mlx5/mlx5_utils.c
@@ -251,7 +251,7 @@ struct mlx5_indexed_pool *
trunk_tmp = pool->trunks;
pool->trunks = p;
if (trunk_tmp)
- pool->cfg.free(pool->trunks);
+ pool->cfg.free(trunk_tmp);
pool->n_trunk += n_grow;
}
if (!pool->cfg.release_mem_en) {
--
1.8.3.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] net/mlx5: fix indexed pool bugs
2020-04-20 2:34 [dpdk-dev] [PATCH 0/2] net/mlx5: fix indexed pool bugs Suanming Mou
2020-04-20 2:34 ` [dpdk-dev] [PATCH 1/2] net/mlx5: fix incorrect indexed pool configurations Suanming Mou
2020-04-20 2:34 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix indexed pool incorrect trunks free Suanming Mou
@ 2020-04-20 13:15 ` Raslan Darawsheh
2 siblings, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2020-04-20 13:15 UTC (permalink / raw)
To: Suanming Mou, Slava Ovsiienko, Matan Azrad; +Cc: dev
Hi,
> -----Original Message-----
> From: Suanming Mou <suanmingm@mellanox.com>
> Sent: Monday, April 20, 2020 5:35 AM
> To: Slava Ovsiienko <viacheslavo@mellanox.com>; Matan Azrad
> <matan@mellanox.com>
> Cc: Raslan Darawsheh <rasland@mellanox.com>; dev@dpdk.org
> Subject: [PATCH 0/2] net/mlx5: fix indexed pool bugs
>
> These two patches fix the bugs with indexed memory pool.
>
> 1. The incorrect pool entry size with mark reg copy.
> 2. The incorrect trunks free.
>
> Suanming Mou (2):
> net/mlx5: fix incorrect indexed pool configurations
> net/mlx5: fix indexed pool incorrect trunks free
>
> drivers/net/mlx5/mlx5.c | 4 ++--
> drivers/net/mlx5/mlx5_utils.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> --
> 1.8.3.1
Patches squashed into relevant commits,
Applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh
^ permalink raw reply [flat|nested] 4+ messages in thread