public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches•com>
To: Ivan Vecera <ivecera@redhat•com>
Cc: netdev@vger•kernel.org, Sathya Perla <sathya.perla@emulex•com>,
	Subbu Seetharaman <subbu.seetharaman@emulex•com>,
	Ajit Khaparde <ajit.khaparde@emulex•com>
Subject: Re: [PATCH net-next v2] be2net: log link status
Date: Wed, 22 Apr 2015 07:07:54 -0700	[thread overview]
Message-ID: <1429711674.32612.8.camel@perches.com> (raw)
In-Reply-To: <1429710210-7291-1-git-send-email-ivecera@redhat.com>

On Wed, 2015-04-22 at 15:43 +0200, Ivan Vecera wrote:
> The driver unlike other drivers does not log link state changes.

Why add all the speed stuff, why not add a query instead?

I think it'd be simpler to add a line like:
	status = be_cmd_link_status_query(adapter, &speed, &status, 0);
before emitting speed/link_status

Question for the emulex folk:

Is the dom argument to link_status_query necessary?
It's currently always 0.

and trivially:

> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
[]
> @@ -649,7 +649,8 @@ static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev,
>  	return stats;
>  }
>  
> -void be_link_status_update(struct be_adapter *adapter, u8 link_status)
> +void be_link_status_update(struct be_adapter *adapter, u8 link_status,
> +			   u16 speed)
>  {
>  	struct net_device *netdev = adapter->netdev;
>  
> @@ -658,10 +659,18 @@ void be_link_status_update(struct be_adapter *adapter, u8 link_status)
>  		adapter->flags |= BE_FLAGS_LINK_STATUS_INIT;
>  	}
>  
> -	if (link_status)
> +	if (link_status) {
> +		if (speed)
> +			/* Print speed only when it is known */
> +			netdev_info(netdev, "Link is Up at %d Mbps\n", speed);

signed/unsigned mismatch. %u, speed

  reply	other threads:[~2015-04-22 14:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 13:43 [PATCH net-next v2] be2net: log link status Ivan Vecera
2015-04-22 14:07 ` Joe Perches [this message]
2015-04-22 14:17   ` Ivan Vecera
2015-04-22 22:44   ` David Miller
2015-04-23  6:35   ` Sathya Perla
2015-04-23  6:31 ` Sathya Perla
2015-04-23  6:52   ` Ivan Vecera
2015-04-28 14:32   ` Ivan Vecera
2015-04-28 16:44     ` David Miller
2015-04-28 19:32       ` Ivan Vecera

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=1429711674.32612.8.camel@perches.com \
    --to=joe@perches$(echo .)com \
    --cc=ajit.khaparde@emulex$(echo .)com \
    --cc=ivecera@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=sathya.perla@emulex$(echo .)com \
    --cc=subbu.seetharaman@emulex$(echo .)com \
    /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