netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Chan" <mchan@broadcom.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@oss.sgi.com
Subject: Re: [TG3]: Add tagged status support
Date: Fri, 06 May 2005 15:27:11 -0700	[thread overview]
Message-ID: <1115418431.15156.153.camel@rh4> (raw)
In-Reply-To: <20050505211735.3829cff2.davem@davemloft.net>

On Thu, 2005-05-05 at 21:17 -0700, David S. Miller wrote:
> I've been meaning to do this for a long time.
> 
> This adds tagged status support.  With this, we don't need to
> poke the chip 10 times per second via the timer to keep from
> losing interrupts.
> 
> Michael, I didn't know what needs to be done wrt. MSI here.
> So I didn't touch the MSI code until I understand things better,
> which likely means that this patch breaks MSI (actually, I think
> it will cause the MSI case to generate interrupts endlessly).
> 
> My best hunch is that all MSI supporting chips support tagged
> status, therefore I should just make the tg3_msi() interrupt
> handler do the tp->last_tag stuff.

That's right. All MSI capable chips support tagged mode.

I tested the patch and it worked fine. But I'd like to suggest a few
things:

At the beginning of tg3_poll() before any work is done, update tp-
>last_tag with the current tag from the status block. The reason is that
under heavy traffic, tg3_poll() may be called multiple times before
interrupts are re-enabled. During this time, there may be additional
status block updates with updated tags. If tp->last_tag is not updated,
when we finally re-enable interrupts, we may write an old tag that will
cause the chip to interrupt us again unnecessarily.

In tagged mode, when we call tg3_restart_ints(), it is not necessary to
check for additional work and do "coalesce_now". The chip will do that
for us by looking at the tag written to the mailbox.

I think we can keep the same tg3_poll() for tagged and untagged modes by
using a function pointer that gets assigned different versions of
tg3_restart_ints() depending on the mode. The update of tp->last_tag at
the beginning of tg3_poll() can be done unconditionally provided we add
a check in tg3_enable_ints() to determine whether or not to use the tag.
This should be ok since tg3_enable_ints() is not in the fast path.

  parent reply	other threads:[~2005-05-06 22:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-06  4:17 [TG3]: Add tagged status support David S. Miller
2005-05-06 16:12 ` Arthur Kepner
2005-05-06 22:27 ` Michael Chan [this message]
2005-05-09 19:48   ` David S. Miller
2005-05-09 21:44     ` Michael Chan
2005-05-09 22:54       ` David S. 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=1115418431.15156.153.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).