From: Grant Grundler <iod00d@hp.com>
To: Michael Chan <mchan@broadcom.com>
Cc: Grant Grundler <iod00d@hp.com>,
"David S. Miller" <davem@davemloft.net>,
netdev@oss.sgi.com
Subject: Re: [PATCH] tg3_msi() and weakly ordered memory
Date: Tue, 14 Jun 2005 10:55:41 -0700 [thread overview]
Message-ID: <20050614175541.GD24371@esmail.cup.hp.com> (raw)
In-Reply-To: <B1508D50A0692F42B217C22C02D84972067F0804@NT-IRVA-0741.brcm.ad.broadcom.com>
On Mon, Jun 13, 2005 at 11:46:47PM -0700, Michael Chan wrote:
> rmb() is needed between reading the tag and tg3_has_work()
> to guarantee strict ordering.
Thinking about this more... tg3_has_work() could be reduced to
comparing status tag with last_tag (vs each of the TX/RX indices).
That assumes all the tg3 NICs support status tags...if not, then we
have to keep checking indices.
[ BTW, I noticed spin_lock*(&tp->lock) calls are nested in tg3_poll.
That's a bug, right? I'm still looking at v3.29 ]
The current implementation of tg3_poll() processes TX and then RX.
The status tag we read afterwards and the TX/RX indices checked
could be newer than the TX/RX indices used during processing.
Is tg3 then roughly rate limited to the TX and RX queue depth
per poll interval?
(I'm still thinking during-ints limits how much DMA can occur)
Given TG3_TX_RING_SIZE is 512, then I would max out at ~500Kpps
if there is any RX traffic that causes tg3_has_work() to come
back true. While this might be normally ok, I'm looking to
maximize pktgen output w/o disabling/enabling interrupts
for each "batch" of TX packets.
> > 2) tg3_poll() and tg3_msi() are not consistent on how they clear
> > the SD_STATUS_UPDATED bit. tg3_poll() does not clear SD_STATUS_UPDATED
> > bit after reading status_tag. I think everytime the driver discovers
> > the status_tag changed, it should to clear SD_STATUS_UPDATED.
> > Michael, can you confirm/deny that offhand?
>
> You're right again. The SD_STATUS_UPDATED bit should be cleared right before
> checking for new work. Clearing the SD_STATUS_UPDATED bit tells the non-msi
> irq handler that all work up to the last status block update has been
> processed.
If I understood this correctly, tg3 may already have new work pending
when tg3_has_work() is called from tg3_poll(). tg3_poll() does not tell
the card anything but promises to pick up where it left off the
next time tg3_poll() is called. If we don't tell the card anything,
it means at some point it's going to stop doing DMA....this might be
one of the things preventing tg3 from doing link rate with pktgen
pushing 64byte packets.
...
> It is important to read the actual status block with the latest indices to
> determine whether there is new work, especially in the non-tagged case where
> you may have race condition between software and hardware.
Yes - I think I understand were several of the races can occur.
Probably not seeing all of them though.
thanks again,
grant
next prev parent reply other threads:[~2005-06-14 17:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <B1508D50A0692F42B217C22C02D84972067F0804@NT-IRVA-0741.brcm.ad.broadcom.com>
2005-06-14 15:40 ` [PATCH] tg3_msi() and weakly ordered memory Grant Grundler
[not found] ` <1118767397.7059.19.camel@rh4>
2005-06-14 18:04 ` Grant Grundler
2005-06-14 17:55 ` Grant Grundler [this message]
[not found] <B1508D50A0692F42B217C22C02D84972067F0805@NT-IRVA-0741.brcm.ad.broadcom.com>
2005-06-14 15:46 ` Grant Grundler
[not found] ` <1118771563.7059.30.camel@rh4>
[not found] ` <20050614211530.GB25516@esmail.cup.hp.com>
2005-06-21 23:56 ` David S. Miller
2005-06-22 5:20 ` Grant Grundler
2005-06-14 3:37 Grant Grundler
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=20050614175541.GD24371@esmail.cup.hp.com \
--to=iod00d@hp.com \
--cc=davem@davemloft.net \
--cc=mchan@broadcom.com \
--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).