Windows driver framework(WDF): USB3 host stops consuming data for SCSI Read16 commands in UAS mode

Veeresh Koninti 0 Reputation points
2024-05-22T08:23:26.9133333+00:00

I have an inhouse developed WDF based driver which can run USB SCSI commands in UAS mode in USB3 speed.

Scenario:

The test script queues multiple Read16 SCSI commands to the USB device and the execution runs for approx. 1hr 45min without any issues. Post that at some point, 30 SCSI Read16 commands are pending to be completed by the device with tags assigned from 1 to 30 to the CommandIUs. Among these commands, there was a request for Tag=7 queued for status, data and command phase to the device.

Below table summarizes wireshark traces captured for CommandIU with Tag=7USBD_STATUS_CANCELLED

30s is the timeout set for each phase of command(Command request, Data request and Status Request).

Among the pending commands, some commands had data transfer phase in progress but not completed and for some pending commands data transfer was not yet started but the command request was acknowledged successfully by the device.

As we can notice from the above table, one status request was acknowledged twice. First status response acknowledgement was with USBD_Status=USBD_STATUS_SUCCESSFUL even before data transfer started for the command and second status response acknowledgement was with USBD_Status=USBD_STATUS_CANCELLED.

Once the second acknowledgement was received by the host for Tag=7, all pending commands from Tag=1 to 30 which were pending for completion fail with USBD_STATUS_CANCELLED status.

My driver has no role in cancelling the commands. It just receives the callbacks registered for each phase of the command with USBD_STATUS_CANCELLED status from wdf framework.

Queries:

  1. Why did all pending commands gets cancelled?
  2. Is there any possibility of lower level USB stack that cancels the requests?
  3. Any possible ways to capture lower level driver traces which is not in control of my driver?
Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,944 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,613 questions
Windows Driver Kit (WDK)
Windows Driver Kit (WDK)
A set of Microsoft tools that are used to develop, test, and deploy Windows drivers.
30 questions
0 comments No comments
{count} votes