> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybche...@solarflare.com]
> Sent: Sunday, August 12, 2018 7:00 PM
> To: Zhang, Qi Z <qi.z.zh...@intel.com>; tho...@monjalon.net;
> gaetan.ri...@6wind.com; Burakov, Anatoly <anatoly.bura...@intel.com>;
> arybche...@solarflare.com
> Cc: Ananyev, Konstantin <konstantin.anan...@intel.com>; dev@dpdk.org;
> Richardson, Bruce <bruce.richard...@intel.com>; Yigit, Ferruh
> <ferruh.yi...@intel.com>; Shelton, Benjamin H
> <benjamin.h.shel...@intel.com>; Vangati, Narender
> <narender.vang...@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v14 4/6] drivers/net: enable hotplug on
> secondary process
> 
> On 10.08.2018 03:42, Qi Zhang wrote:
> > Attach port from secondary should ignore devargs since the private
> > device is not necessary to support. Also previously, detach port on a
> > secondary process will mess primary process and cause the same device
> > can't be attached back again. A secondary process should use
> > rte_eth_dev_release_port_secondary to release a port.
> >
> > Signed-off-by: Qi Zhang <qi.z.zh...@intel.com>
> 
> For me, it looks like duplication of the same code logic in all vdev drivers. 
> I'd
> say that remove should not be called at all in the case of secondary process.

But based on current framework, rte_eth_dev_release_port_secondary is required 
to be called in PMD, and driver->remove is the place to call it as what I see.

> Also I'd consider to introduce separate callback for probe in the case of
> secondary process: it would make it clear if secondary is supported and
> enforce authors to think about secondary process specifics on probe. As far
> as I can see it is always absolutely different branch with own code.

I like this idea. We should give the driver the flexibility to decide to expose 
device on a secondary process or not.
And this is not for vdev only, maybe another option is adding a flag in 
rte_driver to indicate if it supports secondary process or not, so we don't 
need to add callback for all sub bus drivers separately, but in that case we 
still have to handle secondary in the same probe/remove function if a driver 
support secondary.

Btw, this looks like involve a lot of change and break ABI. Also, it exceeds 
the scope of hotplug. I would like to see this in a separate patchset ( better 
a RFC first), what do you think?

Regards
Qi


Reply via email to