DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process
@ 2020-04-29  6:37 alvinx.zhang
       [not found] ` <b3a05966a7494824abb3e92f83729b32@intel.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: alvinx.zhang @ 2020-04-29  6:37 UTC (permalink / raw)
  To: dev; +Cc: beilei.xing, wenzhuo.lu

From: Alvin Zhang <alvinx.zhang@intel.com>

Enable detach device on secondary process.

Fixes: b9eee2cb8c29 (e1000: support port hotplug)
Cc: bernard.iremonger@intel.com
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 drivers/net/e1000/em_ethdev.c  | 2 +-
 drivers/net/e1000/igb_ethdev.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 188cda3..902b1cd 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -321,7 +321,7 @@ static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev,
 	PMD_INIT_FUNC_TRACE();
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return -EPERM;
+		return 0;
 
 	eth_em_close(eth_dev);
 
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 520fba8..a5551e8 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -923,7 +923,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev *eth_dev)
 	PMD_INIT_FUNC_TRACE();
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return -EPERM;
+		return 0;
 
 	eth_igb_close(eth_dev);
 
@@ -1044,7 +1044,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev *eth_dev)
 	PMD_INIT_FUNC_TRACE();
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return -EPERM;
+		return 0;
 
 	igbvf_dev_close(eth_dev);
 
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process
       [not found] ` <b3a05966a7494824abb3e92f83729b32@intel.com>
@ 2020-05-08  3:32   ` Mei, JianweiX
  0 siblings, 0 replies; 6+ messages in thread
From: Mei, JianweiX @ 2020-05-08  3:32 UTC (permalink / raw)
  To: dev

Tested-by: Mei Jianwei <jianweix.mei@intel.com>

-----Original Message-----
From: Jiang, YuX 
Sent: Thursday, May 7, 2020 4:45 PM
To: Mei, JianweiX <jianweix.mei@intel.com>
Subject: FW: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process



-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of alvinx.zhang@intel.com
Sent: Wednesday, April 29, 2020 2:37 PM
To: dev@dpdk.org
Cc: Xing, Beilei <beilei.xing@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>
Subject: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process

From: Alvin Zhang <alvinx.zhang@intel.com>

Enable detach device on secondary process.

Fixes: b9eee2cb8c29 (e1000: support port hotplug)
Cc: bernard.iremonger@intel.com
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 drivers/net/e1000/em_ethdev.c  | 2 +-
 drivers/net/e1000/igb_ethdev.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 188cda3..902b1cd 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -321,7 +321,7 @@ static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev,
 	PMD_INIT_FUNC_TRACE();
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return -EPERM;
+		return 0;
 
 	eth_em_close(eth_dev);
 
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 520fba8..a5551e8 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -923,7 +923,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev *eth_dev)
 	PMD_INIT_FUNC_TRACE();
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return -EPERM;
+		return 0;
 
 	eth_igb_close(eth_dev);
 
@@ -1044,7 +1044,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev *eth_dev)
 	PMD_INIT_FUNC_TRACE();
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return -EPERM;
+		return 0;
 
 	igbvf_dev_close(eth_dev);
 
--
1.8.3.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process
  2020-04-29  6:37 [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process alvinx.zhang
       [not found] ` <b3a05966a7494824abb3e92f83729b32@intel.com>
@ 2020-05-12  3:03 ` Jeff Guo
  2020-05-12  3:44   ` Zhang, AlvinX
  2020-05-12  5:23 ` Ye Xiaolong
  2 siblings, 1 reply; 6+ messages in thread
From: Jeff Guo @ 2020-05-12  3:03 UTC (permalink / raw)
  To: alvinx.zhang, dev; +Cc: beilei.xing, wenzhuo.lu

hi, alvin


On 4/29/2020 2:37 PM, alvinx.zhang@intel.com wrote:
> From: Alvin Zhang <alvinx.zhang@intel.com>
>
> Enable detach device on secondary process.
>
> Fixes: b9eee2cb8c29 (e1000: support port hotplug)
> Cc: bernard.iremonger@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> ---
>   drivers/net/e1000/em_ethdev.c  | 2 +-
>   drivers/net/e1000/igb_ethdev.c | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
> index 188cda3..902b1cd 100644
> --- a/drivers/net/e1000/em_ethdev.c
> +++ b/drivers/net/e1000/em_ethdev.c
> @@ -321,7 +321,7 @@ static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev,
>   	PMD_INIT_FUNC_TRACE();
>   
>   	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> -		return -EPERM;
> +		return 0;
>   


I guess you mean pass through the process of the RTE_PROC_SECONDARY case 
when detach device, but what about the other case like RTE_PROC_INVALID 
or RTE_PROC_AUTO ?


>   	eth_em_close(eth_dev);
>   
> diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
> index 520fba8..a5551e8 100644
> --- a/drivers/net/e1000/igb_ethdev.c
> +++ b/drivers/net/e1000/igb_ethdev.c
> @@ -923,7 +923,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev *eth_dev)
>   	PMD_INIT_FUNC_TRACE();
>   
>   	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> -		return -EPERM;
> +		return 0;
>   
>   	eth_igb_close(eth_dev);
>   
> @@ -1044,7 +1044,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev *eth_dev)
>   	PMD_INIT_FUNC_TRACE();
>   
>   	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> -		return -EPERM;
> +		return 0;
>   
>   	igbvf_dev_close(eth_dev);
>   

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process
  2020-05-12  3:03 ` Jeff Guo
@ 2020-05-12  3:44   ` Zhang, AlvinX
  2020-05-12  4:01     ` Jeff Guo
  0 siblings, 1 reply; 6+ messages in thread
From: Zhang, AlvinX @ 2020-05-12  3:44 UTC (permalink / raw)
  To: Guo, Jia, dev; +Cc: Xing, Beilei, Lu, Wenzhuo

Hi Jia,

It shouldn't return error for secondary. 'rte_eth_dev_release_port()' has already process type in it, so returning '0' should work better which will cause some process specific variables cleared.
In otherwise, only primary process need to really close the device.

BR,
Alvin

> -----Original Message-----
> From: Guo, Jia
> Sent: Tuesday, May 12, 2020 11:03 AM
> To: Zhang, AlvinX <alvinx.zhang@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-
> process
> 
> hi, alvin
> 
> 
> On 4/29/2020 2:37 PM, alvinx.zhang@intel.com wrote:
> > From: Alvin Zhang <alvinx.zhang@intel.com>
> >
> > Enable detach device on secondary process.
> >
> > Fixes: b9eee2cb8c29 (e1000: support port hotplug)
> > Cc: bernard.iremonger@intel.com
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> > ---
> >   drivers/net/e1000/em_ethdev.c  | 2 +-
> >   drivers/net/e1000/igb_ethdev.c | 4 ++--
> >   2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/e1000/em_ethdev.c
> > b/drivers/net/e1000/em_ethdev.c index 188cda3..902b1cd 100644
> > --- a/drivers/net/e1000/em_ethdev.c
> > +++ b/drivers/net/e1000/em_ethdev.c
> > @@ -321,7 +321,7 @@ static int eth_em_set_mc_addr_list(struct
> rte_eth_dev *dev,
> >   	PMD_INIT_FUNC_TRACE();
> >
> >   	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> > -		return -EPERM;
> > +		return 0;
> >
> 
> 
> I guess you mean pass through the process of the RTE_PROC_SECONDARY
> case when detach device, but what about the other case like
> RTE_PROC_INVALID or RTE_PROC_AUTO ?
> 
> 
> >   	eth_em_close(eth_dev);
> >
> > diff --git a/drivers/net/e1000/igb_ethdev.c
> > b/drivers/net/e1000/igb_ethdev.c index 520fba8..a5551e8 100644
> > --- a/drivers/net/e1000/igb_ethdev.c
> > +++ b/drivers/net/e1000/igb_ethdev.c
> > @@ -923,7 +923,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev
> *eth_dev)
> >   	PMD_INIT_FUNC_TRACE();
> >
> >   	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> > -		return -EPERM;
> > +		return 0;
> >
> >   	eth_igb_close(eth_dev);
> >
> > @@ -1044,7 +1044,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev
> *eth_dev)
> >   	PMD_INIT_FUNC_TRACE();
> >
> >   	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> > -		return -EPERM;
> > +		return 0;
> >
> >   	igbvf_dev_close(eth_dev);
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process
  2020-05-12  3:44   ` Zhang, AlvinX
@ 2020-05-12  4:01     ` Jeff Guo
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Guo @ 2020-05-12  4:01 UTC (permalink / raw)
  To: Zhang, AlvinX, dev; +Cc: Xing, Beilei, Lu, Wenzhuo

hi alvin

On 5/12/2020 11:44 AM, Zhang, AlvinX wrote:
> Hi Jia,
>
> It shouldn't return error for secondary. 'rte_eth_dev_release_port()' has already process type in it, so returning '0' should work better which will cause some process specific variables cleared.
> In otherwise, only primary process need to really close the device.
>
> BR,
> Alvin


Sounds that if driver no need to close, no need to show any useless log 
to user, make sense.


>> -----Original Message-----
>> From: Guo, Jia
>> Sent: Tuesday, May 12, 2020 11:03 AM
>> To: Zhang, AlvinX <alvinx.zhang@intel.com>; dev@dpdk.org
>> Cc: Xing, Beilei <beilei.xing@intel.com>; Lu, Wenzhuo
>> <wenzhuo.lu@intel.com>
>> Subject: Re: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-
>> process
>>
>> hi, alvin
>>
>>
>> On 4/29/2020 2:37 PM, alvinx.zhang@intel.com wrote:
>>> From: Alvin Zhang <alvinx.zhang@intel.com>
>>>
>>> Enable detach device on secondary process.
>>>
>>> Fixes: b9eee2cb8c29 (e1000: support port hotplug)
>>> Cc: bernard.iremonger@intel.com
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
>>> ---
>>>    drivers/net/e1000/em_ethdev.c  | 2 +-
>>>    drivers/net/e1000/igb_ethdev.c | 4 ++--
>>>    2 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/net/e1000/em_ethdev.c
>>> b/drivers/net/e1000/em_ethdev.c index 188cda3..902b1cd 100644
>>> --- a/drivers/net/e1000/em_ethdev.c
>>> +++ b/drivers/net/e1000/em_ethdev.c
>>> @@ -321,7 +321,7 @@ static int eth_em_set_mc_addr_list(struct
>> rte_eth_dev *dev,
>>>    	PMD_INIT_FUNC_TRACE();
>>>
>>>    	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
>>> -		return -EPERM;
>>> +		return 0;
>>>
>>
>> I guess you mean pass through the process of the RTE_PROC_SECONDARY
>> case when detach device, but what about the other case like
>> RTE_PROC_INVALID or RTE_PROC_AUTO ?
>>
>>
>>>    	eth_em_close(eth_dev);
>>>
>>> diff --git a/drivers/net/e1000/igb_ethdev.c
>>> b/drivers/net/e1000/igb_ethdev.c index 520fba8..a5551e8 100644
>>> --- a/drivers/net/e1000/igb_ethdev.c
>>> +++ b/drivers/net/e1000/igb_ethdev.c
>>> @@ -923,7 +923,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev
>> *eth_dev)
>>>    	PMD_INIT_FUNC_TRACE();
>>>
>>>    	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
>>> -		return -EPERM;
>>> +		return 0;
>>>
>>>    	eth_igb_close(eth_dev);
>>>
>>> @@ -1044,7 +1044,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev
>> *eth_dev)
>>>    	PMD_INIT_FUNC_TRACE();
>>>
>>>    	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
>>> -		return -EPERM;
>>> +		return 0;
>>>
>>>    	igbvf_dev_close(eth_dev);


Reviewed-by: Jeff Guo <jia.guo@intel.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process
  2020-04-29  6:37 [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process alvinx.zhang
       [not found] ` <b3a05966a7494824abb3e92f83729b32@intel.com>
  2020-05-12  3:03 ` Jeff Guo
@ 2020-05-12  5:23 ` Ye Xiaolong
  2 siblings, 0 replies; 6+ messages in thread
From: Ye Xiaolong @ 2020-05-12  5:23 UTC (permalink / raw)
  To: alvinx.zhang; +Cc: dev, beilei.xing, wenzhuo.lu

On 04/29, alvinx.zhang@intel.com wrote:
>From: Alvin Zhang <alvinx.zhang@intel.com>
Cc: stable@dpdk.org
>
>Enable detach device on secondary process.
>
>Fixes: b9eee2cb8c29 (e1000: support port hotplug)
>Cc: bernard.iremonger@intel.com
>Cc: stable@dpdk.org
>
>Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
>---
> drivers/net/e1000/em_ethdev.c  | 2 +-
> drivers/net/e1000/igb_ethdev.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
>index 188cda3..902b1cd 100644
>--- a/drivers/net/e1000/em_ethdev.c
>+++ b/drivers/net/e1000/em_ethdev.c
>@@ -321,7 +321,7 @@ static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev,
> 	PMD_INIT_FUNC_TRACE();
> 
> 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
>-		return -EPERM;
>+		return 0;
> 
> 	eth_em_close(eth_dev);
> 
>diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
>index 520fba8..a5551e8 100644
>--- a/drivers/net/e1000/igb_ethdev.c
>+++ b/drivers/net/e1000/igb_ethdev.c
>@@ -923,7 +923,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev *eth_dev)
> 	PMD_INIT_FUNC_TRACE();
> 
> 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
>-		return -EPERM;
>+		return 0;
> 
> 	eth_igb_close(eth_dev);
> 
>@@ -1044,7 +1044,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev *eth_dev)
> 	PMD_INIT_FUNC_TRACE();
> 
> 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
>-		return -EPERM;
>+		return 0;
> 
> 	igbvf_dev_close(eth_dev);
> 
>-- 
>1.8.3.1
>

Applied to dpdk-next-net-intel, Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-12  5:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29  6:37 [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process alvinx.zhang
     [not found] ` <b3a05966a7494824abb3e92f83729b32@intel.com>
2020-05-08  3:32   ` Mei, JianweiX
2020-05-12  3:03 ` Jeff Guo
2020-05-12  3:44   ` Zhang, AlvinX
2020-05-12  4:01     ` Jeff Guo
2020-05-12  5:23 ` Ye Xiaolong

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).