Re: NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- From: "Alireza Dabagh [MS]" <alid@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 19 Sep 2008 03:27:25 -0700
I believe in W2K8 if your device does 64 bit DMA, when you call NdisMAllocateSharedMemory you will get high physical addresses before getting low addresses (system tries to reserve low addresses for those devices that can not do 64 bit DMA.).
Have you tried NdisAllocateSharedMemory to see what address range you get?
NDIS does not provide an API to allocate physically contiguous memory outside what HAL DMA APIs provide (NdisMAllocateSharedMemory is a wrapper around DmaChannel->AllocateCommonBuffer). There is a very good reason for this. DMA APIs take into account what your device can address. mm APIs that allow you to allocate physical address directly have no idea of the device capabilities (there is no PDO parameter). Going forward it will become even more important to go through HAL DMA APIs to allocate physical addresses.
In any case, seems like you just need this for testing purpose. If what I said about W2K8 turns out to be false, just allocate as much memory as you can in your driver. At some point the physical address would end up going over 32 bit.
-ali
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Praveen Kumar Amritaluru" <apraveen.kumar@xxxxxxxxx> wrote in message news:eONlaccGJHA.4596@xxxxxxxxxxxxxxxxxxxxxxx
Hi Pavel,
But this needs special hardware (system with PAE support running x86 version of OS) which is not necessarily
the case with a developer's test-system.
But this info is helpful though.
Regards,
-Praveen
"Pavel A." <pavel_a@xxxxxxxxxxxxxxx> wrote in message news:e8lTEubGJHA.3504@xxxxxxxxxxxxxxxxxxxxxxxMaybe /nolowmem boot option is what you need?
(described in windbg help file)
Regards,
--PA
Praveen Kumar Amritaluru wrote:OK. Let me put the requirements clearly.
My earlier mail is not clear I suppose.
The requirement is that from within driver memory allocation needs to be made
that falls within a range. One example requirement is when we want memory allocation
such that physical address contains non-zero bits in higher 32 bit (of 64-bit physical address)
to test the handling of device that is supposed to handle physical memory more than 4 GB (> 32 bits).
I am trying to figure if there is one or set of NDIS calls that can do this.
With NdisMRegisterScatterGatherDMA I can only say that dont give 64-bit addresses since my device only supports 32-bit.
Even I say my device supports 64-bit, there is no guarantee that memory allocated to my device falls above 4 GB.
Regards,
-Praveen
"Pavel A." <pavel_a@xxxxxxxxxxxxxxx> wrote in message news:uP2bPwXGJHA.4984@xxxxxxxxxxxxxxxxxxxxxxxNdisAllocateMemoryWithTag(Priority) allocates nonpaged pool.
Therefore it is not physically contiguous and not limited
by "highest physical address".
For allocation of DMA shared memory use NdisMRegisterScatterGatherDma;
it lets you specify 32- or 64-bit capability of the NIC.
Regards,
--PA
Praveen Kumar Amritaluru wrote:DMA_OPERATIONS->AllocateCommonBuffer() seems to be allocating physically contiguous bufer.
Is there an equivalent Ndis() since NdisAllocateMemory() is obsoleted on Vista and above?
Also is there an Ndis() or any equivalent call to specify the range of physical address?
Basically highest accetable physical address?
Regards.
-Praveen
"Praveen Kumar Amritaluru" <apraveen.kumar@xxxxxxxxx> wrote in message news:uTxJhUXGJHA.1272@xxxxxxxxxxxxxxxxxxxxxxxHi,
NdisAllocateMemory has been obsoleted by NdisAllocateMemoryWithTag which in turn has been obsoleted by NdisAllocateMemoryWithTagPriority,
as per the WDK for Vista(6.0) and above.
The docs say that NdisAllocateMemoryWithTag(Priority) is same as NdisAllocateMemory() except that it allows the caller to supply a tag.
But other differences are:
1. No argument where you can specify flags?
2. No "highest physical address" field.
Now what is the default behaviour with NdisAllocateMemoryWithTag(Priority)?
Does it always allocate physically contiguous memory? OR does it always make best effort to do so though its not guaranteed?
What if there is a need for non-cached memory?
I am not sure if the above requirements have been taken care of - in a different way in NDIS 6.0.
Thanks,
-Praveen
.
- Follow-Ups:
- Re: NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- From: Praveen Kumar Amritaluru
- Re: NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- References:
- NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- From: Praveen Kumar Amritaluru
- Re: NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- From: Praveen Kumar Amritaluru
- Re: NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- From: Pavel A.
- Re: NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- From: Praveen Kumar Amritaluru
- Re: NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- From: Pavel A.
- Re: NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- From: Praveen Kumar Amritaluru
- NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- Prev by Date: Re: Signtool /ac option does nothing
- Next by Date: Re: Any idea what this is cribbing about?
- Previous by thread: Re: NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- Next by thread: Re: NdisAllocateMemoryWithTag(Priority) -> Does it ensure Congtiguous physical memory by default?
- Index(es):
Relevant Pages
|