public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn•ch>
To: Timur Tabi <timur@codeaurora•org>
Cc: "David S. Miller" <davem@davemloft•net>, netdev@vger•kernel.org
Subject: Re: [PATCH 1/2] [for 4.13] net: qcom/emac: disable flow control autonegotiation by default
Date: Wed, 2 Aug 2017 01:15:54 +0200	[thread overview]
Message-ID: <20170801231554.GA8415@lunn.ch> (raw)
In-Reply-To: <1501623460-3575-2-git-send-email-timur@codeaurora.org>

On Tue, Aug 01, 2017 at 04:37:39PM -0500, Timur Tabi wrote:
> The EMAC has a curious qwirk when RX flow control is enabled and the
> kernel hangs.  With the kernel hung, the EMAC's RX queue soon fills.
> If RX flow control is enabled, the EMAC will then send a non-stop
> stream of pause frames until the system is reset.  The EMAC does not
> have a built-in watchdog.
> 
> In various tests, the pause frame stream sometimes overloads nearby
> switches, effectively disabling the network.  Since the RX queue is
> large and the host processor is more than capable of handling incoming
> packets quickly, the only time the EMAC will send any pause frames is
> when the kernel is hung and unrecoverable.
> 
> To avoid all these problems, we disable flow control autonegotiation
> by default, and only enable receiving pause frames.
> 
> Cc: stable@vger•kernel.org # 4.11.x
> Signed-off-by: Timur Tabi <timur@codeaurora•org>
> ---
>  drivers/net/ethernet/qualcomm/emac/emac.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c
> index 60850bfa3d32..475c0ea29235 100644
> --- a/drivers/net/ethernet/qualcomm/emac/emac.c
> +++ b/drivers/net/ethernet/qualcomm/emac/emac.c
> @@ -441,8 +441,13 @@ static void emac_init_adapter(struct emac_adapter *adpt)
>  	/* others */
>  	adpt->preamble = EMAC_PREAMBLE_DEF;
>  
> -	/* default to automatic flow control */
> -	adpt->automatic = true;
> +	/* Disable transmission of pause frames by default, to avoid the
> +	 * risk of a pause frame flood that can occur if the kernel hangs.
> +	 * We still want to be able to respond to them, however.
> +	 */
> +	adpt->automatic = false;
> +	adpt->tx_flow_control = false;
> +	adpt->rx_flow_control = true;

Hi Timur

Pause frames are something you can auto-negotiate at the PHY
level. Should you also be clearing some bits in the phydev, so the
peer knows pause frames are not supported?

     Andrew

  parent reply	other threads:[~2017-08-01 23:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-01 21:37 [PATCH 0/2] net: qcom/emac: fixes for pause frame floods Timur Tabi
2017-08-01 21:37 ` [PATCH 1/2] [for 4.13] net: qcom/emac: disable flow control autonegotiation by default Timur Tabi
2017-08-01 21:55   ` Florian Fainelli
2017-08-01 22:02     ` Timur Tabi
2017-08-01 22:08       ` Florian Fainelli
2017-08-01 23:15   ` Andrew Lunn [this message]
2017-08-02  0:56     ` Timur Tabi
2017-08-02  2:58       ` Andrew Lunn
2017-08-02  3:22         ` Timur Tabi
2017-08-02 13:48   ` David Laight
2017-08-02 14:21     ` Timur Tabi
2017-08-02 14:51       ` David Laight
2017-08-02 15:08         ` Timur Tabi
2017-08-02 15:38           ` David Laight
2017-08-02 17:54   ` David Miller
2017-08-02 18:23     ` Timur Tabi
2017-08-02 18:35       ` David Miller
2017-08-02 18:39         ` Timur Tabi
2017-08-02 23:15           ` David Miller
2017-08-03  1:00             ` Timur Tabi
2017-08-02 18:36       ` David Miller
2017-08-01 21:37 ` [PATCH 2/2] net: qcom/emac: add software control for pause frame mode Timur Tabi
2017-08-01 21:51   ` Florian Fainelli
2017-08-01 22:00     ` Timur Tabi
2017-08-01 22:06       ` Florian Fainelli
2017-09-12 22:07   ` Timur Tabi

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=20170801231554.GA8415@lunn.ch \
    --to=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=timur@codeaurora$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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