DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix the alloc size of rqt attribute
@ 2019-09-26 10:22 Ori Kam
  2019-10-08  9:41 ` Slava Ovsiienko
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ori Kam @ 2019-09-26 10:22 UTC (permalink / raw)
  To: matan; +Cc: dev, orika, dekelp

The receive queues list size is based on the size of uint32_t, so
when allocating the memory, the correct value should be used. Or
else there is risk to corrupt the memory, depending on the queues
number, because there is some pad area for alignment. If the queue
number is not large enough, the issue couldn't be observed.

Based on Bing fix.

Fixes: dc9ceff73c99 ("net/mlx5: create advanced RxQ via DevX")
Cc: dekelp@mellanox.com

Signed-off-by: Ori Kam <orika@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index a1fdeef..0db065a 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1936,7 +1936,7 @@ struct mlx5_rxq_ctrl *
 		struct mlx5_devx_rqt_attr *rqt_attr = NULL;
 
 		rqt_attr = rte_calloc(__func__, 1, sizeof(*rqt_attr) +
-				      queues_n * sizeof(uint16_t), 0);
+				      queues_n * sizeof(uint32_t), 0);
 		if (!rqt_attr) {
 			DRV_LOG(ERR, "port %u cannot allocate RQT resources",
 				dev->data->port_id);
-- 
1.8.3.1


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

end of thread, other threads:[~2019-10-10  8:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-26 10:22 [dpdk-dev] [PATCH] net/mlx5: fix the alloc size of rqt attribute Ori Kam
2019-10-08  9:41 ` Slava Ovsiienko
2019-10-08 11:52 ` Raslan Darawsheh
2019-10-08 12:33 ` Ferruh Yigit
2019-10-10  8:36   ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).