Skip to content
Snippets Groups Projects
  1. Aug 10, 2018
  2. Aug 09, 2018
  3. Aug 07, 2018
  4. Aug 06, 2018
  5. Aug 03, 2018
  6. Aug 02, 2018
  7. Aug 01, 2018
  8. Jul 31, 2018
  9. Jul 30, 2018
    • Yonghong Song's avatar
      tools/bpftool: fix a percpu_array map dump problem · 573b3aa6
      Yonghong Song authored
      
      I hit the following problem when I tried to use bpftool
      to dump a percpu array.
      
        $ sudo ./bpftool map show
        61: percpu_array  name stub  flags 0x0
                key 4B  value 4B  max_entries 1  memlock 4096B
        ...
        $ sudo ./bpftool map dump id 61
        bpftool: malloc.c:2406: sysmalloc: Assertion
        `(old_top == initial_top (av) && old_size == 0) || \
         ((unsigned long) (old_size) >= MINSIZE && \
         prev_inuse (old_top) && \
         ((unsigned long) old_end & (pagesize - 1)) == 0)'
        failed.
        Aborted
      
      Further debugging revealed that this is due to
      miscommunication between bpftool and kernel.
      For example, for the above percpu_array with value size of 4B.
      The map info returned to user space has value size of 4B.
      
      In bpftool, the values array for lookup is allocated like:
         info->value_size * get_possible_cpus() = 4 * get_possible_cpus()
      In kernel (kernel/bpf/syscall.c), the values array size is
      rounded up to multiple of 8.
         round_up(map->value_size, 8) * num_possible_cpus()
         = 8 * num_possible_cpus()
      So when kernel copies the values to user buffer, the kernel will
      overwrite beyond user buffer boundary.
      
      This patch fixed the issue by allocating and stepping through
      percpu map value array properly in bpftool.
      
      Fixes: 71bb428f ("tools: bpf: add bpftool")
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      573b3aa6
    • Petr Machata's avatar
      selftests: forwarding: Test mirror-to-gretap w/ UL team LACP · 541c6ce3
      Petr Machata authored
      
      This tests mirror-to-gretap when an underlay packet path includes a team
      device which is not in loadbalance mode, but in LACP mode. The test
      manipulates LAG membership to achieve changes in txability, thus making
      sure that a driver that offloads mirror-to-gretap doesn't just consider
      upness of a device.
      
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      541c6ce3
    • Petr Machata's avatar
      selftests: forwarding: Test mirror-to-gretap w/ UL team · a9b33b20
      Petr Machata authored
      
      Test for "tc action mirred egress mirror" that mirrors to gretap when
      the underlay route points at a VLAN-aware bridge (802.1q), and the
      traffic egresses the bridge through a team device. Test upping and
      downing individual team device slaves and verify the traffic flows as
      expected.
      
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a9b33b20
    • Petr Machata's avatar
      selftests: forwarding: Introduce $ARPING · ca70a562
      Petr Machata authored
      
      Instead of relying on "arping" being installed everywhere under that
      name, introduce a variable $ARPING like the other tools do.
      
      Convert an existing test, mirror_gre_vlan_bridge_1q.sh to
      require_command $ARPING and then invoke arping through the variable.
      
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca70a562
    • Petr Machata's avatar
      selftests: forwarding: lib: Support team devices · 9d9e6bde
      Petr Machata authored
      
      Add team_create() and team_destroy() to manage team netdevices.
      
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9d9e6bde
    • Petr Machata's avatar
      selftests: forwarding: lib: Add require_command() · e094574f
      Petr Machata authored
      
      The logic for testing whether a certain command is available is used
      several times in the current code base. The tests in follow-up patches
      add more requirements like that.
      
      Therefore extract the logic into a named function, require_command(),
      that can be used directly from lib.sh as well as from any test that
      wishes to declare dependence on some command.
      
      Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e094574f
    • Arnaldo Carvalho de Melo's avatar
      perf tools: Fix the build on the alpine:edge distro · 44fe619b
      Arnaldo Carvalho de Melo authored
      The UAPI file byteorder/little_endian.h uses the __always_inline define
      without including the header where it is defined, linux/stddef.h, this
      ends up working in all the other distros because that file gets included
      seemingly by luck from one of the files included from little_endian.h.
      
      But not on Alpine:edge, that fails for all files where perf_event.h is
      included but linux/stddef.h isn't include before that.
      
      Adding the missing linux/stddef.h file where it breaks on Alpine:edge to
      fix that, in all other distros, that is just a very small header anyway.
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-9r1pifftxvuxms8l7ir73p5l@git.kernel.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      44fe619b
    • Arnaldo Carvalho de Melo's avatar
      tools arch: Update arch/x86/lib/memcpy_64.S copy used in 'perf bench mem memcpy' · 1f27a050
      Arnaldo Carvalho de Melo authored
      To cope with the changes in:
      
        12c89130 ("x86/asm/memcpy_mcsafe: Add write-protection-fault handling")
        60622d68 ("x86/asm/memcpy_mcsafe: Return bytes remaining")
        bd131544 ("x86/asm/memcpy_mcsafe: Add labels for __memcpy_mcsafe() write fault handling")
        da7bc9c5 ("x86/asm/memcpy_mcsafe: Remove loop unrolling")
      
      This needed introducing a file with a copy of the mcsafe_handle_tail()
      function, that is used in the new memcpy_64.S file, as well as a dummy
      mcsafe_test.h header.
      
      Testing it:
      
        $ nm ~/bin/perf | grep mcsafe
        0000000000484130 T mcsafe_handle_tail
        0000000000484300 T __memcpy_mcsafe
        $
        $ perf bench mem memcpy
        # Running 'mem/memcpy' benchmark:
        # function 'default' (Default memcpy() provided by glibc)
        # Copying 1MB bytes ...
      
            44.389205 GB/sec
        # function 'x86-64-unrolled' (unrolled memcpy() in arch/x86/lib/memcpy_64.S)
        # Copying 1MB bytes ...
      
            22.710756 GB/sec
        # function 'x86-64-movsq' (movsq-based memcpy() in arch/x86/lib/memcpy_64.S)
        # Copying 1MB bytes ...
      
            42.459239 GB/sec
        # function 'x86-64-movsb' (movsb-based memcpy() in arch/x86/lib/memcpy_64.S)
        # Copying 1MB bytes ...
      
            42.459239 GB/sec
        $
      
      This silences this perf tools build warning:
      
        Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Mika Penttilä <mika.penttila@nextfour.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-igdpciheradk3gb3qqal52d0@git.kernel.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1f27a050
    • Arnaldo Carvalho de Melo's avatar
      tools headers uapi: Refresh linux/bpf.h copy · fc73bfd6
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
        4c79579b ("bpf: Change bpf_fib_lookup to return lookup status")
      
      That do not entail changes in tools/perf/ use of it, elliminating the
      following perf build warning:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-yei494y6b3mn6bjzz9g0ws12@git.kernel.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      fc73bfd6
    • Arnaldo Carvalho de Melo's avatar
      tools headers powerpc: Update asm/unistd.h copy to pick new · 7def16d1
      Arnaldo Carvalho de Melo authored
      The new 'io_pgetevents' syscall was wired up in PowerPC in the following
      cset:
      
        b2f82565 ("powerpc: Wire up io_pgetevents")
      
      Update tools/arch/powerpc/ copy of the asm/unistd.h file so that 'perf
      trace' on PowerPC gets it in its syscall table.
      
      This elliminated the following perf build warning:
      
        Warning: Kernel ABI header at 'tools/arch/powerpc/include/uapi/asm/unistd.h' differs from latest version at 'arch/powerpc/include/uapi/asm/unistd.h'
      
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Breno Leitao <leitao@debian.org>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
      Link: https://lkml.kernel.org/n/tip-9uvu7tz4ud3bxxfyxwryuz47@git.kernel.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      7def16d1
    • Arnaldo Carvalho de Melo's avatar
      tools headers uapi: Update tools's copy of linux/perf_event.h · 2c3ee0e1
      Arnaldo Carvalho de Melo authored
      To get the changes in:
      
        6cbc304f ("perf/x86/intel: Fix unwind errors from PEBS entries (mk-II)")
      
      That do not imply any changes in the tooling side, the (ab)use of
      sample_type is entirely done in kernel space, nothing for userspace to
      witness here.
      
      This cures the following warning during perf's build:
      
        Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h'
      
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: Wang Nan <wangnan0@huawei.com>
      Link: https://lkml.kernel.org/n/tip-o64mjoy35s9gd1gitunw1zg4@git.kernel.org
      
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      2c3ee0e1
  10. Jul 29, 2018
  11. Jul 28, 2018
    • Thomas Richter's avatar
      perf build: Build error in libbpf missing initialization · b611da43
      Thomas Richter authored
      
      In linux-next tree compiling the perf tool with additional make flags
      EXTRA_CFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -O2" causes a compiler error.
      It is the warning 'variable may be used uninitialized' which is treated
      as error: I compile it using a FEDORA 28 installation, my gcc compiler
      version: gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20). The file that
      causes the error is tools/lib/bpf/libbpf.c.
      
        [root@p23lp27] # make V=1 EXTRA_CFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -O2"
        [...]
        Makefile.config:849: No openjdk development package found, please
           install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel
        Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h'
                differs from latest version at 'include/uapi/linux/if_link.h'
          CC       libbpf.o
        libbpf.c: In function ‘bpf_perf_event_read_simple’:
        libbpf.c:2342:6: error: ‘ret’ may be used uninitialized in this
        			function [-Werror=maybe-uninitialized]
          int ret;
              ^
        cc1: all warnings being treated as errors
        mv: cannot stat './.libbpf.o.tmp': No such file or directory
        /home6/tmricht/linux-next/tools/build/Makefile.build:96: recipe for target 'libbpf.o' failed
      
      Suggested-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      b611da43
  12. Jul 27, 2018
Loading