linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* eBPF on powerpc
@ 2020-11-24 15:00 Christophe Leroy
  2020-11-24 16:35 ` Naveen N. Rao
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2020-11-24 15:00 UTC (permalink / raw)
  To: Naveen N. Rao, linuxppc-dev@lists.ozlabs.org

Hi Naveen,

Few years ago, you implemented eBPF on PPC64.

Is there any reason for implementing it for PPC64 only ? Is there something that makes it impossible 
to have eBPF for PPC32 as well ?

Thanks
Christophe

^ permalink raw reply	[flat|nested] 4+ messages in thread

* eBPF on powerpc
  2020-11-24 15:00 eBPF on powerpc Christophe Leroy
@ 2020-11-24 16:35 ` Naveen N. Rao
  2020-11-24 18:45   ` Christophe Leroy
  0 siblings, 1 reply; 4+ messages in thread
From: Naveen N. Rao @ 2020-11-24 16:35 UTC (permalink / raw)
  To: Christophe Leroy, linuxppc-dev@lists.ozlabs.org

Hi Christophe,

Christophe Leroy wrote:
> Hi Naveen,
> 
> Few years ago, you implemented eBPF on PPC64.
> 
> Is there any reason for implementing it for PPC64 only ?

I focused on ppc64 since eBPF is a 64-bit VM and it was more 
straight-forward to target.

> Is there something that makes it impossible to have eBPF for PPC32 as 
> well ?

No, I just wasn't sure if it would be performant enough to warrant it.  
Since then however, there have been arm32 and riscv 32-bit JIT 
implementations and atleast the arm32 JIT seems to be showing ~50% 
better performance compared to the interpreter (*). So, it would be 
worthwhile to add support for ppc32.

Note that there might be a few instructions which would be difficult to 
support on 32-bit, but those can fallback to the interpreter, while 
allowing other programs to be JIT'ed.


- Naveen

(*) 
http://lkml.kernel.org/r/CAGXu5jLYunVCJGCfHPebKDaoQ71hdMGq4HhdDxTYpBQw_HXUYQ@mail.gmail.com
(*) http://lkml.kernel.org/r/b63fae4b-cb74-1928-b210-80914f3c8995@fb.com
(*) http://lkml.kernel.org/r/20200305050207.4159-1-luke.r.nels@gmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: eBPF on powerpc
  2020-11-24 16:35 ` Naveen N. Rao
@ 2020-11-24 18:45   ` Christophe Leroy
  2020-11-24 19:51     ` Naveen N. Rao
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2020-11-24 18:45 UTC (permalink / raw)
  To: Naveen N. Rao, linuxppc-dev@lists.ozlabs.org



Le 24/11/2020 à 17:35, Naveen N. Rao a écrit :
> Hi Christophe,
> 
> Christophe Leroy wrote:
>> Hi Naveen,
>>
>> Few years ago, you implemented eBPF on PPC64.
>>
>> Is there any reason for implementing it for PPC64 only ?
> 
> I focused on ppc64 since eBPF is a 64-bit VM and it was more straight-forward to target.
> 
>> Is there something that makes it impossible to have eBPF for PPC32 as well ?
> 
> No, I just wasn't sure if it would be performant enough to warrant it. Since then however, there 
> have been arm32 and riscv 32-bit JIT implementations and atleast the arm32 JIT seems to be showing 
> ~50% better performance compared to the interpreter (*). So, it would be worthwhile to add support 
> for ppc32.

That's great.

I know close to nothing about eBPF. Is there any interesting documentation on it somewhere that 
would allow me to easily understand how it works and allow me to extend the 64 bit powerpc to 32 bits ?

> 
> Note that there might be a few instructions which would be difficult to support on 32-bit, but those 
> can fallback to the interpreter, while allowing other programs to be JIT'ed.
> 
> 
> - Naveen
> 
> (*) http://lkml.kernel.org/r/CAGXu5jLYunVCJGCfHPebKDaoQ71hdMGq4HhdDxTYpBQw_HXUYQ@mail.gmail.com
> (*) http://lkml.kernel.org/r/b63fae4b-cb74-1928-b210-80914f3c8995@fb.com
> (*) http://lkml.kernel.org/r/20200305050207.4159-1-luke.r.nels@gmail.com

Christophe

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: eBPF on powerpc
  2020-11-24 18:45   ` Christophe Leroy
@ 2020-11-24 19:51     ` Naveen N. Rao
  0 siblings, 0 replies; 4+ messages in thread
From: Naveen N. Rao @ 2020-11-24 19:51 UTC (permalink / raw)
  To: Christophe Leroy, linuxppc-dev@lists.ozlabs.org

Christophe Leroy wrote:
> 
> 
> Le 24/11/2020 à 17:35, Naveen N. Rao a écrit :
>> Hi Christophe,
>> 
>> Christophe Leroy wrote:
>>> Hi Naveen,
>>>
>>> Few years ago, you implemented eBPF on PPC64.
>>>
>>> Is there any reason for implementing it for PPC64 only ?
>> 
>> I focused on ppc64 since eBPF is a 64-bit VM and it was more straight-forward to target.
>> 
>>> Is there something that makes it impossible to have eBPF for PPC32 as well ?
>> 
>> No, I just wasn't sure if it would be performant enough to warrant it. Since then however, there 
>> have been arm32 and riscv 32-bit JIT implementations and atleast the arm32 JIT seems to be showing 
>> ~50% better performance compared to the interpreter (*). So, it would be worthwhile to add support 
>> for ppc32.
> 
> That's great.
> 
> I know close to nothing about eBPF. Is there any interesting documentation on it somewhere that 
> would allow me to easily understand how it works and allow me to extend the 64 bit powerpc to 32 bits ?

I don't think there was ever a formal spec written for the eBPF VM. Here 
are a few resources which should help, alongside the existing JIT 
implementations:
- BPF Kernel Internals:  
  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/filter.rst#n604
- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/bpf
- BPF and XDP Reference Guide: https://docs.cilium.io/en/stable/bpf/


- Naveen


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-24 19:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-24 15:00 eBPF on powerpc Christophe Leroy
2020-11-24 16:35 ` Naveen N. Rao
2020-11-24 18:45   ` Christophe Leroy
2020-11-24 19:51     ` Naveen N. Rao

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).