LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	Matt Evans <matt@ozlabs.org>
Subject: Re: [PATCH v2] net: filter: BPF 'JIT' compiler for PPC64
Date: Tue, 19 Jul 2011 11:06:08 +0200	[thread overview]
Message-ID: <1311066368.2375.13.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> (raw)
In-Reply-To: <1311062135.25044.409.camel@pasglop>

Le mardi 19 juillet 2011 à 17:55 +1000, Benjamin Herrenschmidt a écrit :
> On Tue, 2011-07-19 at 08:51 +0200, Eric Dumazet wrote:
> 
> > > +		case BPF_S_ANC_CPU:
> > > +#ifdef CONFIG_SMP
> > > +			/*
> > > +			 * PACA ptr is r13:
> > > +			 * raw_smp_processor_id() = local_paca->paca_index
> > > +			 */
> > 
> > This could break if one day linux supports more than 65536 cpus :)
> > 
> > > +			PPC_LHZ_OFFS(r_A, 13,
> > > +				     offsetof(struct paca_struct, paca_index));
> > > +#else
> > > +			PPC_LI(r_A, 0);
> > > +#endif
> > > +			break;
> 
> As would our implementation of raw_smp_processor_id() and our
> spinlocks :-) I don't think we need to fix that -now- but you are
> welcome to add something like a
> BUILD_BUG_ON(sizeof(local_paca->paca_index) != 2); as a reminder :-)

Please Matt add to your next version this check. I dont think I have to
submit a one line patch later...

On x86_64, cpu_number field is already 32bit, we have some time before
it becomes 64bit ;)

We probably should add some extra check to make sure segment doesnt
change (%gs on x86_64, r13 on ppc64) on a future linux version.

  reply	other threads:[~2011-07-19  9:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-18  7:50 [PATCH] net: filter: BPF 'JIT' compiler for PPC64 Matt Evans
2011-07-18  8:39 ` Eric Dumazet
2011-07-18 19:42   ` David Miller
2011-07-18 20:05     ` Eric Dumazet
2011-07-19  1:21     ` Matt Evans
2011-07-19  2:13 ` [PATCH v2] " Matt Evans
2011-07-19  6:51   ` Eric Dumazet
2011-07-19  7:55     ` Benjamin Herrenschmidt
2011-07-19  9:06       ` Eric Dumazet [this message]
2011-07-19  9:22         ` Benjamin Herrenschmidt
2011-07-19  6:59   ` Kumar Gala
2011-07-19  7:06     ` Matt Evans
2011-07-19  7:17       ` Kumar Gala
2011-07-19  7:23         ` Matt Evans
2011-07-21  1:51   ` [PATCH v3] " Matt Evans
2011-07-21  5:00     ` Eric Dumazet
2011-07-21 19:47     ` David 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=1311066368.2375.13.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC \
    --to=eric.dumazet@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=matt@ozlabs.org \
    --cc=netdev@vger.kernel.org \
    /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