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.zh...@intel.com>; dev@dpdk.org
> Cc: Xing, Beilei <beilei.x...@intel.com>; Lu, Wenzhuo
> <wenzhuo...@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.zh...@intel.com wrote:
> > From: Alvin Zhang <alvinx.zh...@intel.com>
> >
> > Enable detach device on secondary process.
> >
> > Fixes: b9eee2cb8c29 (e1000: support port hotplug)
> > Cc: bernard.iremon...@intel.com
> > Cc: sta...@dpdk.org
> >
> > Signed-off-by: Alvin Zhang <alvinx.zh...@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);
> >

Reply via email to