Feasibility for ScsiMiniport Driver to allocate memory on the fly

hi all,
I am working on a Scsi miniport driver for windows 2000. My
requirement is to allocate memory and yet comply with SCSI port and SCSI
Miniport routines so that my driver is good for certification. As per the
scsi port model ,miniport driver should not call routines other than
ScsiPortxx routines.
I am planning to write another kernal mode routine which will act
as a memory allocater for me.This memory allocater will be independent of my
miniport and the two drivers will communicate to each other. The miniport
will raise a request for memory allocation and memory allocater will
complete that and tell the miniport (using ioctl) that the memory is
Allocated.

I think this is possible but the only concern is that is this voilating the
Scsiport and miniport model?? will i have some certification problems with
this???

any help is appreciated,
thanks
ajitabh

Intriguing architecture. How are you raising the allocation request? How
will you free it?

At this point, maybe you are getting close enough to needing a port driver
that you might just as well write your own, or buy VSPort from Jamey.

Phil

Philip D. Barila
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.

“Saxena, Ajitabh Prakash” wrote in message
news:xxxxx@ntdev…
hi all,
I am working on a Scsi miniport driver for windows 2000. My
requirement is to allocate memory and yet comply with SCSI port and SCSI
Miniport routines so that my driver is good for certification. As per the
scsi port model ,miniport driver should not call routines other than
ScsiPortxx routines.
I am planning to write another kernal mode routine which will act
as a memory allocater for me.This memory allocater will be independent of my
miniport and the two drivers will communicate to each other. The miniport
will raise a request for memory allocation and memory allocater will
complete that and tell the miniport (using ioctl) that the memory is
Allocated.

I think this is possible but the only concern is that is this voilating the
Scsiport and miniport model?? will i have some certification problems with
this???

any help is appreciated,
thanks
ajitabh

SCSI miniport model assumes that you need memory only for:

  • per-HBA areas
  • per-LUN areas
  • per-pending-SRB areas

Just set the sizes of these areas in the registration info passed to ScsiPortInitialize. There is no other way for a SCSI miniport to allocate memory. Note that you can specify a flag which will allow to run busmaster DMA over device and SRB extensions, but not the LUN extension.

As about the “memory allocator driver” - looks like a terrifying overcomplication of a simple thing.

Max

----- Original Message -----
From: Saxena, Ajitabh Prakash
To: NT Developers Interest List
Sent: Tuesday, January 28, 2003 8:54 PM
Subject: [ntdev] Feasibility for ScsiMiniport Driver to allocate memory on the fly

hi all,
I am working on a Scsi miniport driver for windows 2000. My requirement is to allocate memory and yet comply with SCSI port and SCSI Miniport routines so that my driver is good for certification. As per the scsi port model ,miniport driver should not call routines other than ScsiPortxx routines.
I am planning to write another kernal mode routine which will act as a memory allocater for me.This memory allocater will be independent of my miniport and the two drivers will communicate to each other. The miniport will raise a request for memory allocation and memory allocater will complete that and tell the miniport (using ioctl) that the memory is Allocated.

I think this is possible but the only concern is that is this voilating the Scsiport and miniport model?? will i have some certification problems with this???

any help is appreciated,
thanks
ajitabh

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

Max,

I doubt that he’s talking about that kind of thing. I’m guessing it’s a
dynamic allocator, so he can, for example, manage a cache inside the
miniport. :slight_smile:

Phil

Philip D. Barila
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
SCSI miniport model assumes that you need memory only for:
- per-HBA areas
- per-LUN areas
- per-pending-SRB areas

Just set the sizes of these areas in the registration info passed to
ScsiPortInitialize. There is no other way for a SCSI miniport to allocate
memory. Note that you can specify a flag which will allow to run busmaster
DMA over device and SRB extensions, but not the LUN extension.

As about the “memory allocator driver” - looks like a terrifying
overcomplication of a simple thing.

Max

----- Original Message -----
From: Saxena, Ajitabh Prakash
To: NT Developers Interest List
Sent: Tuesday, January 28, 2003 8:54 PM
Subject: [ntdev] Feasibility for ScsiMiniport Driver to allocate memory on
the fly

hi all,
I am working on a Scsi miniport driver for windows 2000. My
requirement is to allocate memory and yet comply with SCSI port and SCSI
Miniport routines so that my driver is good for certification. As per the
scsi port model ,miniport driver should not call routines other than
ScsiPortxx routines.
I am planning to write another kernal mode routine which will act
as a memory allocater for me.This memory allocater will be independent of my
miniport and the two drivers will communicate to each other. The miniport
will raise a request for memory allocation and memory allocater will
complete that and tell the miniport (using ioctl) that the memory is
Allocated.

I think this is possible but the only concern is that is this voilating the
Scsiport and miniport model?? will i have some certification problems with
this???

any help is appreciated,
thanks
ajitabh

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

Exactly…that is what i am talking about.I know in initialize routine we
can allocate needed memory.but say for some reason i want to allocate memory
in IO routine… what then??

-----Original Message-----
From: Phil Barila [mailto:xxxxx@Seagate.com]
Sent: Tuesday, January 28, 2003 1:58 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Feasibility for ScsiMiniport Driver to allocate
memory on the fly

Max,

I doubt that he’s talking about that kind of thing. I’m guessing it’s a
dynamic allocator, so he can, for example, manage a cache inside the
miniport. :slight_smile:

Phil

Philip D. Barila
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntdev…
SCSI miniport model assumes that you need memory only for:
- per-HBA areas
- per-LUN areas
- per-pending-SRB areas

Just set the sizes of these areas in the registration info passed to
ScsiPortInitialize. There is no other way for a SCSI miniport to allocate
memory. Note that you can specify a flag which will allow to run busmaster
DMA over device and SRB extensions, but not the LUN extension.

As about the “memory allocator driver” - looks like a terrifying
overcomplication of a simple thing.

Max

----- Original Message -----
From: Saxena, Ajitabh Prakash
To: NT Developers Interest List
Sent: Tuesday, January 28, 2003 8:54 PM
Subject: [ntdev] Feasibility for ScsiMiniport Driver to allocate memory on
the fly

hi all,
I am working on a Scsi miniport driver for windows 2000. My
requirement is to allocate memory and yet comply with SCSI port and SCSI
Miniport routines so that my driver is good for certification. As per the
scsi port model ,miniport driver should not call routines other than
ScsiPortxx routines.
I am planning to write another kernal mode routine which will act
as a memory allocater for me.This memory allocater will be independent of my
miniport and the two drivers will communicate to each other. The miniport
will raise a request for memory allocation and memory allocater will
complete that and tell the miniport (using ioctl) that the memory is
Allocated.

I think this is possible but the only concern is that is this voilating the
Scsiport and miniport model?? will i have some certification problems with
this???

any help is appreciated,
thanks
ajitabh

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


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

“Saxena, Ajitabh Prakash” wrote in message
news:xxxxx@ntdev…
>
> Exactly…that is what i am talking about.I know in initialize routine we
> can allocate needed memory.but say for some reason i want to allocate
memory
> in IO routine… what then??

Forget it. You are at DIRQL, you can’t do anything that involves pageable
memory, file writes, IOCTLs, not much of anything except calling the
ScsiPort routines as they are prescribed. You never mentioned how you
intended to “raise the request”, but I have doubts about being able to do
anything like that > PASSIVE_LEVEL.

You might be able to do such a thing with VSPort, but you’d have to ask
Max or Jamey about that.

Why would you want to do something so costly as a memory allocation in a
StartIo or Interrupt routine, anyway? Unless you only do it once in a blue
moon, or you do it while you are waiting for the device to interrupt, you
are going to kill your throughput.

Phil

Philip D. Barila
Seagate Technology, LLC
(720) 684-1842
As if I need to say it: Not speaking for Seagate.

SinceVSPORT is really nothing more than a standard DDK that replaces
SCSIPORT, you can fairly well do what you want … but one must abide by DDK
rules. You may not allocate/manage/free memory when at DIRQL. But can use
worker or system thr5eads threads or you can use you DpcForIsr, since these
things are now available to you.

Having used it I would recommend VSPORT.


Gary G. Little
Have Computer, will travel …
909-698-3191
909-551-2105

“Phil Barila” wrote in message
news:xxxxx@ntdev…
>
> “Saxena, Ajitabh Prakash” wrote in message
> news:xxxxx@ntdev…
> >
> > Exactly…that is what i am talking about.I know in initialize routine
we
> > can allocate needed memory.but say for some reason i want to allocate
> memory
> > in IO routine… what then??
>
> Forget it. You are at DIRQL, you can’t do anything that involves pageable
> memory, file writes, IOCTLs, not much of anything except calling the
> ScsiPort routines as they are prescribed. You never mentioned how you
> intended to “raise the request”, but I have doubts about being able to do
> anything like that > PASSIVE_LEVEL.
>
> You might be able to do such a thing with VSPort, but you’d have to ask
> Max or Jamey about that.
>
> Why would you want to do something so costly as a memory allocation in a
> StartIo or Interrupt routine, anyway? Unless you only do it once in a
blue
> moon, or you do it while you are waiting for the device to interrupt, you
> are going to kill your throughput.
>
> Phil
> –
> Philip D. Barila
> Seagate Technology, LLC
> (720) 684-1842
> As if I need to say it: Not speaking for Seagate.
>
>
>
>
>

> You *might* be able to do such a thing with VSPort, but you’d have
to ask

Max or Jamey about that.

VSPORT’s miniports can use any OS facilities they want. No more
sandboxes with interrupt spinlocks on entry :slight_smile:

Max