Performance of SCSI miniport for IDE RAID

Hello,

I am wondering on how to improve performance of SCSI miniport driver for IDE
RAID controller that I have written.
As you all know the IDE does not support tagged command queueing like SCSI.
So the driver issues one command at time and waits till it completes and
then sends notification for the NextSRBRequest to the port driver.

Is Implementing a QUEUE in miniport driver gives any performance
improvements? This way the miniport can build the scatter/gather list for
the read/write requests and keep it ready in FIFO and send them one by one
to the IDE RAID controller. Is this really going to give us any performance
improvements? is the effort worth doing? I want your inputs from the experts
in this field before I implement it.

Thanks

> Is Implementing a QUEUE in miniport driver gives any performance

improvements?

No. It is absolutely irrelevant where the queue is - in SCSIPORT or in your
miniport.

The firmware queue in the disk is better since the disk firmware can reorder
requests to reduce unnecessary head seeks and revolutions, and only due to
this.

Your miniport has no head/revolutions knowledge, and thus cannot do the same.

In a RAID, you can do the following though. If the request can be serviced off
1 disk - then it is not necessary to block the whole RAID for its duration. You
can allow requests to other disks.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Thanks Maxim,

Good point. Currently in miniport I won’t allow more than one outstanding
request for controller. If the miniport driver is processing SRB it returns
status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and modified it to
work for 2K/XP. I think the reason being is, Since there is one interrupt
handler for the controller how will it know which disk drive completed the
transfer if multiple outstanding requests are allowed. I may be wrong here,
Is there way to send request to other drives while the first one is still in
middle of transfer for an IDE RAID controller.

Thanks in advance,
Shakeel.

BOOLEAN
AtapiStartIo(
IN PVOID HwDeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb
)

/*++

Routine Description:

This routine is called from the SCSI port driver synchronized
with the kernel to start an IO request.

Arguments:

HwDeviceExtension - HBA miniport driver’s adapter data storage
Srb - IO request packet

Return Value:

TRUE

–*/

{
PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
ULONG status;

//
// Determine which function.
//

switch (Srb->Function) {

case SRB_FUNCTION_EXECUTE_SCSI:

//
// Sanity check. Only one request can be outstanding on a
// controller.
//

if (deviceExtension->CurrentSrb) {

DebugPrint((1,
“AtapiStartIo: Already have a request!\n”));
Srb->SrbStatus = SRB_STATUS_BUSY;
ScsiPortNotification(RequestComplete,
deviceExtension,
Srb);
return FALSE;
}

//
// Indicate that a request is active on the controller.
//

deviceExtension->CurrentSrb = Srb;

//
// Send command to device.
//

if (deviceExtension->DeviceFlags[Srb->TargetId] &
DFLAGS_ATAPI_DEVICE) {

status = AtapiSendCommand(HwDeviceExtension,
Srb);

} else if (deviceExtension->DeviceFlags[Srb->TargetId] &
DFLAGS_DEVICE_PRESENT) {

status = IdeSendCommand(HwDeviceExtension,
Srb);
} else {

status = SRB_STATUS_SELECTION_TIMEOUT;
}

break;

case SRB_FUNCTION_ABORT_COMMAND:

//
// Verify that SRB to abort is still outstanding.
//

if (!deviceExtension->CurrentSrb) {

DebugPrint((1, “AtapiStartIo: SRB to abort already
completed\n”));

//
// Complete abort SRB.
//

status = SRB_STATUS_ABORT_FAILED;

break;
}

//
// Abort function indicates that a request timed out.
// Call reset routine. Card will only be reset if
// status indicates something is wrong.
// Fall through to reset code.
//

case SRB_FUNCTION_RESET_BUS:

//
// Reset Atapi and SCSI bus.
//

DebugPrint((1, “AtapiStartIo: Reset bus request received\n”));

if (!AtapiResetController(deviceExtension,
Srb->PathId)) {

DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));

//
// Log reset failure.
//

ScsiPortLogError(
HwDeviceExtension,
NULL,
0,
0,
0,
SP_INTERNAL_ADAPTER_ERROR,
5 << 8
);

status = SRB_STATUS_ERROR;

} else {

status = SRB_STATUS_SUCCESS;
}

break;

default :

status = SRB_STATUS_INVALID_REQUEST;
break;

}

break;

default:

//
// Indicate unsupported command.
//

status = SRB_STATUS_INVALID_REQUEST;

break;

} // end switch

//
// Check if command complete.
//

if (status != SRB_STATUS_PENDING) {

DebugPrint((2,
“AtapiStartIo: Srb %x complete with status %x\n”,
Srb,
status));

//
// Clear current SRB.
//

deviceExtension->CurrentSrb = NULL;

//
// Set status in SRB.
//

Srb->SrbStatus = (UCHAR)status;

//
// Indicate command complete.
//

ScsiPortNotification(RequestComplete,
deviceExtension,
Srb);

//
// Indicate ready for next request.
//

ScsiPortNotification(NextRequest,
deviceExtension,
NULL);
}

return TRUE;

} // end AtapiStartIo()

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
> > Is Implementing a QUEUE in miniport driver gives any performance
> > improvements?
>
> No. It is absolutely irrelevant where the queue is - in SCSIPORT or in
your
> miniport.
>
> The firmware queue in the disk is better since the disk firmware can
reorder
> requests to reduce unnecessary head seeks and revolutions, and only due to
> this.
>
> Your miniport has no head/revolutions knowledge, and thus cannot do the
same.
>
> In a RAID, you can do the following though. If the request can be serviced
off
> 1 disk - then it is not necessary to block the whole RAID for its
duration. You
> can allow requests to other disks.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>

Hi Shakeel,

There is no way to do that. The IDE controllers have one DMA controller per
channel
and once the DMA is active you should not touch the channel till yu issue a
STOP_TRANSFER
in ISR to that channel’s Bus Master DMA. So since you can fire only one
command per channel
it will be your internal logic that determines which command is current. You
will still be able to
fire commands simultaneously on different channels. So, For IDE RAID
controller the best performance
can only be obtained when the drives are placed on two different channels.
Also remember that equations change for SATA.

Thanks,
Ajitabh

-----Original Message-----
From: shakeel [mailto:xxxxx@yahoo.com]
Sent: Thursday, June 10, 2004 4:12 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID

Thanks Maxim,

Good point. Currently in miniport I won’t allow more than one outstanding
request for controller. If the miniport driver is processing SRB it returns
status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and modified it to
work for 2K/XP. I think the reason being is, Since there is one interrupt
handler for the controller how will it know which disk drive completed the
transfer if multiple outstanding requests are allowed. I may be wrong here,
Is there way to send request to other drives while the first one is still in
middle of transfer for an IDE RAID controller.

Thanks in advance,
Shakeel.

BOOLEAN
AtapiStartIo(
IN PVOID HwDeviceExtension,
IN PSCSI_REQUEST_BLOCK Srb
)

/*++

Routine Description:

This routine is called from the SCSI port driver synchronized
with the kernel to start an IO request.

Arguments:

HwDeviceExtension - HBA miniport driver’s adapter data storage
Srb - IO request packet

Return Value:

TRUE

–*/

{
PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
ULONG status;

//
// Determine which function.
//

switch (Srb->Function) {

case SRB_FUNCTION_EXECUTE_SCSI:

//
// Sanity check. Only one request can be outstanding on a
// controller.
//

if (deviceExtension->CurrentSrb) {

DebugPrint((1,
“AtapiStartIo: Already have a request!\n”));
Srb->SrbStatus = SRB_STATUS_BUSY;
ScsiPortNotification(RequestComplete,
deviceExtension,
Srb);
return FALSE;
}

//
// Indicate that a request is active on the controller.
//

deviceExtension->CurrentSrb = Srb;

//
// Send command to device.
//

if (deviceExtension->DeviceFlags[Srb->TargetId] &
DFLAGS_ATAPI_DEVICE) {

status = AtapiSendCommand(HwDeviceExtension,
Srb);

} else if (deviceExtension->DeviceFlags[Srb->TargetId] &
DFLAGS_DEVICE_PRESENT) {

status = IdeSendCommand(HwDeviceExtension,
Srb);
} else {

status = SRB_STATUS_SELECTION_TIMEOUT;
}

break;

case SRB_FUNCTION_ABORT_COMMAND:

//
// Verify that SRB to abort is still outstanding.
//

if (!deviceExtension->CurrentSrb) {

DebugPrint((1, “AtapiStartIo: SRB to abort already
completed\n”));

//
// Complete abort SRB.
//

status = SRB_STATUS_ABORT_FAILED;

break;
}

//
// Abort function indicates that a request timed out.
// Call reset routine. Card will only be reset if
// status indicates something is wrong.
// Fall through to reset code.
//

case SRB_FUNCTION_RESET_BUS:

//
// Reset Atapi and SCSI bus.
//

DebugPrint((1, “AtapiStartIo: Reset bus request received\n”));

if (!AtapiResetController(deviceExtension,
Srb->PathId)) {

DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));

//
// Log reset failure.
//

ScsiPortLogError(
HwDeviceExtension,
NULL,
0,
0,
0,
SP_INTERNAL_ADAPTER_ERROR,
5 << 8
);

status = SRB_STATUS_ERROR;

} else {

status = SRB_STATUS_SUCCESS;
}

break;

default :

status = SRB_STATUS_INVALID_REQUEST;
break;

}

break;

default:

//
// Indicate unsupported command.
//

status = SRB_STATUS_INVALID_REQUEST;

break;

} // end switch

//
// Check if command complete.
//

if (status != SRB_STATUS_PENDING) {

DebugPrint((2,
“AtapiStartIo: Srb %x complete with status %x\n”,
Srb,
status));

//
// Clear current SRB.
//

deviceExtension->CurrentSrb = NULL;

//
// Set status in SRB.
//

Srb->SrbStatus = (UCHAR)status;

//
// Indicate command complete.
//

ScsiPortNotification(RequestComplete,
deviceExtension,
Srb);

//
// Indicate ready for next request.
//

ScsiPortNotification(NextRequest,
deviceExtension,
NULL);
}

return TRUE;

} // end AtapiStartIo()

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
> > Is Implementing a QUEUE in miniport driver gives any performance
> > improvements?
>
> No. It is absolutely irrelevant where the queue is - in SCSIPORT or in
your
> miniport.
>
> The firmware queue in the disk is better since the disk firmware can
reorder
> requests to reduce unnecessary head seeks and revolutions, and only due to
> this.
>
> Your miniport has no head/revolutions knowledge, and thus cannot do the
same.
>
> In a RAID, you can do the following though. If the request can be serviced
off
> 1 disk - then it is not necessary to block the whole RAID for its
duration. You
> can allow requests to other disks.
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.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

So, no tagged queue and no disconnects :slight_smile:

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Saxena, Ajitabh Prakash”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 14, 2004 7:25 PM
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

> Hi Shakeel,
>
> There is no way to do that. The IDE controllers have one DMA controller per
> channel
> and once the DMA is active you should not touch the channel till yu issue a
> STOP_TRANSFER
> in ISR to that channel’s Bus Master DMA. So since you can fire only one
> command per channel
> it will be your internal logic that determines which command is current. You
> will still be able to
> fire commands simultaneously on different channels. So, For IDE RAID
> controller the best performance
> can only be obtained when the drives are placed on two different channels.
> Also remember that equations change for SATA.
>
> Thanks,
> Ajitabh
>
> -----Original Message-----
> From: shakeel [mailto:xxxxx@yahoo.com]
> Sent: Thursday, June 10, 2004 4:12 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID
>
>
> Thanks Maxim,
>
> Good point. Currently in miniport I won’t allow more than one outstanding
> request for controller. If the miniport driver is processing SRB it returns
> status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and modified it to
> work for 2K/XP. I think the reason being is, Since there is one interrupt
> handler for the controller how will it know which disk drive completed the
> transfer if multiple outstanding requests are allowed. I may be wrong here,
> Is there way to send request to other drives while the first one is still in
> middle of transfer for an IDE RAID controller.
>
> Thanks in advance,
> Shakeel.
>
> BOOLEAN
> AtapiStartIo(
> IN PVOID HwDeviceExtension,
> IN PSCSI_REQUEST_BLOCK Srb
> )
>
> /++
>
> Routine Description:
>
> This routine is called from the SCSI port driver synchronized
> with the kernel to start an IO request.
>
> Arguments:
>
> HwDeviceExtension - HBA miniport driver’s adapter data storage
> Srb - IO request packet
>
> Return Value:
>
> TRUE
>
> –
/
>
> {
> PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
> ULONG status;
>
> //
> // Determine which function.
> //
>
> switch (Srb->Function) {
>
> case SRB_FUNCTION_EXECUTE_SCSI:
>
> //
> // Sanity check. Only one request can be outstanding on a
> // controller.
> //
>
> if (deviceExtension->CurrentSrb) {
>
> DebugPrint((1,
> “AtapiStartIo: Already have a request!\n”));
> Srb->SrbStatus = SRB_STATUS_BUSY;
> ScsiPortNotification(RequestComplete,
> deviceExtension,
> Srb);
> return FALSE;
> }
>
> //
> // Indicate that a request is active on the controller.
> //
>
> deviceExtension->CurrentSrb = Srb;
>
> //
> // Send command to device.
> //
>
> if (deviceExtension->DeviceFlags[Srb->TargetId] &
> DFLAGS_ATAPI_DEVICE) {
>
> status = AtapiSendCommand(HwDeviceExtension,
> Srb);
>
> } else if (deviceExtension->DeviceFlags[Srb->TargetId] &
> DFLAGS_DEVICE_PRESENT) {
>
> status = IdeSendCommand(HwDeviceExtension,
> Srb);
> } else {
>
> status = SRB_STATUS_SELECTION_TIMEOUT;
> }
>
> break;
>
> case SRB_FUNCTION_ABORT_COMMAND:
>
> //
> // Verify that SRB to abort is still outstanding.
> //
>
> if (!deviceExtension->CurrentSrb) {
>
> DebugPrint((1, “AtapiStartIo: SRB to abort already
> completed\n”));
>
> //
> // Complete abort SRB.
> //
>
> status = SRB_STATUS_ABORT_FAILED;
>
> break;
> }
>
> //
> // Abort function indicates that a request timed out.
> // Call reset routine. Card will only be reset if
> // status indicates something is wrong.
> // Fall through to reset code.
> //
>
> case SRB_FUNCTION_RESET_BUS:
>
> //
> // Reset Atapi and SCSI bus.
> //
>
> DebugPrint((1, “AtapiStartIo: Reset bus request received\n”));
>
> if (!AtapiResetController(deviceExtension,
> Srb->PathId)) {
>
> DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));
>
> //
> // Log reset failure.
> //
>
> ScsiPortLogError(
> HwDeviceExtension,
> NULL,
> 0,
> 0,
> 0,
> SP_INTERNAL_ADAPTER_ERROR,
> 5 << 8
> );
>
> status = SRB_STATUS_ERROR;
>
> } else {
>
> status = SRB_STATUS_SUCCESS;
> }
>
> break;
>
> default :
>
> status = SRB_STATUS_INVALID_REQUEST;
> break;
>
> }
>
> break;
>
> default:
>
> //
> // Indicate unsupported command.
> //
>
> status = SRB_STATUS_INVALID_REQUEST;
>
> break;
>
> } // end switch
>
> //
> // Check if command complete.
> //
>
> if (status != SRB_STATUS_PENDING) {
>
> DebugPrint((2,
> “AtapiStartIo: Srb %x complete with status %x\n”,
> Srb,
> status));
>
> //
> // Clear current SRB.
> //
>
> deviceExtension->CurrentSrb = NULL;
>
> //
> // Set status in SRB.
> //
>
> Srb->SrbStatus = (UCHAR)status;
>
> //
> // Indicate command complete.
> //
>
> ScsiPortNotification(RequestComplete,
> deviceExtension,
> Srb);
>
> //
> // Indicate ready for next request.
> //
>
> ScsiPortNotification(NextRequest,
> deviceExtension,
> NULL);
> }
>
> return TRUE;
>
> } // end AtapiStartIo()
>
>
> “Maxim S. Shatskih” wrote in message
> news:xxxxx@ntdev…
> > > Is Implementing a QUEUE in miniport driver gives any performance
> > > improvements?
> >
> > No. It is absolutely irrelevant where the queue is - in SCSIPORT or in
> your
> > miniport.
> >
> > The firmware queue in the disk is better since the disk firmware can
> reorder
> > requests to reduce unnecessary head seeks and revolutions, and only due to
> > this.
> >
> > Your miniport has no head/revolutions knowledge, and thus cannot do the
> same.
> >
> > In a RAID, you can do the following though. If the request can be serviced
> off
> > 1 disk - then it is not necessary to block the whole RAID for its
> duration. You
> > can allow requests to other disks.
> >
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > xxxxx@storagecraft.com
> > http://www.storagecraft.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@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Exactly. IDE is far away from these things. :slight_smile:

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Monday, June 14, 2004 12:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID

So, no tagged queue and no disconnects :slight_smile:

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Saxena, Ajitabh Prakash”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 14, 2004 7:25 PM
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

> Hi Shakeel,
>
> There is no way to do that. The IDE controllers have one DMA controller
per
> channel
> and once the DMA is active you should not touch the channel till yu issue
a
> STOP_TRANSFER
> in ISR to that channel’s Bus Master DMA. So since you can fire only one
> command per channel
> it will be your internal logic that determines which command is current.
You
> will still be able to
> fire commands simultaneously on different channels. So, For IDE RAID
> controller the best performance
> can only be obtained when the drives are placed on two different channels.
> Also remember that equations change for SATA.
>
> Thanks,
> Ajitabh
>
> -----Original Message-----
> From: shakeel [mailto:xxxxx@yahoo.com]
> Sent: Thursday, June 10, 2004 4:12 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID
>
>
> Thanks Maxim,
>
> Good point. Currently in miniport I won’t allow more than one outstanding
> request for controller. If the miniport driver is processing SRB it
returns
> status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and modified it
to
> work for 2K/XP. I think the reason being is, Since there is one interrupt
> handler for the controller how will it know which disk drive completed the
> transfer if multiple outstanding requests are allowed. I may be wrong
here,
> Is there way to send request to other drives while the first one is still
in
> middle of transfer for an IDE RAID controller.
>
> Thanks in advance,
> Shakeel.
>
> BOOLEAN
> AtapiStartIo(
> IN PVOID HwDeviceExtension,
> IN PSCSI_REQUEST_BLOCK Srb
> )
>
> /++
>
> Routine Description:
>
> This routine is called from the SCSI port driver synchronized
> with the kernel to start an IO request.
>
> Arguments:
>
> HwDeviceExtension - HBA miniport driver’s adapter data storage
> Srb - IO request packet
>
> Return Value:
>
> TRUE
>
> –
/
>
> {
> PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
> ULONG status;
>
> //
> // Determine which function.
> //
>
> switch (Srb->Function) {
>
> case SRB_FUNCTION_EXECUTE_SCSI:
>
> //
> // Sanity check. Only one request can be outstanding on a
> // controller.
> //
>
> if (deviceExtension->CurrentSrb) {
>
> DebugPrint((1,
> “AtapiStartIo: Already have a request!\n”));
> Srb->SrbStatus = SRB_STATUS_BUSY;
> ScsiPortNotification(RequestComplete,
> deviceExtension,
> Srb);
> return FALSE;
> }
>
> //
> // Indicate that a request is active on the controller.
> //
>
> deviceExtension->CurrentSrb = Srb;
>
> //
> // Send command to device.
> //
>
> if (deviceExtension->DeviceFlags[Srb->TargetId] &
> DFLAGS_ATAPI_DEVICE) {
>
> status = AtapiSendCommand(HwDeviceExtension,
> Srb);
>
> } else if (deviceExtension->DeviceFlags[Srb->TargetId] &
> DFLAGS_DEVICE_PRESENT) {
>
> status = IdeSendCommand(HwDeviceExtension,
> Srb);
> } else {
>
> status = SRB_STATUS_SELECTION_TIMEOUT;
> }
>
> break;
>
> case SRB_FUNCTION_ABORT_COMMAND:
>
> //
> // Verify that SRB to abort is still outstanding.
> //
>
> if (!deviceExtension->CurrentSrb) {
>
> DebugPrint((1, “AtapiStartIo: SRB to abort already
> completed\n”));
>
> //
> // Complete abort SRB.
> //
>
> status = SRB_STATUS_ABORT_FAILED;
>
> break;
> }
>
> //
> // Abort function indicates that a request timed out.
> // Call reset routine. Card will only be reset if
> // status indicates something is wrong.
> // Fall through to reset code.
> //
>
> case SRB_FUNCTION_RESET_BUS:
>
> //
> // Reset Atapi and SCSI bus.
> //
>
> DebugPrint((1, “AtapiStartIo: Reset bus request received\n”));
>
> if (!AtapiResetController(deviceExtension,
> Srb->PathId)) {
>
> DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));
>
> //
> // Log reset failure.
> //
>
> ScsiPortLogError(
> HwDeviceExtension,
> NULL,
> 0,
> 0,
> 0,
> SP_INTERNAL_ADAPTER_ERROR,
> 5 << 8
> );
>
> status = SRB_STATUS_ERROR;
>
> } else {
>
> status = SRB_STATUS_SUCCESS;
> }
>
> break;
>
> default :
>
> status = SRB_STATUS_INVALID_REQUEST;
> break;
>
> }
>
> break;
>
> default:
>
> //
> // Indicate unsupported command.
> //
>
> status = SRB_STATUS_INVALID_REQUEST;
>
> break;
>
> } // end switch
>
> //
> // Check if command complete.
> //
>
> if (status != SRB_STATUS_PENDING) {
>
> DebugPrint((2,
> “AtapiStartIo: Srb %x complete with status %x\n”,
> Srb,
> status));
>
> //
> // Clear current SRB.
> //
>
> deviceExtension->CurrentSrb = NULL;
>
> //
> // Set status in SRB.
> //
>
> Srb->SrbStatus = (UCHAR)status;
>
> //
> // Indicate command complete.
> //
>
> ScsiPortNotification(RequestComplete,
> deviceExtension,
> Srb);
>
> //
> // Indicate ready for next request.
> //
>
> ScsiPortNotification(NextRequest,
> deviceExtension,
> NULL);
> }
>
> return TRUE;
>
> } // end AtapiStartIo()
>
>
> “Maxim S. Shatskih” wrote in message
> news:xxxxx@ntdev…
> > > Is Implementing a QUEUE in miniport driver gives any performance
> > > improvements?
> >
> > No. It is absolutely irrelevant where the queue is - in SCSIPORT or in
> your
> > miniport.
> >
> > The firmware queue in the disk is better since the disk firmware can
> reorder
> > requests to reduce unnecessary head seeks and revolutions, and only due
to
> > this.
> >
> > Your miniport has no head/revolutions knowledge, and thus cannot do the
> same.
> >
> > In a RAID, you can do the following though. If the request can be
serviced
> off
> > 1 disk - then it is not necessary to block the whole RAID for its
> duration. You
> > can allow requests to other disks.
> >
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > xxxxx@storagecraft.com
> > http://www.storagecraft.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@storagecraft.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

I disagree.

IDE (ATA) supports the concept of tagged queuing as does SATA.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]
Sent: Monday, June 14, 2004 1:06 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

Exactly. IDE is far away from these things. :slight_smile:

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Monday, June 14, 2004 12:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID

So, no tagged queue and no disconnects :slight_smile:

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Saxena, Ajitabh Prakash”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 14, 2004 7:25 PM
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

> Hi Shakeel,
>
> There is no way to do that. The IDE controllers have one DMA
controller
per
> channel
> and once the DMA is active you should not touch the channel till yu
issue
a
> STOP_TRANSFER
> in ISR to that channel’s Bus Master DMA. So since you can fire only
one
> command per channel
> it will be your internal logic that determines which command is
current.
You
> will still be able to
> fire commands simultaneously on different channels. So, For IDE RAID
> controller the best performance
> can only be obtained when the drives are placed on two different
channels.
> Also remember that equations change for SATA.
>
> Thanks,
> Ajitabh
>
> -----Original Message-----
> From: shakeel [mailto:xxxxx@yahoo.com]
> Sent: Thursday, June 10, 2004 4:12 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID
>
>
> Thanks Maxim,
>
> Good point. Currently in miniport I won’t allow more than one
outstanding
> request for controller. If the miniport driver is processing SRB it
returns
> status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and modified
it
to
> work for 2K/XP. I think the reason being is, Since there is one
interrupt
> handler for the controller how will it know which disk drive completed
the
> transfer if multiple outstanding requests are allowed. I may be wrong
here,
> Is there way to send request to other drives while the first one is
still
in
> middle of transfer for an IDE RAID controller.
>
> Thanks in advance,
> Shakeel.
>
> BOOLEAN
> AtapiStartIo(
> IN PVOID HwDeviceExtension,
> IN PSCSI_REQUEST_BLOCK Srb
> )
>
> /++
>
> Routine Description:
>
> This routine is called from the SCSI port driver synchronized
> with the kernel to start an IO request.
>
> Arguments:
>
> HwDeviceExtension - HBA miniport driver’s adapter data storage
> Srb - IO request packet
>
> Return Value:
>
> TRUE
>
> –
/
>
> {
> PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
> ULONG status;
>
> //
> // Determine which function.
> //
>
> switch (Srb->Function) {
>
> case SRB_FUNCTION_EXECUTE_SCSI:
>
> //
> // Sanity check. Only one request can be outstanding on a
> // controller.
> //
>
> if (deviceExtension->CurrentSrb) {
>
> DebugPrint((1,
> “AtapiStartIo: Already have a request!\n”));
> Srb->SrbStatus = SRB_STATUS_BUSY;
> ScsiPortNotification(RequestComplete,
> deviceExtension,
> Srb);
> return FALSE;
> }
>
> //
> // Indicate that a request is active on the controller.
> //
>
> deviceExtension->CurrentSrb = Srb;
>
> //
> // Send command to device.
> //
>
> if (deviceExtension->DeviceFlags[Srb->TargetId] &
> DFLAGS_ATAPI_DEVICE) {
>
> status = AtapiSendCommand(HwDeviceExtension,
> Srb);
>
> } else if (deviceExtension->DeviceFlags[Srb->TargetId] &
> DFLAGS_DEVICE_PRESENT) {
>
> status = IdeSendCommand(HwDeviceExtension,
> Srb);
> } else {
>
> status = SRB_STATUS_SELECTION_TIMEOUT;
> }
>
> break;
>
> case SRB_FUNCTION_ABORT_COMMAND:
>
> //
> // Verify that SRB to abort is still outstanding.
> //
>
> if (!deviceExtension->CurrentSrb) {
>
> DebugPrint((1, “AtapiStartIo: SRB to abort already
> completed\n”));
>
> //
> // Complete abort SRB.
> //
>
> status = SRB_STATUS_ABORT_FAILED;
>
> break;
> }
>
> //
> // Abort function indicates that a request timed out.
> // Call reset routine. Card will only be reset if
> // status indicates something is wrong.
> // Fall through to reset code.
> //
>
> case SRB_FUNCTION_RESET_BUS:
>
> //
> // Reset Atapi and SCSI bus.
> //
>
> DebugPrint((1, “AtapiStartIo: Reset bus request received\n”));
>
> if (!AtapiResetController(deviceExtension,
> Srb->PathId)) {
>
> DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));
>
> //
> // Log reset failure.
> //
>
> ScsiPortLogError(
> HwDeviceExtension,
> NULL,
> 0,
> 0,
> 0,
> SP_INTERNAL_ADAPTER_ERROR,
> 5 << 8
> );
>
> status = SRB_STATUS_ERROR;
>
> } else {
>
> status = SRB_STATUS_SUCCESS;
> }
>
> break;
>
> default :
>
> status = SRB_STATUS_INVALID_REQUEST;
> break;
>
> }
>
> break;
>
> default:
>
> //
> // Indicate unsupported command.
> //
>
> status = SRB_STATUS_INVALID_REQUEST;
>
> break;
>
> } // end switch
>
> //
> // Check if command complete.
> //
>
> if (status != SRB_STATUS_PENDING) {
>
> DebugPrint((2,
> “AtapiStartIo: Srb %x complete with status %x\n”,
> Srb,
> status));
>
> //
> // Clear current SRB.
> //
>
> deviceExtension->CurrentSrb = NULL;
>
> //
> // Set status in SRB.
> //
>
> Srb->SrbStatus = (UCHAR)status;
>
> //
> // Indicate command complete.
> //
>
> ScsiPortNotification(RequestComplete,
> deviceExtension,
> Srb);
>
> //
> // Indicate ready for next request.
> //
>
> ScsiPortNotification(NextRequest,
> deviceExtension,
> NULL);
> }
>
> return TRUE;
>
> } // end AtapiStartIo()
>
>
> “Maxim S. Shatskih” wrote in message
> news:xxxxx@ntdev…
> > > Is Implementing a QUEUE in miniport driver gives any performance
> > > improvements?
> >
> > No. It is absolutely irrelevant where the queue is - in SCSIPORT or
in
> your
> > miniport.
> >
> > The firmware queue in the disk is better since the disk firmware can
> reorder
> > requests to reduce unnecessary head seeks and revolutions, and only
due
to
> > this.
> >
> > Your miniport has no head/revolutions knowledge, and thus cannot do
the
> same.
> >
> > In a RAID, you can do the following though. If the request can be
serviced
> off
> > 1 disk - then it is not necessary to block the whole RAID for its
> duration. You
> > can allow requests to other disks.
> >
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > xxxxx@storagecraft.com
> > http://www.storagecraft.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@storagecraft.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@nvidia.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

How can you do disconnects if the bus does not support multiple initiators?
To be fully asynchronous I would think that the device would have to be able
to request control of the bus when it needs it. Otherwise, it will have to
wait until it is polled and that time between device ready and poll seen
would add to average access time. With a single controller for each device,
then why waste the time disconnecting at all? SCSI can be a little
inefficient if you only have one device on a single controller with all the
disconnects, reconnects. Maybe some of the better SCSI controllers suppress
that feature if it won’t buy anything. I remember that some of the Adaptec
controllers have a BIOS that permits selective setting of some features on a
per SCSI ID basis.

“Saxena, Ajitabh Prakash” wrote in message
news:xxxxx@ntdev…
> Exactly. IDE is far away from these things. :slight_smile:
>
> -----Original Message-----
> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> Sent: Monday, June 14, 2004 12:02 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> So, no tagged queue and no disconnects :slight_smile:
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> ----- Original Message -----
> From: “Saxena, Ajitabh Prakash”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, June 14, 2004 7:25 PM
> Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> > Hi Shakeel,
> >
> > There is no way to do that. The IDE controllers have one DMA controller
> per
> > channel
> > and once the DMA is active you should not touch the channel till yu
issue
> a
> > STOP_TRANSFER
> > in ISR to that channel’s Bus Master DMA. So since you can fire only one
> > command per channel
> > it will be your internal logic that determines which command is current.
> You
> > will still be able to
> > fire commands simultaneously on different channels. So, For IDE RAID
> > controller the best performance
> > can only be obtained when the drives are placed on two different
channels.
> > Also remember that equations change for SATA.
> >
> > Thanks,
> > Ajitabh
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Thursday, June 10, 2004 4:12 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID
> >
> >
> > Thanks Maxim,
> >
> > Good point. Currently in miniport I won’t allow more than one
outstanding
> > request for controller. If the miniport driver is processing SRB it
> returns
> > status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and modified
it
> to
> > work for 2K/XP. I think the reason being is, Since there is one
interrupt
> > handler for the controller how will it know which disk drive completed
the
> > transfer if multiple outstanding requests are allowed. I may be wrong
> here,
> > Is there way to send request to other drives while the first one is
still
> in
> > middle of transfer for an IDE RAID controller.
> >
> > Thanks in advance,
> > Shakeel.
> >
> > BOOLEAN
> > AtapiStartIo(
> > IN PVOID HwDeviceExtension,
> > IN PSCSI_REQUEST_BLOCK Srb
> > )
> >
> > /++
> >
> > Routine Description:
> >
> > This routine is called from the SCSI port driver synchronized
> > with the kernel to start an IO request.
> >
> > Arguments:
> >
> > HwDeviceExtension - HBA miniport driver’s adapter data storage
> > Srb - IO request packet
> >
> > Return Value:
> >
> > TRUE
> >
> > –
/
> >
> > {
> > PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
> > ULONG status;
> >
> > //
> > // Determine which function.
> > //
> >
> > switch (Srb->Function) {
> >
> > case SRB_FUNCTION_EXECUTE_SCSI:
> >
> > //
> > // Sanity check. Only one request can be outstanding on a
> > // controller.
> > //
> >
> > if (deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1,
> > “AtapiStartIo: Already have a request!\n”));
> > Srb->SrbStatus = SRB_STATUS_BUSY;
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> > return FALSE;
> > }
> >
> > //
> > // Indicate that a request is active on the controller.
> > //
> >
> > deviceExtension->CurrentSrb = Srb;
> >
> > //
> > // Send command to device.
> > //
> >
> > if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_ATAPI_DEVICE) {
> >
> > status = AtapiSendCommand(HwDeviceExtension,
> > Srb);
> >
> > } else if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_DEVICE_PRESENT) {
> >
> > status = IdeSendCommand(HwDeviceExtension,
> > Srb);
> > } else {
> >
> > status = SRB_STATUS_SELECTION_TIMEOUT;
> > }
> >
> > break;
> >
> > case SRB_FUNCTION_ABORT_COMMAND:
> >
> > //
> > // Verify that SRB to abort is still outstanding.
> > //
> >
> > if (!deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1, “AtapiStartIo: SRB to abort already
> > completed\n”));
> >
> > //
> > // Complete abort SRB.
> > //
> >
> > status = SRB_STATUS_ABORT_FAILED;
> >
> > break;
> > }
> >
> > //
> > // Abort function indicates that a request timed out.
> > // Call reset routine. Card will only be reset if
> > // status indicates something is wrong.
> > // Fall through to reset code.
> > //
> >
> > case SRB_FUNCTION_RESET_BUS:
> >
> > //
> > // Reset Atapi and SCSI bus.
> > //
> >
> > DebugPrint((1, “AtapiStartIo: Reset bus request received\n”));
> >
> > if (!AtapiResetController(deviceExtension,
> > Srb->PathId)) {
> >
> > DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));
> >
> > //
> > // Log reset failure.
> > //
> >
> > ScsiPortLogError(
> > HwDeviceExtension,
> > NULL,
> > 0,
> > 0,
> > 0,
> > SP_INTERNAL_ADAPTER_ERROR,
> > 5 << 8
> > );
> >
> > status = SRB_STATUS_ERROR;
> >
> > } else {
> >
> > status = SRB_STATUS_SUCCESS;
> > }
> >
> > break;
> >
> > default :
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> > break;
> >
> > }
> >
> > break;
> >
> > default:
> >
> > //
> > // Indicate unsupported command.
> > //
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> >
> > break;
> >
> > } // end switch
> >
> > //
> > // Check if command complete.
> > //
> >
> > if (status != SRB_STATUS_PENDING) {
> >
> > DebugPrint((2,
> > “AtapiStartIo: Srb %x complete with status %x\n”,
> > Srb,
> > status));
> >
> > //
> > // Clear current SRB.
> > //
> >
> > deviceExtension->CurrentSrb = NULL;
> >
> > //
> > // Set status in SRB.
> > //
> >
> > Srb->SrbStatus = (UCHAR)status;
> >
> > //
> > // Indicate command complete.
> > //
> >
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> >
> > //
> > // Indicate ready for next request.
> > //
> >
> > ScsiPortNotification(NextRequest,
> > deviceExtension,
> > NULL);
> > }
> >
> > return TRUE;
> >
> > } // end AtapiStartIo()
> >
> >
> > “Maxim S. Shatskih” wrote in message
> > news:xxxxx@ntdev…
> > > > Is Implementing a QUEUE in miniport driver gives any performance
> > > > improvements?
> > >
> > > No. It is absolutely irrelevant where the queue is - in SCSIPORT or in
> > your
> > > miniport.
> > >
> > > The firmware queue in the disk is better since the disk firmware can
> > reorder
> > > requests to reduce unnecessary head seeks and revolutions, and only
due
> to
> > > this.
> > >
> > > Your miniport has no head/revolutions knowledge, and thus cannot do
the
> > same.
> > >
> > > In a RAID, you can do the following though. If the request can be
> serviced
> > off
> > > 1 disk - then it is not necessary to block the whole RAID for its
> > duration. You
> > > can allow requests to other disks.
> > >
> > > Maxim Shatskih, Windows DDK MVP
> > > StorageCraft Corporation
> > > xxxxx@storagecraft.com
> > > http://www.storagecraft.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@storagecraft.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
>

Concept != implemented. AFAIK there are no commercially available SATA-I
drives that support command queuing.

For example see
http://www.seagate.com/docs/pdf/whitepaper/D2c_tech_paper_intc-stx_sata_ncq.
pdf

=====================
Mark Roddy

-----Original Message-----
From: Mark Overby [mailto:xxxxx@nvidia.com]
Sent: Monday, June 14, 2004 4:12 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

I disagree.

IDE (ATA) supports the concept of tagged queuing as does SATA.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]
Sent: Monday, June 14, 2004 1:06 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

Exactly. IDE is far away from these things. :slight_smile:

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Monday, June 14, 2004 12:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID

So, no tagged queue and no disconnects :slight_smile:

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Saxena, Ajitabh Prakash”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 14, 2004 7:25 PM
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

> Hi Shakeel,
>
> There is no way to do that. The IDE controllers have one DMA
controller
per
> channel
> and once the DMA is active you should not touch the channel till yu
issue
a
> STOP_TRANSFER
> in ISR to that channel’s Bus Master DMA. So since you can fire only
one
> command per channel
> it will be your internal logic that determines which command is
current.
You
> will still be able to
> fire commands simultaneously on different channels. So, For IDE RAID
> controller the best performance
> can only be obtained when the drives are placed on two different
channels.
> Also remember that equations change for SATA.
>
> Thanks,
> Ajitabh
>
> -----Original Message-----
> From: shakeel [mailto:xxxxx@yahoo.com]
> Sent: Thursday, June 10, 2004 4:12 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID
>
>
> Thanks Maxim,
>
> Good point. Currently in miniport I won’t allow more than one
outstanding
> request for controller. If the miniport driver is processing SRB it
returns
> status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and modified
it
to
> work for 2K/XP. I think the reason being is, Since there is one
interrupt
> handler for the controller how will it know which disk drive completed
the
> transfer if multiple outstanding requests are allowed. I may be wrong
here,
> Is there way to send request to other drives while the first one is
still
in
> middle of transfer for an IDE RAID controller.
>
> Thanks in advance,
> Shakeel.
>
> BOOLEAN
> AtapiStartIo(
> IN PVOID HwDeviceExtension,
> IN PSCSI_REQUEST_BLOCK Srb
> )
>
> /++
>
> Routine Description:
>
> This routine is called from the SCSI port driver synchronized
> with the kernel to start an IO request.
>
> Arguments:
>
> HwDeviceExtension - HBA miniport driver’s adapter data storage
> Srb - IO request packet
>
> Return Value:
>
> TRUE
>
> –
/
>
> {
> PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
> ULONG status;
>
> //
> // Determine which function.
> //
>
> switch (Srb->Function) {
>
> case SRB_FUNCTION_EXECUTE_SCSI:
>
> //
> // Sanity check. Only one request can be outstanding on a
> // controller.
> //
>
> if (deviceExtension->CurrentSrb) {
>
> DebugPrint((1,
> “AtapiStartIo: Already have a request!\n”));
> Srb->SrbStatus = SRB_STATUS_BUSY;
> ScsiPortNotification(RequestComplete,
> deviceExtension,
> Srb);
> return FALSE;
> }
>
> //
> // Indicate that a request is active on the controller.
> //
>
> deviceExtension->CurrentSrb = Srb;
>
> //
> // Send command to device.
> //
>
> if (deviceExtension->DeviceFlags[Srb->TargetId] &
> DFLAGS_ATAPI_DEVICE) {
>
> status = AtapiSendCommand(HwDeviceExtension,
> Srb);
>
> } else if (deviceExtension->DeviceFlags[Srb->TargetId] &
> DFLAGS_DEVICE_PRESENT) {
>
> status = IdeSendCommand(HwDeviceExtension,
> Srb);
> } else {
>
> status = SRB_STATUS_SELECTION_TIMEOUT;
> }
>
> break;
>
> case SRB_FUNCTION_ABORT_COMMAND:
>
> //
> // Verify that SRB to abort is still outstanding.
> //
>
> if (!deviceExtension->CurrentSrb) {
>
> DebugPrint((1, “AtapiStartIo: SRB to abort already
> completed\n”));
>
> //
> // Complete abort SRB.
> //
>
> status = SRB_STATUS_ABORT_FAILED;
>
> break;
> }
>
> //
> // Abort function indicates that a request timed out.
> // Call reset routine. Card will only be reset if
> // status indicates something is wrong.
> // Fall through to reset code.
> //
>
> case SRB_FUNCTION_RESET_BUS:
>
> //
> // Reset Atapi and SCSI bus.
> //
>
> DebugPrint((1, “AtapiStartIo: Reset bus request received\n”));
>
> if (!AtapiResetController(deviceExtension,
> Srb->PathId)) {
>
> DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));
>
> //
> // Log reset failure.
> //
>
> ScsiPortLogError(
> HwDeviceExtension,
> NULL,
> 0,
> 0,
> 0,
> SP_INTERNAL_ADAPTER_ERROR,
> 5 << 8
> );
>
> status = SRB_STATUS_ERROR;
>
> } else {
>
> status = SRB_STATUS_SUCCESS;
> }
>
> break;
>
> default :
>
> status = SRB_STATUS_INVALID_REQUEST;
> break;
>
> }
>
> break;
>
> default:
>
> //
> // Indicate unsupported command.
> //
>
> status = SRB_STATUS_INVALID_REQUEST;
>
> break;
>
> } // end switch
>
> //
> // Check if command complete.
> //
>
> if (status != SRB_STATUS_PENDING) {
>
> DebugPrint((2,
> “AtapiStartIo: Srb %x complete with status %x\n”,
> Srb,
> status));
>
> //
> // Clear current SRB.
> //
>
> deviceExtension->CurrentSrb = NULL;
>
> //
> // Set status in SRB.
> //
>
> Srb->SrbStatus = (UCHAR)status;
>
> //
> // Indicate command complete.
> //
>
> ScsiPortNotification(RequestComplete,
> deviceExtension,
> Srb);
>
> //
> // Indicate ready for next request.
> //
>
> ScsiPortNotification(NextRequest,
> deviceExtension,
> NULL);
> }
>
> return TRUE;
>
> } // end AtapiStartIo()
>
>
> “Maxim S. Shatskih” wrote in message
> news:xxxxx@ntdev…
> > > Is Implementing a QUEUE in miniport driver gives any performance
> > > improvements?
> >
> > No. It is absolutely irrelevant where the queue is - in SCSIPORT or
in
> your
> > miniport.
> >
> > The firmware queue in the disk is better since the disk firmware can
> reorder
> > requests to reduce unnecessary head seeks and revolutions, and only
due
to
> > this.
> >
> > Your miniport has no head/revolutions knowledge, and thus cannot do
the
> same.
> >
> > In a RAID, you can do the following though. If the request can be
serviced
> off
> > 1 disk - then it is not necessary to block the whole RAID for its
> duration. You
> > can allow requests to other disks.
> >
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > xxxxx@storagecraft.com
> > http://www.storagecraft.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@storagecraft.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@nvidia.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@stratus.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

If the controller’s DMA facility supports only 1 operation a time - then
the whole tagged queue thing does away, even if the bus and the drive support
it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Mark Overby”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, June 15, 2004 12:12 AM
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

> I disagree.
>
> IDE (ATA) supports the concept of tagged queuing as does SATA.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]
> Sent: Monday, June 14, 2004 1:06 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID
>
> Exactly. IDE is far away from these things. :slight_smile:
>
> -----Original Message-----
> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> Sent: Monday, June 14, 2004 12:02 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> So, no tagged queue and no disconnects :slight_smile:
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> ----- Original Message -----
> From: “Saxena, Ajitabh Prakash”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, June 14, 2004 7:25 PM
> Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> > Hi Shakeel,
> >
> > There is no way to do that. The IDE controllers have one DMA
> controller
> per
> > channel
> > and once the DMA is active you should not touch the channel till yu
> issue
> a
> > STOP_TRANSFER
> > in ISR to that channel’s Bus Master DMA. So since you can fire only
> one
> > command per channel
> > it will be your internal logic that determines which command is
> current.
> You
> > will still be able to
> > fire commands simultaneously on different channels. So, For IDE RAID
> > controller the best performance
> > can only be obtained when the drives are placed on two different
> channels.
> > Also remember that equations change for SATA.
> >
> > Thanks,
> > Ajitabh
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Thursday, June 10, 2004 4:12 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID
> >
> >
> > Thanks Maxim,
> >
> > Good point. Currently in miniport I won’t allow more than one
> outstanding
> > request for controller. If the miniport driver is processing SRB it
> returns
> > status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and modified
> it
> to
> > work for 2K/XP. I think the reason being is, Since there is one
> interrupt
> > handler for the controller how will it know which disk drive completed
> the
> > transfer if multiple outstanding requests are allowed. I may be wrong
> here,
> > Is there way to send request to other drives while the first one is
> still
> in
> > middle of transfer for an IDE RAID controller.
> >
> > Thanks in advance,
> > Shakeel.
> >
> > BOOLEAN
> > AtapiStartIo(
> > IN PVOID HwDeviceExtension,
> > IN PSCSI_REQUEST_BLOCK Srb
> > )
> >
> > /++
> >
> > Routine Description:
> >
> > This routine is called from the SCSI port driver synchronized
> > with the kernel to start an IO request.
> >
> > Arguments:
> >
> > HwDeviceExtension - HBA miniport driver’s adapter data storage
> > Srb - IO request packet
> >
> > Return Value:
> >
> > TRUE
> >
> > –
/
> >
> > {
> > PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
> > ULONG status;
> >
> > //
> > // Determine which function.
> > //
> >
> > switch (Srb->Function) {
> >
> > case SRB_FUNCTION_EXECUTE_SCSI:
> >
> > //
> > // Sanity check. Only one request can be outstanding on a
> > // controller.
> > //
> >
> > if (deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1,
> > “AtapiStartIo: Already have a request!\n”));
> > Srb->SrbStatus = SRB_STATUS_BUSY;
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> > return FALSE;
> > }
> >
> > //
> > // Indicate that a request is active on the controller.
> > //
> >
> > deviceExtension->CurrentSrb = Srb;
> >
> > //
> > // Send command to device.
> > //
> >
> > if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_ATAPI_DEVICE) {
> >
> > status = AtapiSendCommand(HwDeviceExtension,
> > Srb);
> >
> > } else if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_DEVICE_PRESENT) {
> >
> > status = IdeSendCommand(HwDeviceExtension,
> > Srb);
> > } else {
> >
> > status = SRB_STATUS_SELECTION_TIMEOUT;
> > }
> >
> > break;
> >
> > case SRB_FUNCTION_ABORT_COMMAND:
> >
> > //
> > // Verify that SRB to abort is still outstanding.
> > //
> >
> > if (!deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1, “AtapiStartIo: SRB to abort already
> > completed\n”));
> >
> > //
> > // Complete abort SRB.
> > //
> >
> > status = SRB_STATUS_ABORT_FAILED;
> >
> > break;
> > }
> >
> > //
> > // Abort function indicates that a request timed out.
> > // Call reset routine. Card will only be reset if
> > // status indicates something is wrong.
> > // Fall through to reset code.
> > //
> >
> > case SRB_FUNCTION_RESET_BUS:
> >
> > //
> > // Reset Atapi and SCSI bus.
> > //
> >
> > DebugPrint((1, “AtapiStartIo: Reset bus request received\n”));
> >
> > if (!AtapiResetController(deviceExtension,
> > Srb->PathId)) {
> >
> > DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));
> >
> > //
> > // Log reset failure.
> > //
> >
> > ScsiPortLogError(
> > HwDeviceExtension,
> > NULL,
> > 0,
> > 0,
> > 0,
> > SP_INTERNAL_ADAPTER_ERROR,
> > 5 << 8
> > );
> >
> > status = SRB_STATUS_ERROR;
> >
> > } else {
> >
> > status = SRB_STATUS_SUCCESS;
> > }
> >
> > break;
> >
> > default :
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> > break;
> >
> > }
> >
> > break;
> >
> > default:
> >
> > //
> > // Indicate unsupported command.
> > //
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> >
> > break;
> >
> > } // end switch
> >
> > //
> > // Check if command complete.
> > //
> >
> > if (status != SRB_STATUS_PENDING) {
> >
> > DebugPrint((2,
> > “AtapiStartIo: Srb %x complete with status %x\n”,
> > Srb,
> > status));
> >
> > //
> > // Clear current SRB.
> > //
> >
> > deviceExtension->CurrentSrb = NULL;
> >
> > //
> > // Set status in SRB.
> > //
> >
> > Srb->SrbStatus = (UCHAR)status;
> >
> > //
> > // Indicate command complete.
> > //
> >
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> >
> > //
> > // Indicate ready for next request.
> > //
> >
> > ScsiPortNotification(NextRequest,
> > deviceExtension,
> > NULL);
> > }
> >
> > return TRUE;
> >
> > } // end AtapiStartIo()
> >
> >
> > “Maxim S. Shatskih” wrote in message
> > news:xxxxx@ntdev…
> > > > Is Implementing a QUEUE in miniport driver gives any performance
> > > > improvements?
> > >
> > > No. It is absolutely irrelevant where the queue is - in SCSIPORT or
> in
> > your
> > > miniport.
> > >
> > > The firmware queue in the disk is better since the disk firmware can
> > reorder
> > > requests to reduce unnecessary head seeks and revolutions, and only
> due
> to
> > > this.
> > >
> > > Your miniport has no head/revolutions knowledge, and thus cannot do
> the
> > same.
> > >
> > > In a RAID, you can do the following though. If the request can be
> serviced
> > off
> > > 1 disk - then it is not necessary to block the whole RAID for its
> > duration. You
> > > can allow requests to other disks.
> > >
> > > Maxim Shatskih, Windows DDK MVP
> > > StorageCraft Corporation
> > > xxxxx@storagecraft.com
> > > http://www.storagecraft.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@storagecraft.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@nvidia.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@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Ah, but there is at least one that is commercially available.

Western Digital Raptor 740GD

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]
Sent: Monday, June 14, 2004 1:47 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

Concept != implemented. AFAIK there are no commercially available SATA-I
drives that support command queuing.

For example see
http://www.seagate.com/docs/pdf/whitepaper/D2c_tech_paper_intc-stx_sata_
ncq.
pdf

=====================
Mark Roddy

-----Original Message-----
From: Mark Overby [mailto:xxxxx@nvidia.com]
Sent: Monday, June 14, 2004 4:12 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

I disagree.

IDE (ATA) supports the concept of tagged queuing as does SATA.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]
Sent: Monday, June 14, 2004 1:06 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

Exactly. IDE is far away from these things. :slight_smile:

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Monday, June 14, 2004 12:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID

So, no tagged queue and no disconnects :slight_smile:

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Saxena, Ajitabh Prakash”
To: “Windows System Software Devs Interest List”
Sent: Monday, June 14, 2004 7:25 PM
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

> Hi Shakeel,
>
> There is no way to do that. The IDE controllers have one DMA
controller
per
> channel
> and once the DMA is active you should not touch the channel till yu
issue
a
> STOP_TRANSFER
> in ISR to that channel’s Bus Master DMA. So since you can fire only
one
> command per channel
> it will be your internal logic that determines which command is
current.
You
> will still be able to
> fire commands simultaneously on different channels. So, For IDE RAID
> controller the best performance
> can only be obtained when the drives are placed on two different
channels.
> Also remember that equations change for SATA.
>
> Thanks,
> Ajitabh
>
> -----Original Message-----
> From: shakeel [mailto:xxxxx@yahoo.com]
> Sent: Thursday, June 10, 2004 4:12 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID
>
>
> Thanks Maxim,
>
> Good point. Currently in miniport I won’t allow more than one
outstanding
> request for controller. If the miniport driver is processing SRB it
returns
> status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and modified
it
to
> work for 2K/XP. I think the reason being is, Since there is one
interrupt
> handler for the controller how will it know which disk drive completed
the
> transfer if multiple outstanding requests are allowed. I may be wrong
here,
> Is there way to send request to other drives while the first one is
still
in
> middle of transfer for an IDE RAID controller.
>
> Thanks in advance,
> Shakeel.
>
> BOOLEAN
> AtapiStartIo(
> IN PVOID HwDeviceExtension,
> IN PSCSI_REQUEST_BLOCK Srb
> )
>
> /++
>
> Routine Description:
>
> This routine is called from the SCSI port driver synchronized
> with the kernel to start an IO request.
>
> Arguments:
>
> HwDeviceExtension - HBA miniport driver’s adapter data storage
> Srb - IO request packet
>
> Return Value:
>
> TRUE
>
> –
/
>
> {
> PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
> ULONG status;
>
> //
> // Determine which function.
> //
>
> switch (Srb->Function) {
>
> case SRB_FUNCTION_EXECUTE_SCSI:
>
> //
> // Sanity check. Only one request can be outstanding on a
> // controller.
> //
>
> if (deviceExtension->CurrentSrb) {
>
> DebugPrint((1,
> “AtapiStartIo: Already have a request!\n”));
> Srb->SrbStatus = SRB_STATUS_BUSY;
> ScsiPortNotification(RequestComplete,
> deviceExtension,
> Srb);
> return FALSE;
> }
>
> //
> // Indicate that a request is active on the controller.
> //
>
> deviceExtension->CurrentSrb = Srb;
>
> //
> // Send command to device.
> //
>
> if (deviceExtension->DeviceFlags[Srb->TargetId] &
> DFLAGS_ATAPI_DEVICE) {
>
> status = AtapiSendCommand(HwDeviceExtension,
> Srb);
>
> } else if (deviceExtension->DeviceFlags[Srb->TargetId] &
> DFLAGS_DEVICE_PRESENT) {
>
> status = IdeSendCommand(HwDeviceExtension,
> Srb);
> } else {
>
> status = SRB_STATUS_SELECTION_TIMEOUT;
> }
>
> break;
>
> case SRB_FUNCTION_ABORT_COMMAND:
>
> //
> // Verify that SRB to abort is still outstanding.
> //
>
> if (!deviceExtension->CurrentSrb) {
>
> DebugPrint((1, “AtapiStartIo: SRB to abort already
> completed\n”));
>
> //
> // Complete abort SRB.
> //
>
> status = SRB_STATUS_ABORT_FAILED;
>
> break;
> }
>
> //
> // Abort function indicates that a request timed out.
> // Call reset routine. Card will only be reset if
> // status indicates something is wrong.
> // Fall through to reset code.
> //
>
> case SRB_FUNCTION_RESET_BUS:
>
> //
> // Reset Atapi and SCSI bus.
> //
>
> DebugPrint((1, “AtapiStartIo: Reset bus request received\n”));
>
> if (!AtapiResetController(deviceExtension,
> Srb->PathId)) {
>
> DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));
>
> //
> // Log reset failure.
> //
>
> ScsiPortLogError(
> HwDeviceExtension,
> NULL,
> 0,
> 0,
> 0,
> SP_INTERNAL_ADAPTER_ERROR,
> 5 << 8
> );
>
> status = SRB_STATUS_ERROR;
>
> } else {
>
> status = SRB_STATUS_SUCCESS;
> }
>
> break;
>
> default :
>
> status = SRB_STATUS_INVALID_REQUEST;
> break;
>
> }
>
> break;
>
> default:
>
> //
> // Indicate unsupported command.
> //
>
> status = SRB_STATUS_INVALID_REQUEST;
>
> break;
>
> } // end switch
>
> //
> // Check if command complete.
> //
>
> if (status != SRB_STATUS_PENDING) {
>
> DebugPrint((2,
> “AtapiStartIo: Srb %x complete with status %x\n”,
> Srb,
> status));
>
> //
> // Clear current SRB.
> //
>
> deviceExtension->CurrentSrb = NULL;
>
> //
> // Set status in SRB.
> //
>
> Srb->SrbStatus = (UCHAR)status;
>
> //
> // Indicate command complete.
> //
>
> ScsiPortNotification(RequestComplete,
> deviceExtension,
> Srb);
>
> //
> // Indicate ready for next request.
> //
>
> ScsiPortNotification(NextRequest,
> deviceExtension,
> NULL);
> }
>
> return TRUE;
>
> } // end AtapiStartIo()
>
>
> “Maxim S. Shatskih” wrote in message
> news:xxxxx@ntdev…
> > > Is Implementing a QUEUE in miniport driver gives any performance
> > > improvements?
> >
> > No. It is absolutely irrelevant where the queue is - in SCSIPORT or
in
> your
> > miniport.
> >
> > The firmware queue in the disk is better since the disk firmware can
> reorder
> > requests to reduce unnecessary head seeks and revolutions, and only
due
to
> > this.
> >
> > Your miniport has no head/revolutions knowledge, and thus cannot do
the
> same.
> >
> > In a RAID, you can do the following though. If the request can be
serviced
> off
> > 1 disk - then it is not necessary to block the whole RAID for its
> duration. You
> > can allow requests to other disks.
> >
> > Maxim Shatskih, Windows DDK MVP
> > StorageCraft Corporation
> > xxxxx@storagecraft.com
> > http://www.storagecraft.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@storagecraft.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@nvidia.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@stratus.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@nvidia.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Yes, but there are controllers out there that can maintain multiple DMA
contexts and bounce back and forth between operations.

I agree that this used to be the case, but the world in storage is
changing rapidly is this regard. Yes, ATA-7 (and the working group that
I can’t talk about) (P-ATA and S-ATA) command queuing is not nearly as
clean as SCSI tag queuing, but it is certainly much better than the old
days.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]
Sent: Monday, June 14, 2004 2:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID

If the controller’s DMA facility supports only 1 operation a time -
then
the whole tagged queue thing does away, even if the bus and the drive
support
it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Mark Overby”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, June 15, 2004 12:12 AM
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

> I disagree.
>
> IDE (ATA) supports the concept of tagged queuing as does SATA.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]
> Sent: Monday, June 14, 2004 1:06 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID
>
> Exactly. IDE is far away from these things. :slight_smile:
>
> -----Original Message-----
> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> Sent: Monday, June 14, 2004 12:02 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> So, no tagged queue and no disconnects :slight_smile:
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> ----- Original Message -----
> From: “Saxena, Ajitabh Prakash”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, June 14, 2004 7:25 PM
> Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> > Hi Shakeel,
> >
> > There is no way to do that. The IDE controllers have one DMA
> controller
> per
> > channel
> > and once the DMA is active you should not touch the channel till yu
> issue
> a
> > STOP_TRANSFER
> > in ISR to that channel’s Bus Master DMA. So since you can fire only
> one
> > command per channel
> > it will be your internal logic that determines which command is
> current.
> You
> > will still be able to
> > fire commands simultaneously on different channels. So, For IDE RAID
> > controller the best performance
> > can only be obtained when the drives are placed on two different
> channels.
> > Also remember that equations change for SATA.
> >
> > Thanks,
> > Ajitabh
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Thursday, June 10, 2004 4:12 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID
> >
> >
> > Thanks Maxim,
> >
> > Good point. Currently in miniport I won’t allow more than one
> outstanding
> > request for controller. If the miniport driver is processing SRB it
> returns
> > status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and
modified
> it
> to
> > work for 2K/XP. I think the reason being is, Since there is one
> interrupt
> > handler for the controller how will it know which disk drive
completed
> the
> > transfer if multiple outstanding requests are allowed. I may be
wrong
> here,
> > Is there way to send request to other drives while the first one is
> still
> in
> > middle of transfer for an IDE RAID controller.
> >
> > Thanks in advance,
> > Shakeel.
> >
> > BOOLEAN
> > AtapiStartIo(
> > IN PVOID HwDeviceExtension,
> > IN PSCSI_REQUEST_BLOCK Srb
> > )
> >
> > /++
> >
> > Routine Description:
> >
> > This routine is called from the SCSI port driver synchronized
> > with the kernel to start an IO request.
> >
> > Arguments:
> >
> > HwDeviceExtension - HBA miniport driver’s adapter data storage
> > Srb - IO request packet
> >
> > Return Value:
> >
> > TRUE
> >
> > –
/
> >
> > {
> > PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
> > ULONG status;
> >
> > //
> > // Determine which function.
> > //
> >
> > switch (Srb->Function) {
> >
> > case SRB_FUNCTION_EXECUTE_SCSI:
> >
> > //
> > // Sanity check. Only one request can be outstanding on a
> > // controller.
> > //
> >
> > if (deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1,
> > “AtapiStartIo: Already have a request!\n”));
> > Srb->SrbStatus = SRB_STATUS_BUSY;
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> > return FALSE;
> > }
> >
> > //
> > // Indicate that a request is active on the controller.
> > //
> >
> > deviceExtension->CurrentSrb = Srb;
> >
> > //
> > // Send command to device.
> > //
> >
> > if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_ATAPI_DEVICE) {
> >
> > status = AtapiSendCommand(HwDeviceExtension,
> > Srb);
> >
> > } else if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_DEVICE_PRESENT) {
> >
> > status = IdeSendCommand(HwDeviceExtension,
> > Srb);
> > } else {
> >
> > status = SRB_STATUS_SELECTION_TIMEOUT;
> > }
> >
> > break;
> >
> > case SRB_FUNCTION_ABORT_COMMAND:
> >
> > //
> > // Verify that SRB to abort is still outstanding.
> > //
> >
> > if (!deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1, “AtapiStartIo: SRB to abort already
> > completed\n”));
> >
> > //
> > // Complete abort SRB.
> > //
> >
> > status = SRB_STATUS_ABORT_FAILED;
> >
> > break;
> > }
> >
> > //
> > // Abort function indicates that a request timed out.
> > // Call reset routine. Card will only be reset if
> > // status indicates something is wrong.
> > // Fall through to reset code.
> > //
> >
> > case SRB_FUNCTION_RESET_BUS:
> >
> > //
> > // Reset Atapi and SCSI bus.
> > //
> >
> > DebugPrint((1, “AtapiStartIo: Reset bus request
received\n”));
> >
> > if (!AtapiResetController(deviceExtension,
> > Srb->PathId)) {
> >
> > DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));
> >
> > //
> > // Log reset failure.
> > //
> >
> > ScsiPortLogError(
> > HwDeviceExtension,
> > NULL,
> > 0,
> > 0,
> > 0,
> > SP_INTERNAL_ADAPTER_ERROR,
> > 5 << 8
> > );
> >
> > status = SRB_STATUS_ERROR;
> >
> > } else {
> >
> > status = SRB_STATUS_SUCCESS;
> > }
> >
> > break;
> >
> > default :
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> > break;
> >
> > }
> >
> > break;
> >
> > default:
> >
> > //
> > // Indicate unsupported command.
> > //
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> >
> > break;
> >
> > } // end switch
> >
> > //
> > // Check if command complete.
> > //
> >
> > if (status != SRB_STATUS_PENDING) {
> >
> > DebugPrint((2,
> > “AtapiStartIo: Srb %x complete with status %x\n”,
> > Srb,
> > status));
> >
> > //
> > // Clear current SRB.
> > //
> >
> > deviceExtension->CurrentSrb = NULL;
> >
> > //
> > // Set status in SRB.
> > //
> >
> > Srb->SrbStatus = (UCHAR)status;
> >
> > //
> > // Indicate command complete.
> > //
> >
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> >
> > //
> > // Indicate ready for next request.
> > //
> >
> > ScsiPortNotification(NextRequest,
> > deviceExtension,
> > NULL);
> > }
> >
> > return TRUE;
> >
> > } // end AtapiStartIo()
> >
> >
> > “Maxim S. Shatskih” wrote in message
> > news:xxxxx@ntdev…
> > > > Is Implementing a QUEUE in miniport driver gives any performance
> > > > improvements?
> > >
> > > No. It is absolutely irrelevant where the queue is - in SCSIPORT
or
> in
> > your
> > > miniport.
> > >
> > > The firmware queue in the disk is better since the disk firmware
can
> > reorder
> > > requests to reduce unnecessary head seeks and revolutions, and
only
> due
> to
> > > this.
> > >
> > > Your miniport has no head/revolutions knowledge, and thus cannot
do
> the
> > same.
> > >
> > > In a RAID, you can do the following though. If the request can be
> serviced
> > off
> > > 1 disk - then it is not necessary to block the whole RAID for its
> > duration. You
> > > can allow requests to other disks.
> > >
> > > Maxim Shatskih, Windows DDK MVP
> > > StorageCraft Corporation
> > > xxxxx@storagecraft.com
> > > http://www.storagecraft.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@storagecraft.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@nvidia.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@storagecraft.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@nvidia.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

I have never seen a IDE controller that has QDMA.
I have seen SATA controllers that have some QDMA capability and not seen (as
of now) SATA drives that support native command queuing. But AFAIK they will
be out soon.
The SATA controllers that support command queues can have some benifits but
not exactly same as disconnects and reconnects in SCSI.
All the SATA controllers that has command queuing have some kind of shared
memory (in system RAM) in which the commands are put and the controller is
notified. But the controller executes the commands one at a time (single
DMA) but can do it’s optimizations. The only considerable benifit being a
single interrupt for multiple commands. This is not exaclty the disconnect
and re-connect feature.

Thanks,
Ajitabh

-----Original Message-----
From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Monday, June 14, 2004 5:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID

If the controller’s DMA facility supports only 1 operation a time - then
the whole tagged queue thing does away, even if the bus and the drive
support
it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Mark Overby”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, June 15, 2004 12:12 AM
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

> I disagree.
>
> IDE (ATA) supports the concept of tagged queuing as does SATA.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]
> Sent: Monday, June 14, 2004 1:06 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID
>
> Exactly. IDE is far away from these things. :slight_smile:
>
> -----Original Message-----
> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> Sent: Monday, June 14, 2004 12:02 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> So, no tagged queue and no disconnects :slight_smile:
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> ----- Original Message -----
> From: “Saxena, Ajitabh Prakash”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, June 14, 2004 7:25 PM
> Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> > Hi Shakeel,
> >
> > There is no way to do that. The IDE controllers have one DMA
> controller
> per
> > channel
> > and once the DMA is active you should not touch the channel till yu
> issue
> a
> > STOP_TRANSFER
> > in ISR to that channel’s Bus Master DMA. So since you can fire only
> one
> > command per channel
> > it will be your internal logic that determines which command is
> current.
> You
> > will still be able to
> > fire commands simultaneously on different channels. So, For IDE RAID
> > controller the best performance
> > can only be obtained when the drives are placed on two different
> channels.
> > Also remember that equations change for SATA.
> >
> > Thanks,
> > Ajitabh
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Thursday, June 10, 2004 4:12 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID
> >
> >
> > Thanks Maxim,
> >
> > Good point. Currently in miniport I won’t allow more than one
> outstanding
> > request for controller. If the miniport driver is processing SRB it
> returns
> > status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and modified
> it
> to
> > work for 2K/XP. I think the reason being is, Since there is one
> interrupt
> > handler for the controller how will it know which disk drive completed
> the
> > transfer if multiple outstanding requests are allowed. I may be wrong
> here,
> > Is there way to send request to other drives while the first one is
> still
> in
> > middle of transfer for an IDE RAID controller.
> >
> > Thanks in advance,
> > Shakeel.
> >
> > BOOLEAN
> > AtapiStartIo(
> > IN PVOID HwDeviceExtension,
> > IN PSCSI_REQUEST_BLOCK Srb
> > )
> >
> > /++
> >
> > Routine Description:
> >
> > This routine is called from the SCSI port driver synchronized
> > with the kernel to start an IO request.
> >
> > Arguments:
> >
> > HwDeviceExtension - HBA miniport driver’s adapter data storage
> > Srb - IO request packet
> >
> > Return Value:
> >
> > TRUE
> >
> > –
/
> >
> > {
> > PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
> > ULONG status;
> >
> > //
> > // Determine which function.
> > //
> >
> > switch (Srb->Function) {
> >
> > case SRB_FUNCTION_EXECUTE_SCSI:
> >
> > //
> > // Sanity check. Only one request can be outstanding on a
> > // controller.
> > //
> >
> > if (deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1,
> > “AtapiStartIo: Already have a request!\n”));
> > Srb->SrbStatus = SRB_STATUS_BUSY;
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> > return FALSE;
> > }
> >
> > //
> > // Indicate that a request is active on the controller.
> > //
> >
> > deviceExtension->CurrentSrb = Srb;
> >
> > //
> > // Send command to device.
> > //
> >
> > if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_ATAPI_DEVICE) {
> >
> > status = AtapiSendCommand(HwDeviceExtension,
> > Srb);
> >
> > } else if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_DEVICE_PRESENT) {
> >
> > status = IdeSendCommand(HwDeviceExtension,
> > Srb);
> > } else {
> >
> > status = SRB_STATUS_SELECTION_TIMEOUT;
> > }
> >
> > break;
> >
> > case SRB_FUNCTION_ABORT_COMMAND:
> >
> > //
> > // Verify that SRB to abort is still outstanding.
> > //
> >
> > if (!deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1, “AtapiStartIo: SRB to abort already
> > completed\n”));
> >
> > //
> > // Complete abort SRB.
> > //
> >
> > status = SRB_STATUS_ABORT_FAILED;
> >
> > break;
> > }
> >
> > //
> > // Abort function indicates that a request timed out.
> > // Call reset routine. Card will only be reset if
> > // status indicates something is wrong.
> > // Fall through to reset code.
> > //
> >
> > case SRB_FUNCTION_RESET_BUS:
> >
> > //
> > // Reset Atapi and SCSI bus.
> > //
> >
> > DebugPrint((1, “AtapiStartIo: Reset bus request received\n”));
> >
> > if (!AtapiResetController(deviceExtension,
> > Srb->PathId)) {
> >
> > DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));
> >
> > //
> > // Log reset failure.
> > //
> >
> > ScsiPortLogError(
> > HwDeviceExtension,
> > NULL,
> > 0,
> > 0,
> > 0,
> > SP_INTERNAL_ADAPTER_ERROR,
> > 5 << 8
> > );
> >
> > status = SRB_STATUS_ERROR;
> >
> > } else {
> >
> > status = SRB_STATUS_SUCCESS;
> > }
> >
> > break;
> >
> > default :
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> > break;
> >
> > }
> >
> > break;
> >
> > default:
> >
> > //
> > // Indicate unsupported command.
> > //
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> >
> > break;
> >
> > } // end switch
> >
> > //
> > // Check if command complete.
> > //
> >
> > if (status != SRB_STATUS_PENDING) {
> >
> > DebugPrint((2,
> > “AtapiStartIo: Srb %x complete with status %x\n”,
> > Srb,
> > status));
> >
> > //
> > // Clear current SRB.
> > //
> >
> > deviceExtension->CurrentSrb = NULL;
> >
> > //
> > // Set status in SRB.
> > //
> >
> > Srb->SrbStatus = (UCHAR)status;
> >
> > //
> > // Indicate command complete.
> > //
> >
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> >
> > //
> > // Indicate ready for next request.
> > //
> >
> > ScsiPortNotification(NextRequest,
> > deviceExtension,
> > NULL);
> > }
> >
> > return TRUE;
> >
> > } // end AtapiStartIo()
> >
> >
> > “Maxim S. Shatskih” wrote in message
> > news:xxxxx@ntdev…
> > > > Is Implementing a QUEUE in miniport driver gives any performance
> > > > improvements?
> > >
> > > No. It is absolutely irrelevant where the queue is - in SCSIPORT or
> in
> > your
> > > miniport.
> > >
> > > The firmware queue in the disk is better since the disk firmware can
> > reorder
> > > requests to reduce unnecessary head seeks and revolutions, and only
> due
> to
> > > this.
> > >
> > > Your miniport has no head/revolutions knowledge, and thus cannot do
> the
> > same.
> > >
> > > In a RAID, you can do the following though. If the request can be
> serviced
> > off
> > > 1 disk - then it is not necessary to block the whole RAID for its
> > duration. You
> > > can allow requests to other disks.
> > >
> > > Maxim Shatskih, Windows DDK MVP
> > > StorageCraft Corporation
> > > xxxxx@storagecraft.com
> > > http://www.storagecraft.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@storagecraft.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@nvidia.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@storagecraft.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

I can’t speak to the specifics of IDE or SATA here, but in general only
allowing one DMA transfer at a time does not negate the benefit of
allowing multiple commands to run on a target device.

The benefit of overlapping commands is in allowing a drive

(a) to reorder commands in an efficient manner for it’s own internal
implementation and
(b) to overlap the separate processes of reading data from the disk into
some sort of transfer buffer (perhaps the disk cache) and of
transferring data from the device to the initiator

In general you can only be transferring one stream of data across the
bus at a time anyway (or does SATA interleave them? I don’t know), but
that doesn’t mean the devices can’t be getting more data ready for the
next transfer while the current one runs.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Monday, June 14, 2004 2:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID

If the controller’s DMA facility supports only 1 operation a time -
then the whole tagged queue thing does away, even if the bus and the
drive support it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Mark Overby”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, June 15, 2004 12:12 AM
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

> I disagree.
>
> IDE (ATA) supports the concept of tagged queuing as does SATA.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]
> Sent: Monday, June 14, 2004 1:06 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID
>
> Exactly. IDE is far away from these things. :slight_smile:
>
> -----Original Message-----
> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> Sent: Monday, June 14, 2004 12:02 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> So, no tagged queue and no disconnects :slight_smile:
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> ----- Original Message -----
> From: “Saxena, Ajitabh Prakash”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, June 14, 2004 7:25 PM
> Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> > Hi Shakeel,
> >
> > There is no way to do that. The IDE controllers have one DMA
> controller
> per
> > channel
> > and once the DMA is active you should not touch the channel till yu
> issue
> a
> > STOP_TRANSFER
> > in ISR to that channel’s Bus Master DMA. So since you can fire only
> one
> > command per channel
> > it will be your internal logic that determines which command is
> current.
> You
> > will still be able to
> > fire commands simultaneously on different channels. So, For IDE RAID
> > controller the best performance
> > can only be obtained when the drives are placed on two different
> channels.
> > Also remember that equations change for SATA.
> >
> > Thanks,
> > Ajitabh
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Thursday, June 10, 2004 4:12 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID
> >
> >
> > Thanks Maxim,
> >
> > Good point. Currently in miniport I won’t allow more than one
> outstanding
> > request for controller. If the miniport driver is processing SRB it
> returns
> > status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and
modified
> it
> to
> > work for 2K/XP. I think the reason being is, Since there is one
> interrupt
> > handler for the controller how will it know which disk drive
completed
> the
> > transfer if multiple outstanding requests are allowed. I may be
wrong
> here,
> > Is there way to send request to other drives while the first one is
> still
> in
> > middle of transfer for an IDE RAID controller.
> >
> > Thanks in advance,
> > Shakeel.
> >
> > BOOLEAN
> > AtapiStartIo(
> > IN PVOID HwDeviceExtension,
> > IN PSCSI_REQUEST_BLOCK Srb
> > )
> >
> > /++
> >
> > Routine Description:
> >
> > This routine is called from the SCSI port driver synchronized
> > with the kernel to start an IO request.
> >
> > Arguments:
> >
> > HwDeviceExtension - HBA miniport driver’s adapter data storage
> > Srb - IO request packet
> >
> > Return Value:
> >
> > TRUE
> >
> > –
/
> >
> > {
> > PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
> > ULONG status;
> >
> > //
> > // Determine which function.
> > //
> >
> > switch (Srb->Function) {
> >
> > case SRB_FUNCTION_EXECUTE_SCSI:
> >
> > //
> > // Sanity check. Only one request can be outstanding on a
> > // controller.
> > //
> >
> > if (deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1,
> > “AtapiStartIo: Already have a request!\n”));
> > Srb->SrbStatus = SRB_STATUS_BUSY;
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> > return FALSE;
> > }
> >
> > //
> > // Indicate that a request is active on the controller.
> > //
> >
> > deviceExtension->CurrentSrb = Srb;
> >
> > //
> > // Send command to device.
> > //
> >
> > if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_ATAPI_DEVICE) {
> >
> > status = AtapiSendCommand(HwDeviceExtension,
> > Srb);
> >
> > } else if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_DEVICE_PRESENT) {
> >
> > status = IdeSendCommand(HwDeviceExtension,
> > Srb);
> > } else {
> >
> > status = SRB_STATUS_SELECTION_TIMEOUT;
> > }
> >
> > break;
> >
> > case SRB_FUNCTION_ABORT_COMMAND:
> >
> > //
> > // Verify that SRB to abort is still outstanding.
> > //
> >
> > if (!deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1, “AtapiStartIo: SRB to abort already
> > completed\n”));
> >
> > //
> > // Complete abort SRB.
> > //
> >
> > status = SRB_STATUS_ABORT_FAILED;
> >
> > break;
> > }
> >
> > //
> > // Abort function indicates that a request timed out.
> > // Call reset routine. Card will only be reset if
> > // status indicates something is wrong.
> > // Fall through to reset code.
> > //
> >
> > case SRB_FUNCTION_RESET_BUS:
> >
> > //
> > // Reset Atapi and SCSI bus.
> > //
> >
> > DebugPrint((1, “AtapiStartIo: Reset bus request
received\n”));
> >
> > if (!AtapiResetController(deviceExtension,
> > Srb->PathId)) {
> >
> > DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));
> >
> > //
> > // Log reset failure.
> > //
> >
> > ScsiPortLogError(
> > HwDeviceExtension,
> > NULL,
> > 0,
> > 0,
> > 0,
> > SP_INTERNAL_ADAPTER_ERROR,
> > 5 << 8
> > );
> >
> > status = SRB_STATUS_ERROR;
> >
> > } else {
> >
> > status = SRB_STATUS_SUCCESS;
> > }
> >
> > break;
> >
> > default :
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> > break;
> >
> > }
> >
> > break;
> >
> > default:
> >
> > //
> > // Indicate unsupported command.
> > //
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> >
> > break;
> >
> > } // end switch
> >
> > //
> > // Check if command complete.
> > //
> >
> > if (status != SRB_STATUS_PENDING) {
> >
> > DebugPrint((2,
> > “AtapiStartIo: Srb %x complete with status %x\n”,
> > Srb,
> > status));
> >
> > //
> > // Clear current SRB.
> > //
> >
> > deviceExtension->CurrentSrb = NULL;
> >
> > //
> > // Set status in SRB.
> > //
> >
> > Srb->SrbStatus = (UCHAR)status;
> >
> > //
> > // Indicate command complete.
> > //
> >
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> >
> > //
> > // Indicate ready for next request.
> > //
> >
> > ScsiPortNotification(NextRequest,
> > deviceExtension,
> > NULL);
> > }
> >
> > return TRUE;
> >
> > } // end AtapiStartIo()
> >
> >
> > “Maxim S. Shatskih” wrote in message
> > news:xxxxx@ntdev…
> > > > Is Implementing a QUEUE in miniport driver gives any performance
> > > > improvements?
> > >
> > > No. It is absolutely irrelevant where the queue is - in SCSIPORT
or
> in
> > your
> > > miniport.
> > >
> > > The firmware queue in the disk is better since the disk firmware
can
> > reorder
> > > requests to reduce unnecessary head seeks and revolutions, and
only
> due
> to
> > > this.
> > >
> > > Your miniport has no head/revolutions knowledge, and thus cannot
do
> the
> > same.
> > >
> > > In a RAID, you can do the following though. If the request can be
> serviced
> > off
> > > 1 disk - then it is not necessary to block the whole RAID for its
> > duration. You
> > > can allow requests to other disks.
> > >
> > > Maxim Shatskih, Windows DDK MVP
> > > StorageCraft Corporation
> > > xxxxx@storagecraft.com
> > > http://www.storagecraft.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@storagecraft.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@nvidia.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@storagecraft.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

Peter, you beat me to the punch. :slight_smile:

SATA II has the capability of overlapping DMA streams. (FPDMA and
non-zero offset).

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]
Sent: Monday, June 14, 2004 2:14 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

I can’t speak to the specifics of IDE or SATA here, but in general only
allowing one DMA transfer at a time does not negate the benefit of
allowing multiple commands to run on a target device.

The benefit of overlapping commands is in allowing a drive

(a) to reorder commands in an efficient manner for it’s own internal
implementation and
(b) to overlap the separate processes of reading data from the disk into
some sort of transfer buffer (perhaps the disk cache) and of
transferring data from the device to the initiator

In general you can only be transferring one stream of data across the
bus at a time anyway (or does SATA interleave them? I don’t know), but
that doesn’t mean the devices can’t be getting more data ready for the
next transfer while the current one runs.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Monday, June 14, 2004 2:02 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID

If the controller’s DMA facility supports only 1 operation a time -
then the whole tagged queue thing does away, even if the bus and the
drive support it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Mark Overby”
To: “Windows System Software Devs Interest List”
Sent: Tuesday, June 15, 2004 12:12 AM
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

> I disagree.
>
> IDE (ATA) supports the concept of tagged queuing as does SATA.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]
> Sent: Monday, June 14, 2004 1:06 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID
>
> Exactly. IDE is far away from these things. :slight_smile:
>
> -----Original Message-----
> From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
> Sent: Monday, June 14, 2004 12:02 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> So, no tagged queue and no disconnects :slight_smile:
>
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> ----- Original Message -----
> From: “Saxena, Ajitabh Prakash”
> To: “Windows System Software Devs Interest List”
> Sent: Monday, June 14, 2004 7:25 PM
> Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID
>
>
> > Hi Shakeel,
> >
> > There is no way to do that. The IDE controllers have one DMA
> controller
> per
> > channel
> > and once the DMA is active you should not touch the channel till yu
> issue
> a
> > STOP_TRANSFER
> > in ISR to that channel’s Bus Master DMA. So since you can fire only
> one
> > command per channel
> > it will be your internal logic that determines which command is
> current.
> You
> > will still be able to
> > fire commands simultaneously on different channels. So, For IDE RAID
> > controller the best performance
> > can only be obtained when the drives are placed on two different
> channels.
> > Also remember that equations change for SATA.
> >
> > Thanks,
> > Ajitabh
> >
> > -----Original Message-----
> > From: shakeel [mailto:xxxxx@yahoo.com]
> > Sent: Thursday, June 10, 2004 4:12 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re:[ntdev] Performance of SCSI miniport for IDE RAID
> >
> >
> > Thanks Maxim,
> >
> > Good point. Currently in miniport I won’t allow more than one
> outstanding
> > request for controller. If the miniport driver is processing SRB it
> returns
> > status SRB_STATUS_BUSY. I took atapi.sys code from NT 4.0 and
modified
> it
> to
> > work for 2K/XP. I think the reason being is, Since there is one
> interrupt
> > handler for the controller how will it know which disk drive
completed
> the
> > transfer if multiple outstanding requests are allowed. I may be
wrong
> here,
> > Is there way to send request to other drives while the first one is
> still
> in
> > middle of transfer for an IDE RAID controller.
> >
> > Thanks in advance,
> > Shakeel.
> >
> > BOOLEAN
> > AtapiStartIo(
> > IN PVOID HwDeviceExtension,
> > IN PSCSI_REQUEST_BLOCK Srb
> > )
> >
> > /++
> >
> > Routine Description:
> >
> > This routine is called from the SCSI port driver synchronized
> > with the kernel to start an IO request.
> >
> > Arguments:
> >
> > HwDeviceExtension - HBA miniport driver’s adapter data storage
> > Srb - IO request packet
> >
> > Return Value:
> >
> > TRUE
> >
> > –
/
> >
> > {
> > PHW_DEVICE_EXTENSION deviceExtension = HwDeviceExtension;
> > ULONG status;
> >
> > //
> > // Determine which function.
> > //
> >
> > switch (Srb->Function) {
> >
> > case SRB_FUNCTION_EXECUTE_SCSI:
> >
> > //
> > // Sanity check. Only one request can be outstanding on a
> > // controller.
> > //
> >
> > if (deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1,
> > “AtapiStartIo: Already have a request!\n”));
> > Srb->SrbStatus = SRB_STATUS_BUSY;
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> > return FALSE;
> > }
> >
> > //
> > // Indicate that a request is active on the controller.
> > //
> >
> > deviceExtension->CurrentSrb = Srb;
> >
> > //
> > // Send command to device.
> > //
> >
> > if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_ATAPI_DEVICE) {
> >
> > status = AtapiSendCommand(HwDeviceExtension,
> > Srb);
> >
> > } else if (deviceExtension->DeviceFlags[Srb->TargetId] &
> > DFLAGS_DEVICE_PRESENT) {
> >
> > status = IdeSendCommand(HwDeviceExtension,
> > Srb);
> > } else {
> >
> > status = SRB_STATUS_SELECTION_TIMEOUT;
> > }
> >
> > break;
> >
> > case SRB_FUNCTION_ABORT_COMMAND:
> >
> > //
> > // Verify that SRB to abort is still outstanding.
> > //
> >
> > if (!deviceExtension->CurrentSrb) {
> >
> > DebugPrint((1, “AtapiStartIo: SRB to abort already
> > completed\n”));
> >
> > //
> > // Complete abort SRB.
> > //
> >
> > status = SRB_STATUS_ABORT_FAILED;
> >
> > break;
> > }
> >
> > //
> > // Abort function indicates that a request timed out.
> > // Call reset routine. Card will only be reset if
> > // status indicates something is wrong.
> > // Fall through to reset code.
> > //
> >
> > case SRB_FUNCTION_RESET_BUS:
> >
> > //
> > // Reset Atapi and SCSI bus.
> > //
> >
> > DebugPrint((1, “AtapiStartIo: Reset bus request
received\n”));
> >
> > if (!AtapiResetController(deviceExtension,
> > Srb->PathId)) {
> >
> > DebugPrint((1,“AtapiStartIo: Reset bus failed\n”));
> >
> > //
> > // Log reset failure.
> > //
> >
> > ScsiPortLogError(
> > HwDeviceExtension,
> > NULL,
> > 0,
> > 0,
> > 0,
> > SP_INTERNAL_ADAPTER_ERROR,
> > 5 << 8
> > );
> >
> > status = SRB_STATUS_ERROR;
> >
> > } else {
> >
> > status = SRB_STATUS_SUCCESS;
> > }
> >
> > break;
> >
> > default :
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> > break;
> >
> > }
> >
> > break;
> >
> > default:
> >
> > //
> > // Indicate unsupported command.
> > //
> >
> > status = SRB_STATUS_INVALID_REQUEST;
> >
> > break;
> >
> > } // end switch
> >
> > //
> > // Check if command complete.
> > //
> >
> > if (status != SRB_STATUS_PENDING) {
> >
> > DebugPrint((2,
> > “AtapiStartIo: Srb %x complete with status %x\n”,
> > Srb,
> > status));
> >
> > //
> > // Clear current SRB.
> > //
> >
> > deviceExtension->CurrentSrb = NULL;
> >
> > //
> > // Set status in SRB.
> > //
> >
> > Srb->SrbStatus = (UCHAR)status;
> >
> > //
> > // Indicate command complete.
> > //
> >
> > ScsiPortNotification(RequestComplete,
> > deviceExtension,
> > Srb);
> >
> > //
> > // Indicate ready for next request.
> > //
> >
> > ScsiPortNotification(NextRequest,
> > deviceExtension,
> > NULL);
> > }
> >
> > return TRUE;
> >
> > } // end AtapiStartIo()
> >
> >
> > “Maxim S. Shatskih” wrote in message
> > news:xxxxx@ntdev…
> > > > Is Implementing a QUEUE in miniport driver gives any performance
> > > > improvements?
> > >
> > > No. It is absolutely irrelevant where the queue is - in SCSIPORT
or
> in
> > your
> > > miniport.
> > >
> > > The firmware queue in the disk is better since the disk firmware
can
> > reorder
> > > requests to reduce unnecessary head seeks and revolutions, and
only
> due
> to
> > > this.
> > >
> > > Your miniport has no head/revolutions knowledge, and thus cannot
do
> the
> > same.
> > >
> > > In a RAID, you can do the following though. If the request can be
> serviced
> > off
> > > 1 disk - then it is not necessary to block the whole RAID for its
> > duration. You
> > > can allow requests to other disks.
> > >
> > > Maxim Shatskih, Windows DDK MVP
> > > StorageCraft Corporation
> > > xxxxx@storagecraft.com
> > > http://www.storagecraft.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@storagecraft.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@nvidia.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@storagecraft.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


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

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

> If the controller’s DMA facility supports only 1 operation a time - then

the whole tagged queue thing does away, even if the bus and the drive
support
it.

If the controller uses “First Party DMA” as described in the seagate doc
on
SATA II Native Command Queuing previously posted here, there’s no need for
more than one concurrent DMA at any time.

  1. drive signals controller that data for command #X is ready
  2. controller sets up DMA for data for command #X
  3. controller signals drive to send data for command #X via DMA
  4. driver transfers data
  5. everybody is happy

Of course there can only be one active DMA at a time (more than one
“waiting”
though), but the drive can buffer new data in it’s internal cache while
transferring “old” data via DMA, and if the bus is fast enough (ie.
somewhat
faster than the driver can ever be) and the controller is not “sleeping
all day”
there should be no problem transferring all data in time to “empty” the
read-cache of the drive so that it can be used for new data.
The possible only problem I see here is that the drive selects the buffer
to
transfer it there are multiple buffers ready for transfer, not the
controller.

And what’s the point of disconnect/reconnect if there is only one drive
connected to the bus as it is in SATA? I don’t know how current
multi-channel
SATA controllers are implemented, but it should be no problem at all to
have
distinct controllers for the distinct “cables” (buses).

Or did I get this wrong?

Regards,

Paul Groke

p.S.: ok, I see you guys were faster, but whatsoever :slight_smile:

Peter, Mark O, Mark Roddy,

Please leave something for storage guys too, they get hungry once in a while too :slight_smile:

-pro

Generally speaking, SATA controllers have one DMA engine per root port.
(Not all do, but some do - it’s an implementation decision). If you
invoke port multiplers then you have a different can of worms.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]
Sent: Monday, June 14, 2004 2:41 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID

If the controller’s DMA facility supports only 1 operation a time -
then
the whole tagged queue thing does away, even if the bus and the drive
support
it.

If the controller uses “First Party DMA” as described in the seagate doc

on
SATA II Native Command Queuing previously posted here, there’s no need
for
more than one concurrent DMA at any time.

  1. drive signals controller that data for command #X is ready
  2. controller sets up DMA for data for command #X
  3. controller signals drive to send data for command #X via DMA
  4. driver transfers data
  5. everybody is happy

Of course there can only be one active DMA at a time (more than one
“waiting”
though), but the drive can buffer new data in it’s internal cache while
transferring “old” data via DMA, and if the bus is fast enough (ie.
somewhat
faster than the driver can ever be) and the controller is not “sleeping
all day”
there should be no problem transferring all data in time to “empty” the
read-cache of the drive so that it can be used for new data.
The possible only problem I see here is that the drive selects the
buffer
to
transfer it there are multiple buffers ready for transfer, not the
controller.

And what’s the point of disconnect/reconnect if there is only one drive
connected to the bus as it is in SATA? I don’t know how current
multi-channel
SATA controllers are implemented, but it should be no problem at all to
have
distinct controllers for the distinct “cables” (buses).

Or did I get this wrong?

Regards,

Paul Groke

p.S.: ok, I see you guys were faster, but whatsoever :slight_smile:


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

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

“If the controller’s DMA facility supports only 1 operation a time -
then the whole tagged queue thing does away, even if the bus and the drive
support it.”

This statement is totally correct. No matter even if your miniport or
controller or drive queues the command. The only benifit you will be able to
see is single interrupt for multiple commands (which is considerable
benefit). Even with SATA-II native command queuing the drive is doing only
one DMA transfer at a time and notifying the controller of the completed
commands. If a error occurs in one command everything has to stop and the
driver has to take corrective actions. No disconnects and reconnects.

The disconnects and reconnect are logical only for the buses which have more
than one device on them.
So the controller can start a transfer on one device and disconnect it and
then start another transfer on other device.
Here multiple transfers are occuring at the same time. This is a HUGE
performance boost.

Thanks,
Ajitabh

-----Original Message-----
From: Mark Overby [mailto:xxxxx@nvidia.com]
Sent: Monday, June 14, 2004 6:35 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

Generally speaking, SATA controllers have one DMA engine per root port.
(Not all do, but some do - it’s an implementation decision). If you
invoke port multiplers then you have a different can of worms.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]
Sent: Monday, June 14, 2004 2:41 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID

If the controller’s DMA facility supports only 1 operation a time -
then
the whole tagged queue thing does away, even if the bus and the drive
support
it.

If the controller uses “First Party DMA” as described in the seagate doc

on
SATA II Native Command Queuing previously posted here, there’s no need
for
more than one concurrent DMA at any time.

  1. drive signals controller that data for command #X is ready
  2. controller sets up DMA for data for command #X
  3. controller signals drive to send data for command #X via DMA
  4. driver transfers data
  5. everybody is happy

Of course there can only be one active DMA at a time (more than one
“waiting”
though), but the drive can buffer new data in it’s internal cache while
transferring “old” data via DMA, and if the bus is fast enough (ie.
somewhat
faster than the driver can ever be) and the controller is not “sleeping
all day”
there should be no problem transferring all data in time to “empty” the
read-cache of the drive so that it can be used for new data.
The possible only problem I see here is that the drive selects the
buffer
to
transfer it there are multiple buffers ready for transfer, not the
controller.

And what’s the point of disconnect/reconnect if there is only one drive
connected to the bus as it is in SATA? I don’t know how current
multi-channel
SATA controllers are implemented, but it should be no problem at all to
have
distinct controllers for the distinct “cables” (buses).

Or did I get this wrong?

Regards,

Paul Groke

p.S.: ok, I see you guys were faster, but whatsoever :slight_smile:


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

You are currently subscribed to ntdev as: xxxxx@nvidia.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

You can do this with FIS-based switching of port multipliers on SATA-II.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]
Sent: Monday, June 14, 2004 4:42 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

“If the controller’s DMA facility supports only 1 operation a time -
then the whole tagged queue thing does away, even if the bus and the
drive
support it.”

This statement is totally correct. No matter even if your miniport or
controller or drive queues the command. The only benifit you will be
able to
see is single interrupt for multiple commands (which is considerable
benefit). Even with SATA-II native command queuing the drive is doing
only
one DMA transfer at a time and notifying the controller of the completed
commands. If a error occurs in one command everything has to stop and
the
driver has to take corrective actions. No disconnects and reconnects.

The disconnects and reconnect are logical only for the buses which have
more
than one device on them.
So the controller can start a transfer on one device and disconnect it
and
then start another transfer on other device.
Here multiple transfers are occuring at the same time. This is a HUGE
performance boost.

Thanks,
Ajitabh

-----Original Message-----
From: Mark Overby [mailto:xxxxx@nvidia.com]
Sent: Monday, June 14, 2004 6:35 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Performance of SCSI miniport for IDE RAID

Generally speaking, SATA controllers have one DMA engine per root port.
(Not all do, but some do - it’s an implementation decision). If you
invoke port multiplers then you have a different can of worms.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]
Sent: Monday, June 14, 2004 2:41 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Performance of SCSI miniport for IDE RAID

If the controller’s DMA facility supports only 1 operation a time -
then
the whole tagged queue thing does away, even if the bus and the drive
support
it.

If the controller uses “First Party DMA” as described in the seagate doc

on
SATA II Native Command Queuing previously posted here, there’s no need
for
more than one concurrent DMA at any time.

  1. drive signals controller that data for command #X is ready
  2. controller sets up DMA for data for command #X
  3. controller signals drive to send data for command #X via DMA
  4. driver transfers data
  5. everybody is happy

Of course there can only be one active DMA at a time (more than one
“waiting”
though), but the drive can buffer new data in it’s internal cache while
transferring “old” data via DMA, and if the bus is fast enough (ie.
somewhat
faster than the driver can ever be) and the controller is not “sleeping
all day”
there should be no problem transferring all data in time to “empty” the
read-cache of the drive so that it can be used for new data.
The possible only problem I see here is that the drive selects the
buffer
to
transfer it there are multiple buffers ready for transfer, not the
controller.

And what’s the point of disconnect/reconnect if there is only one drive
connected to the bus as it is in SATA? I don’t know how current
multi-channel
SATA controllers are implemented, but it should be no problem at all to
have
distinct controllers for the distinct “cables” (buses).

Or did I get this wrong?

Regards,

Paul Groke

p.S.: ok, I see you guys were faster, but whatsoever :slight_smile:


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

You are currently subscribed to ntdev as: xxxxx@nvidia.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@nvidia.com
To unsubscribe send a blank email to xxxxx@lists.osr.com