net/mlx5: fix unused calculation in RSS expansion
PATCH 1/5 net/mlx5: fix unused calculation in RSS expansion
The RSS flow expansion get a memory buffer to fill the new patterns of the expanded flows.
This memory management saves the next address to write into the buffer in a dedicated variable.
The calculation for the next address was wrongly also done when all the patterns were ready.
Remove it.
--- drivers/net/mlx5/mlx5_flow.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/mlx5/mlx5_flow.c +0 -2
@@ -377,8 +377,6 @@ struct mlx5_flow_expand_rss { user_pattern_size); addr = (void *)(((uintptr_t )addr) + user_pattern_size);rte_memcpy (addr, flow_items, elt *sizeof (*item)); - addr = (void *)(((uintptr_t )addr) + - elt *sizeof (*item)); } }return lsize;
Signature · 1 line
1.8.3.1
PATCH 2/5 net/mlx5: fix Rx queue creation error flow
In Rx queue creation, there is a validation for the Rx configuration.
When scatter offload validation for buffer split is failed, the Rx queue object memory was not freed what caused a memory leak.
Free it.
--- drivers/net/mlx5/mlx5_rxq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/mlx5/mlx5_rxq.c +1 -1
@@ -1506,7 +1506,7 @@ struct mlx5_rxq_ctrl * dev->data->port_id, idx, mb_len, max_rx_pkt_len, RTE_PKTMBUF_HEADROOM); rte_errno =ENOSPC ; -return NULL ; + goto error; } tmpl->type =MLX5_RXQ_TYPE_STANDARD ; if (mlx5_mr_btree_init(&tmpl->rxq.mr_ctrl.cache_bh,
Signature · 1 line
1.8.3.1
PATCH 3/5 net/mlx5: fix ASO age pools resize error flow
In reply to Michael BaumIn ASO age pools resize, the PMD starts ASO data-path.
When starting ASO data-path is failed, the pools memory was not freed what caused a memory leak.
Free it.
--- drivers/net/mlx5/mlx5_flow_dv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5_flow_dv.c +3 -1
@@ -9347,8 +9347,10 @@ struct mlx5_cache_entry */* First ASO flow hit allocation - starting ASO data-path. */ int ret =mlx5_aso_queue_start (priv->sh); -if (ret) +if (ret) { +mlx5_free (pools);return ret; + } } mng->n = resize; mng->pools = pools;
Signature · 1 line
1.8.3.1
PATCH 4/5 net/mlx5: fix compiler code arrangement in probe
In reply to Michael BaumBonding adjustment is done only when DEVX_PORT is supported in the rdma-core.
Some bonding condition was done even when DEVX_PORT is not supported.
Remove it.
--- drivers/net/mlx5/linux/mlx5_os.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/mlx5/linux/mlx5_os.c +2 -0
@@ -1942,6 +1942,7 @@ (list[ns].ifindex, &list[ns].info); } +#ifdef HAVE_MLX5DV_DR_DEVX_PORT if (!ret && bd >=0 ) {switch (list[ns].info.name_type) {case MLX5_PHYS_PORT_NAME_TYPE_UPLINK :
@@ -1959,6 +1960,7 @@ }continue ; } +#endif if (!ret && (list[ns].info.representor ^ list[ns].info.master)) ns++;
Signature · 1 line
1.8.3.1
PATCH 5/5 common/mlx5: fix flex parser creation error flow
In reply to Michael BaumFrom: Michael Baum <[email protected]>
The mlx5_devx_cmd_create_flex_parser function defines a local array (with constant size) named in, and then allocates a pointer to mlx5_devx_obj structure by the mlx5_malloc function.
If the allocation fails, the function releases the array in and returns NULL. However, the array has been defined locally on the stack and the mlx5_free function is not required to release it.
Remove the call to the mlx5_free function.
--- drivers/common/mlx5/mlx5_devx_cmds.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/common/mlx5/mlx5_devx_cmds.c +3 -5
@@ -530,15 +530,13 @@ struct mlx5_devx_obj *void *sample =MLX5_ADDR_OF (parse_graph_flex, flex, sample_table);void *in_arc =MLX5_ADDR_OF (parse_graph_flex, flex, input_arc);void *out_arc =MLX5_ADDR_OF (parse_graph_flex, flex, output_arc); -struct mlx5_devx_obj *parse_flex_obj =NULL ; +struct mlx5_devx_obj *parse_flex_obj =mlx5_malloc + (MLX5_MEM_ZERO ,sizeof (*parse_flex_obj),0 ,SOCKET_ID_ANY );uint32_t i; - parse_flex_obj =mlx5_malloc (MLX5_MEM_ZERO ,sizeof (*parse_flex_obj),0 , -SOCKET_ID_ANY );if (!parse_flex_obj) { -DRV_LOG (ERR ,"Failed to allocate flex parser data" ); +DRV_LOG (ERR ,"Failed to allocate flex parser data." ); rte_errno =ENOMEM ; -mlx5_free (in);return NULL ; } MLX5_SET(general_obj_in_cmd_hdr, hdr, opcode,
Signature · 1 line
1.8.3.1
11/11/2020 08:36, Michael Baum:
Quoted 8 lines
The RSS flow expansion get a memory buffer to fill the new patterns of the expanded flows.
This memory management saves the next address to write into the buffer in a dedicated variable.The calculation for the next address was wrongly also done when all the patterns were ready.
Quoted 7 lines
Remove it.
Fixes 4ed05fcd441b ("ethdev: add flow API to expand RSS flows")Signed-off-by Michael Baum <[email protected]>Acked-by Matan Azrad <[email protected]>
Series applied in next-net-mlx, thanks.