netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nithin Nayak Sujir" <nsujir@broadcom.com>
To: "Ben Hutchings" <bhutchings@solarflare.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, mchan@broadcom.com
Subject: Re: [PATCH net-next 04/11] tg3: Add a warning during link settings change if mgmt enabled
Date: Wed, 10 Apr 2013 08:06:53 -0700	[thread overview]
Message-ID: <5165800D.7030608@broadcom.com> (raw)
In-Reply-To: <1365598609.2581.8.camel@bwh-desktop.uk.solarflarecom.com>



On 4/10/2013 5:56 AM, Ben Hutchings wrote:
> On Tue, 2013-04-09 at 11:48 -0700, Nithin Nayak Sujir wrote:
>> When the user executes certain ethtool commands such as -s, -A, -G, -L,
>> -r a phy reset or autonegotiate is performed which results in management
>> traffic being interrupted.
>>
>> Add a warning in these cases.
>
> It seems entirely obvious that PHY reconfiguration will break the link
> and stop all traffic until the link is re-established; this is nothing
> specific to this driver.  Is it more disruptive to management traffic on
> these controllers?  Unless it is, I think this is not a helpful warning.

This goes in conjunction with the Link Flap Avoidance feature introduced 
in this patchset. For the LFA feature the driver skips the normal phy 
resets and speed changes to maintain the link. The expectation now is 
that mgmt traffic is never interrupted even if the interface is brought 
down or the system rebooted/suspended etc.

Except, in these cases where the user forces a phy change we don't 
prevent it. We let the user go ahead with the config change but it does 
flap the link. It's useful to have this event logged to let the user 
know the flap was intentional.

To simplify the conditional, we don't limit it to only LFA enabled 
devices since it doesn't hurt to have it.


>
> Ben.
>
>> Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
>> Signed-off-by: Michael Chan <mchan@broadcom.com>
>> ---
>>   drivers/net/ethernet/broadcom/tg3.c | 14 ++++++++++++++
>>   1 file changed, 14 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
>> index 3f0d43f..a744998 100644
>> --- a/drivers/net/ethernet/broadcom/tg3.c
>> +++ b/drivers/net/ethernet/broadcom/tg3.c
>> @@ -2531,6 +2531,13 @@ static void tg3_carrier_off(struct tg3 *tp)
>>   	tp->link_up = false;
>>   }
>>
>> +static void tg3_warn_mgmt_link_flap(struct tg3 *tp)
>> +{
>> +	if (tg3_flag(tp, ENABLE_ASF))
>> +		netdev_warn(tp->dev,
>> +			    "Management side-band traffic will be interrupted during phy settings change\n");
>> +}
>> +
>>   /* This will reset the tigon3 PHY if there is no valid
>>    * link unless the FORCE argument is non-zero.
>>    */
>> @@ -11565,6 +11572,8 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
>>   		tp->link_config.duplex = cmd->duplex;
>>   	}
>>
>> +	tg3_warn_mgmt_link_flap(tp);
>> +
>>   	if (netif_running(dev))
>>   		tg3_setup_phy(tp, 1);
>>
>> @@ -11643,6 +11652,8 @@ static int tg3_nway_reset(struct net_device *dev)
>>   	if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
>>   		return -EINVAL;
>>
>> +	tg3_warn_mgmt_link_flap(tp);
>> +
>>   	if (tg3_flag(tp, USE_PHYLIB)) {
>>   		if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
>>   			return -EAGAIN;
>> @@ -11755,6 +11766,9 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam
>>   	struct tg3 *tp = netdev_priv(dev);
>>   	int err = 0;
>>
>> +	if (tp->link_config.autoneg == AUTONEG_ENABLE)
>> +		tg3_warn_mgmt_link_flap(tp);
>> +
>>   	if (tg3_flag(tp, USE_PHYLIB)) {
>>   		u32 newadv;
>>   		struct phy_device *phydev;
>

  reply	other threads:[~2013-04-10 17:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 18:48 [PATCH net-next 00/11] tg3: misc patches - minor fixes and enhancements Nithin Nayak Sujir
2013-04-09 18:48 ` [PATCH net-next 01/11] tg3: Fix flow control settings not propagated to hardware Nithin Nayak Sujir
2013-04-09 18:48 ` [PATCH net-next 02/11] tg3: Fix NVRAM size detection for the STM45PE20 pinstrap on 5762 devices Nithin Nayak Sujir
2013-04-09 18:48 ` [PATCH net-next 03/11] tg3: Remove unnecessary phy reset during ethtool commands Nithin Nayak Sujir
2013-04-09 18:48 ` [PATCH net-next 04/11] tg3: Add a warning during link settings change if mgmt enabled Nithin Nayak Sujir
2013-04-10 12:56   ` Ben Hutchings
2013-04-10 15:06     ` Nithin Nayak Sujir [this message]
2013-04-09 18:48 ` [PATCH net-next 05/11] tg3: Add tg3_clear_mac_status() common function Nithin Nayak Sujir
2013-04-09 18:48 ` [PATCH net-next 06/11] tg3: Add SGMII phy support for 5719/5718 serdes Nithin Nayak Sujir
2013-04-09 18:48 ` [PATCH net-next 07/11] tg3: Add support for link flap avoidance Nithin Nayak Sujir
2013-04-09 19:15   ` David Miller
2013-04-09 20:59     ` Nithin Nayak Sujir
2013-04-09 21:07       ` David Miller
2013-04-09 18:48 ` [PATCH net-next 08/11] tg3: Pull the phy advertised speed and flow control settings on driver load Nithin Nayak Sujir
2013-04-09 18:48 ` [PATCH net-next 09/11] tg3: Reset the phy to allow modified EEE settings to take effect Nithin Nayak Sujir
2013-04-09 18:48 ` [PATCH net-next 10/11] tg3: Update version to 3.131 Nithin Nayak Sujir
2013-04-09 18:48 ` [PATCH net-next 11/11] MAINTAINERS: Update tg3 to reflect organizational changes Nithin Nayak Sujir
2013-04-09 20:18 ` [PATCH net-next] tg3: Use bool not int Joe Perches
2013-04-09 21:00   ` Michael Chan
2013-04-09 21:08     ` 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=5165800D.7030608@broadcom.com \
    --to=nsujir@broadcom.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=mchan@broadcom.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).