[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <57E18404.1010409@akamai.com>
Date: Tue, 20 Sep 2016 14:46:28 -0400
From: Jason Baron <jbaron@...mai.com>
To: David Laight <David.Laight@...LAB.COM>,
"Mintz, Yuval" <Yuval.Mintz@...ium.com>,
"davem@...emloft.net" <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Ariel.Elior@...gic.com" <Ariel.Elior@...gic.com>
Subject: Re: [PATCH net-next 2/2] bnx2x: allocate mac filtering pending list
in PAGE_SIZE increments
On 09/20/2016 07:30 AM, David Laight wrote:
> From: Jason Baron
>> Sent: 19 September 2016 19:34
> ...
>>
>> sizeof(struct bnx2x_mcast_list_elem) = 24. So there are 170 per
>> page on x86. So if we want to fit 2,048 elements, we need 12 pages.
>
> If you only need to save the mcast addresses you could use a 'heap'
> that requires no overhead per entry and gives you O(log) lookup.
> 6 bytes per entry is 682 in a 4k page.
>
> David
>
Indeed, that would save space here.
Based on Yuval's comments it sounds as though he agrees that it makes
sense to go beyond a page (even if we get 682 per page as you suggest),
when configuring these mac filters. So we would then have to allocate
and manage the page pointers. Currently, there is a list_head per entry
to manage the macs as a linked list. The patch I proposed continues to
use that same data structure, thus it will not add to the memory
footprint, it only proposes to break that footprint up into PAGE_SIZE
chunks.
So I think the change you suggest can be viewed as an additional
enhancement here, and also note that the memory allocations here are
short-lived. That is, they only exist in memory until the NIC is
re-configured.
Thanks,
-Jason
Powered by blists - more mailing lists