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 E8EFCA04F0 for ; Thu, 19 Dec 2019 15:42:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DB6731C033; Thu, 19 Dec 2019 15:42:07 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id B04381C01F for ; Thu, 19 Dec 2019 15:42:06 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id w15so6252298wru.4 for ; Thu, 19 Dec 2019 06:42:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/eqlSCcqL7+algjkehTPcRwsbKPXoQIxPrPQngwnHyg=; b=Smy8zxKcjbDQJeAFaojYPd8vqdiO0DHE1Ma3FqOju54P4N7cw1kEMyUrU8KQTrJMI5 xlrZNAKztZH7go9TQ9lUqc+Stdt9pXAa31dVJxR0a7+ZLOD1uNUPIhgLKj34JvXzVkwU Ctlt4yCgkPdaxfsGEihmLa25hOTWZP1ceIvtMKWiT7hJl+hBfkI7GrJrHe/Zej4dpzX9 g5Aobf1Y+8zPEfKYA5vonplFGbGrAHSYYi1yj2aPv/yFda+BjhXhCcxCE7jOxZUCMxZ7 6lDEP+T/A2DqC2CVTIrt0fZk1GTrY8KPQlJL7r6y3oCPw0iYl/qUbHByBf3rWcmdYC8f aUvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/eqlSCcqL7+algjkehTPcRwsbKPXoQIxPrPQngwnHyg=; b=m1IgggV0aylwlbSJuMOp8bTuhEnQJGYk0B3BDqMb8EdNNIc6DJQIys2n39pOOBGlez vm4ys7g7e8u6ftQ7L7NIqdcnaFcTCz6MNmrsOjqCJdf19GsVBNEar27giCYjD2dzeETG O2d5zKQbBkC6e9nbiuFHIzUhV0UIxMl3eScwiaRj4jYDVhtLsUE4ZXMLuNYVF11w7kby zdW/zYU2iAHpEaoSa4lZ+KJVrK9V+2fELA9sxMqsPnEfCDH4NHd9mvzVtnX8o4RPoRGk bB+6JAfp4wuniaZKItgc3w7d3tx4mohOp2ZDWj+M5cpn+EvDv9+ZopP71n4qp4Gx1xtV f0fQ== X-Gm-Message-State: APjAAAUwUxyI3+SfZMytN2XDxXtyc+TAowIj5hTVZ6UrN8sOH+LNtaCd hGs8iiA2vHTa2DSyBA/rNlow8VkRmNw= X-Google-Smtp-Source: APXvYqxIqrm0kuRV703247NwJ+j799aait2RtMpyXsxeKl9f8z2xxkcly5usSXIiUzDEFUyNDqPHEg== X-Received: by 2002:adf:e40f:: with SMTP id g15mr10325837wrm.223.1576766526456; Thu, 19 Dec 2019 06:42:06 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id c68sm6360433wme.13.2019.12.19.06.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 06:42:05 -0800 (PST) From: luca.boccassi@gmail.com To: Thomas Monjalon Cc: Raslan Darawsheh , Ferruh Yigit , David Marchand , dpdk stable Date: Thu, 19 Dec 2019 14:34:44 +0000 Message-Id: <20191219143447.21506-137-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191219143447.21506-1-luca.boccassi@gmail.com> References: <20191219143447.21506-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'ethdev: limit maximum number of queues' has been queued to LTS release 17.11.10 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 17.11.10 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/21/19. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 12d3b2b57aaa9815147c7e26b352a70be2d834a9 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Wed, 27 Nov 2019 13:22:56 +0100 Subject: [PATCH] ethdev: limit maximum number of queues [ upstream commit 20bbb9e0450f2ccda374584173dc0a5cd93c9f06 ] A buffer overflow happens in testpmd with some drivers since the queue arrays are limited to RTE_MAX_QUEUES_PER_PORT. The advertised capabilities of mlx4, mlx5 and softnic for the number of queues were the maximum number: UINT16_MAX. They must be limited by the configured RTE_MAX_QUEUES_PER_PORT that applications expect to be respected. The limitation is applied at ethdev level (function rte_eth_dev_info_get), in order to force the configured limit for all drivers. Fixes: 14b53e27b30e ("ethdev: fix crash with multiprocess") Reported-by: Raslan Darawsheh Signed-off-by: Thomas Monjalon Reviewed-by: Ferruh Yigit Reviewed-by: David Marchand --- lib/librte_ether/rte_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index d8595ab34a..f11670789d 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -2051,6 +2051,12 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) dev_info->rx_desc_lim = lim; dev_info->tx_desc_lim = lim; + /* Maximum number of queues should be <= RTE_MAX_QUEUES_PER_PORT */ + dev_info->max_rx_queues = RTE_MIN(dev_info->max_rx_queues, + RTE_MAX_QUEUES_PER_PORT); + dev_info->max_tx_queues = RTE_MIN(dev_info->max_tx_queues, + RTE_MAX_QUEUES_PER_PORT); + RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get); (*dev->dev_ops->dev_infos_get)(dev, dev_info); dev_info->driver_name = dev->device->driver->name; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-12-19 14:32:31.767630802 +0000 +++ 0137-ethdev-limit-maximum-number-of-queues.patch 2019-12-19 14:32:26.361302902 +0000 @@ -1,8 +1,10 @@ -From 20bbb9e0450f2ccda374584173dc0a5cd93c9f06 Mon Sep 17 00:00:00 2001 +From 12d3b2b57aaa9815147c7e26b352a70be2d834a9 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Wed, 27 Nov 2019 13:22:56 +0100 Subject: [PATCH] ethdev: limit maximum number of queues +[ upstream commit 20bbb9e0450f2ccda374584173dc0a5cd93c9f06 ] + A buffer overflow happens in testpmd with some drivers since the queue arrays are limited to RTE_MAX_QUEUES_PER_PORT. @@ -15,23 +17,22 @@ in order to force the configured limit for all drivers. Fixes: 14b53e27b30e ("ethdev: fix crash with multiprocess") -Cc: stable@dpdk.org Reported-by: Raslan Darawsheh Signed-off-by: Thomas Monjalon Reviewed-by: Ferruh Yigit Reviewed-by: David Marchand --- - lib/librte_ethdev/rte_ethdev.c | 6 ++++++ + lib/librte_ether/rte_ethdev.c | 6 ++++++ 1 file changed, 6 insertions(+) -diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c -index 8d2ce31a81..6e9cb243ea 100644 ---- a/lib/librte_ethdev/rte_ethdev.c -+++ b/lib/librte_ethdev/rte_ethdev.c -@@ -2986,6 +2986,12 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) - return eth_err(port_id, diag); - } +diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c +index d8595ab34a..f11670789d 100644 +--- a/lib/librte_ether/rte_ethdev.c ++++ b/lib/librte_ether/rte_ethdev.c +@@ -2051,6 +2051,12 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info) + dev_info->rx_desc_lim = lim; + dev_info->tx_desc_lim = lim; + /* Maximum number of queues should be <= RTE_MAX_QUEUES_PER_PORT */ + dev_info->max_rx_queues = RTE_MIN(dev_info->max_rx_queues, @@ -39,9 +40,9 @@ + dev_info->max_tx_queues = RTE_MIN(dev_info->max_tx_queues, + RTE_MAX_QUEUES_PER_PORT); + + RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get); + (*dev->dev_ops->dev_infos_get)(dev, dev_info); dev_info->driver_name = dev->device->driver->name; - dev_info->nb_rx_queues = dev->data->nb_rx_queues; - dev_info->nb_tx_queues = dev->data->nb_tx_queues; -- 2.20.1