22/03/2023 02:26, Huang, Wei:
> From: Thomas Monjalon <tho...@monjalon.net>
> > 21/03/2023 09:41, Huang, Wei:
> > > From: Thomas Monjalon <tho...@monjalon.net>
> > > > 21/03/2023 01:11, Huang, Wei:
> > > > > From: Thomas Monjalon <tho...@monjalon.net>
> > > > > > 16/03/2023 21:44, Wei Huang:
> > > > > > > VDEV bus has implemented cleanup() function to perform cleanup
> > > > > > > for devices on the bus during eal_cleanup(), so there is no
> > > > > > > need for ifpga driver to record virtual devices and unplug them.
> > > > > >
> > > > > > Why no need?
> > > > > > If the application wants to explicitly remove a device, what 
> > > > > > happens?
> > > > > >
> > > > > >
> > > > > EAL will output an error information "Cannot find plugged device 
> > > > > (%s)".
> > > >
> > > > It does not look what we expect.
> > > >
> > > Let me clear it.
> > > With this patch, no error information will be outputted.
> > > Without this patch, error information will be outputted.
> > > Because bus cleanup action will unplug virtual device, then ifpga PMD
> > > unplug the virtual device which is already be cleanup,
> > 
> > Why ipfga unplug the device after the bus cleanup?
> > I'm not following.
> > 
> The virtual device is created upon ifpga, if VDEV bus doesn't perform cleanup,
> ifpga has the responsibility to unplug these virtual devices.

Really I don't understand the flow.
Are you talking about EAL cleanup case?
What happens first? Do you need ifpga to be called first?
I think you need the correct checks to allow any order of cleanup.

> > > bus->find_device() returns NULL,
> > > EAL output "Cannot find plugged device (%s)\n" at line 302 in
> > > eal_common_dev.c
> > 
> > Anyway, the good answer is not to completely remove the "remove"
> > operation.
> > 
> If not to completely remove the "remove", the same virtual device will be 
> unplug twice, is it reasonable?

You need to add a check to not unplug something already unplugged.
But you must allow the user calling "remove" directly.


Reply via email to