1. 16 12月, 2019 2 次提交
  2. 05 12月, 2019 1 次提交
    • J
      samples/bpf: Fix broken xdp_rxq_info due to map order assumptions · edbca120
      Jesper Dangaard Brouer 提交于
      In the days of using bpf_load.c the order in which the 'maps' sections
      were defines in BPF side (*_kern.c) file, were used by userspace side
      to identify the map via using the map order as an index. In effect the
      order-index is created based on the order the maps sections are stored
      in the ELF-object file, by the LLVM compiler.
      
      This have also carried over in libbpf via API bpf_map__next(NULL, obj)
      to extract maps in the order libbpf parsed the ELF-object file.
      
      When BTF based maps were introduced a new section type ".maps" were
      created. I found that the LLVM compiler doesn't create the ".maps"
      sections in the order they are defined in the C-file. The order in the
      ELF file is based on the order the map pointer is referenced in the code.
      
      This combination of changes lead to xdp_rxq_info mixing up the map
      file-descriptors in userspace, resulting in very broken behaviour, but
      without warning the user.
      
      This patch fix issue by instead using bpf_object__find_map_by_name()
      to find maps via their names. (Note, this is the ELF name, which can
      be longer than the name the kernel retains).
      
      Fixes: be5bca44 ("samples: bpf: convert some XDP samples from bpf_load to libbpf")
      Fixes: 451d1dc8 ("samples: bpf: update map definition to new syntax BTF-defined map")
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NToke Høiland-Jørgensen <toke@redhat.com>
      Acked-by: NAndrii Nakryiko <andriin@fb.com>
      Link: https://lore.kernel.org/bpf/157529025128.29832.5953245340679936909.stgit@firesoul
      edbca120
  3. 16 11月, 2019 2 次提交
  4. 12 11月, 2019 1 次提交
  5. 11 11月, 2019 2 次提交
  6. 09 11月, 2019 2 次提交
  7. 03 11月, 2019 1 次提交
  8. 01 11月, 2019 1 次提交
  9. 13 10月, 2019 13 次提交
  10. 09 10月, 2019 3 次提交
  11. 08 10月, 2019 2 次提交
  12. 07 10月, 2019 1 次提交
  13. 03 10月, 2019 2 次提交
  14. 16 9月, 2019 1 次提交
  15. 31 8月, 2019 3 次提交
  16. 21 8月, 2019 1 次提交
  17. 18 8月, 2019 1 次提交
  18. 10 8月, 2019 1 次提交