Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Jonas Gorski <jonas.gorski@gmail.com>
Cc: Semih Baskan <strst.gs@gmail.com>,
	florian.fainelli@broadcom.com, andrew@lunn.ch,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, vladimir.oltean@nxp.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: dsa: b53: be VLAN unaware when not filtering
Date: Thu, 13 Aug 2026 01:06:27 +0300	[thread overview]
Message-ID: <20260812220627.r6gesugv2q3s6x2o@skbuf> (raw)
In-Reply-To: <20260812205047.ojq2yyjtmoe5gjot@skbuf>

On Wed, Aug 12, 2026 at 11:50:47PM +0300, Vladimir Oltean wrote:
> 1. This looks implementable with some complexity isolated within the b53
>    driver:
>    - on any .port_fdb_add(), .port_fdb_del(), .port_mdb_add(), .port_mdb_del(),
>      compare the VID of the entry with the dev->vlan_enabled state.
>      - if VID != 0 and dev->vlan_enabled, or if VID == 0 and !dev->vlan_enabled,
>        commit the operation directly to the ARL, as is currently done
>      - if VID == 0 and !dev->vlan_enabled, or if VID != 0 and dev->vlan_enabled,
>        operate on a software list, allocating, deleting or modifying a
>        local representation of the ARL entry
>    - on vlan_filtering toggles from 0 to 1 or from 1 to 0, acquire
>      dev->arl_mutex and flush out all static and dynamic ARL entries
>      across the entire switch, commit the static ones from the software
>      list and clear the software list
>    - dev->vlan_enabled will probably need to be merged with
>      dev->vlan_filtering, since the vlan_enabled=1 vlan_filtering=0 case
>      is broken

Actually this algorithm is too simplistic as I specified it. In this sequence:

ip link add br0 type bridge vlan_filtering 0 && ip link set swp0 master br0
bridge fdb add swp0 00:01:02:03:04:05 master static
ip link set br0 type bridge vlan_filtering 1
ip link set br0 type bridge vlan_filtering 0 # the 00:01:02:03:04:05 address would be lost here

Furthermore, the ARL is limited in size (1024, 2048 or 4096 entries),
and we could mistakenly end up queuing more than we can commit.

I'm not yet sure what are reasonable amendments that would keep the
complexity in check. Currently the most obvious would be to do a one-time
allocation of dev->num_arl_bins * dev->num_arl_buckets, to always keep
all entries in software, and only the active ones in hardware. But I
need to think about this some more, as I'm aware OpenWrt typically
doesn't operate with huge memory budgets.

I'm not sure that avoiding local copies is possible, because the ARL
entries don't come from a single source - we have bridge FDB, bridge
MDB, ndo_dflt_fdb_add(), dev->uc, dev->mc, dev->dev_addr, sometimes
replicated per VLAN, etc. They all only converge at driver level.

  reply	other threads:[~2026-08-12 22:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05  7:26 [PATCH net] net: dsa: b53: be VLAN unaware when not filtering Semih Baskan
2026-08-05  7:44 ` Jonas Gorski
2026-08-05  9:50   ` Semih Baskan
2026-08-06 10:23   ` Vladimir Oltean
2026-08-06 11:08     ` Semih Baskan
2026-08-06 11:09     ` Jonas Gorski
2026-08-10 12:04       ` Vladimir Oltean
2026-08-11  8:06         ` Jonas Gorski
2026-08-11 16:13           ` Florian Fainelli
2026-08-12 20:50   ` Vladimir Oltean
2026-08-12 22:06     ` Vladimir Oltean [this message]
2026-08-12 22:28       ` Florian Fainelli

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=20260812220627.r6gesugv2q3s6x2o@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=jonas.gorski@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=strst.gs@gmail.com \
    --cc=vladimir.oltean@nxp.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