DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/mlx5: fix rxq object allocation with MPRQ
@ 2020-11-04  7:55 Ophir Munk
  2020-11-05 10:05 ` Raslan Darawsheh
  0 siblings, 1 reply; 2+ messages in thread
From: Ophir Munk @ 2020-11-04  7:55 UTC (permalink / raw)
  To: dev, Raslan Darawsheh, Matan Azrad, Viacheslav Ovsiienko; +Cc: Ophir Munk

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")

Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index a733eda..0510186 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;
-- 
2.8.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH v1] net/mlx5: fix rxq object allocation with MPRQ
  2020-11-04  7:55 [dpdk-dev] [PATCH v1] net/mlx5: fix rxq object allocation with MPRQ Ophir Munk
@ 2020-11-05 10:05 ` Raslan Darawsheh
  0 siblings, 0 replies; 2+ messages in thread
From: Raslan Darawsheh @ 2020-11-05 10:05 UTC (permalink / raw)
  To: Ophir Munk, dev, Matan Azrad, Slava Ovsiienko; +Cc: Ophir Munk

Hi,

> -----Original Message-----
> From: Ophir Munk <ophirmu@nvidia.com>
> Sent: Wednesday, November 4, 2020 9:55 AM
> To: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Matan Azrad
> <matan@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>
> Cc: Ophir Munk <ophirmu@nvidia.com>
> 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.
> 
> Fixes: f6dcff4788a1 ("net/mlx5: configure Rx queue for buffer split")
> 
> Signed-off-by: Ophir Munk <ophirmu@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  drivers/net/mlx5/mlx5_rxq.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-05 10:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04  7:55 [dpdk-dev] [PATCH v1] net/mlx5: fix rxq object allocation with MPRQ Ophir Munk
2020-11-05 10:05 ` Raslan Darawsheh

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git