From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CC7EDA0613 for ; Thu, 26 Sep 2019 12:22:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 820972F4F; Thu, 26 Sep 2019 12:22:35 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 682042C39 for ; Thu, 26 Sep 2019 12:22:33 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from orika@mellanox.com) with ESMTPS (AES256-SHA encrypted); 26 Sep 2019 13:22:28 +0300 Received: from pegasus04.mtr.labs.mlnx. (pegasus04.mtr.labs.mlnx [10.210.16.126]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x8QAMS4H028700; Thu, 26 Sep 2019 13:22:28 +0300 From: Ori Kam To: matan@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com, dekelp@mellanox.com Date: Thu, 26 Sep 2019 10:22:15 +0000 Message-Id: <1569493335-44790-1-git-send-email-orika@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/mlx5: fix the alloc size of rqt attribute X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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