From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id BD1281B4B6 for ; Thu, 29 Nov 2018 14:22:37 +0100 (CET) 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 mx1.redhat.com (Postfix) with ESMTPS id 26684804F8; Thu, 29 Nov 2018 13:22:37 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-230.ams2.redhat.com [10.36.117.230]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E7581019626; Thu, 29 Nov 2018 13:22:35 +0000 (UTC) From: Kevin Traynor To: Wenzhuo Lu Cc: Ferruh Yigit , Andrew Rybchenko , dpdk stable Date: Thu, 29 Nov 2018 13:20:26 +0000 Message-Id: <20181129132128.7609-26-ktraynor@redhat.com> In-Reply-To: <20181129132128.7609-1-ktraynor@redhat.com> References: <20181129132128.7609-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 29 Nov 2018 13:22:37 +0000 (UTC) Subject: [dpdk-stable] patch 'ethdev: fix device info getting' has been queued to stable release 18.08.1 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: , X-List-Received-Date: Thu, 29 Nov 2018 13:22:38 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 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/08/18. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 9cd64ef01b250f08db274fd9f28bad5e5f4f6d9c Mon Sep 17 00:00:00 2001 From: Wenzhuo Lu Date: Tue, 13 Nov 2018 11:12:37 +0000 Subject: [PATCH] ethdev: fix device info getting [ upstream commit 1a411a6fdbf18574153eb91bc9cc8b63025a2050 ] The device information cannot be gotten correctly before the configuration is set. Because on some NICs the information has dependence on the configuration. Fixes: 3be82f5cc5e3 ("ethdev: support PMD-tuned Tx/Rx parameters") Signed-off-by: Wenzhuo Lu Signed-off-by: Ferruh Yigit Reviewed-by: Andrew Rybchenko --- lib/librte_ethdev/rte_ethdev.c | 35 +++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 85e80b313..196b27c95 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1032,4 +1032,20 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_configure, -ENOTSUP); + if (dev->data->dev_started) { + RTE_ETHDEV_LOG(ERR, + "Port %u must be stopped to allow configuration\n", + port_id); + return -EBUSY; + } + + /* Store original config, as rollback required on failure */ + memcpy(&orig_conf, &dev->data->dev_conf, sizeof(dev->data->dev_conf)); + + /* + * Copy the dev_conf parameter into the dev structure. + * rte_eth_dev_info_get() requires dev_conf, copy it before dev_info get + */ + memcpy(&dev->data->dev_conf, &local_conf, sizeof(dev->data->dev_conf)); + rte_eth_dev_info_get(port_id, &dev_info); @@ -1053,5 +1069,6 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, "Number of RX queues requested (%u) is greater than max supported(%d)\n", nb_rx_q, RTE_MAX_QUEUES_PER_PORT); - return -EINVAL; + ret = -EINVAL; + goto rollback; } @@ -1060,20 +1077,8 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, "Number of TX queues requested (%u) is greater than max supported(%d)\n", nb_tx_q, RTE_MAX_QUEUES_PER_PORT); - return -EINVAL; + ret = -EINVAL; + goto rollback; } - if (dev->data->dev_started) { - RTE_ETHDEV_LOG(ERR, - "Port %u must be stopped to allow configuration\n", - port_id); - return -EBUSY; - } - - /* Store original config, as rollback required on failure */ - memcpy(&orig_conf, &dev->data->dev_conf, sizeof(dev->data->dev_conf)); - - /* Copy the dev_conf parameter into the dev structure */ - memcpy(&dev->data->dev_conf, &local_conf, sizeof(dev->data->dev_conf)); - /* * Check that the numbers of RX and TX queues are not greater -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-29 13:11:35.687043120 +0000 +++ 0025-ethdev-fix-device-info-getting.patch 2018-11-29 13:11:34.000000000 +0000 @@ -1,14 +1,15 @@ -From 1a411a6fdbf18574153eb91bc9cc8b63025a2050 Mon Sep 17 00:00:00 2001 +From 9cd64ef01b250f08db274fd9f28bad5e5f4f6d9c Mon Sep 17 00:00:00 2001 From: Wenzhuo Lu Date: Tue, 13 Nov 2018 11:12:37 +0000 Subject: [PATCH] ethdev: fix device info getting +[ upstream commit 1a411a6fdbf18574153eb91bc9cc8b63025a2050 ] + The device information cannot be gotten correctly before the configuration is set. Because on some NICs the information has dependence on the configuration. Fixes: 3be82f5cc5e3 ("ethdev: support PMD-tuned Tx/Rx parameters") -Cc: stable@dpdk.org Signed-off-by: Wenzhuo Lu Signed-off-by: Ferruh Yigit @@ -18,10 +19,10 @@ 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c -index 04dff1f5e..0f01138ea 100644 +index 85e80b313..196b27c95 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c -@@ -1105,4 +1105,20 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, +@@ -1032,4 +1032,20 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_configure, -ENOTSUP); + if (dev->data->dev_started) { @@ -42,7 +43,7 @@ + rte_eth_dev_info_get(port_id, &dev_info); -@@ -1126,5 +1142,6 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, +@@ -1053,5 +1069,6 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, "Number of RX queues requested (%u) is greater than max supported(%d)\n", nb_rx_q, RTE_MAX_QUEUES_PER_PORT); - return -EINVAL; @@ -50,7 +51,7 @@ + goto rollback; } -@@ -1133,20 +1150,8 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, +@@ -1060,20 +1077,8 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, "Number of TX queues requested (%u) is greater than max supported(%d)\n", nb_tx_q, RTE_MAX_QUEUES_PER_PORT); - return -EINVAL;