9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <forsyth@terzarima.net>
To: 9fans@9fans.net
Subject: Re: [9fans] dumb kw question
Date: Thu, 30 Dec 2010 01:05:17 +0000	[thread overview]
Message-ID: <a11646816f0e8bd28b7eb0226da61203@terzarima.net> (raw)
In-Reply-To: <b2eb68a71e4102fa136b0d091f3b19c0@hamnavoe.com>

>ether1116.c:573: 		cachedwbse(&r->cs, BY2SE);

led me to read:

		/* set up receive descriptor */
		r = &ctlr->rx[ctlr->rxtail];
		assert(((uintptr)r & (Descralign - 1)) == 0);
		r->countsize = Bufsize(Rxblklen);
		r->buf = PADDR(b->rp);
		cachedwbse(r, sizeof *r);
		l2cacheuwbse(r, sizeof *r);

		/* and fire */
		r->cs = RCSdmaown | RCSenableintr;
		cachedwbse(&r->cs, BY2SE);
		l2cacheuwbse(&r->cs, BY2SE);

if Descralign is 16, and sizeof(Rx) is 16, but the cache line size is 32,
i'm surprised it works. there are two descriptors per cache line,
and two processors, but only one sees both caches. the other processor -
the ethernet controller - depending how it's wired up,
sees at best L2 but more usually uncached RAM. i don't see how this cache
flushing (and invalidation elsewhere) can give a coherent view of both descriptors.

i'd expect to see peculiar errors, such as non-trivial levels of retransmission
(both sides) causing poor performance.



  parent reply	other threads:[~2010-12-30  1:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-27  2:52 erik quanstrom
2010-12-27  9:06 ` Richard Miller
2010-12-27 14:00   ` erik quanstrom
2010-12-28 10:41     ` Gorka Guardiola
2010-12-28 10:42       ` Gorka Guardiola
2010-12-28 13:59         ` erik quanstrom
2010-12-30  1:05   ` Charles Forsyth [this message]
2010-12-30  1:24     ` erik quanstrom

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=a11646816f0e8bd28b7eb0226da61203@terzarima.net \
    --to=forsyth@terzarima.net \
    --cc=9fans@9fans.net \
    /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).