Skip to contentSkip to conversation

net/e1000: fix port hotplug for multi-process

PATCH Applied [email protected] 4 participants 6 messages Apr 29, 2020 – May 12, 2020 1 message not in the archive Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/e1000: fix port hotplug for multi-process

From: Alvin Zhang <[email protected]>

Enable detach device on secondary process.

Fixes b9eee2cb8c29 (e1000: support port hotplug)
---
 drivers/net/e1000/em_ethdev.c  | 2 +-
 drivers/net/e1000/igb_ethdev.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/e1000/em_ethdev.c +1 -1
index 188cda3..902b1cd 100644
@@ -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);
 
drivers/net/e1000/igb_ethdev.c +2 -2
index 520fba8..a5551e8 100644
@@ -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);
 
Signature · 1 line
1.8.3.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

Tested-by
#2 lore raw

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

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of [email protected]
Sent: Wednesday, April 29, 2020 2:37 PM
To: [email protected]
Cc: Xing, Beilei <[email protected]>; Lu, Wenzhuo <[email protected]>
Subject: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi-process

From: Alvin Zhang <[email protected]>

Enable detach device on secondary process.

Fixes b9eee2cb8c29 (e1000: support port hotplug)
---
 drivers/net/e1000/em_ethdev.c  | 2 +-
 drivers/net/e1000/igb_ethdev.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/e1000/em_ethdev.c +1 -1
@@ -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);
 
drivers/net/e1000/igb_ethdev.c +2 -2
@@ -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

#3 lore raw
In reply to [email protected]

hi, alvin

Quoted 19 lines · On 4/29/2020 2:37 PM, [email protected] wrote:

From: Alvin Zhang <[email protected]>

Enable detach device on secondary process.

Fixes b9eee2cb8c29 (e1000: support port hotplug)
---
  drivers/net/e1000/em_ethdev.c  | 2 +-
  drivers/net/e1000/igb_ethdev.c | 4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/e1000/em_ethdev.c +0 -0
index 188cda3..902b1cd 100644

drivers/net/e1000/em_ethdev.c static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev, · line 325

Quoted 6 lines
drivers/net/e1000/em_ethdev.c +1 -1
@@ -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 ?

Quoted 24 lines
drivers/net/e1000/em_ethdev.c +0 -0
  	eth_em_close(eth_dev);
 
drivers/net/e1000/igb_ethdev.c +2 -2
index 520fba8..a5551e8 100644
@@ -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);
 
#4 lore raw

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

Quoted 72 lines

-----Original Message-----
From: Guo, Jia
Sent: Tuesday, May 12, 2020 11:03 AM
To: Zhang, AlvinX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Lu, Wenzhuo <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi- process

hi, alvin

drivers/net/e1000/em_ethdev.c static int eth_em_set_mc_addr_list(struct

Quoted 19 lines · On 4/29/2020 2:37 PM, [email protected] wrote:

From: Alvin Zhang <[email protected]>

Enable detach device on secondary process.

Fixes b9eee2cb8c29 (e1000: support port hotplug)
---
  drivers/net/e1000/em_ethdev.c  | 2 +-
  drivers/net/e1000/igb_ethdev.c | 4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/net/e1000/em_ethdev.c index 188cda3..902b1cd 100644

drivers/net/e1000/em_ethdev.c +0 -0
@@ -321,7 +321,7 @@ static int eth_em_set_mc_addr_list(struct

rte_eth_dev *dev,

drivers/net/e1000/em_ethdev.c static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev, · line 325

Quoted 6 lines
drivers/net/e1000/em_ethdev.c +1 -1
  	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 ?

drivers/net/e1000/igb_ethdev.c static int igb_flex_filter_uninit(struct rte_eth_dev

Quoted 7 lines
drivers/net/e1000/em_ethdev.c +0 -0
  	eth_em_close(eth_dev);
 
(quoted diff) +0 -0

b/drivers/net/e1000/igb_ethdev.c index 520fba8..a5551e8 100644

drivers/net/e1000/igb_ethdev.c +0 -0
@@ -923,7 +923,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev

*eth_dev)

drivers/net/e1000/igb_ethdev.c static int igb_flex_filter_uninit(struct rte_eth_dev

Quoted 9 lines
drivers/net/e1000/igb_ethdev.c +1 -1
  	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)

Quoted 8 lines
drivers/net/e1000/igb_ethdev.c +1 -1
  	PMD_INIT_FUNC_TRACE();
 
  	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return -EPERM;
+		return 0;
 
  	igbvf_dev_close(eth_dev);
 
Reviewed-by
#5 lore raw

hi alvin

Quoted 7 lines · AlvinX

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.

Quoted 63 lines
Quoted 63 lines

-----Original Message-----
From: Guo, Jia
Sent: Tuesday, May 12, 2020 11:03 AM
To: Zhang, AlvinX <[email protected]>; [email protected]
Cc: Xing, Beilei <[email protected]>; Lu, Wenzhuo <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/e1000: fix port hotplug for multi- process

hi, alvin

drivers/net/e1000/em_ethdev.c static int eth_em_set_mc_addr_list(struct

Quoted 19 lines · On 4/29/2020 2:37 PM, [email protected] wrote:

From: Alvin Zhang <[email protected]>

Enable detach device on secondary process.

Fixes b9eee2cb8c29 (e1000: support port hotplug)
---
   drivers/net/e1000/em_ethdev.c  | 2 +-
   drivers/net/e1000/igb_ethdev.c | 4 ++--
   2 files changed, 3 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/net/e1000/em_ethdev.c index 188cda3..902b1cd 100644

drivers/net/e1000/em_ethdev.c +0 -0
@@ -321,7 +321,7 @@ static int eth_em_set_mc_addr_list(struct

rte_eth_dev *dev,

drivers/net/e1000/em_ethdev.c static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev, · line 325

Quoted 6 lines
drivers/net/e1000/em_ethdev.c +1 -1
   	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 ?

drivers/net/e1000/igb_ethdev.c static int igb_flex_filter_uninit(struct rte_eth_dev

Quoted 7 lines
drivers/net/e1000/em_ethdev.c +0 -0
   	eth_em_close(eth_dev);
 
(quoted diff) +0 -0

b/drivers/net/e1000/igb_ethdev.c index 520fba8..a5551e8 100644

drivers/net/e1000/igb_ethdev.c +0 -0
@@ -923,7 +923,7 @@ static int igb_flex_filter_uninit(struct rte_eth_dev

*eth_dev)

drivers/net/e1000/igb_ethdev.c static int igb_flex_filter_uninit(struct rte_eth_dev

Quoted 9 lines
drivers/net/e1000/igb_ethdev.c +1 -1
   	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)

Quoted 7 lines
Quoted 7 lines

drivers/net/e1000/igb_ethdev.c static int igb_flex_filter_uninit(struct rte_eth_dev *eth_dev) · line 1049

Quoted 7 lines
drivers/net/e1000/igb_ethdev.c +1 -1
   	PMD_INIT_FUNC_TRACE();
 
   	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
-		return -EPERM;
+		return 0;
 
   	igbvf_dev_close(eth_dev);
Applied
#6 lore raw
In reply to [email protected]
Quoted 1 line · On 04/29, [email protected] wrote:

From: Alvin Zhang <[email protected]>

Quoted 51 lines

Enable detach device on secondary process.

Fixes b9eee2cb8c29 (e1000: support port hotplug)

---
drivers/net/e1000/em_ethdev.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 4 ++--

2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/e1000/em_ethdev.c +1 -1
index 188cda3..902b1cd 100644
@@ -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);
 
drivers/net/e1000/igb_ethdev.c +2 -2
index 520fba8..a5551e8 100644
@@ -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);
 
Signature · 1 line
1.8.3.1

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