summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Kam <orika@mellanox.com>2019-09-26 10:22:15 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-23 16:43:08 +0200
commite72bd9603e2cbc6c456d2615ac7b62de19e2141c (patch)
tree15a5bff27434fb8f1f45a8ba4b5de7e3b9d99234
parent906a2efae8da8507bab2d089c544d4fa4150a5fd (diff)
downloaddpdk-next-eventdev-e72bd9603e2cbc6c456d2615ac7b62de19e2141c.zip
dpdk-next-eventdev-e72bd9603e2cbc6c456d2615ac7b62de19e2141c.tar.gz
dpdk-next-eventdev-e72bd9603e2cbc6c456d2615ac7b62de19e2141c.tar.xz
net/mlx5: fix allocation size of RQT attribute
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. Fixes: dc9ceff73c99 ("net/mlx5: create advanced RxQ via DevX") Cc: stable@dpdk.org Signed-off-by: Ori Kam <orika@mellanox.com> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
-rw-r--r--drivers/net/mlx5/mlx5_rxq.c2
1 files changed, 1 insertions, 1 deletions
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 @@ mlx5_ind_table_obj_new(struct rte_eth_dev *dev, const uint16_t *queues,
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);