FLR to a VF when the IOs are going on

Hi Guys,

I just have a question about the driver’s behavior in case of a SRIOV device (with all the Virtual functions are identical). Lets say that there are IOs going on and a FLR is issued to a VF. My assumption is that the function driver will not even know that the reset occurred. The OS will

  1. issue the reset,
  2. unload the driver,
  3. claim all the pending commands in the driver
  4. Perform a PCIe level initialization of the function (mostly a VF is initialized using the SRIOV capabilities, so not much to do here)
  5. Reload the driver

I am not really sure about step 3 here. Will the driver need to participate in “aborting” the commands? can the driver register for a “reset notification” on FLR and abort perform all the commands there?

Appreciate any inputs here.

Thanks
-Aj

Who is going to request a reset? A driver cannot be unloaded while it has pending requests. The system will have to do a clean shutdown of the driver, and as part of that shutdown, the driver will need to clean up whatever outstanding requests it has. Only then could the driver be unloaded.

The function driver could go through the surprise removal state transitions, ending in an unload, assuming that some entity actually resets the function, and that the reset results in a re-enumeration that in turn does not enumerate the function in question.