SrbExtion at Scsiminiport ? HCT Driver Verifier fail ?

HI, all :

At the SCSI miniport driver, I get the physical address of Srb->DataBuffer
with the following code.
ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, Srb,
virtualAddress, &length));

I have some questions :

  1. To do a DMA transfer, we need a PRD table to record information about
    each data segment.
    At the DiverEntry I request an extra buffer, with
    hwInitializationData.SrbExtensionSize = sizeof(SRB_EXT)

Could I have this SrbExtension buffer to be the PRD table ?
I do it like…
PSRB_EXT srbExt = (PSRB_EXT)Srb->SrbExtension;
srbExt->SG.Ptr = ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, Srb,
virtualAddress, &length));
srbExt->SG.Len = length;

Then I get the physcial address of the PRD table with the following
codes.
phySG = ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, NULL, srbExt->SG,
&length));

So write the physical address of SG to the DMA controller.

  1. In fact I have trouble in HCT driver verifier test. I could pass all
    tests except that one.
    The log tells me I get unexpected data read error after system wake up
    from S4 in ACPI S1 Stress.
    I am doubt if there is trouble in the PRD buffer that I used with
    SrbExtension.
    What kinds of memory the port driver allocate for the SrbExtension ?

  2. Another test I take is let the ScatterGather to be false
    ConfigInfo->ScatterGather = FALSE;
    All the other codes are unchanged, and I could pass the test !
    I am very confused with it …

Any recommandation are very appreciated, thank you.

David

SrbExtensions are allocated from common buffer along with your uncached
extension. You can safely share their contents with your hardware.

You don’t want to clear scatter gather. This will kill your performance
and limit your maximum transfer size.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of ??(David Wang)
Sent: Friday, April 23, 2004 1:33 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] SrbExtion at Scsiminiport ? HCT Driver Verifier fail ?

HI, all :

At the SCSI miniport driver, I get the physical address of
Srb->DataBuffer with the following code.
ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, Srb,
virtualAddress, &length));

I have some questions :

  1. To do a DMA transfer, we need a PRD table to record information about
    each data segment.
    At the DiverEntry I request an extra buffer, with
    hwInitializationData.SrbExtensionSize = sizeof(SRB_EXT)

Could I have this SrbExtension buffer to be the PRD table ?
I do it like…
PSRB_EXT srbExt = (PSRB_EXT)Srb->SrbExtension;
srbExt->SG.Ptr = ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, Srb,
virtualAddress, &length));
srbExt->SG.Len = length;

Then I get the physcial address of the PRD table with the following
codes.
phySG = ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, NULL,
srbExt->SG, &length));

So write the physical address of SG to the DMA controller.

  1. In fact I have trouble in HCT driver verifier test. I could pass all
    tests except that one.
    The log tells me I get unexpected data read error after system wake
    up from S4 in ACPI S1 Stress.
    I am doubt if there is trouble in the PRD buffer that I used with
    SrbExtension.
    What kinds of memory the port driver allocate for the SrbExtension ?

  2. Another test I take is let the ScatterGather to be false
    ConfigInfo->ScatterGather = FALSE;
    All the other codes are unchanged, and I could pass the test !
    I am very confused with it …

Any recommandation are very appreciated, thank you.

David


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Hi Peter,

There are some hardware which have some alignment requirements when sharing
the memory with it.
for example a hardware may have requirement that my SG list should be DWORD
aligned and start address and end address of the SGL should be in the same
4K page. So i assume that it is Miniport’s reponsibility to handle these
requirements and here it cannot use the SrbExtension directly. Is this
assumption correct or am i missing something here??

thanks,
Ajitabh

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Friday, April 23, 2004 10:24 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SrbExtion at Scsiminiport ? HCT Driver Verifier
fail ?

SrbExtensions are allocated from common buffer along with your uncached
extension. You can safely share their contents with your hardware.

You don’t want to clear scatter gather. This will kill your performance
and limit your maximum transfer size.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of ??(David Wang)
Sent: Friday, April 23, 2004 1:33 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] SrbExtion at Scsiminiport ? HCT Driver Verifier fail ?

HI, all :

At the SCSI miniport driver, I get the physical address of
Srb->DataBuffer with the following code.
ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, Srb,
virtualAddress, &length));

I have some questions :

  1. To do a DMA transfer, we need a PRD table to record information about
    each data segment.
    At the DiverEntry I request an extra buffer, with
    hwInitializationData.SrbExtensionSize = sizeof(SRB_EXT)

Could I have this SrbExtension buffer to be the PRD table ?
I do it like…
PSRB_EXT srbExt = (PSRB_EXT)Srb->SrbExtension;
srbExt->SG.Ptr = ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, Srb,
virtualAddress, &length));
srbExt->SG.Len = length;

Then I get the physcial address of the PRD table with the following
codes.
phySG = ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, NULL,
srbExt->SG, &length));

So write the physical address of SG to the DMA controller.

  1. In fact I have trouble in HCT driver verifier test. I could pass all
    tests except that one.
    The log tells me I get unexpected data read error after system wake
    up from S4 in ACPI S1 Stress.
    I am doubt if there is trouble in the PRD buffer that I used with
    SrbExtension.
    What kinds of memory the port driver allocate for the SrbExtension ?

  2. Another test I take is let the ScatterGather to be false
    ConfigInfo->ScatterGather = FALSE;
    All the other codes are unchanged, and I could pass the test !
    I am very confused with it …

Any recommandation are very appreciated, thank you.

David


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@lsil.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

No - that’s correct.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Saxena, Ajitabh
Prakash
Sent: Friday, April 23, 2004 9:33 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SrbExtion at Scsiminiport ? HCT Driver Verifier
fail ?

Hi Peter,

There are some hardware which have some alignment requirements when
sharing the memory with it.
for example a hardware may have requirement that my SG list should be
DWORD aligned and start address and end address of the SGL should be in
the same 4K page. So i assume that it is Miniport’s reponsibility to
handle these requirements and here it cannot use the SrbExtension
directly. Is this assumption correct or am i missing something here??

thanks,
Ajitabh

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Friday, April 23, 2004 10:24 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] SrbExtion at Scsiminiport ? HCT Driver Verifier
fail ?

SrbExtensions are allocated from common buffer along with your uncached
extension. You can safely share their contents with your hardware.

You don’t want to clear scatter gather. This will kill your performance
and limit your maximum transfer size.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of ??(David Wang)
Sent: Friday, April 23, 2004 1:33 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] SrbExtion at Scsiminiport ? HCT Driver Verifier fail ?

HI, all :

At the SCSI miniport driver, I get the physical address of
Srb->DataBuffer with the following code.
ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, Srb,
virtualAddress, &length));

I have some questions :

  1. To do a DMA transfer, we need a PRD table to record information about
    each data segment.
    At the DiverEntry I request an extra buffer, with
    hwInitializationData.SrbExtensionSize = sizeof(SRB_EXT)

Could I have this SrbExtension buffer to be the PRD table ?
I do it like…
PSRB_EXT srbExt = (PSRB_EXT)Srb->SrbExtension;
srbExt->SG.Ptr = ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, Srb,
virtualAddress, &length));
srbExt->SG.Len = length;

Then I get the physcial address of the PRD table with the following
codes.
phySG = ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, NULL,
srbExt->SG, &length));

So write the physical address of SG to the DMA controller.

  1. In fact I have trouble in HCT driver verifier test. I could pass all
    tests except that one.
    The log tells me I get unexpected data read error after system wake
    up from S4 in ACPI S1 Stress.
    I am doubt if there is trouble in the PRD buffer that I used with
    SrbExtension.
    What kinds of memory the port driver allocate for the SrbExtension ?

  2. Another test I take is let the ScatterGather to be false
    ConfigInfo->ScatterGather = FALSE;
    All the other codes are unchanged, and I could pass the test !
    I am very confused with it …

Any recommandation are very appreciated, thank you.

David


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@lsil.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks for your reply.

Now I did turn on the SG feature of the SCSI miniport.
If I disable this feature, the max transfer length of the SRB packet I
received is only 0x38 sectors.
For performance consideration, I turn on SG of the scsiminiport.

We had used “verifier” to turn on different settings seperately,
such as IRQL, I/O verification, DeadLock, DMA checking…, then call the
batch file to run ACPI S1 stress testing.
I could pass the test, and it does at other combination.
But, only at these four settings " Force IRQL checking, I/O verification,
Deadlock detection, and DMA checking",
is enabled at the same time will be failed.

David

----- Original Message -----
From: “Peter Wieland”
To: “Windows System Software Devs Interest List”
Sent: Friday, April 23, 2004 10:23 PM
Subject: RE: [ntdev] SrbExtion at Scsiminiport ? HCT Driver Verifier fail ?

SrbExtensions are allocated from common buffer along with your uncached
extension. You can safely share their contents with your hardware.

You don’t want to clear scatter gather. This will kill your performance
and limit your maximum transfer size.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of ??(David Wang)
Sent: Friday, April 23, 2004 1:33 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] SrbExtion at Scsiminiport ? HCT Driver Verifier fail ?

HI, all :

At the SCSI miniport driver, I get the physical address of
Srb->DataBuffer with the following code.
ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, Srb,
virtualAddress, &length));

I have some questions :
1. To do a DMA transfer, we need a PRD table to record information about
each data segment.
At the DiverEntry I request an extra buffer, with
hwInitializationData.SrbExtensionSize = sizeof(SRB_EXT)

Could I have this SrbExtension buffer to be the PRD table ?
I do it like…
PSRB_EXT srbExt = (PSRB_EXT)Srb->SrbExtension;
srbExt->SG.Ptr = ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, Srb,
virtualAddress, &length));
srbExt->SG.Len = length;

Then I get the physcial address of the PRD table with the following
codes.
phySG = ScsiPortConvertPhysicalAddressToUlong (
ScsiPortGetPhysicalAddress (deviceExtension, NULL,
srbExt->SG, &length));

So write the physical address of SG to the DMA controller.

2. In fact I have trouble in HCT driver verifier test. I could pass all
tests except that one.
The log tells me I get unexpected data read error after system wake
up from S4 in ACPI S1 Stress.
I am doubt if there is trouble in the PRD buffer that I used with
SrbExtension.
What kinds of memory the port driver allocate for the SrbExtension ?

3. Another test I take is let the ScatterGather to be false
ConfigInfo->ScatterGather = FALSE;
All the other codes are unchanged, and I could pass the test !
I am very confused with it …

Any recommandation are very appreciated, thank you.

David


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@sis.com.tw
To unsubscribe send a blank email to xxxxx@lists.osr.com