Skip to content
  • Martin KaFai Lau's avatar
    bpf: Add BPF_OBJ_GET_INFO_BY_FD · 1e270976
    Martin KaFai Lau authored
    
    
    A single BPF_OBJ_GET_INFO_BY_FD cmd is used to obtain the info
    for both bpf_prog and bpf_map.  The kernel can figure out the
    fd is associated with a bpf_prog or bpf_map.
    
    The suggested struct bpf_prog_info and struct bpf_map_info are
    not meant to be a complete list and it is not the goal of this patch.
    New fields can be added in the future patch.
    
    The focus of this patch is to create the interface,
    BPF_OBJ_GET_INFO_BY_FD cmd for exposing the bpf_prog's and
    bpf_map's info.
    
    The obj's info, which will be extended (and get bigger) over time, is
    separated from the bpf_attr to avoid bloating the bpf_attr.
    
    Signed-off-by: default avatarMartin KaFai Lau <kafai@fb.com>
    Acked-by: default avatarAlexei Starovoitov <ast@fb.com>
    Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1e270976