cardigliano at ntop
May 13, 2011, 10:10 AM
Post #4 of 4
Re: ring_alloc_mem() in pf_ring kernel module
[In reply to]
As you said SHMLBA is defined as PAGE_SIZE on x86 platforms, so you should
not worry about that.
Anyway, there was an error computing the memory size, but we fixed it today.
Check it out.
2011/5/11 Lynch, Jonathan <jonathan.lynch [at] thenowfactory>
> Is this something that could be put inside a ARCH define and just set for
> the relevant architectures?
> Does this functionality added to vmalloc_user() in kernel 2.6.32 provide
> the alignment necessary?
> On 10 May 2011 17:27, Alfredo Cardigliano <cardigliano [at] ntop> wrote:
>> 2011/5/10 Lynch, Jonathan <jonathan.lynch [at] thenowfactory>
>> Hi Luca,
>>> I was looking at the code in pfring kernel module function
>>> ring_alloc_mem() to see how the module param min_num_slots impacts on the
>>> amount of memory allocated for the ring.
>>> I am wondering what the highlighted line below is doing. What alignment
>>> is it looking to achieve? (it was added in revision 4400).
>>> /* Alignment necessary on ARM platforms */
>>> num_pages = tot_mem / PAGE_SIZE;
>>> num_pages += (num_pages + (SHMLBA-1)) % SHMLBA;
>>> On x86, SHMLBA is defined as PAGE_SIZE. On ARM SHMLBA it is defined as
>>> (4 * PAGE_SIZE)
>> SHMLBA is a multiple needed in some architectures with virtually indexed
>> L1 caches, which suffer from aliasing problems, to make virtual aliases
>> Best Regards
>> Ntop-misc mailing list
>> Ntop-misc [at] listgateway
> Ntop-misc mailing list
> Ntop-misc [at] listgateway