[Ntop-misc] why is PF_RING limited to only allocating up to 4MB of
ring slots
Rob Willis
rob.willis at quest.com
Tue Jun 27 00:24:50 CEST 2006
(Hopefully, this doesnt turn into a double post since I sent an earlier email via my home email account by accident).
I've been playing with PF_RING (with positive results). However it seems to be limited to only allocating enough slots up to 4MB of memory. I'm on FedoraCore4, 2.6.12.
I took a look at the RF_RING code and it is calling __get_free_pages(priority,order) where order represents the number of kernel memory pages to return: 2^order. So pages returned:
order=0: 1 page
order=1: 2 pages
order=2: 4 pages
...
And in my case, PF_RING decides on an order of 10:
order=10: 1024 pages
Since each page is 4kb, that means it returns 4 MB of memory for use as ring slots. My ring slot size is set to 1518 (just big enough for an 802.1q packet).
Anyways, even when I request 8MB or 16 MB, this function always returns 4 MB (ie it always uses an order of 10). Is there another option to get PF_RING to allocate more memory? I've got 8 GB on this system and need to do some fairly indepth analysis of packets. So would like to have a very large buffer allocated.
If there is some reason that __get_free_pages can only return 4 MB blocks, perhaps PF_RING could be reworked to manage multiple large blocks. Then could call __get_free_pages multiple times and put all of the blocks in a array. Would mean an extra level of indirection when referencing a ring slot, but that doesnt seem like that much more overhead.
I might even be willing to dive in and come up with a patch to do just that if someone told me that was even possible. And if they said there wasnt an easier way to get PF_RING to allocate more memory.
-Rob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listgateway.unipi.it/pipermail/ntop-misc/attachments/20060626/a2cf6f71/attachment.htm
More information about the Ntop-misc
mailing list