From: Nikolay Aleksandrov <razor@blackwall.org>
To: netdev@vger.kernel.org
Cc: Nikolay Aleksandrov <razor@blackwall.org>,
Ido Schimmel <idosch@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
bridge@lists.linux.dev
Subject: [PATCH net-next 0/3] net: bridge: optimize vlan multicast forwarding
Date: Mon, 23 Nov 2026 12:28:30 +0200 [thread overview]
Message-ID: <20261123102833.924427-1-razor@blackwall.org> (raw)
Hi,
This is the last part of the patch-sets that optimize forwarding by caching
VLANs. It adds the forwarding optimizations to the bridge multicast code
and also optimizes vlan range add (see tables below).
Patch 01 - use the vlan already stored in the in per-VLAN router context
Patch 02 - use a small hash (64 entries) to find the port vlan groups
without walking all
Patch 03 - cache the port-VLAN destination in mdbs to avoid egress VLAN
lookups
VLAN Add improvement (patch 02):
Operation VLANs Global ms before/after Change % Per-VLAN ms before/after Change %
------------------------------------------------------------------------------------------
add 1 0.0519 / 0.0900 +73.52 0.0481 / 0.0895 +86.16
add 64 2.2500 / 0.7190 -68.04 2.2726 / 0.7441 -67.26
add 1024 32.7464 / 5.7028 -82.58 32.9841 / 6.3116 -80.86
add 4094 149.6750 / 34.3223 -77.07 151.5808 / 35.4586 -76.61
Single vlan add is slower, but vlan group add is 67-80% faster. Vlan del is
pretty much the same.
VLAN forwarding improvement (patch 03):
VLANs Listeners Mpps before Mpps after Gain % Cycles before Cycles after Saved %
---------------------------------------------------------------------------------------
8 4 0.785571 0.865156 +10.13 3771.2 3381.2 10.34
8 8 0.454257 0.511490 +12.60 6900.5 6091.0 11.73
8 16 0.249896 0.288575 +15.48 13144.0 11362.9 13.55
64 4 0.765468 0.841916 +9.99 3881.6 3462.1 10.81
64 8 0.437448 0.501744 +14.70 7153.6 6215.6 13.11
64 16 0.238901 0.279188 +16.86 13690.2 11674.2 14.73
4094 4 0.583447 0.695246 +19.16 5271.6 4339.3 17.68
4094 8 0.293712 0.373710 +27.24 11001.0 8492.8 22.80
4094 16 0.140026 0.191269 +36.60 23509.6 17213.7 26.78
Medians of 6 runs, 64-byte frames, one group per VLAN, and packet VIDs
chosen at random. Cycles are PMU cycles / input packet on the fwding CPU.
CC: Ido Schimmel <idosch@nvidia.com>
CC: David S. Miller <davem@davemloft.net>
CC: Eric Dumazet <edumazet@kernel.org>
CC: Jakub Kicinski <kuba@kernel.org>
CC: Paolo Abeni <pabeni@redhat.com>
CC: Simon Horman <horms@kernel.org>
CC: bridge@lists.linux.dev
Thanks,
Nik
Nikolay Aleksandrov (3):
net: bridge: avoid VLAN lookups for multicast router forwarding
net: bridge: mdb: index port groups by VLAN
net: bridge: mdb: avoid VLAN lookups in listener forwarding
net/bridge/br_forward.c | 21 +++++++++++++--------
net/bridge/br_multicast.c | 31 ++++++++++++++++++++++++++++++-
net/bridge/br_private.h | 30 ++++++++++++++++--------------
net/bridge/br_vlan.c | 2 ++
4 files changed, 61 insertions(+), 23 deletions(-)
--
2.47.3
next reply other threads:[~2026-11-23 10:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 10:28 Nikolay Aleksandrov [this message]
2026-11-23 10:28 ` [PATCH net-next 1/3] net: bridge: avoid VLAN lookups for multicast router forwarding Nikolay Aleksandrov
2026-11-23 10:28 ` [PATCH net-next 2/3] net: bridge: mdb: index port groups by VLAN Nikolay Aleksandrov
2026-11-23 10:28 ` [PATCH net-next 3/3] net: bridge: mdb: avoid VLAN lookups in listener forwarding Nikolay Aleksandrov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261123102833.924427-1-razor@blackwall.org \
--to=razor@blackwall.org \
--cc=bridge@lists.linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox