net/e1000: fix port hotplug for multi-process
PATCH 1/1 net/e1000: fix port hotplug for multi-process
From: Alvin Zhang <[email protected]>
Enable detach device on secondary process.
--- 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);
Signature · 1 line
1.8.3.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
Mei, JianweiX
Tested-by-----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.
--- 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
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.
Signed-off-by Alvin Zhang <[email protected]>--- 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
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
-0eth_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);
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- processhi, 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.
Signed-off-by Alvin Zhang <[email protected]>--- 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.cindex 188cda3..902b1cd 100644drivers/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
-1PMD_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_SECONDARYcase when detach device, but what about the other case likeRTE_PROC_INVALIDorRTE_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
-0eth_em_close (eth_dev);(quoted diff) +0
-0
b/drivers/net/e1000/igb_ethdev.cindex 520fba8..a5551e8 100644drivers/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
-1PMD_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
-1PMD_INIT_FUNC_TRACE ();if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) -return -EPERM ; +return 0 ;igbvf_dev_close (eth_dev);
Jeff Guo
Reviewed-byhi 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- processhi, 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.
Signed-off-by Alvin Zhang <[email protected]>--- 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.cindex 188cda3..902b1cd 100644drivers/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
-1PMD_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_SECONDARYcase when detach device, but what about the other case likeRTE_PROC_INVALIDorRTE_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
-0eth_em_close (eth_dev);(quoted diff) +0
-0
b/drivers/net/e1000/igb_ethdev.cindex 520fba8..a5551e8 100644drivers/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
-1PMD_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
-1PMD_INIT_FUNC_TRACE ();if (rte_eal_process_type () !=RTE_PROC_PRIMARY ) -return -EPERM ; +return 0 ;igbvf_dev_close (eth_dev);
Ye Xiaolong
AppliedQuoted 1 line · On 04/29, [email protected] wrote:
From: Alvin Zhang <[email protected]>
Quoted 51 lines
Enable detach device on secondary process.
Signed-off-by Alvin Zhang <[email protected]>---
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);Signature · 1 line
1.8.3.1
Applied to dpdk-next-net-intel, Thanks.