Thread (16 messages) flat view 16 messages, 4 authors, 2021-08-11

Re: [RFC PATCH net-next 2/4] net: dsa: remove the "dsa_to_port in a loop" antipattern from the core

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2021-08-10 09:41:15


On 8/9/2021 8:33 PM, DENG Qingfang wrote:
On Mon, Aug 09, 2021 at 10:03:18PM +0300, Vladimir Oltean wrote:
quoted
Ever since Vivien's conversion of the ds->ports array into a dst->ports
list, and the introduction of dsa_to_port, iterations through the ports
of a switch became quadratic whenever dsa_to_port was needed.
So, what is the benefit of a linked list here? Do we allow users to
insert/delete a dsa_port at runtime? If not, how about using a
dynamically allocated array instead?
The goal was to flatten the space while doing cross switch operations, 
which would have otherwise required iterating over dsa_switch instances 
within a dsa_switch_tree, and then over dsa_port within each dsa_switch.
-- 
Florian
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help