question

Devicwen-1645 avatar image
0 Votes"
Devicwen-1645 asked

How to set 32Byte alignment DMA transfer for storport

Use WDK10, target env: windows server2019

I created a storage miniport driver base on storport.

For bus master DMA with scatter/gather supported, is there a way to make the start address of each physical segment aligned to 32Byte? or change the default alignment?

From https://docs.microsoft.com/zh-cn/windows-hardware/drivers/ddi/storport/ns-storport-_port_configuration_information
PORT_CONFIGURATION_INFORMATION.AlignmentMask = FILE_32_BYTE_ALIGNMENT
PORT_CONFIGURATION_INFORMATION.ScatterGather= TRUE
PORT_CONFIGURATION_INFORMATION.Dma32BitAddresses = TRUE;
PORT_CONFIGURATION_INFORMATION.Dma64BitAddresses = SCSI_DMA64_MINIPORT_FULL64BIT_SUPPORTED;

BUT the SRB data buffer physical address always 16Byte alignment, AlignmentMask invalid.
HwStartIo:srb opcode:0x28 ,data buffer phy:0x84a277b90, len:512
HwStartIo:srb opcode:0x25 ,data buffer phy:0x1efe54470, len:8
HwStartIo:srb opcode:0x25 ,data buffer phy:0x1efe540c0, len:8
HwStartIo:srb opcode:0x28 ,data buffer phy:0x1883a0b80, len:512
HwStartIo:srb opcode:0x28 ,data buffer phy:0x1824d3270, len:512



How to change the alignment?

windows-server-storage
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers