[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e4891c23-b456-4433-1ee2-5a4e4e5d9a4f@gmail.com>
Date: Mon, 21 Feb 2022 19:43:40 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Vladimir Oltean <vladimir.oltean@....com>, netdev@...r.kernel.org
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
Ansuel Smith <ansuelsmth@...il.com>,
Tobias Waldekranz <tobias@...dekranz.com>,
DENG Qingfang <dqfext@...il.com>,
Claudiu Manoil <claudiu.manoil@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
UNGLinuxDriver@...rochip.com, Jiri Pirko <jiri@...nulli.us>,
Ivan Vecera <ivecera@...hat.com>
Subject: Re: [PATCH v4 net-next 04/11] net: dsa: make LAG IDs one-based
On 2/21/2022 1:23 PM, Vladimir Oltean wrote:
> The DSA LAG API will be changed to become more similar with the bridge
> data structures, where struct dsa_bridge holds an unsigned int num,
> which is generated by DSA and is one-based. We have a similar thing
> going with the DSA LAG, except that isn't stored anywhere, it is
> calculated dynamically by dsa_lag_id() by iterating through dst->lags.
>
> The idea of encoding an invalid (or not requested) LAG ID as zero for
> the purpose of simplifying checks in drivers means that the LAG IDs
> passed by DSA to drivers need to be one-based too. So back-and-forth
> conversion is needed when indexing the dst->lags array, as well as in
> drivers which assume a zero-based index.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
--
Florian
Powered by blists - more mailing lists