Netdev List
 help / color / mirror / Atom feed
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: "Rafał Miłecki" <zajec5@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@kernel.org>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>, "Andrew Lunn" <andrew@lunn.ch>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"Jonas Gorski" <jonas.gorski@gmail.com>
Cc: netdev@vger.kernel.org, "Rosen Penev" <rosenp@gmail.com>,
	"Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH net-next V4] net: dsa: b53: prefer CPU port 8 for Northstar devices
Date: Wed, 2 Dec 2026 13:10:36 -0800	[thread overview]
Message-ID: <e74bbfa1-0772-47d6-891e-79d7181c1be4@broadcom.com> (raw)
In-Reply-To: <0d4b60e7-8e75-4419-a790-1c4b7069ffcb@gmail.com>

On 12/2/26 12:32, Rafał Miłecki wrote:
> W dniu 2.12.2026 o 21:13, Florian Fainelli pisze:
>> On 12/2/26 02:34, Rafał Miłecki wrote:
>>> From: Rafał Miłecki <rafal@milecki.pl>
>>>
>>> Port 8 allows using all switch features as in opposite to ports 5 and 7.
>>>
>>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>>> ---
>>> V4: Add check for NULL pointer
>>>
>>>   drivers/net/dsa/b53/b53_common.c | 27 +++++++++++++++++++++++++++
>>>   1 file changed, 27 insertions(+)
>>>
>>> diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/ 
>>> b53_common.c
>>> index ee2d27732c0c..53625090131e 100644
>>> --- a/drivers/net/dsa/b53/b53_common.c
>>> +++ b/drivers/net/dsa/b53/b53_common.c
>>> @@ -758,6 +758,32 @@ void b53_disable_port(struct dsa_switch *ds, int 
>>> port)
>>>   }
>>>   EXPORT_SYMBOL(b53_disable_port);
>>> +static struct dsa_port *b53_preferred_default_local_cpu_port(struct 
>>> dsa_switch *ds)
>>> +{
>>> +    struct b53_device *dev = ds->priv;
>>> +    struct dsa_port *cpu_dp;
>>> +
>>> +    /*
>>> +     * Northstar SoCs devices have 3 Ethernet controllers and 3 CPU 
>>> ports:
>>> +     * 5 (IMP1), 7, 8 (IMP0). This design was meant for dual IMP 
>>> setups when
>>> +     * WAN traffic goes to port 5 and LAN traffic goes to port 8.
>>> +     *
>>> +     * While all 3 ports support Broadcom header, ports 5 and 7 have 
>>> their
>>> +     * limitations. Features that relay on trapping to CPU (e.g. 
>>> EAP, STP)
>>> +     * won't work when using those as CPU ones.
>>
>> typo: s/relay/rely/
>>
>>> +     *
>>> +     * Prefer CPU port 8 if available.
>>> +     */
>>> +    if (is5301x(dev)) {
>>
>> Appreciate you want to be somewhat conservative here but the list is 
>> much longer, in fact, we should probably implement this by exception, 
>> the norm is to use port 8, and the exception is to use another one.
> 
> I'm just not really familiar with other hardware supported by b53.
> 
> Are you aware of any devices that this logic shouldn't be applied to?

Except 5325 and 5365, and some odd combinations where there is an actual 
ned not to use port 8, see 
https://lore.kernel.org/all/20261130-b53-bpdu-mirror-v3-1-3d82c0e0571f@telaak.dev 
then I can't think of a configuration where it is not done. With that 
said, I would go with something like this:

static struct dsa_port *
   b53_preferred_default_local_cpu_port(struct dsa_switch *ds)
   {
           struct b53_device *dev = ds->priv;
           struct dsa_port *cpu_dp;

           /* BCM5325/5365 only have CPU port 5 (port 8 is an alias) */
           if (is5325(dev) || is5365(dev))
                   return NULL;

           /* Port 8 (IMP0) is the fully featured CPU port. Ports 5 and 
7 ... */
           cpu_dp = dsa_to_port(ds, B53_CPU_PORT);
           if (cpu_dp && dsa_port_is_cpu(cpu_dp))
                   return cpu_dp;

           return NULL;
   }

-- 
Florian

      reply	other threads:[~2026-12-02 21:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 10:34 [PATCH net-next V4] net: dsa: b53: prefer CPU port 8 for Northstar devices Rafał Miłecki
2026-12-02 20:13 ` Florian Fainelli
2026-12-02 20:32   ` Rafał Miłecki
2026-12-02 21:10     ` Florian Fainelli [this message]

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=e74bbfa1-0772-47d6-891e-79d7181c1be4@broadcom.com \
    --to=florian.fainelli@broadcom.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=jonas.gorski@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=rafal@milecki.pl \
    --cc=rosenp@gmail.com \
    --cc=zajec5@gmail.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