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]
Date:   Fri, 12 Mar 2021 02:56:44 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     David Thompson <davthompson@...dia.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
        limings@...dia.com, Asmaa Mnebhi <asmaa@...dia.com>
Subject: Re: [PATCH net-next v4] Add Mellanox BlueField Gigabit Ethernet
 driver

> +static void mlxbf_gige_get_pauseparam(struct net_device *netdev,
> +				      struct ethtool_pauseparam *pause)
> +{
> +	struct mlxbf_gige *priv = netdev_priv(netdev);
> +
> +	pause->autoneg = priv->aneg_pause;
> +	pause->rx_pause = priv->tx_pause;
> +	pause->tx_pause = priv->rx_pause;
> +}

> +static int mlxbf_gige_probe(struct platform_device *pdev)
> +{
> +	err = phy_connect_direct(netdev, phydev,
> +				 mlxbf_gige_adjust_link,
> +				 PHY_INTERFACE_MODE_GMII);
> +	if (err) {
> +		dev_err(&pdev->dev, "Could not attach to PHY\n");
> +		mlxbf_gige_mdio_remove(priv);
> +		return err;
> +	}
> +
> +	/* MAC only supports 1000T full duplex mode */
> +	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
> +	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Full_BIT);
> +	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT);
> +	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Full_BIT);
> +	phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Half_BIT);
> +
> +	/* MAC supports symmetric flow control */
> +	phy_support_sym_pause(phydev);
> +
> +	/* Enable pause */
> +	priv->rx_pause = phydev->pause;
> +	priv->tx_pause = phydev->pause;
> +	priv->aneg_pause = AUTONEG_ENABLE;

Hi David

I'm pretty sure mlxbf_gige_get_pauseparam() is broken.

This is the only code which sets priv->rx_pause, etc. And this is
before the PHY has had time to do anything. auto-neg has not completed
so you have no idea what has been negotiated for pause.
mlxbf_gige_adjust_link() should be adjusting priv->??_pause once the
link has been established.

     Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ