From: Gaetan Rivet <gaetan.rivet@6wind.com>
To: dev@dpdk.org
Cc: Gaetan Rivet <gaetan.rivet@6wind.com>,
stable@dpdk.org, Bruce Richardson <bruce.richardson@intel.com>
Subject: [dpdk-stable] [PATCH v2 11/11] net/ring: fix dev handle in eth_dev
Date: Wed, 31 May 2017 15:17:56 +0200 [thread overview]
Message-ID: <3162b325eecd194d947f7e6290e54ca6ed388936.1496235017.git.gaetan.rivet@6wind.com> (raw)
In-Reply-To: <cover.1496235017.git.gaetan.rivet@6wind.com>
In-Reply-To: <cover.1496235017.git.gaetan.rivet@6wind.com>
The ring PMD uses special eth_dev allocators, which cannot be updated to
accept an rte_vdev_device.
Circumvent the limitation and store the rte_device handle in the
rte_eth_dev structure.
Fixes: 050fe6e9ff97 ("drivers/net: use ethdev allocation helper for
vdev")
Cc: stable@dpdk.org
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/ring/rte_eth_ring.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 87d2258..9ebc60e 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -515,6 +515,8 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
RTE_LOG(INFO, PMD, "Initializing pmd_ring for %s\n", name);
if (params == NULL || params[0] == '\0') {
+ struct rte_eth_dev *eth_dev;
+
ret = eth_dev_ring_create(name, rte_socket_id(), DEV_CREATE);
if (ret == -1) {
RTE_LOG(INFO, PMD,
@@ -522,6 +524,11 @@ rte_pmd_ring_probe(struct rte_vdev_device *dev)
ret = eth_dev_ring_create(name, rte_socket_id(),
DEV_ATTACH);
}
+ /* find an ethdev entry */
+ eth_dev = rte_eth_dev_allocated(name);
+ if (eth_dev == NULL)
+ return -ENODEV;
+ eth_dev->device = &dev->device;
}
else {
kvlist = rte_kvargs_parse(params, valid_arguments);
--
2.1.4
next parent reply other threads:[~2017-05-31 13:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1495637723.git.gaetan.rivet@6wind.com>
[not found] ` <cover.1496235017.git.gaetan.rivet@6wind.com>
2017-05-31 13:17 ` Gaetan Rivet [this message]
[not found] ` <cover.1496876710.git.gaetan.rivet@6wind.com>
2017-06-07 23:53 ` [dpdk-stable] [PATCH v3 10/10] " Gaetan Rivet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3162b325eecd194d947f7e6290e54ca6ed388936.1496235017.git.gaetan.rivet@6wind.com \
--to=gaetan.rivet@6wind.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).