netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>, David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>, maxime.chevallier@bootlin.com
Subject: Re: [PATCH net-next 10/12] net: ethernet: Add helper for set_pauseparam for Asym Pause
Date: Mon, 3 Sep 2018 10:49:20 -0700	[thread overview]
Message-ID: <d0f68efb-01ff-74d3-f655-269068df5c25@gmail.com> (raw)
In-Reply-To: <1535908001-18593-11-git-send-email-andrew@lunn.ch>



On 9/2/2018 10:06 AM, Andrew Lunn wrote:
> ethtool can be used to enable/disable pause. Add a helper to configure
> the PHY when asym pause is supported.

Don't you want to go one step further and incorporate the logic that 
xgenet, tg3, gianfar and others have? That is: look at the currently 
advertised parameters, determine what changed, and re-start 
auto-negotiation as a result of it being enabled and something changed?

Could be done as a follow-up patch I suppose, although see below:

[snip]
> index 4f50f11718f4..dfe03afd00b0 100644
> --- a/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c
> +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c
> @@ -306,7 +306,6 @@ static int xgene_set_pauseparam(struct net_device *ndev,
>   {
>   	struct xgene_enet_pdata *pdata = netdev_priv(ndev);
>   	struct phy_device *phydev = ndev->phydev;
> -	u32 oldadv, newadv;
>   
>   	if (phy_interface_mode_is_rgmii(pdata->phy_mode) ||
>   	    pdata->phy_mode == PHY_INTERFACE_MODE_SGMII) {
> @@ -322,29 +321,12 @@ static int xgene_set_pauseparam(struct net_device *ndev,
>   		pdata->tx_pause = pp->tx_pause;
>   		pdata->rx_pause = pp->rx_pause;
>   
> -		oldadv = phydev->advertising;
> -		newadv = oldadv & ~(ADVERTISED_Pause | ADVERTISED_Asym_Pause);
> +		phy_set_asym_pause(phydev, pp->rx_pause,  pp->tx_pause);
>   
> -		if (pp->rx_pause)
> -			newadv |= ADVERTISED_Pause | ADVERTISED_Asym_Pause;
> -
> -		if (pp->tx_pause)
> -			newadv ^= ADVERTISED_Asym_Pause;
> -
> -		if (oldadv ^ newadv) {
> -			phydev->advertising = newadv;
> -
> -			if (phydev->autoneg)
> -				return phy_start_aneg(phydev);
> -

You have remove the part that checks for phydev->autoneg here, was that 
intentional?

> -			if (!pp->autoneg) {
> -				pdata->mac_ops->flowctl_tx(pdata,
> -							   pdata->tx_pause);
> -				pdata->mac_ops->flowctl_rx(pdata,
> -							   pdata->rx_pause);
> -			}
> +		if (!pp->autoneg) {
> +			pdata->mac_ops->flowctl_tx(pdata, pdata->tx_pause);
> +			pdata->mac_ops->flowctl_rx(pdata, pdata->rx_pause);
>   		}


-- 
Florian

  reply	other threads:[~2018-09-03 22:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-02 17:06 [PATCH net-next 00/12] Preparing for phylib limkmodes Andrew Lunn
2018-09-02 17:06 ` [PATCH net-next 01/12] net: phy: ste10Xp: Remove wrong SUPPORTED_Pause Andrew Lunn
2018-09-03 17:53   ` Florian Fainelli
2018-09-04  1:20     ` Andrew Lunn
2018-09-02 17:06 ` [PATCH net-next 02/12] net: phy: et1011c: Remove incorrect missing 1000 Half Andrew Lunn
2018-09-03 17:46   ` Florian Fainelli
2018-09-02 17:06 ` [PATCH net-next 03/12] net: phy: bcm63xx: Allow to be built with COMPILE_TEST Andrew Lunn
2018-09-03 17:28   ` Florian Fainelli
2018-09-02 17:06 ` [PATCH net-next 04/12] net: ethernet: Use phy_set_max_speed() to limit advertised speed Andrew Lunn
2018-09-03 17:31   ` Florian Fainelli
2018-09-02 17:06 ` [PATCH net-next 05/12] net: ethernet: genet: Fix speed selection Andrew Lunn
2018-09-03 17:32   ` Florian Fainelli
2018-09-02 17:06 ` [PATCH net-next 06/12] net: ethernet: Fix up drivers masking pause support Andrew Lunn
2018-09-03 17:33   ` Florian Fainelli
2018-09-02 17:06 ` [PATCH net-next 07/12] net: ethernet: Add helper to remove a supported link mode Andrew Lunn
2018-09-03 17:35   ` Florian Fainelli
2018-09-02 17:06 ` [PATCH net-next 08/12] net: ethernet: Add helper for MACs which support asym pause Andrew Lunn
2018-09-03 17:38   ` Florian Fainelli
2018-09-02 17:06 ` [PATCH net-next 09/12] net: ethernet: Add helper for MACs which support pause Andrew Lunn
2018-09-03 17:39   ` Florian Fainelli
2018-09-03 19:54     ` Andrew Lunn
2018-09-02 17:06 ` [PATCH net-next 10/12] net: ethernet: Add helper for set_pauseparam for Asym Pause Andrew Lunn
2018-09-03 17:49   ` Florian Fainelli [this message]
2018-09-03 19:58     ` Andrew Lunn
2018-09-03 22:30       ` Florian Fainelli
2018-09-02 17:06 ` [PATCH net-next 11/12] net: ethernet: Add helper for set_pauseparam for Pause Andrew Lunn
2018-09-03 17:49   ` Florian Fainelli
2018-09-02 17:06 ` [PATCH net-next 12/12] net: ethernet: Add helper to determine if pause configuration is supported Andrew Lunn
2018-09-03 17:52   ` Florian Fainelli
2018-09-04  2:44 ` [PATCH net-next 00/12] Preparing for phylib limkmodes David Miller

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=d0f68efb-01ff-74d3-f655-269068df5c25@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=maxime.chevallier@bootlin.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).