How to setup "per target-mode-SCSI-operation DMA" for "target mode" data transfer with **ScsiPort Mi

Discussion in 'Windows Vista Drivers' started by Shailesh Chaudhari, Aug 23, 2005.

  1. Hi All,

    I know that there is no "target mode" support in ScsiPort Miniport driver
    framework of Windows.

    Here is my question - though in context of "SCSI target mode operations" it
    is more related to "being able to setup DMA" -

    How to setup "per target-mode-SCSI-operation DMA" for "target mode" data
    transfer with **ScsiPort Miniport** driver model?
    At-least there should be a "clean documented" way to address such
    requirements, until the right support comes in the next versions of this
    driver framework.

    ScsiPort Miniport framework does not allow setting up DMA separately.

    The required objects like "device object" (PDO) to start with to issue
    IoGetDmaAdapter are unavailable.
    Writing filter drivers to get hold of such hidden information is kind of
    overkill.
    ScsiPortGetUncachedExtension is the only DMA (common buffer only - with
    restrictions on the allocation size) related support which can be done once
    for each HwFindAdapter call in the Miniport driver.
    This one is only useful for things like HBA mailboxes and IOCBs etc.

    One would need to setup DMA for - per SCSI "target mode" operation data
    transfers.
    Scsiport Miniport driver framework has no support for this.
    This will be specifically required when one is attempting this for "target
    mode SCSI" operations for say an FC HBA.
    Also driver developers are discouraged from using
    - MmXXX functions to setup DMA memory for compatibility reasons
    - and HalXXX DMA functions as these are being obsoleted with some (like
    HalGetAdapter) not being available in Windows IA64.

    This is/will be a pretty common case for any ISV trying to write a SCSI
    "target mode" driver for FC HBAs say.
    And I will be surprised if Microsoft does not support such needs - as this
    will just cause people to code in non-standard way causing more support
    pressure in absence of right recommendations.

    Please provide some guidance or redirect me to appropriate person.

    Thanks in advance.

    Thanks with best regards
    ddkuser
     
    Shailesh Chaudhari, Aug 23, 2005
    #1
    1. Advertisements

  2. Scsiport Miniport driver framework has no support for this.

    Yes. Declare your device as DMA-capable, then use ScsiPortGetPhysicalAddress to
    get the device-side hardware addresses of the IRP's buffer.
     
    Maxim S. Shatskih, Aug 23, 2005
    #2
    1. Advertisements

  3. Hi,

    Just make it more clearer I am talking about "target mode" data transfer DMA
    setup.
    I need to setup - per request data transfer - apart from "uncached
    extension" common buffer DMA setup for mailboxes and IOCBs.

    There are limitations on how much uncached extension I can allocate with
    ScsiPortGetUncachedExtension.

    So when I receive [FCP[SCSI CDBs]] in my FC HBA interrupt DPC with data
    transfer needs (viz. SCSI read or write).
    I need to setup DMA-able memory for FCP-DATA exchange that will follow this
    command CDB.
    This is the time I wish to setup my "per SCSI target mode operation" DMA.
    There are ways to setup DMA as stated in my previous message below, but then
    ScsiPort Miniport driver framework puts restriction on this.
    I am trying to figure out how people are addressing this with these
    restrictions.

    So I am figuring out in first place how to DMA setup (i.e. get DMA-able
    physical memory) with either common buffer allocated or scatter gather list
    created? in Scsiport Miniport driver framework - where I do not have access
    to DMA adapter or PDO (physical device object) to use with IoGetDmaAdapter
    to get DMA adapter.
    Please note HalGetAdapter is not an option for me as it is deprecated and
    not supported in Windows IA64.

    Then only can I use say ScsiPortGetPhysicalAddress or MmGetPhysicalAddress
    to get the logical addresses.

    Thanks with best regards
    Shailesh

    --------------------------------------------------------------------------------------------------------------------------------------
    Hi All,

    I know that there is no "target mode" support in ScsiPort Miniport driver
    framework of Windows.

    Here is my question - though in context of "SCSI target mode operations" it
    is more related to "being able to setup DMA" -

    How to setup "per target-mode-SCSI-operation DMA" for "target mode" data
    transfer with **ScsiPort Miniport** driver model?
    At-least there should be a "clean documented" way to address such
    requirements, until the right support comes in the next versions of this
    driver framework.

    ScsiPort Miniport framework does not allow setting up DMA separately.

    The required objects like "device object" (PDO) to start with to issue
    IoGetDmaAdapter are unavailable.
    Writing filter drivers to get hold of such hidden information is kind of
    overkill.
    ScsiPortGetUncachedExtension is the only DMA (common buffer only - with
    restrictions on the allocation size) related support which can be done once
    for each HwFindAdapter call in the Miniport driver.
    This one is only useful for things like HBA mailboxes and IOCBs etc.

    One would need to setup DMA for - per SCSI "target mode" operation data
    transfers.
    Scsiport Miniport driver framework has no support for this.
    This will be specifically required when one is attempting this for "target
    mode SCSI" operations for say an FC HBA.
    Also driver developers are discouraged from using
    - MmXXX functions to setup DMA memory for compatibility reasons
    - and HalXXX DMA functions as these are being obsoleted with some (like
    HalGetAdapter) not being available in Windows IA64.

    This is/will be a pretty common case for any ISV trying to write a SCSI
    "target mode" driver for FC HBAs say.
    And I will be surprised if Microsoft does not support such needs - as this
    will just cause people to code in non-standard way causing more support
    pressure in absence of right recommendations.

    Please provide some guidance or redirect me to appropriate person.

    Thanks in advance.

    Thanks with best regards
    ddkuser


    --------------------------------------------------------------------------------------------------------------------------------------
     
    Shailesh Chaudhari, Aug 23, 2005
    #3
  4. Create the per-device DMA buffer (this is easy - just declare the size you
    want in the init structure) and then subdivide it the way you want. Its DMAble
    addresses are also accessible with ScsiPortGetPhysicalAddress with Srb == NULL.

    --
    Maxim Shatskih, Windows DDK MVP
    StorageCraft Corporation

    http://www.storagecraft.com

     
    Maxim S. Shatskih, Aug 23, 2005
    #4
  5. Hi,

    First thing is I need "per operation" buffers to be set fo DMA "not per
    device".

    The init time per device size you are talking about is a way to go for
    "initiator mode" related data buffer management.

    The target mode data buffers is altogether different issue.
    It needs to be address separately than ScsiPortGetUncachedExtension (with
    SrbExtensionSize given in initialize time).

    I need to know how does "ScsiPort Miniport framework" supports - lets say
    "packet based" DMA data transfer per "target mode" operation.
    To explain "packet based" DMA - Say I have locked user buffers based on
    "target mode CDB" that came in.
    Now want to use these locked-in physical pages for DMAing the data transfer
    expected for this "target mode CDB".

    Thanks with best regards
    Shailesh


    In Miniport allocating such buffers

     
    Shailesh Chaudhari, Aug 24, 2005
    #5
  6. What is "target mode"? Are you implementing a SCSI target? Then sorry,
    ScsiPort and StorPort cannot help you.

    --
    Maxim Shatskih, Windows DDK MVP
    StorageCraft Corporation

    http://www.storagecraft.com

     
    Maxim S. Shatskih, Aug 24, 2005
    #6
  7. Hi,

    You got it, as I mentioned before

    Yes, I am implementing SCSI target in the same code base of my initiator
    driver which is a Scsiport Miniport.

    My posting is for figuring out how people are addressing this today and are
    there any Microsoft recommendations around this.

    Thanks with best regards
    ddkuser


     
    Shailesh Chaudhari, Aug 24, 2005
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.