From: olof@lixom.net (Olof Johansson)
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: jgarzik@pobox.com, netdev@vger.kernel.org
Subject: Re: [PATCH] PA Semi PWRficient Ethernet driver
Date: Tue, 30 Jan 2007 22:52:09 -0600 [thread overview]
Message-ID: <20070131045209.GA31095@lixom.net> (raw)
In-Reply-To: <20070130214518.GB3252@electric-eye.fr.zoreil.com>
On Tue, Jan 30, 2007 at 10:45:18PM +0100, Francois Romieu wrote:
> Olof Johansson <olof@lixom.net> :
> > On Mon, Jan 29, 2007 at 11:35:06PM +0100, Francois Romieu wrote:
> [...]
> > > - The driver does not contain a single SMP locking instruction but
> > > http://www.pasemi.com claims the platform to be multicore.
> > > Is the driver really designed to be lockless ?
> >
> > Unless I misunderstood something, NAPI drivers that don't set NETIF_F_LLTX
> > will have all locking taken care of by higher layers, no?
>
> It is not necessarily _that_ simple (it would be cool though :o) ).
>
> For instance, what does prevent pasemi_mac_clean_tx() to be issued
> from IRQ context (pasemi_mac_tx_intr) and from the xmit handler
> (pasemi_mac_start_tx) at the same time ?
You're right. Bummer. I'll add locking on the rings.
> [...]
> > > unsigned int is supposed to save some cycles on ppc.
> >
> > Who told you that? That's not true.
>
> Jon D Mason <jonmason@us.ibm.com> on 25/08/2004 about ppc64 (not ppc, sorry).
Interesting, I hadn't thought about that before.
There's nothing architectural in PPC that makes signed math slower than
unsigned, but in the case of modulo operations (which we do alot on the
rings), unsigned is per definition more complex to do the operations on.
It's pretty much within the noise on the current implementation, but
still an interesting tidbit. Thanks.
> [...]
> > > > +#define DESCR(ring, i) ((ring)->desc[i % ((ring)->count)])
> > > > +#define BUFF(ring, i) ((ring)->buffers[i % ((ring)->count)])
> > > > +#define INFO(ring, i) ((ring)->desc_info[i % ((ring)->count)])
> > >
> > > A bit ugly/obfuscating/name clash prone imvho.
> > >
> > > Use local variables ?
> >
> > I'm open for suggestions here, not sure how local variables will help though?
>
> struct pas_dma_xct_descr *desc = ring->desc[i % ring->count];
That makes sense. Done.
-Olof
next prev parent reply other threads:[~2007-01-31 4:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-29 6:08 [PATCH] PA Semi PWRficient Ethernet driver Olof Johansson
2007-01-29 18:22 ` Stephen Hemminger
2007-01-30 1:41 ` Olof Johansson
2007-01-30 2:34 ` Jeff Garzik
2007-01-30 20:53 ` Olof Johansson
2007-01-29 22:35 ` Francois Romieu
2007-01-30 1:41 ` Olof Johansson
2007-01-30 10:06 ` Christoph Hellwig
2007-01-30 15:34 ` Olof Johansson
2007-01-30 21:45 ` Francois Romieu
2007-01-31 4:52 ` Olof Johansson [this message]
2007-01-30 1:44 ` [PATCH] [v2]PA " Olof Johansson
2007-01-31 5:44 ` [PATCH] [v3] PA " Olof Johansson
2007-01-31 10:34 ` Jeff Garzik
2007-02-01 3:40 ` Olof Johansson
2007-01-31 12:44 ` Ingo Oeser
2007-01-31 15:16 ` Olof Johansson
2007-01-31 18:38 ` Stephen Hemminger
2007-02-01 3:20 ` Olof Johansson
2007-02-01 3:43 ` [PATCH] [v4] " Olof Johansson
2007-02-02 13:26 ` Jeff Garzik
2007-01-30 10:03 ` [PATCH] " Christoph Hellwig
2007-01-30 15:36 ` Olof Johansson
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=20070131045209.GA31095@lixom.net \
--to=olof@lixom.net \
--cc=jgarzik@pobox.com \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.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).