All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: stefanc@marvell.com
Cc: davem@davemloft.net, andrew@lunn.ch, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, shaulb@marvell.com,
	nadavh@marvell.com, ymarkman@marvell.com, marcin@marvell.com
Subject: Re: [PATCH] net: phylink: Fix flow control resolution
Date: Thu, 5 Sep 2019 17:59:44 +0100	[thread overview]
Message-ID: <20190905165943.GL13294@shell.armlinux.org.uk> (raw)
In-Reply-To: <1567701978-16056-1-git-send-email-stefanc@marvell.com>

On Thu, Sep 05, 2019 at 07:46:18PM +0300, stefanc@marvell.com wrote:
> From: Stefan Chulski <stefanc@marvell.com>
> 
> Regarding to IEEE 802.3-2015 standard section 2
> 28B.3 Priority resolution - Table 28-3 - Pause resolution
> 
> In case of Local device Pause=1 AsymDir=0, Link partner
> Pause=1 AsymDir=1, Local device resolution should be enable PAUSE
> transmit, disable PAUSE receive.
> And in case of Local device Pause=1 AsymDir=1, Link partner
> Pause=1 AsymDir=0, Local device resolution should be enable PAUSE
> receive, disable PAUSE transmit.
> 
> Signed-off-by: Stefan Chulski <stefanc@marvell.com>
> Reported-by: Shaul Ben-Mayor <shaulb@marvell.com>

Good catch, thanks for the patch.

Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Fixes: 9525ae83959b ("phylink: add phylink infrastructure")

> ---
>  drivers/net/phy/phylink.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index a45c5de..a5a57ca 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -376,8 +376,8 @@ static void phylink_get_fixed_state(struct phylink *pl, struct phylink_link_stat
>   *  Local device  Link partner
>   *  Pause AsymDir Pause AsymDir Result
>   *    1     X       1     X     TX+RX
> - *    0     1       1     1     RX
> - *    1     1       0     1     TX
> + *    0     1       1     1     TX
> + *    1     1       0     1     RX
>   */
>  static void phylink_resolve_flow(struct phylink *pl,
>  				 struct phylink_link_state *state)
> @@ -398,7 +398,7 @@ static void phylink_resolve_flow(struct phylink *pl,
>  			new_pause = MLO_PAUSE_TX | MLO_PAUSE_RX;
>  		else if (pause & MLO_PAUSE_ASYM)
>  			new_pause = state->pause & MLO_PAUSE_SYM ?
> -				 MLO_PAUSE_RX : MLO_PAUSE_TX;
> +				 MLO_PAUSE_TX : MLO_PAUSE_RX;
>  	} else {
>  		new_pause = pl->link_config.pause & MLO_PAUSE_TXRX_MASK;
>  	}
> -- 
> 1.9.1
> 
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

  reply	other threads:[~2019-09-05 16:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 16:46 [PATCH] net: phylink: Fix flow control resolution stefanc
2019-09-05 16:59 ` Russell King - ARM Linux admin [this message]
2019-09-07 15:27 ` 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=20190905165943.GL13294@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcin@marvell.com \
    --cc=nadavh@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=shaulb@marvell.com \
    --cc=stefanc@marvell.com \
    --cc=ymarkman@marvell.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.