netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Mithlesh Thukral <mithlesh@netxen.com>
Cc: netdev@vger.kernel.org, amitkale@netxen.com,
	netxenproj@linsyssoft.com, rob@netxen.com
Subject: Re: [PATCH 1/4] NetXen: Fix link status messages
Date: Sat, 09 Jun 2007 18:22:30 -0400	[thread overview]
Message-ID: <466B2826.2060007@garzik.org> (raw)
In-Reply-To: <200706071130.l57BUvcO007523@dut39.unminc.com>

Mithlesh Thukral wrote:
> -	if ((netif_running(netdev)) && !netif_carrier_ok(netdev)) {
> -		printk(KERN_INFO "%s port %d, %s carrier is now ok\n",
> -		       netxen_nic_driver_name, adapter->portnum, netdev->name);
> +	if ((netdev->flags & IFF_UP) && !netif_carrier_ok(netdev) &&
> +			netxen_nic_link_ok(adapter) ) {
> +		printk(KERN_INFO "%s %s (port %d), Link is up\n",
> +			       netxen_nic_driver_name, netdev->name, adapter->portnum);
>  		netif_carrier_on(netdev);
> -	}
> -
> -	if (netif_queue_stopped(netdev))
>  		netif_wake_queue(netdev);
> +	} else if(!(netdev->flags & IFF_UP) && netif_carrier_ok(netdev)) {
> +		printk(KERN_ERR "%s %s Link is Down\n",
> +				netxen_nic_driver_name, netdev->name);
> +		netif_carrier_off(netdev);
> +		netif_stop_queue(netdev);


Most of the patch is OK, but by substituting IFF_UP tests for 
netif_running(), you are removing race-free, correct tests and replacing 
them with incorrect, racy tests.

NAK the IFF_UP changes.  the rest looks OK.

	Jeff



  reply	other threads:[~2007-06-09 22:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-07 11:30 [PATCH 1/4] NetXen: Fix link status messages Mithlesh Thukral
2007-06-09 22:22 ` Jeff Garzik [this message]
2007-06-11  6:37   ` Mithlesh Thukral

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=466B2826.2060007@garzik.org \
    --to=jeff@garzik.org \
    --cc=amitkale@netxen.com \
    --cc=mithlesh@netxen.com \
    --cc=netdev@vger.kernel.org \
    --cc=netxenproj@linsyssoft.com \
    --cc=rob@netxen.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 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).