From: "Michael Chan" <mchan@broadcom.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@oss.sgi.com
Subject: Re: Locking model for NAPI drivers
Date: Thu, 02 Jun 2005 12:56:52 -0700 [thread overview]
Message-ID: <1117742212.22670.24.camel@rh4> (raw)
In-Reply-To: <1117661650.4310.62.camel@rh4>
On Wed, 2005-06-01 at 14:34 -0700, Michael Chan wrote:
> On Wed, 2005-06-01 at 15:21 -0700, David S. Miller wrote:
> > Since the caller shuts down NAPI ->poll(), after setting the SYNC bit
> > we can just check the MAILBOX register, and if a '1' is there just
> > return. Does one need to mask out the upper bits of the regiser in
> > order to avoid seeing the IRQ tag in such a comparison?
> >
> No, just check for the value 1 since that's the value we use to disable
> interrupts. The value read back will always be 1 if 1 was previously
> written to it.
>
One more race condition:
CPU1 CPU2
tg3_poll()
__netif_rx_complete()
tg3_netif_stop()
netif_poll_disable()
tg3_full_lock()
tg3_irq_quiesce()
tg3_restart_ints()
BUG_ON(tp->irq_state)
This race condition is somewhat harmless but I think we need to take
care of it for correctness. Any simple ways to fix it?
prev parent reply other threads:[~2005-06-02 19:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-31 22:48 Locking model for NAPI drivers David S. Miller
2005-06-01 6:28 ` Andi Kleen
2005-06-01 8:42 ` Herbert Xu
2005-06-01 8:16 ` Greg Banks
2005-06-01 20:33 ` Michael Chan
2005-06-01 22:21 ` David S. Miller
2005-06-01 21:34 ` Michael Chan
2005-06-02 19:56 ` Michael Chan [this message]
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=1117742212.22670.24.camel@rh4 \
--to=mchan@broadcom.com \
--cc=davem@davemloft.net \
--cc=netdev@oss.sgi.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).