[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87mtyw7a6w.fsf@waldekranz.com>
Date: Wed, 02 Dec 2020 11:51:19 +0100
From: Tobias Waldekranz <tobias@...dekranz.com>
To: Vladimir Oltean <olteanv@...il.com>
Cc: davem@...emloft.net, kuba@...nel.org, andrew@...n.ch,
vivien.didelot@...il.com, f.fainelli@...il.com,
j.vosburgh@...il.com, vfalico@...il.com, andy@...yhouse.net,
netdev@...r.kernel.org
Subject: Re: [PATCH v3 net-next 2/4] net: dsa: Link aggregation support
On Wed, Dec 02, 2020 at 12:07, Vladimir Oltean <olteanv@...il.com> wrote:
> On Wed, Dec 02, 2020 at 10:13:54AM +0100, Tobias Waldekranz wrote:
>> +
>> + /* Link aggregates */
>> + struct {
>> + struct dsa_lag *pool;
>> + unsigned long *busy;
>> + unsigned int num;
>
> Can we get rid of the busy array and just look at the refcounts?
We can, but it is typically 4/8B that makes iterating over used LAGs,
finding the first free LAG etc. much easier.
> Can we also get rid of the "num" variable?
It can be computed but it requires traversing the entire dst port list
every time, as you can see in dsa_tree_setup_lags. We need to hoist the
lowest supported num up from the ds level to the dst.
Powered by blists - more mailing lists