How to set 32Byte alignment DMA transfer for storport

Devic wen 1 Reputation point
2021-10-21T10:53:48.3+00:00

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://learn.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
Windows Server Storage
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Storage: The hardware and software system used to retain data for subsequent retrieval.
538 questions
No comments
{count} votes