netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: David Thompson <davthompson@nvidia.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	limings@nvidia.com, Asmaa Mnebhi <asmaa@nvidia.com>
Subject: Re: [PATCH net-next v4] Add Mellanox BlueField Gigabit Ethernet driver
Date: Fri, 12 Mar 2021 02:56:44 +0100	[thread overview]
Message-ID: <YErKXAhto42RU+xn@lunn.ch> (raw)
In-Reply-To: <1615380399-31970-1-git-send-email-davthompson@nvidia.com>

> +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

  reply	other threads:[~2021-03-12  1:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 12:46 [PATCH net-next v4] Add Mellanox BlueField Gigabit Ethernet driver David Thompson
2021-03-12  1:56 ` Andrew Lunn [this message]
2021-03-16 23:16   ` David Thompson
2021-03-12  2:19 ` Andrew Lunn
2021-03-16 23:28   ` David Thompson
2021-03-18  1:14     ` Andrew Lunn

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=YErKXAhto42RU+xn@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=asmaa@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=davthompson@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=limings@nvidia.com \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).