[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231119122527.ccp56obhpofvc3vo@skbuf>
Date: Sun, 19 Nov 2023 14:25:27 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Arınç ÜNAL <arinc.unal@...nc9.com>
Cc: Daniel Golle <daniel@...rotopia.org>,
Landen Chao <Landen.Chao@...iatek.com>,
DENG Qingfang <dqfext@...il.com>,
Sean Wang <sean.wang@...iatek.com>, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Russell King <linux@...linux.org.uk>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
Frank Wunderlich <frank-w@...lic-files.de>,
Bartel Eerdekens <bartel.eerdekens@...stell8.be>,
mithat.guner@...ont.com, erkin.bozoglu@...ont.com
Subject: Re: [PATCH net-next 01/15] net: dsa: mt7530: always trap frames to
active CPU port on MT7530
On Sat, Nov 18, 2023 at 03:31:51PM +0300, Arınç ÜNAL wrote:
> +static void
> +mt753x_conduit_state_change(struct dsa_switch *ds,
> + const struct net_device *conduit,
> + bool operational)
> +{
> + struct mt7530_priv *priv = ds->priv;
> + struct dsa_port *cpu_dp = conduit->dsa_ptr;
nitpick: reverse Christmas tree variable ordering
> +
> + /* Set the CPU port to trap frames to for MT7530. Trapped frames will be
> + * forwarded to the numerically smallest CPU port which the DSA conduit
> + * interface its affine to is up.
> + */
> + if (priv->id != ID_MT7530 && priv->id != ID_MT7621)
> + return;
> +
> + if (operational)
> + priv->active_cpu_ports |= BIT(cpu_dp->index);
> + else
> + priv->active_cpu_ports &= ~BIT(cpu_dp->index);
> +
> + if (priv->active_cpu_ports)
> + mt7530_rmw(priv, MT7530_MFC, CPU_EN | CPU_PORT_MASK, CPU_EN |
> + CPU_PORT(__ffs(priv->active_cpu_ports)));
> +}
Powered by blists - more mailing lists