lkml.org 
[lkml]   [2015]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH v3 18/37] bpf tools: Record map accessing instructions for each program
    On 5/17/15 3:56 AM, Wang Nan wrote:
    > This patch records the indics of instructions which are needed to be
    > relocated. Those information are saved in 'reloc_desc' field in
    > 'struct bpf_program'. In loading phase (this patch takes effect in
    > opening phase), the collected instructions will be replaced by
    > map loading instructions.
    >
    > Since we are going to close the ELF file and clear all data at the end
    > of 'opening' phase, ELF information will no longer be valid in
    > 'loading' phase. We have to locate the instructions before maps are
    > loaded, instead of directly modifying the instruction.
    >
    > 'struct bpf_map_def' is introduce in this patch to let us know how many
    > maps defined in the object.
    >
    > Signed-off-by: Wang Nan <wangnan0@huawei.com>
    ...
    > +/*
    > + * packed attribute is unnecessary for 'bpf_map_def'.
    > + */
    > +struct bpf_map_def {
    > + unsigned int type;
    > + unsigned int key_size;
    > + unsigned int value_size;
    > + unsigned int max_entries;
    > +};

    the comment looks out of place. 'packed' is necessary somewhere else?
    What were you concerned about here?



    \
     
     \ /
      Last update: 2015-05-18 21:21    [W:4.684 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site