From: Ophir Munk Date: Wed, 4 Nov 2020 07:55:20 +0000 (+0000) Subject: net/mlx5: fix Rx queue object allocation with MPRQ X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6c3dc9ebaa9f8bc9257299ec703a9a0fbff627b0;p=dpdk.git net/mlx5: fix Rx queue object allocation with MPRQ The space for extra buffer pointers used by MPRQ routines was not allocated in Rx queue object creation structure causing memory corruption. The fix allocates the extra memory for the pointers in case MPRQ is engaged. Fixes: a0a45e8af723 ("net/mlx5: configure Rx queue for buffer split") Signed-off-by: Ophir Munk Acked-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 4d3bd00d8b..a61a2dac95 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1424,8 +1424,11 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, const struct rte_eth_rxseg_split *qs_seg = rx_seg; unsigned int tail_len; - tmpl = mlx5_malloc(MLX5_MEM_RTE | MLX5_MEM_ZERO, sizeof(*tmpl) + - desc_n * sizeof(struct rte_mbuf *), 0, socket); + tmpl = mlx5_malloc(MLX5_MEM_RTE | MLX5_MEM_ZERO, + sizeof(*tmpl) + desc_n * sizeof(struct rte_mbuf *) + + (!!mprq_en) * + (desc >> mprq_stride_nums) * sizeof(struct mlx5_mprq_buf *), + 0, socket); if (!tmpl) { rte_errno = ENOMEM; return NULL;