lkml.org 
[lkml]   [2015]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v4 17/29] bpf tools: Relocate eBPF programs
On Wed, May 27, 2015 at 05:19:52AM +0000, Wang Nan wrote:
> If an eBPF program access a map, LLVM generates a relocated load
> instruction. To enable the usage of that map, relocation must be done
> by replacing original instructions by map loading instructions.
>
> Based on relocation description collected during 'opening' phase, this
> patch replaces the instructions with map loading with correct map fd.

I think this message is a bit confusing.. How about this?

If an eBPF program accesses a map, LLVM generates a load instruction
with pseudo map fd. Since actual map fd can only be known after it
loads the map at runtime, it records such information in relocation
section(s). So in order to access the map, relocation must be done by
replacing original (pseudo) map fd with correct map fd.

Thanks,
Namhyung


\
 
 \ /
  Last update: 2015-06-01 07:41    [W:0.201 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site