net/mlx5: optimize tunnel offload index pool

Message ID 1607320714-358846-1-git-send-email-suanmingm@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: optimize tunnel offload index pool |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed

Commit Message

Suanming Mou Dec. 7, 2020, 5:58 a.m. UTC
  Currently, when creating the index pool, if the trunk size is not
configured, the index pool default trunk size will be 4096.

The maximum tunnel offload supported now is 256(MLX5_MAX_TUNNELS),
create the index pool with trunk size 4096 wastes the memory.

This commits changes the tunnel offload index pool trunk size to
MLX5_MAX_TUNNELS to save the memory.

Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Reviewed-by: Gregory Etelson <getelson@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Raslan Darawsheh Dec. 9, 2020, 9:12 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Suanming Mou <suanmingm@nvidia.com>
> Sent: Monday, December 7, 2020 7:59 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> <matan@nvidia.com>
> Cc: Raslan Darawsheh <rasland@nvidia.com>; dev@dpdk.org
> Subject: [PATCH] net/mlx5: optimize tunnel offload index pool
> 
> Currently, when creating the index pool, if the trunk size is not
> configured, the index pool default trunk size will be 4096.
> 
> The maximum tunnel offload supported now is 256(MLX5_MAX_TUNNELS),
> create the index pool with trunk size 4096 wastes the memory.
> 
> This commits changes the tunnel offload index pool trunk size to
> MLX5_MAX_TUNNELS to save the memory.
> 
> Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> Reviewed-by: Gregory Etelson <getelson@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index ca3667a..a742f4b 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -265,6 +265,7 @@  static LIST_HEAD(, mlx5_dev_ctx_shared) mlx5_dev_ctx_list =
 	},
 	[MLX5_IPOOL_TUNNEL_ID] = {
 		.size = sizeof(struct mlx5_flow_tunnel),
+		.trunk_size = MLX5_MAX_TUNNELS,
 		.need_lock = 1,
 		.release_mem_en = 1,
 		.type = "mlx5_tunnel_offload",