mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Yang <mmyangfl@gmail.com>
Cc: netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.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>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/6] net: dsa: motorcomm: Rely on port isolation for CPU port
Date: Wed, 4 Nov 2026 16:04:44 +0100	[thread overview]
Message-ID: <de4954a2-8d01-4a6f-9641-230e9faca4cd@lunn.ch> (raw)
In-Reply-To: <CAAXyoMN4ySBtnLjqKcfAa4XwUR14-fjaJh-hcCyumERagmcHvg@mail.gmail.com>

On Wed, Nov 04, 2026 at 06:05:32PM +0800, David Yang wrote:
> On Wed, Nov 4, 2026 at 11:59 AM Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > > -     ctrl = ~priv->cpu_ports_mask;
> > > -     res = yt921x_reg_write(priv, YT921X_PORTn_ISOLATION(port), ctrl);
> > > -     if (res)
> > > -             return res;
> > > +     if (!(BIT(port) & priv->cpu_ports_mask)) {
> >
> >         if (!dsa_is_cpu_port(ds, port) ?
> >
> 
> The next line is ctrl = ~priv->cpu_ports_mask, but could change both
> if you prefer.

The advantage of the dsa_is_cpu_port() is that is it very obvious what
it does. And anybody who has looked at any DSA driver knows these
functions and what they do. So maintenance is easier. The more you can
make the driver look like other DSA drivers, use the same constructs,
helpers, etc the better.

	  Andrew

  reply	other threads:[~2026-11-04 15:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 15:56 [PATCH net-next 0/6] net: dsa: motorcomm: More BR_* flags support David Yang
2026-11-02 15:56 ` [PATCH net-next 1/6] net: dsa: motorcomm: Isolate all ports during chip setup David Yang
2026-11-02 15:56 ` [PATCH net-next 2/6] net: dsa: motorcomm: Rely on port isolation for CPU port David Yang
2026-11-04  3:59   ` Andrew Lunn
2026-11-04 10:05     ` David Yang
2026-11-04 15:04       ` Andrew Lunn [this message]
2026-11-02 15:56 ` [PATCH net-next 3/6] net: dsa: motorcomm: Add BR_FLOOD and BR_MCAST_FLOOD support David Yang
2026-11-02 15:56 ` [PATCH net-next 4/6] net: dsa: motorcomm: Translate FDB VID for VLAN-unaware bridges David Yang
2026-11-02 15:56 ` [PATCH net-next 5/6] net: dsa: tag_yt921x: handle FDB suspend copy tag code David Yang
2026-11-02 15:56 ` [PATCH net-next 6/6] net: dsa: motorcomm: Add BR_PORT_LOCKED and BR_PORT_MAB support David Yang

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=de4954a2-8d01-4a6f-9641-230e9faca4cd@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmyangfl@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --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

all inboxes | Powered by JetHome®