From patchwork Wed Nov 4 07:55:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ophir Munk X-Patchwork-Id: 83660 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1A7A6A04E7; Wed, 4 Nov 2020 08:55:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 449942BF5; Wed, 4 Nov 2020 08:55:41 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 454B7DED for ; Wed, 4 Nov 2020 08:55:38 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from ophirmu@nvidia.com) with SMTP; 4 Nov 2020 09:55:31 +0200 Received: from nvidia.com (pegasus05.mtr.labs.mlnx [10.210.16.100]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 0A47tVhw022227; Wed, 4 Nov 2020 09:55:31 +0200 From: Ophir Munk To: dev@dpdk.org, Raslan Darawsheh , Matan Azrad , Viacheslav Ovsiienko Cc: Ophir Munk Date: Wed, 4 Nov 2020 07:55:20 +0000 Message-Id: <20201104075520.23508-1-ophirmu@nvidia.com> X-Mailer: git-send-email 2.8.4 Subject: [dpdk-dev] [PATCH v1] net/mlx5: fix rxq object allocation with MPRQ 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 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 Acked-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- 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;