* [dpdk-dev] [PATCH] net/tap: fix the vdev data sharing for tun
@ 2018-05-12 6:37 Vipin Varghese
2018-05-15 12:35 ` Wiles, Keith
2018-05-22 11:01 ` [dpdk-dev] [PATCH v2] " Vipin Varghese
0 siblings, 2 replies; 7+ messages in thread
From: Vipin Varghese @ 2018-05-12 6:37 UTC (permalink / raw)
To: ferruh.yigit, pascal.mazon, zhihong.wang, dev; +Cc: Vipin Varghese
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>
---
---
drivers/net/tap/rte_eth_tap.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index db397d6..ea6d899 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1657,6 +1657,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;
tap_type = 0;
strcpy(tuntap_name, "TUN");
@@ -1665,6 +1666,18 @@ 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;
+ }
+ /* TODO: request info from primary to set up Rx and Tx */
+ eth_dev->dev_ops = &ops;
+ return 0;
+ }
+
snprintf(tun_name, sizeof(tun_name), "%s%u",
DEFAULT_TUN_NAME, tun_unit++);
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] net/tap: fix the vdev data sharing for tun
2018-05-12 6:37 [dpdk-dev] [PATCH] net/tap: fix the vdev data sharing for tun Vipin Varghese
@ 2018-05-15 12:35 ` Wiles, Keith
2018-05-15 12:56 ` Varghese, Vipin
2018-05-22 11:01 ` [dpdk-dev] [PATCH v2] " Vipin Varghese
1 sibling, 1 reply; 7+ messages in thread
From: Wiles, Keith @ 2018-05-15 12:35 UTC (permalink / raw)
To: Varghese, Vipin; +Cc: Yigit, Ferruh, pascal.mazon, Wang, Zhihong, dev
> On May 12, 2018, at 1:37 AM, Vipin Varghese <vipin.varghese@intel.com> wrote:
>
> 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>
> ---
> ---
> drivers/net/tap/rte_eth_tap.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
> index db397d6..ea6d899 100644
> --- a/drivers/net/tap/rte_eth_tap.c
> +++ b/drivers/net/tap/rte_eth_tap.c
> @@ -1657,6 +1657,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;
>
> tap_type = 0;
> strcpy(tuntap_name, "TUN");
> @@ -1665,6 +1666,18 @@ 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;
> + }
> + /* TODO: request info from primary to set up Rx and Tx */
What is the rule (if we have one) about having TODO, FIXME, … like comments in the code? Maybe remove the todo and create a enhancement request for later.
> + eth_dev->dev_ops = &ops;
> + return 0;
> + }
> +
> snprintf(tun_name, sizeof(tun_name), "%s%u",
> DEFAULT_TUN_NAME, tun_unit++);
>
> --
> 2.7.4
>
Regards,
Keith
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] net/tap: fix the vdev data sharing for tun
2018-05-15 12:35 ` Wiles, Keith
@ 2018-05-15 12:56 ` Varghese, Vipin
2018-05-22 9:50 ` Ferruh Yigit
0 siblings, 1 reply; 7+ messages in thread
From: Varghese, Vipin @ 2018-05-15 12:56 UTC (permalink / raw)
To: Wiles, Keith; +Cc: Yigit, Ferruh, pascal.mazon, Wang, Zhihong, dev
HI Keith,
Thanks for the input, please find my answer inline to email therad
<Snipped>
> > + /* TODO: request info from primary to set up Rx and Tx */
>
> What is the rule (if we have one) about having TODO, FIXME, … like comments in
> the code? Maybe remove the todo and create a enhancement request for later.
>
I am not aware of the 'To Do' planned. This came in as part of logic block from previous commit for all PMD to support Secondary
<Snipped>
>
> Regards,
> Keith
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] net/tap: fix the vdev data sharing for tun
2018-05-15 12:56 ` Varghese, Vipin
@ 2018-05-22 9:50 ` Ferruh Yigit
0 siblings, 0 replies; 7+ messages in thread
From: Ferruh Yigit @ 2018-05-22 9:50 UTC (permalink / raw)
To: Varghese, Vipin, Wiles, Keith; +Cc: pascal.mazon, Wang, Zhihong, dev
On 5/15/2018 1:56 PM, Varghese, Vipin wrote:
> HI Keith,
>
> Thanks for the input, please find my answer inline to email therad
>
> <Snipped>
>
>>> + /* TODO: request info from primary to set up Rx and Tx */
>>
>> What is the rule (if we have one) about having TODO, FIXME, … like comments in
>> the code? Maybe remove the todo and create a enhancement request for later.
>>
>
> I am not aware of the 'To Do' planned. This came in as part of logic block from previous commit for all PMD to support Secondary
Specially when there is a work not planned for this, agreed to drop todo, can
you please send a new version without that note please?
>
> <Snipped>
>
>>
>> Regards,
>> Keith
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH v2] net/tap: fix the vdev data sharing for tun
2018-05-12 6:37 [dpdk-dev] [PATCH] net/tap: fix the vdev data sharing for tun Vipin Varghese
2018-05-15 12:35 ` Wiles, Keith
@ 2018-05-22 11:01 ` Vipin Varghese
2018-05-22 13:40 ` Wiles, Keith
1 sibling, 1 reply; 7+ messages in thread
From: Vipin Varghese @ 2018-05-22 11:01 UTC (permalink / raw)
To: dev, ferruh.yigit, keith.wiles; +Cc: pascal.mazon, zhihong.wang, Vipin Varghese
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/tap: fix the vdev data sharing for tun
2018-05-22 11:01 ` [dpdk-dev] [PATCH v2] " Vipin Varghese
@ 2018-05-22 13:40 ` Wiles, Keith
2018-05-22 22:26 ` Ferruh Yigit
0 siblings, 1 reply; 7+ messages in thread
From: Wiles, Keith @ 2018-05-22 13:40 UTC (permalink / raw)
To: Varghese, Vipin; +Cc: dev, Yigit, Ferruh, pascal.mazon, Wang, Zhihong
> On May 22, 2018, at 6:01 AM, Varghese, Vipin <vipin.varghese@intel.com> wrote:
>
> 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
Acked-by: Keith Wiles<keith.wiles@intel.com>
Regards,
Keith
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/tap: fix the vdev data sharing for tun
2018-05-22 13:40 ` Wiles, Keith
@ 2018-05-22 22:26 ` Ferruh Yigit
0 siblings, 0 replies; 7+ messages in thread
From: Ferruh Yigit @ 2018-05-22 22:26 UTC (permalink / raw)
To: Wiles, Keith, Varghese, Vipin; +Cc: dev, pascal.mazon, Wang, Zhihong
On 5/22/2018 2:40 PM, Wiles, Keith wrote:
>
>
>> On May 22, 2018, at 6:01 AM, Varghese, Vipin <vipin.varghese@intel.com> wrote:
>>
>> 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
>
> Acked-by: Keith Wiles<keith.wiles@intel.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-05-22 22:26 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-12 6:37 [dpdk-dev] [PATCH] net/tap: fix the vdev data sharing for tun 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 ` [dpdk-dev] [PATCH v2] " Vipin Varghese
2018-05-22 13:40 ` Wiles, Keith
2018-05-22 22:26 ` Ferruh Yigit
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).