Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] net: bridge: optimize vlan multicast forwarding
@ 2026-11-23 10:28 Nikolay Aleksandrov
  2026-11-23 10:28 ` [PATCH net-next 1/3] net: bridge: avoid VLAN lookups for multicast router forwarding Nikolay Aleksandrov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nikolay Aleksandrov @ 2026-11-23 10:28 UTC (permalink / raw)
  To: netdev
  Cc: Nikolay Aleksandrov, Ido Schimmel, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, bridge

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-23 10:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 10:28 [PATCH net-next 0/3] net: bridge: optimize vlan multicast forwarding Nikolay Aleksandrov
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox