Skip to contentSkip to conversation

net/mlx5: fix rxq object allocation with MPRQ

PATCH In review Ophir Munk 2 participants 2 messages Nov 4, 2020 – Nov 5, 2020 Network drivers

lore
Share & tools
lore

Ophir Munk

author
#0 lore raw

PATCH 1/1 net/mlx5: fix rxq 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 f6dcff4788a1 ("net/mlx5: configure Rx queue for buffer split")
---
 drivers/net/mlx5/mlx5_rxq.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/net/mlx5/mlx5_rxq.c +5 -2
index a733eda..0510186 100644
@@ -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;
Signature · 1 line
2.8.4
#1 lore raw

Hi,

Quoted 14 lines

-----Original Message-----
From: Ophir Munk <[email protected]>
Sent: Wednesday, November 4, 2020 9:55 AM
To: [email protected]; Raslan Darawsheh <[email protected]>; Matan Azrad <[email protected]>; Slava Ovsiienko <[email protected]>
Cc: Ophir Munk <[email protected]>
Subject: [PATCH v1] net/mlx5: fix rxq 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.

Quoted 9 lines
Fixes f6dcff4788a1 ("net/mlx5: configure Rx queue for buffer split")
---
 drivers/net/mlx5/mlx5_rxq.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh