Re: [PATCH net 4/5] net: dsa: b53: reject conflicting mirror destinations

From: Jonas Gorski

Date: Wed Oct 28 2026 - 06:03:47 EST


On Tue, Oct 27, 2026 at 9:22 PM Florian Fainelli
<florian.fainelli@xxxxxxxxxxxx> wrote:
>
> The mirror capture control register selects one destination for all
> ingress and egress mirror sources. Adding a rule for a different capture
> port currently overwrites that field and silently redirects all existing
> mirror rules.
>
> Read the capture control before changing any source masks and reject a
> different destination while mirroring is enabled. Return an extack which
> describes the hardware limitation, and propagate a failed capture-control
> read rather than making the decision from uninitialized data.
>
> Clear the capture-port field when the final source is removed so a later
> rule can select a new destination.
>
> Fixes: ed3af5fd08eb ("net: dsa: b53: Add support for port mirroring")
> Signed-off-by: Florian Fainelli <florian.fainelli@xxxxxxxxxxxx>

Reviewed-by: Jonas Gorski <jonas.gorski@xxxxxxxxx>