netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Feldman <scofeldm@cisco.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>
Subject: Re: [net-next PATCH 1/6] enic: Bug fix: use safe queue shutdown in dev->stop
Date: Sat, 19 Dec 2009 12:44:19 -0800	[thread overview]
Message-ID: <C7527B23.1B005%scofeldm@cisco.com> (raw)
In-Reply-To: <1261236899.2418.93.camel@localhost>

On 12/19/09 7:34 AM, "Ben Hutchings" <bhutchings@solarflare.com> wrote:

> On Fri, 2009-12-18 at 18:09 -0800, Scott Feldman wrote:
>> enic: Bug fix: use safe queue shutdown in dev->stop
>> 
>> Fix dev->stop shutdown bug where driver was stopping xmit queue and then
>> disabling intrs.  Fix is to disable intrs first and then stop the xmit
>> queue, otherwise an interrupt could cause the queue to be rewoken.  Also,
>> no need to explicitly do queue servicing because queues are cleaned and
>> reset back to initial state at end of dev->stop.  Servicing queues also
>> had the side-effect of also rewakening the xmit queue, which is not what
>> we want.
> [...]
>> @@ -1409,16 +1382,18 @@ static int enic_stop(struct net_device *netdev)
>> unsigned int i;
>> int err;
>>  
>> + for (i = 0; i < enic->intr_count; i++)
>> +  vnic_intr_mask(&enic->intr[i]);
>> +
> 
> I think you need to use synchronize_irq() after this.

I think you're right.  That's what I want: all intrs masked and no IRQs
running.  I also need to add a PIO read to flush the PIO write to mask.

I want intrs shut down from here on.
 
>> del_timer_sync(&enic->notify_timer);
>>  
>> spin_lock(&enic->devcmd_lock);
>> vnic_dev_disable(enic->vdev);
>> spin_unlock(&enic->devcmd_lock);
>> napi_disable(&enic->napi);
>> - netif_stop_queue(netdev);
>> -
>> - for (i = 0; i < enic->intr_count; i++)
>> -  vnic_intr_mask(&enic->intr[i]);
>> + netif_tx_disable(netdev);
>> + msleep(10);
> 
> This sleep is suspicious.

Ya, that can go.  Netif_tx_disable grabs netif_tx_lock, so we should be
synced with xmit_hard_start.  Forgot to delete that when we had
netif_stop_queue.
 
>> + netif_carrier_off(netdev);
> [...]
> 
> And this should be unnecessary.

We don't have any way to get true link status when the interface is down, so
this forces us to always report link status down when the interface is down.

-scott


  reply	other threads:[~2009-12-19 20:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-19  2:09 [net-next PATCH 0/6] enic: updates to version 1.1.0.241 Scott Feldman
2009-12-19  2:09 ` [net-next PATCH 1/6] enic: Bug fix: use safe queue shutdown in dev->stop Scott Feldman
2009-12-19 15:34   ` Ben Hutchings
2009-12-19 20:44     ` Scott Feldman [this message]
2009-12-19  2:09 ` [net-next PATCH 2/6] enic: Bug fix: try harder to fill Rx ring on skb allocation failures Scott Feldman
2009-12-19 10:41   ` Simon Horman
2009-12-19 20:39     ` Scott Feldman
2009-12-20  1:15       ` Simon Horman
2009-12-20  1:29         ` Scott Feldman
2009-12-20  6:14           ` Simon Horman
2009-12-20  1:51     ` Scott Feldman
2009-12-20  6:54       ` Simon Horman
2009-12-19  2:09 ` [net-next PATCH 3/6] enic: minimize pkt filter updates to firmware Scott Feldman
2009-12-19  2:09 ` [net-next PATCH 4/6] enic: Bug fix: align desc ring sizes to 32 descs Scott Feldman
2009-12-19  2:10 ` [net-next PATCH 5/6] enic: feature add: add ethtool -c/C support Scott Feldman
2009-12-19 10:10   ` Simon Horman
2009-12-19 19:33     ` Scott Feldman
2009-12-20  1:15       ` Simon Horman
2009-12-19  2:10 ` [net-next PATCH 6/6] enic: whitespace cleanup; #define cleanup; more verbose err msg Scott Feldman
  -- strict thread matches above, loose matches on Subject: below --
2009-12-22  2:21 [net-next PATCH 0/6] enic: updates to version 1.1.0.241a Scott Feldman
2009-12-22  2:21 ` [net-next PATCH 1/6] enic: Bug fix: use safe queue shutdown in dev->stop Scott Feldman
2009-12-23 23:27 [net-next PATCH 0/6] enic: updates to version 1.1.0.241a Scott Feldman
2009-12-23 23:27 ` [net-next PATCH 1/6] enic: Bug fix: use safe queue shutdown in dev->stop Scott Feldman

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=C7527B23.1B005%scofeldm@cisco.com \
    --to=scofeldm@cisco.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --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).