lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Fri, 27 Nov 2020 21:19:22 -0800 From: Florian Fainelli <f.fainelli@...il.com> To: Tobias Waldekranz <tobias@...dekranz.com>, Andrew Lunn <andrew@...n.ch> Cc: davem@...emloft.net, kuba@...nel.org, vivien.didelot@...il.com, olteanv@...il.com, j.vosburgh@...il.com, vfalico@...il.com, andy@...yhouse.net, netdev@...r.kernel.org Subject: Re: [PATCH net-next 2/4] net: dsa: Link aggregation support On 11/27/2020 3:19 PM, Tobias Waldekranz wrote: >> The initial design of switchdev was transactions. First there was a >> prepare call, where you validated the requested action is possible, >> and allocate resources needed, but don't actually do it. This prepare >> call is allowed to fail. Then there is a second call to actually do >> it, and that call is not allowed to fail. This structure avoids most >> of the complexity of the unwind, just free up some resources. If you >> never had to allocate the resources in the first place, better still. > > OK I think I finally see what you are saying. Sorry it took me this > long. I do not mean to be difficult, I just want to understand. > > How about this: > > - Add a `lags_max` field to `struct dsa_switch` to let each driver > define the maximum number supported by the hardware. By default this > would be zero, which would mean that LAG offloading is not supported. > > - In dsa_tree_setup we allocate a static array of the minimum supported > number across the entire tree. > > - When joining a new LAG, we ensure that a slot is available in > NETDEV_PRECHANGEUPPER, avoiding the issue you are describing. > > - In NETDEV_CHANGEUPPER, we actually mark it as busy and start using it. > Sounds reasonable to me. -- Florian
Powered by blists - more mailing lists