1. 17 8月, 2021 12 次提交
  2. 15 8月, 2021 2 次提交
  3. 14 8月, 2021 4 次提交
  4. 10 8月, 2021 2 次提交
  5. 07 8月, 2021 2 次提交
  6. 06 8月, 2021 2 次提交
  7. 05 8月, 2021 3 次提交
    • C
      selftests/net: toeplitz test · 5ebfb4cc
      Coco Li 提交于
      To verify that this hash implements the Toeplitz hash function.
      
      Additionally, provide a script toeplitz.sh to run the test in loopback mode
      on a networking device of choice (see setup_loopback.sh). Since the
      script modifies the NIC setup, it will not be run by selftests
      automatically.
      
      Tested:
      ./toeplitz.sh -i eth0 -irq_prefix <eth0_pattern> -t -6
      carrier ready
      rxq 0: cpu 14
      rxq 1: cpu 20
      rxq 2: cpu 17
      rxq 3: cpu 23
      cpu 14: rx_hash 0x69103ebc [saddr fda8::2 daddr fda8::1 sport 58938 dport 8000] OK rxq 0 (cpu 14)
      ...
      cpu 20: rx_hash 0x257118b9 [saddr fda8::2 daddr fda8::1 sport 59258 dport 8000] OK rxq 1 (cpu 20)
      count: pass=111 nohash=0 fail=0
      Test Succeeded!
      Signed-off-by: NCoco Li <lixiaoyan@google.com>
      Reviewed-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ebfb4cc
    • C
      selftests/net: GRO coalesce test · 7d157501
      Coco Li 提交于
      Implement a GRO testsuite that expects Linux kernel GRO behavior.
      All tests pass with the kernel software GRO stack. Run against a device
      with hardware GRO to verify that it matches the software stack.
      
      gro.c generates packets and sends them out through a packet socket. The
      receiver in gro.c (run separately) receives the packets on a packet
      socket, filters them by destination ports using BPF and checks the
      packet geometry to see whether GRO was applied.
      
      gro.sh provides a wrapper to run the gro.c in NIC loopback mode.
      It is not included in continuous testing because it modifies network
      configuration around a physical NIC: gro.sh sets the NIC in loopback
      mode, creates macvlan devices on the physical device in separate
      namespaces, and sends traffic generated by gro.c between the two
      namespaces to observe coalescing behavior.
      
      GRO coalescing is time sensitive.
      Some tests may prove flaky on some hardware.
      
      Note that this test suite tests for software GRO unless hardware GRO is
      enabled (ethtool -K $DEV rx-gro-hw on).
      
      To test, run ./gro.sh.
      The wrapper will output success or failed test names, and generate
      log.txt and stderr.
      
      Sample log.txt result:
      ...
      pure data packet of same size: Test succeeded
      
      large data packets followed by a smaller one: Test succeeded
      
      small data packets followed by a larger one: Test succeeded
      ...
      
      Sample stderr result:
      ...
      carrier ready
      running test ipv4 data
      Expected {200 }, Total 1 packets
      Received {200 }, Total 1 packets.
      ...
      Signed-off-by: NCoco Li <lixiaoyan@google.com>
      Reviewed-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7d157501
    • S
      selftests/bpf: Move netcnt test under test_progs · 372642ea
      Stanislav Fomichev 提交于
      Rewrite to skel and ASSERT macros as well while we are at it.
      
      v3:
      - replace -f with -A to make it work with busybox ping.
        -A is available on both busybox and iputils, from the man page:
        On networks with low RTT this mode is essentially equivalent to
        flood mode.
      
      v2:
      - don't check result of bpf_map__fd (Yonghong Song)
      - remove from .gitignore (Andrii Nakryiko)
      - move ping_command into network_helpers (Andrii Nakryiko)
      - remove assert() (Andrii Nakryiko)
      Signed-off-by: NStanislav Fomichev <sdf@google.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Acked-by: NYonghong Song <yhs@fb.com>
      Link: https://lore.kernel.org/bpf/20210804205524.3748709-1-sdf@google.com
      372642ea
  8. 04 8月, 2021 3 次提交
  9. 03 8月, 2021 2 次提交
  10. 02 8月, 2021 1 次提交
  11. 31 7月, 2021 7 次提交
    • Q
      tools: bpftool: Complete metrics list in "bpftool prog profile" doc · 475a23c2
      Quentin Monnet 提交于
      Profiling programs with bpftool was extended some time ago to support
      two new metrics, namely itlb_misses and dtlb_misses (misses for the
      instruction/data translation lookaside buffer). Update the manual page
      and bash completion accordingly.
      
      Fixes: 450d060e ("bpftool: Add {i,d}tlb_misses support for bpftool profile")
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20210730215435.7095-8-quentin@isovalent.com
      475a23c2
    • Q
      tools: bpftool: Document and add bash completion for -L, -B options · 8cc8c635
      Quentin Monnet 提交于
      The -L|--use-loader option for using loader programs when loading, or
      when generating a skeleton, did not have any documentation or bash
      completion. Same thing goes for -B|--base-btf, used to pass a path to a
      base BTF object for split BTF such as BTF for kernel modules.
      
      This patch documents and adds bash completion for those options.
      
      Fixes: 75fa1777 ("tools/bpftool: Add bpftool support for split BTF")
      Fixes: d510296d ("bpftool: Use syscall/loader program in "prog load" and "gen skeleton" command.")
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20210730215435.7095-7-quentin@isovalent.com
      8cc8c635
    • Q
      selftests/bpf: Update bpftool's consistency script for checking options · da87772f
      Quentin Monnet 提交于
      Update the script responsible for checking that the different types used
      at various places in bpftool are synchronised, and extend it to check
      the consistency of options between the help messages in the source code
      and the manual pages.
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20210730215435.7095-6-quentin@isovalent.com
      da87772f
    • Q
      tools: bpftool: Update and synchronise option list in doc and help msg · c07ba629
      Quentin Monnet 提交于
      All bpftool commands support the options for JSON output and debug from
      libbpf. In addition, some commands support additional options
      corresponding to specific use cases.
      
      The list of options described in the man pages for the different
      commands are not always accurate. The messages for interactive help are
      mostly limited to HELP_SPEC_OPTIONS, and are even less representative of
      the actual set of options supported for the commands.
      
      Let's update the lists:
      
      - HELP_SPEC_OPTIONS is modified to contain the "default" options (JSON
        and debug), and to be extensible (no ending curly bracket).
      - All commands use HELP_SPEC_OPTIONS in their help message, and then
        complete the list with their specific options.
      - The lists of options in the man pages are updated.
      - The formatting of the list for bpftool.rst is adjusted to match
        formatting for the other man pages. This is for consistency, and also
        because it will be helpful in a future patch to automatically check
        that the files are synchronised.
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20210730215435.7095-5-quentin@isovalent.com
      c07ba629
    • Q
      tools: bpftool: Complete and synchronise attach or map types · b544342e
      Quentin Monnet 提交于
      Update bpftool's list of attach type names to tell it about the latest
      attach types, or the "ringbuf" map. Also update the documentation, help
      messages, and bash completion when relevant.
      
      These missing items were reported by the newly added Python script used
      to help maintain consistency in bpftool.
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20210730215435.7095-4-quentin@isovalent.com
      b544342e
    • Q
      selftests/bpf: Check consistency between bpftool source, doc, completion · a2b5944f
      Quentin Monnet 提交于
      Whenever the eBPF subsystem gains new elements, such as new program or
      map types, it is necessary to update bpftool if we want it able to
      handle the new items.
      
      In addition to the main arrays containing the names of these elements in
      the source code, there are also multiple locations to update:
      
      - The help message in the do_help() functions in bpftool's source code.
      - The RST documentation files.
      - The bash completion file.
      
      This has led to omissions multiple times in the past. This patch
      attempts to address this issue by adding consistency checks for all
      these different locations. It also verifies that the bpf_prog_type,
      bpf_map_type and bpf_attach_type enums from the UAPI BPF header have all
      their members present in bpftool.
      
      The script requires no argument to run, it reads and parses the
      different files to check, and prints the mismatches, if any. It
      currently reports a number of missing elements, which will be fixed in a
      later patch:
      
        $ ./test_bpftool_synctypes.py
        Comparing [...]/linux/tools/bpf/bpftool/map.c (map_type_name) and [...]/linux/tools/bpf/bpftool/bash-completion/bpftool (BPFTOOL_MAP_CREATE_TYPES): {'ringbuf'}
        Comparing BPF header (enum bpf_attach_type) and [...]/linux/tools/bpf/bpftool/common.c (attach_type_name): {'BPF_TRACE_ITER', 'BPF_XDP_DEVMAP', 'BPF_XDP', 'BPF_SK_REUSEPORT_SELECT', 'BPF_XDP_CPUMAP', 'BPF_SK_REUSEPORT_SELECT_OR_MIGRATE'}
        Comparing [...]/linux/tools/bpf/bpftool/prog.c (attach_type_strings) and [...]/linux/tools/bpf/bpftool/prog.c (do_help() ATTACH_TYPE): {'skb_verdict'}
        Comparing [...]/linux/tools/bpf/bpftool/prog.c (attach_type_strings) and [...]/linux/tools/bpf/bpftool/Documentation/bpftool-prog.rst (ATTACH_TYPE): {'skb_verdict'}
        Comparing [...]/linux/tools/bpf/bpftool/prog.c (attach_type_strings) and [...]/linux/tools/bpf/bpftool/bash-completion/bpftool (BPFTOOL_PROG_ATTACH_TYPES): {'skb_verdict'}
      
      Note that the script does NOT check for consistency between the list of
      program types that bpftool claims it accepts and the actual list of
      keywords that can be used. This is because bpftool does not "see" them,
      they are ELF section names parsed by libbpf. It is not hard to parse the
      section_defs[] array in libbpf, but some section names are associated
      with program types that bpftool cannot load at the moment. For example,
      some programs require a BTF target and an attach target that bpftool
      cannot handle. The script may be extended to parse the array and check
      only relevant values in the future.
      
      The script is not added to the selftests' Makefile, because doing so
      would require all patches with BPF UAPI change to also update bpftool.
      Instead it is to be added to the CI.
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20210730215435.7095-3-quentin@isovalent.com
      a2b5944f
    • Q
      tools: bpftool: Slightly ease bash completion updates · 510b4d4c
      Quentin Monnet 提交于
      Bash completion for bpftool gets two minor improvements in this patch.
      
      Move the detection of attach types for "bpftool cgroup attach" outside
      of the "case/esac" bloc, where we cannot reuse our variable holding the
      list of supported attach types as a pattern list. After the change, we
      have only one list of cgroup attach types to update when new types are
      added, instead of the former two lists.
      
      Also rename the variables holding lists of names for program types, map
      types, and attach types, to make them more unique. This can make it
      slightly easier to point people to the relevant variables to update, but
      the main objective here is to help run a script to check that bash
      completion is up-to-date with bpftool's source code.
      Signed-off-by: NQuentin Monnet <quentin@isovalent.com>
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/bpf/20210730215435.7095-2-quentin@isovalent.com
      510b4d4c