1. Sep 02, 2018
  2. Sep 01, 2018
  3. Aug 31, 2018
  4. Aug 30, 2018
    • Björn Töpel's avatar
      xsk: include XDP meta data in AF_XDP frames · 18baed26
      Björn Töpel authored
      
      
      Previously, the AF_XDP (XDP_DRV/XDP_SKB copy-mode) ingress logic did
      not include XDP meta data in the data buffers copied out to the user
      application.
      
      In this commit, we check if meta data is available, and if so, it is
      prepended to the frame.
      
      Signed-off-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      18baed26
    • Daniel Borkmann's avatar
      Merge branch 'bpf-bpffs-bpftool-dump-with-btf' · 56b48c6a
      Daniel Borkmann authored
      Yonghong Song says:
      
      ====================
      Commit a26ca7c9 ("bpf: btf: Add pretty print support to the
      basic arraymap") and Commit 699c86d6
      
       ("bpf: btf: add pretty print
      for hash/lru_hash maps") added bpffs pretty print for array, hash and
      lru hash maps. The pretty print gives users a structurally formatted
      dump for keys/values which much easy to understand than raw bytes.
      
      This patch set implemented bpffs pretty print support for
      percpu arraymap, percpu hashmap and percpu lru hashmap.
      For complex key/value types, the pretty print here is even more useful
      due to:
      
        . large volumne of data making it even harder to correlate bytes
          to a particular field in a particular cpu.
        . kernel rounds the value size for each cpu to multiple of 8.
          User has to be aware of this otherwise wrong value may be
          derived from cpu 1/2/...
      
      For example, we may have a bpffs pretty print like below:
         43602: {
              cpu0: {43602,0,-43602,0x3,0xaa52,0x3,{43602|[82,170,0,0,0,0,0,0]},ENUM_TWO}
              cpu1: {43602,0,-43602,0x3,0xaa52,0x3,{43602|[82,170,0,0,0,0,0,0]},ENUM_TWO}
              cpu2: {43602,0,-43602,0x3,0xaa52,0x3,{43602|[82,170,0,0,0,0,0,0]},ENUM_TWO}
              cpu3: {43602,0,-43602,0x3,0xaa52,0x3,{43602|[82,170,0,0,0,0,0,0]},ENUM_TWO}
         }
      for a percpu map.
      
      This patch also added percpu formatted print on bpftool. For example,
      bpftool may print like below:
          {
              "key": 0,
              "values": [{
                      "cpu": 0,
                      "value": {
                          "ui32": 0,
                          "ui16": 0,
                      }
                  },{
                      "cpu": 1,
                      "value": {
                          "ui32": 1,
                          "ui16": 0,
                      }
                  },{
                      "cpu": 2,
                      "value": {
                          "ui32": 2,
                          "ui16": 0,
                      }
                  },{
                      "cpu": 3,
                      "value": {
                          "ui32": 3,
                          "ui16": 0,
                      }
                  }
              ]
          }
      
      Patch #1 implemented bpffs pretty print for percpu arraymap/hash/lru_hash
      in kernel. Patch #2 added the test case in tools bpf selftest test_btf.
      Patch #3 added percpu map btf based dump.
      ====================
      
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      56b48c6a
    • Yonghong Song's avatar
      tools/bpf: bpftool: add btf percpu map formated dump · 1a86ad89
      Yonghong Song authored
      
      
      The btf pretty print is added to percpu arraymap,
      percpu hashmap and percpu lru hashmap.
      For each <key, value> pair, the following will be
      added to plain/json output:
      
         {
             "key": <pretty_print_key>,
             "values": [{
                   "cpu": 0,
                   "value": <pretty_print_value_on_cpu0>
                },{
                   "cpu": 1,
                   "value": <pretty_print_value_on_cpu1>
                },{
                ....
                },{
                   "cpu": n,
                   "value": <pretty_print_value_on_cpun>
                }
             ]
         }
      
      For example, the following could be part of plain or json formatted
      output:
          {
              "key": 0,
              "values": [{
                      "cpu": 0,
                      "value": {
                          "ui32": 0,
                          "ui16": 0,
                      }
                  },{
                      "cpu": 1,
                      "value": {
                          "ui32": 1,
                          "ui16": 0,
                      }
                  },{
                      "cpu": 2,
                      "value": {
                          "ui32": 2,
                          "ui16": 0,
                      }
                  },{
                      "cpu": 3,
                      "value": {
                          "ui32": 3,
                          "ui16": 0,
                      }
                  }
              ]
          }
      
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      1a86ad89