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 4AF54A04F5 for ; Wed, 11 Dec 2019 22:29:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3EC9B1BE83; Wed, 11 Dec 2019 22:29:29 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 9834E1BE83 for ; Wed, 11 Dec 2019 22:29:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576099768; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2BhIBu4J0a2Dl7OOgMVgU3kGv9MHl5J4XM1aaqg06wU=; b=e++xiH4rvmS5oED3ycxx5xYJsXMh9HvQ6T27KelwvKVKADkEpabygTxR5vZRJtF9yuZVuI 9oebvIw/Vd4iht7Wfcf3+j+GZTLiXH7HBgeLVS7DY6p4H6e1DsKjLNdR0mSlGioTF4R/FZ j4hZPRMwuvNc3gljFMkqm+rJxhqi6C8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-316-f_ImShzmNRm-mi5ADa_86Q-1; Wed, 11 Dec 2019 16:29:26 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A62A7107ACC4; Wed, 11 Dec 2019 21:29:25 +0000 (UTC) Received: from rh.redhat.com (ovpn-116-64.ams2.redhat.com [10.36.116.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06A3D1001920; Wed, 11 Dec 2019 21:29:21 +0000 (UTC) From: Kevin Traynor To: Thomas Monjalon Cc: Raslan Darawsheh , Ferruh Yigit , David Marchand , dpdk stable Date: Wed, 11 Dec 2019 21:26:58 +0000 Message-Id: <20191211212702.27851-66-ktraynor@redhat.com> In-Reply-To: <20191211212702.27851-1-ktraynor@redhat.com> References: <20191211212702.27851-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: f_ImShzmNRm-mi5ADa_86Q-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'ethdev: limit maximum number of queues' has been queued to LTS release 18.11.6 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 18.11.6 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/17/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 rebasi= ng (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/1d985701169f7e2230= 7996d48598abfdb79927f0 Thanks. Kevin. --- >From 1d985701169f7e22307996d48598abfdb79927f0 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_ethdev/rte_ethdev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.= c index 16e6a5d38..a5df3e562 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -2535,4 +2535,11 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_et= h_dev_info *dev_info) =09RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get); =09(*dev->dev_ops->dev_infos_get)(dev, dev_info); + +=09/* Maximum number of queues should be <=3D RTE_MAX_QUEUES_PER_PORT */ +=09dev_info->max_rx_queues =3D RTE_MIN(dev_info->max_rx_queues, +=09=09=09RTE_MAX_QUEUES_PER_PORT); +=09dev_info->max_tx_queues =3D RTE_MIN(dev_info->max_tx_queues, +=09=09=09RTE_MAX_QUEUES_PER_PORT); + =09dev_info->driver_name =3D dev->device->driver->name; =09dev_info->nb_rx_queues =3D dev->data->nb_rx_queues; --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-11 21:24:17.842739129 +0000 +++ 0066-ethdev-limit-maximum-number-of-queues.patch=092019-12-11 21:24:12.= 754649420 +0000 @@ -1 +1 @@ -From 20bbb9e0450f2ccda374584173dc0a5cd93c9f06 Mon Sep 17 00:00:00 2001 +From 1d985701169f7e22307996d48598abfdb79927f0 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 20bbb9e0450f2ccda374584173dc0a5cd93c9f06 ] + @@ -18 +19,0 @@ -Cc: stable@dpdk.org @@ -25,2 +26,2 @@ - lib/librte_ethdev/rte_ethdev.c | 6 ++++++ - 1 file changed, 6 insertions(+) + lib/librte_ethdev/rte_ethdev.c | 7 +++++++ + 1 file changed, 7 insertions(+) @@ -29 +30 @@ -index 8d2ce31a8..6e9cb243e 100644 +index 16e6a5d38..a5df3e562 100644 @@ -32,3 +33,4 @@ -@@ -2987,4 +2987,10 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_e= th_dev_info *dev_info) - =09} -=20 +@@ -2535,4 +2535,11 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_e= th_dev_info *dev_info) + =09RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get); + =09(*dev->dev_ops->dev_infos_get)(dev, dev_info); ++