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 22A2AA04A3 for ; Fri, 5 Jun 2020 20:27:09 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 19AB01D510; Fri, 5 Jun 2020 20:27:09 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id A898D1D515 for ; Fri, 5 Jun 2020 20:27:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591381627; 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=UnuscJnBn30PGK/S+0shjWBDnj3m1po+XWoyvpwJnP0=; b=KvrFwPBeWWR28c22/Eqwgqj1UIAwmDtjiOs/lxLIK+hA/eDQtNXciDg+lXMbx4Ip9/OfOJ PFaLx+ikGqNJquGs8T8XvLTJVoRAYrxXTlHg0npBN2CMSm7DleH0Fw8CsVAvRvYggIJaZl QMg5RkD1JRrjDEeu0ZdCJcpf69dBhzo= 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-431-KzWbFE8ZNkyIc9JMvylYrQ-1; Fri, 05 Jun 2020 14:27:04 -0400 X-MC-Unique: KzWbFE8ZNkyIc9JMvylYrQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 813C81005512; Fri, 5 Jun 2020 18:27:03 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D8D8619C3; Fri, 5 Jun 2020 18:27:02 +0000 (UTC) From: Kevin Traynor To: Gaetan Rivet Cc: Ferruh Yigit , dpdk stable Date: Fri, 5 Jun 2020 19:24:40 +0100 Message-Id: <20200605182525.22483-43-ktraynor@redhat.com> In-Reply-To: <20200605182525.22483-1-ktraynor@redhat.com> References: <20200605182525.22483-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ring: fix device pointer on allocation' has been queued to LTS release 18.11.9 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.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/10/20. 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. 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/160d1b6410cd4db1ec84dba0038f377605741c4f Thanks. Kevin. --- >From 160d1b6410cd4db1ec84dba0038f377605741c4f Mon Sep 17 00:00:00 2001 From: Gaetan Rivet Date: Wed, 6 May 2020 20:09:49 +0200 Subject: [PATCH] net/ring: fix device pointer on allocation [ upstream commit 8459f5ab32211fb10bbfe388fa0e017475d8507c ] When a net_ring device is allocated, its device pointer is not set before calling rte_eth_dev_probing_finish, which is incorrect. The following: commit 96cb19521147 ("net/ring: use EAL APIs in PMD specific API") commit a6992e961050 ("net/ring: set ethernet device field") already fixed the same issue in 17.08, which was fine at the time. Adding the hook rte_eth_dev_probing_finish() however created this bug, as the eth_dev exposed when this hook is executed is expected to be complete. Remove the prior attempts to fix the issue in rte_pmd_ring_probe() and write the pointer properly in do_eth_dev_ring_create(). Fixes: fbe90cdd776c ("ethdev: add probing finish function") Signed-off-by: Gaetan Rivet Reviewed-by: Ferruh Yigit --- drivers/net/ring/rte_eth_ring.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 452114d0c5..7298ee93e2 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -252,4 +252,5 @@ static const struct eth_dev_ops ops = { static int do_eth_dev_ring_create(const char *name, + struct rte_vdev_device *vdev, struct rte_ring * const rx_queues[], const unsigned int nb_rx_queues, @@ -297,4 +298,5 @@ do_eth_dev_ring_create(const char *name, /* now put it all together + * - store EAL device in eth_dev, * - store queue data in internals, * - store numa_node info in eth_dev_data @@ -303,4 +305,6 @@ do_eth_dev_ring_create(const char *name, */ + eth_dev->device = &vdev->device; + data = eth_dev->data; data->rx_queues = rx_queues_local; @@ -412,5 +416,7 @@ rte_eth_from_ring(struct rte_ring *r) static int -eth_dev_ring_create(const char *name, const unsigned int numa_node, +eth_dev_ring_create(const char *name, + struct rte_vdev_device *vdev, + const unsigned int numa_node, enum dev_action action, struct rte_eth_dev **eth_dev) { @@ -442,5 +448,5 @@ eth_dev_ring_create(const char *name, const unsigned int numa_node, } - if (do_eth_dev_ring_create(name, rxtx, num_rings, rxtx, num_rings, + if (do_eth_dev_ring_create(name, vdev, rxtx, num_rings, rxtx, num_rings, numa_node, action, eth_dev) < 0) return -1; @@ -563,10 +569,10 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) if (params == NULL || params[0] == '\0') { - ret = eth_dev_ring_create(name, rte_socket_id(), DEV_CREATE, + ret = eth_dev_ring_create(name, dev, rte_socket_id(), DEV_CREATE, ð_dev); if (ret == -1) { PMD_LOG(INFO, "Attach to pmd_ring for %s", name); - ret = eth_dev_ring_create(name, rte_socket_id(), + ret = eth_dev_ring_create(name, dev, rte_socket_id(), DEV_ATTACH, ð_dev); } @@ -577,5 +583,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) PMD_LOG(INFO, "Ignoring unsupported parameters when creatingrings-backed ethernet device"); - ret = eth_dev_ring_create(name, rte_socket_id(), + ret = eth_dev_ring_create(name, dev, rte_socket_id(), DEV_CREATE, ð_dev); if (ret == -1) { @@ -583,11 +589,8 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) "Attach to pmd_ring for %s", name); - ret = eth_dev_ring_create(name, rte_socket_id(), + ret = eth_dev_ring_create(name, dev, rte_socket_id(), DEV_ATTACH, ð_dev); } - if (eth_dev) - eth_dev->device = &dev->device; - return ret; } @@ -600,5 +603,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) goto out_free; - ret = do_eth_dev_ring_create(name, + ret = do_eth_dev_ring_create(name, dev, internal_args->rx_queues, internal_args->nb_rx_queues, @@ -630,4 +633,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) for (info->count = 0; info->count < info->total; info->count++) { ret = eth_dev_ring_create(info->list[info->count].name, + dev, info->list[info->count].node, info->list[info->count].action, @@ -638,5 +642,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) "Attach to pmd_ring for %s", name); - ret = eth_dev_ring_create(name, + ret = eth_dev_ring_create(name, dev, info->list[info->count].node, DEV_ATTACH, @@ -647,7 +651,4 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) } - if (eth_dev) - eth_dev->device = &dev->device; - out_free: rte_kvargs_free(kvlist); -- 2.21.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-06-05 19:20:53.200289319 +0100 +++ 0043-net-ring-fix-device-pointer-on-allocation.patch 2020-06-05 19:20:50.820040586 +0100 @@ -1 +1 @@ -From 8459f5ab32211fb10bbfe388fa0e017475d8507c Mon Sep 17 00:00:00 2001 +From 160d1b6410cd4db1ec84dba0038f377605741c4f Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 8459f5ab32211fb10bbfe388fa0e017475d8507c ] + @@ -22 +23,0 @@ -Cc: stable@dpdk.org @@ -31 +32 @@ -index 41acbc513d..f0fafa0c0d 100644 +index 452114d0c5..7298ee93e2 100644 @@ -34 +35 @@ -@@ -247,4 +247,5 @@ static const struct eth_dev_ops ops = { +@@ -252,4 +252,5 @@ static const struct eth_dev_ops ops = { @@ -40 +41 @@ -@@ -292,4 +293,5 @@ do_eth_dev_ring_create(const char *name, +@@ -297,4 +298,5 @@ do_eth_dev_ring_create(const char *name, @@ -46 +47 @@ -@@ -298,4 +300,6 @@ do_eth_dev_ring_create(const char *name, +@@ -303,4 +305,6 @@ do_eth_dev_ring_create(const char *name, @@ -53 +54 @@ -@@ -409,5 +413,7 @@ rte_eth_from_ring(struct rte_ring *r) +@@ -412,5 +416,7 @@ rte_eth_from_ring(struct rte_ring *r) @@ -62 +63 @@ -@@ -439,5 +445,5 @@ eth_dev_ring_create(const char *name, const unsigned int numa_node, +@@ -442,5 +448,5 @@ eth_dev_ring_create(const char *name, const unsigned int numa_node, @@ -69 +70 @@ -@@ -561,10 +567,10 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) +@@ -563,10 +569,10 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) @@ -82 +83 @@ -@@ -575,5 +581,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) +@@ -577,5 +583,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) @@ -89 +90 @@ -@@ -581,11 +587,8 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) +@@ -583,11 +589,8 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) @@ -102 +103 @@ -@@ -598,5 +601,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) +@@ -600,5 +603,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) @@ -109 +110 @@ -@@ -628,4 +631,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) +@@ -630,4 +633,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) @@ -115 +116 @@ -@@ -636,5 +640,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) +@@ -638,5 +642,5 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) @@ -122 +123 @@ -@@ -645,7 +649,4 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev) +@@ -647,7 +651,4 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)