netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tbogendoerfer@suse.de>
To: Michael Chan <michael.chan@broadcom.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] bnxt_en: Don't print "Link speed -1 no longer supported" messages.
Date: Thu, 7 Dec 2017 14:13:40 +0100	[thread overview]
Message-ID: <20171207141340.930bb4f02401d88439d8210a@suse.de> (raw)
In-Reply-To: <1512599482-31273-1-git-send-email-michael.chan@broadcom.com>

On Wed,  6 Dec 2017 17:31:22 -0500
Michael Chan <michael.chan@broadcom.com> wrote:

> On some dual port NICs, the 2 ports have to be configured with compatible
> link speeds.  Under some conditions, a port's configured speed may no
> longer be supported.  The firmware will send a message to the driver
> when this happens.
> 
> Improve this logic that prints out the warning by only printing it if
> we can determine the link speed that is no longer supported.  If the
> speed is unknown or it is in autoneg mode, skip the warning message.
> 
> Reported-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
> Signed-off-by: Michael Chan <michael.chan@broadcom.com>

Tested-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>

> ---
>  drivers/net/ethernet/broadcom/bnxt/bnxt.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> index 24fe676..af6c83f 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> @@ -1706,12 +1706,16 @@ static int bnxt_async_event_process(struct bnxt *bp,
>  
>  		if (BNXT_VF(bp))
>  			goto async_event_process_exit;
> -		if (data1 & 0x20000) {
> +
> +		/* print unsupported speed warning in forced speed mode only */
> +		if (!(link_info->autoneg & BNXT_AUTONEG_SPEED) &&
> +		    (data1 & 0x20000)) {
>  			u16 fw_speed = link_info->force_link_speed;
>  			u32 speed = bnxt_fw_to_ethtool_speed(fw_speed);
>  
> -			netdev_warn(bp->dev, "Link speed %d no longer supported\n",
> -				    speed);
> +			if (speed != SPEED_UNKNOWN)
> +				netdev_warn(bp->dev, "Link speed %d no longer supported\n",
> +					    speed);
>  		}
>  		set_bit(BNXT_LINK_SPEED_CHNG_SP_EVENT, &bp->sp_event);
>  		/* fall thru */
> -- 
> 1.8.3.1
> 


-- 
SUSE Linux GmbH
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

  reply	other threads:[~2017-12-07 13:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-06 22:31 [PATCH net-next] bnxt_en: Don't print "Link speed -1 no longer supported" messages Michael Chan
2017-12-07 13:13 ` Thomas Bogendoerfer [this message]
2017-12-07 18:36 ` 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=20171207141340.930bb4f02401d88439d8210a@suse.de \
    --to=tbogendoerfer@suse.de \
    --cc=davem@davemloft.net \
    --cc=michael.chan@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).