lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240415115435.prmwrsuamlhk5tze@skbuf>
Date: Mon, 15 Apr 2024 14:54:35 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: 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>,
	netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net: dsa: qca8k: provide own phylink MAC
 operations

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@...linux.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@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ