Socket buffer allocation outside DMA-able memory
Hello all!
I work with ADM5120 chip. it has embedded switch.
Switch descriptor has 25-bit dma addres field - so addressible only 32Mb!
My system has 64Mb memory. But I have to set 32Mb to make it work! I thought that setting DMA mask can help. So in /arch/mips/adm5120/setup.c i make:
static struct platform_device adm5120hcd_device = {
.name = "adm5120-hcd",
.id = -1,
.dev = { .dma_mask = &hcd_dmamask,
.coherent_dma_mask = 0x01ffffff,
},
.num_resources = ARRAY_SIZE(adm5120_hcd_resources),
.resource = adm5120_hcd_resources,
};
But It is wrong, because dev_alloc_skb dont know to which device it allocates buffer!
How to tell kernel allocate skbuffers in less then 32Mb addrspace whet system has 64Mb?
Signature · 2 lines
Best regards, art mailto:[email protected]
hi,
I guess your 25 bit dma address field will be word alligned, so ur dma engine will be able to index up to 64 MB( 25+2 = 27 bits).
If that is not the case then you can use one of the foll. work around,
* dont give whole 64 MB to linux, give only Lower 32 MB.
* Give only upper 32 MB to linux, and give memory to ur dma engine from lower 32 MB, and once you recv any data you copy to skb and submit to linux. ( ofcourse your performance will get hit in this case.)
Regards,
A'Jones.
art <[email protected]> wrote:
Hello all!
I work with ADM5120 chip. it has embedded switch.
Switch descriptor has 25-bit dma addres field - so addressible only 32Mb!
My system has 64Mb memory. But I have to set 32Mb to make it work! I thought that setting DMA mask can help. So in /arch/mips/adm5120/setup.c i make:
static struct platform_device adm5120hcd_device = { .name = "adm5120-hcd",
.id = -1,
.dev = {
.dma_mask = &hcd_dmamask,
.coherent_dma_mask = 0x01ffffff,
},
.num_resources = ARRAY_SIZE(adm5120_hcd_resources), .resource = adm5120_hcd_resources,
};
But It is wrong, because dev_alloc_skb dont know to which device it allocates buffer!
How to tell kernel allocate skbuffers in less then 32Mb addrspace whet system has 64Mb?
Signature · 11 lines
Best regards, art mailto:[email protected] __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Hello ashley,
Tuesday, June 06, 2006, 7:37:35 PM, you wrote:
aj> I guess your 25 bit dma address field will be word alligned, so ur dma engine will be able to index up to 64 MB( 25+2 = 27 bits).
Address not aligned - if I don't do anything driver work incorrect!
aj> * dont give whole 64 MB to linux, give only Lower 32 MB.
You mean with command line kernel option? If so - I already did so to get all work!
aj> * Give only upper 32 MB to linux, and give memory to ur dma engine from lower 32 MB, and once you recv any data you copy to skb and submit to linux. ( ofcourse your performance will get hit
aj> in this case.)
How can I do this? I have variant that if addres is upper than 32Mb then copy skbuffer to previously allocated memory that lower than 32Mb, but perfomance is wery Important. Maybe you mean this??
art <[email protected]> wrote: Hello ashley,
Tuesday, June 06, 2006, 7:37:35 PM, you wrote:
aj> I guess your 25 bit dma address field will be word alligned, so ur dma engine will be able to index up to 64 MB( 25+2 = 27 bits). Address not aligned - if I don't do anything driver work incorrect!
*** what do you mean by Address not aligned ??
*** What address you r passing to dma ? u should pass (skb->data >> 2) (if word alligned address is required for dma engine.)
aj> * dont give whole 64 MB to linux, give only Lower 32 MB. You mean with command line kernel option? If so - I already did so to get all work!
*** when you do add_memory_region(), give only first 32 MB to linux, so all the skbs will be in lower 32 MB range.
aj> * Give only upper 32 MB to linux, and give memory to ur dma engine from lower 32 MB, and once you recv any data you copy to skb and submit to linux. ( ofcourse your performance will get hit
aj> in this case.)
How can I do this? I have variant that if addres is upper than 32Mb then copy skbuffer to
previously allocated memory that lower than 32Mb, but perfomance is wery Important. Maybe
you mean this??
A'Jones.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Hello ashley,
Wednesday, June 07, 2006, 12:17:56 PM, you wrote:
aj>> I guess your 25 bit dma address field will be word alligned, so ur dma engine will be able to index up to 64 MB( 25+2 = 27 bits). aj> Address not aligned - if I don't do anything driver work incorrect!
aj> *** what do you mean by Address not aligned ??
aj> *** What address you r passing to dma ? u should pass (skb->data >> 2) (if word alligned address is required for dma engine.)
In adm5120 switch driver to dma passed skb->data
Signature · 2 lines
Best regards, art mailto:[email protected]