From: Vipin Varghese <vipin.varghese@intel.com>
To: dev@dpdk.org, ferruh.yigit@intel.com, keith.wiles@intel.com
Cc: pascal.mazon@6wind.com, zhihong.wang@intel.com,
Vipin Varghese <vipin.varghese@intel.com>
Subject: [dpdk-dev] [PATCH v2] net/tap: fix the vdev data sharing for tun
Date: Tue, 22 May 2018 16:31:54 +0530 [thread overview]
Message-ID: <1526986914-31856-1-git-send-email-vipin.varghese@intel.com> (raw)
In-Reply-To: <1526107055-26637-1-git-send-email-vipin.varghese@intel.com>
Fixes: ee27edbe0c10 ("drivers/net: share vdev data to secondary process")
Enables TUN PMD sharing by attaching the port from the shared data.
Cc: zhihong.wang@intel.com
Cc: ferruh.yigit@intel.com
Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
---
Changes in V2:
- removal of To Do comment - Keith Wiles, Ferruh Yigit
---
drivers/net/tap/rte_eth_tap.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 8d8f67b..41300a6 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1650,6 +1650,7 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)
struct rte_kvargs *kvlist = NULL;
char tun_name[RTE_ETH_NAME_MAX_LEN];
char remote_iface[RTE_ETH_NAME_MAX_LEN];
+ struct rte_eth_dev *eth_dev;
strcpy(tuntap_name, "TUN");
@@ -1657,6 +1658,17 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)
params = rte_vdev_device_args(dev);
memset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN);
+ if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
+ strlen(params) == 0) {
+ eth_dev = rte_eth_dev_attach_secondary(name);
+ if (!eth_dev) {
+ TAP_LOG(ERR, "Failed to probe %s", name);
+ return -1;
+ }
+ eth_dev->dev_ops = &ops;
+ return 0;
+ }
+
snprintf(tun_name, sizeof(tun_name), "%s%u",
DEFAULT_TUN_NAME, tun_unit++);
--
2.7.4
next prev parent reply other threads:[~2018-05-22 11:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-12 6:37 [dpdk-dev] [PATCH] " Vipin Varghese
2018-05-15 12:35 ` Wiles, Keith
2018-05-15 12:56 ` Varghese, Vipin
2018-05-22 9:50 ` Ferruh Yigit
2018-05-22 11:01 ` Vipin Varghese [this message]
2018-05-22 13:40 ` [dpdk-dev] [PATCH v2] " Wiles, Keith
2018-05-22 22:26 ` Ferruh Yigit
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=1526986914-31856-1-git-send-email-vipin.varghese@intel.com \
--to=vipin.varghese@intel.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=keith.wiles@intel.com \
--cc=pascal.mazon@6wind.com \
--cc=zhihong.wang@intel.com \
/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).