[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALW65jatBuoE=NDRqccfiMVugPh5eeYSf-9a9qWYhvvszD2Jiw@mail.gmail.com>
Date: Tue, 2 Mar 2021 13:51:42 +0800
From: DENG Qingfang <dqfext@...il.com>
To: netdev <netdev@...r.kernel.org>, Andrew Lunn <andrew@...n.ch>,
Jakub Kicinski <kuba@...nel.org>,
David Miller <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
linux-kernel@...r.kernel.org,
Russell King - ARM Linux admin <linux@...linux.org.uk>
Cc: Birger Koblitz <git@...ger-koblitz.de>,
Bjørn Mork <bjorn@...k.no>,
Stijn Segers <foss@...atilesystems.org>
Subject: dsa_master_find_slave()'s time complexity and potential performance hit
Since commit 7b9a2f4bac68 ("net: dsa: use ports list to find slave"),
dsa_master_find_slave() has been iterating over a linked list instead
of accessing arrays, making its time complexity O(n).
The said function is called frequently in DSA RX path, so it may cause
a performance hit, especially for switches that have many ports (20+)
such as RTL8380/8390/9300 (There is a downstream DSA driver for it,
see https://github.com/openwrt/openwrt/tree/openwrt-21.02/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx).
I don't have one of those switches, so I can't test if the performance
impact is huge or not.
Powered by blists - more mailing lists