Netdev List
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH net-next] net: dsa: qca8k: provide own phylink MAC operations
Date: Mon, 15 Apr 2024 14:54:35 +0300	[thread overview]
Message-ID: <20240415115435.prmwrsuamlhk5tze@skbuf> (raw)
In-Reply-To: <E1rvIce-006bQi-58@rmk-PC.armlinux.org.uk> <E1rvIce-006bQi-58@rmk-PC.armlinux.org.uk>

On Fri, Apr 12, 2024 at 04:15:24PM +0100, Russell King (Oracle) wrote:
> Convert qca8k to provide its own phylink MAC operations, thus
> avoiding the shim layer in DSA's port.c.
> 
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
>  static void
> -qca8k_phylink_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode,
> -			  phy_interface_t interface, struct phy_device *phydev,
> -			  int speed, int duplex, bool tx_pause, bool rx_pause)
> +qca8k_phylink_mac_link_up(struct phylink_config *config,
> +			  struct phy_device *phydev, unsigned int mode,
> +			  phy_interface_t interface, int speed, int duplex,
> +			  bool tx_pause, bool rx_pause)
>  {
> -	struct qca8k_priv *priv = ds->priv;
> +	struct dsa_port *dp = dsa_phylink_to_port(config);
> +	struct qca8k_priv *priv = dp->ds->priv;
> +	int port = dp->index;
>  	u32 reg;
>  
>  	if (phylink_autoneg_inband(mode)) {
> @@ -1463,10 +1474,10 @@ qca8k_phylink_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode,
>  		if (duplex == DUPLEX_FULL)
>  			reg |= QCA8K_PORT_STATUS_DUPLEX;
>  
> -		if (rx_pause || dsa_is_cpu_port(ds, port))
> +		if (rx_pause || dsa_port_is_cpu(dp))
>  			reg |= QCA8K_PORT_STATUS_RXFLOW;
>  
> -		if (tx_pause || dsa_is_cpu_port(ds, port))
> +		if (tx_pause || dsa_port_is_cpu(dp))
>  			reg |= QCA8K_PORT_STATUS_TXFLOW;

Thanks for changing these from dsa_is_*_port() to dsa_port_is_*(), the
latter operation is cheaper.

>  	}
>  
> @@ -1991,6 +2002,13 @@ qca8k_setup(struct dsa_switch *ds)
>  	return 0;
>  }

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>

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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-12 15:15 [PATCH net-next] net: dsa: qca8k: provide own phylink MAC operations Russell King (Oracle)
2024-04-15 11:54 ` Vladimir Oltean [this message]
2024-04-15 15:27 ` Florian Fainelli
2024-04-16  9:00 ` patchwork-bot+netdevbpf

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=20240415115435.prmwrsuamlhk5tze@skbuf \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rmk+kernel@armlinux.org.uk \
    /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