From patchwork Mon Apr 20 02:34:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suanming Mou X-Patchwork-Id: 68913 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 59A26A0561; Mon, 20 Apr 2020 04:34:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4EE321C20E; Mon, 20 Apr 2020 04:34:45 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 506861C205 for ; Mon, 20 Apr 2020 04:34:43 +0200 (CEST) From: Suanming Mou To: viacheslavo@mellanox.com, matan@mellanox.com Cc: rasland@mellanox.com, dev@dpdk.org Date: Mon, 20 Apr 2020 10:34:35 +0800 Message-Id: <1587350076-58468-2-git-send-email-suanmingm@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1587350076-58468-1-git-send-email-suanmingm@mellanox.com> References: <1587350076-58468-1-git-send-email-suanmingm@mellanox.com> Subject: [dpdk-dev] [PATCH 1/2] net/mlx5: fix incorrect indexed pool configurations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "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 --- 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), From patchwork Mon Apr 20 02:34:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suanming Mou X-Patchwork-Id: 68914 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 31ED8A0561; Mon, 20 Apr 2020 04:35:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A00CD1C2A4; Mon, 20 Apr 2020 04:34:47 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 902D31C208 for ; Mon, 20 Apr 2020 04:34:44 +0200 (CEST) From: Suanming Mou To: viacheslavo@mellanox.com, matan@mellanox.com Cc: rasland@mellanox.com, dev@dpdk.org Date: Mon, 20 Apr 2020 10:34:36 +0800 Message-Id: <1587350076-58468-3-git-send-email-suanmingm@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1587350076-58468-1-git-send-email-suanmingm@mellanox.com> References: <1587350076-58468-1-git-send-email-suanmingm@mellanox.com> Subject: [dpdk-dev] [PATCH 2/2] net/mlx5: fix indexed pool incorrect trunks free X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "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 --- 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) {