Trigger UserAbortTaskRequest method in IOUserSCSIParallelInterfaceController subclass

Hello, I have DriverKit SCSI driver (PCI through Thunderbolt). And there is some logic and command which should be send to device in UserAbortTaskRequest method. But I cannot find out a way UserAbortTaskRequest to be called by system, so cannot debug the code inside.

  1. In which cases IOUserSCSIParallelInterfaceController/DriverKit framework calls UserAbortTaskRequest ?
  2. Is there a way to imitate situation (in driver or in some external tool), so that UserAbortTaskRequest be called to debug such case?
Answered by DTS Engineer in 843364022

Hello, I have DriverKit SCSI driver (PCI through Thunderbolt). And there is some logic and command which should be send to device in UserAbortTaskRequest method. But I cannot find out a way UserAbortTaskRequest to be called by system, so cannot debug the code inside.

First off, please file a bug on this and then send me the bug number once it's filed. As far as I can tell, the 6 SCSI Task Management Functions:

...are not currently implemented by SCSIControllerDriverKit and never have been. I haven't confirmed the full details of why that choice was made, but from the larger kernel context I suspect it's because they're basically unused by the system and always have been. For standard I/O request there isn't any cancellation options, so all requests are either completed by the controlling driver (note that this includes errors) or fail "externally" as part of things like driver teardown.

Historically, these methods might have been by things that directly issued SCSI commands like the SCSITaskUserClient's AbortTask(). However, looking at our code, that was actually implemented by calling AbortCommand, which has since been deprecated and is no longer functional. This appears to have been overlooked because, as far as I can, nothing in the system ever actually called SCSITaskUserClient AbortTask.

In other words, while the kernel does "implement" these functions, none of them are actually used for anything. Bugs were filed about removing these functions (r.64130212&63913004), but that removal did not occur. As mentioned above, please file a bug on this and post the bug number back here. At this point I'm not sure removal is possible (due to binary compatibility issues) but we should at least document that they are not functional.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Accepted Answer

Hello, I have DriverKit SCSI driver (PCI through Thunderbolt). And there is some logic and command which should be send to device in UserAbortTaskRequest method. But I cannot find out a way UserAbortTaskRequest to be called by system, so cannot debug the code inside.

First off, please file a bug on this and then send me the bug number once it's filed. As far as I can tell, the 6 SCSI Task Management Functions:

...are not currently implemented by SCSIControllerDriverKit and never have been. I haven't confirmed the full details of why that choice was made, but from the larger kernel context I suspect it's because they're basically unused by the system and always have been. For standard I/O request there isn't any cancellation options, so all requests are either completed by the controlling driver (note that this includes errors) or fail "externally" as part of things like driver teardown.

Historically, these methods might have been by things that directly issued SCSI commands like the SCSITaskUserClient's AbortTask(). However, looking at our code, that was actually implemented by calling AbortCommand, which has since been deprecated and is no longer functional. This appears to have been overlooked because, as far as I can, nothing in the system ever actually called SCSITaskUserClient AbortTask.

In other words, while the kernel does "implement" these functions, none of them are actually used for anything. Bugs were filed about removing these functions (r.64130212&63913004), but that removal did not occur. As mentioned above, please file a bug on this and post the bug number back here. At this point I'm not sure removal is possible (due to binary compatibility issues) but we should at least document that they are not functional.

__
Kevin Elliott
DTS Engineer, CoreOS/Hardware

Thank you very much for so detailed explanation! It is mush clear now. I appreciate that it's been known at early stage and I may optimise our driver implementation.

I totally agree that it should be documented. And I understand that it cannot be removed for binary compatibility reasons, it's fine.

Could you please guide me how to (and where) report the bug for this case?

Regards

Trigger UserAbortTaskRequest method in IOUserSCSIParallelInterfaceController subclass
 
 
Q