16 Jan, 2019

1 commit

  • x86 compilation has required asm goto support since 4.17.
    Since clang does not support asm goto, at 4.17,
    Commit b1ae32dbab50 ("x86/cpufeature: Guard asm_volatile_goto usage
    for BPF compilation") worked around the issue by permitting an
    alternative implementation without asm goto for clang.

    At 5.0, more asm goto usages appeared.
    [yhs@148 x86]$ egrep -r asm_volatile_goto
    include/asm/cpufeature.h: asm_volatile_goto("1: jmp 6f\n"
    include/asm/jump_label.h: asm_volatile_goto("1:"
    include/asm/jump_label.h: asm_volatile_goto("1:"
    include/asm/rmwcc.h: asm_volatile_goto (fullop "; j" #cc " %l[cc_label]" \
    include/asm/uaccess.h: asm_volatile_goto("\n" \
    include/asm/uaccess.h: asm_volatile_goto("\n" \
    [yhs@148 x86]$

    Compiling samples/bpf directories, most bpf programs failed
    compilation with error messages like:
    In file included from /home/yhs/work/bpf-next/samples/bpf/xdp_sample_pkts_kern.c:2:
    In file included from /home/yhs/work/bpf-next/include/linux/ptrace.h:6:
    In file included from /home/yhs/work/bpf-next/include/linux/sched.h:15:
    In file included from /home/yhs/work/bpf-next/include/linux/sem.h:5:
    In file included from /home/yhs/work/bpf-next/include/uapi/linux/sem.h:5:
    In file included from /home/yhs/work/bpf-next/include/linux/ipc.h:9:
    In file included from /home/yhs/work/bpf-next/include/linux/refcount.h:72:
    /home/yhs/work/bpf-next/arch/x86/include/asm/refcount.h:70:9: error: 'asm goto' constructs are not supported yet
    return GEN_BINARY_SUFFIXED_RMWcc(LOCK_PREFIX "subl",
    ^
    /home/yhs/work/bpf-next/arch/x86/include/asm/rmwcc.h:67:2: note: expanded from macro 'GEN_BINARY_SUFFIXED_RMWcc'
    __GEN_RMWcc(op " %[val], %[var]\n\t" suffix, var, cc, \
    ^
    /home/yhs/work/bpf-next/arch/x86/include/asm/rmwcc.h:21:2: note: expanded from macro '__GEN_RMWcc'
    asm_volatile_goto (fullop "; j" #cc " %l[cc_label]" \
    ^
    /home/yhs/work/bpf-next/include/linux/compiler_types.h:188:37: note: expanded from macro 'asm_volatile_goto'
    #define asm_volatile_goto(x...) asm goto(x)

    Most implementation does not even provide an alternative
    implementation. And it is also not practical to make changes
    for each call site.

    This patch workarounded the asm goto issue by redefining the macro like below:
    #define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto")

    If asm_volatile_goto is not used by bpf programs, which is typically the case, nothing bad
    will happen. If asm_volatile_goto is used by bpf programs, which is incorrect, the compiler
    will issue an error since "invalid use of asm_volatile_goto" is not valid assembly codes.

    With this patch, all bpf programs under samples/bpf can pass compilation.

    Note that bpf programs under tools/testing/selftests/bpf/ compiled fine as
    they do not access kernel internal headers.

    Fixes: e769742d3584 ("Revert "x86/jump-labels: Macrofy inline assembly code to work around GCC inlining bugs"")
    Fixes: 18fe58229d80 ("x86, asm: change the GEN_*_RMWcc() macros to not quote the condition")
    Acked-by: Alexei Starovoitov
    Signed-off-by: Yonghong Song
    Signed-off-by: Daniel Borkmann

    Yonghong Song
     

10 Jan, 2019

1 commit

  • Use optind as index for argv instead of a hardcoded value.
    When the program has options this leads to improper parameter handling.

    Fixes: dc378a1ab5b6 ("samples: bpf: get ifindex from ifname")
    Signed-off-by: Ioana Ciornei
    Acked-by: Matteo Croce
    Signed-off-by: Daniel Borkmann

    Ioana Ciornei
     

08 Jan, 2019

1 commit

  • We have some tests that assume create_and_get_cgroup returns -1 on error
    which is incorrect (it returns 0 on error). Since fd might be zero in
    general case, change create_and_get_cgroup to return -1 on error
    and fix the users that assume 0 on error.

    Fixes: f269099a7e7a ("tools/bpf: add a selftest for bpf_get_current_cgroup_id() helper")
    Fixes: 7d2c6cfc5411 ("bpf: use --cgroup in test_suite if supplied")

    v2:
    - instead of fixing the uses that assume -1 on error, convert the users
    that assume 0 on error (fd might be zero in general case)

    Signed-off-by: Stanislav Fomichev
    Signed-off-by: Alexei Starovoitov

    Stanislav Fomichev
     

30 Dec, 2018

1 commit

  • Pull Kbuild updates from Masahiro Yamada:
    "Kbuild core:
    - remove unneeded $(call cc-option,...) switches
    - consolidate Clang compiler flags into CLANG_FLAGS
    - announce the deprecation of SUBDIRS
    - fix single target build for external module
    - simplify the dependencies of 'prepare' stage targets
    - allow fixdep to directly write to .*.cmd files
    - simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS
    - change if_changed_rule to accept multi-line recipe
    - move .SECONDARY special target to scripts/Kbuild.include
    - remove redundant 'set -e'
    - improve parallel execution for CONFIG_HEADERS_CHECK
    - misc cleanups

    Treewide fixes and cleanups
    - set Clang flags correctly for PowerPC boot images
    - fix UML build error with CONFIG_GCC_PLUGINS
    - remove unneeded patterns from .gitignore files
    - refactor firmware/Makefile
    - remove unneeded rules for *offsets.s
    - avoid unneeded regeneration of intermediate .s files
    - clean up ./Kbuild

    Modpost:
    - remove unused -M, -K options
    - fix false positive warnings about section mismatch
    - use simple devtable lookup instead of linker magic
    - misc cleanups

    Coccinelle:
    - relax boolinit.cocci checks for overall consistency
    - fix warning messages of boolinit.cocci

    Other tools:
    - improve -dirty check of scripts/setlocalversion
    - add a tool to generate compile_commands.json from .*.cmd files"

    * tag 'kbuild-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (51 commits)
    kbuild: remove unused cmd_gentimeconst
    kbuild: remove $(obj)/ prefixes in ./Kbuild
    treewide: add intermediate .s files to targets
    treewide: remove explicit rules for *offsets.s
    firmware: refactor firmware/Makefile
    firmware: remove unnecessary patterns from .gitignore
    scripts: remove unnecessary ihex2fw and check-lc_ctypes from .gitignore
    um: remove unused filechk_gen_header in Makefile
    scripts: add a tool to produce a compile_commands.json file
    kbuild: add -Werror=implicit-int flag unconditionally
    kbuild: add -Werror=strict-prototypes flag unconditionally
    kbuild: add -fno-PIE flag unconditionally
    scripts: coccinelle: Correct warning message
    scripts: coccinelle: only suggest true/false in files that already use them
    kbuild: handle part-of-module correctly for *.ll and *.symtypes
    kbuild: refactor part-of-module
    kbuild: refactor quiet_modtag
    kbuild: remove redundant quiet_modtag for $(obj-m)
    kbuild: refactor Makefile.asm-generic
    user/Makefile: Fix typo and capitalization in comment section
    ...

    Linus Torvalds
     

23 Dec, 2018

2 commits


04 Dec, 2018

1 commit


01 Dec, 2018

2 commits


24 Nov, 2018

1 commit

  • Currently, kprobe_events failure won't be handled properly.
    Due to calling system() indirectly to write to kprobe_events,
    it can't be identified whether an error is derived from kprobe or system.

    // buf = "echo '%c:%s %s' >> /s/k/d/t/kprobe_events"
    err = system(buf);
    if (err < 0) {
    printf("failed to create kprobe ..");
    return -1;
    }

    For example, running ./tracex7 sample in ext4 partition,
    "echo p:open_ctree open_ctree >> /s/k/d/t/kprobe_events"
    gets 256 error code system() failure.
    => The error comes from kprobe, but it's not handled correctly.

    According to man of system(3), it's return value
    just passes the termination status of the child shell
    rather than treating the error as -1. (don't care success)

    Which means, currently it's not working as desired.
    (According to the upper code snippet)

    ex) running ./tracex7 with ext4 env.
    # Current Output
    sh: echo: I/O error
    failed to open event open_ctree

    # Desired Output
    failed to create kprobe 'open_ctree' error 'No such file or directory'

    The problem is, error can't be verified whether from child ps
    or system. But using write() directly can verify the command
    failure, and it will treat all error as -1. So I suggest using
    write() directly to 'kprobe_events' rather than calling system().

    Signed-off-by: Daniel T. Lee
    Signed-off-by: Daniel Borkmann

    Daniel T. Lee
     

21 Nov, 2018

1 commit


08 Nov, 2018

1 commit


04 Oct, 2018

1 commit

  • There is a warning when compiling bpf sample programs in sample/bpf:

    make -C /home/foo/bpf/samples/bpf/../../tools/lib/bpf/ RM='rm -rf' LDFLAGS= srctree=/home/foo/bpf/samples/bpf/../../ O=
    HOSTCC /home/foo/bpf/samples/bpf/tracex3_user.o
    /home/foo/bpf/samples/bpf/tracex3_user.c:20:0: warning: "ARRAY_SIZE" redefined
    #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))

    In file included from /home/foo/bpf/samples/bpf/tracex3_user.c:18:0:
    ./tools/testing/selftests/bpf/bpf_util.h:48:0: note: this is the location of the previous definition
    # define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

    Signed-off-by: Bo YU
    Signed-off-by: Daniel Borkmann

    Bo YU
     

01 Oct, 2018

1 commit

  • This commit extends the test_cgrp2_attach2 test to cover per-cpu
    cgroup storage. Bpf program will use shared and per-cpu cgroup
    storages simultaneously, so a better coverage of corresponding
    core code will be achieved.

    Expected output:
    $ ./test_cgrp2_attach2
    Attached DROP prog. This ping in cgroup /foo should fail...
    ping: sendmsg: Operation not permitted
    Attached DROP prog. This ping in cgroup /foo/bar should fail...
    ping: sendmsg: Operation not permitted
    Attached PASS prog. This ping in cgroup /foo/bar should pass...
    Detached PASS from /foo/bar while DROP is attached to /foo.
    This ping in cgroup /foo/bar should fail...
    ping: sendmsg: Operation not permitted
    Attached PASS from /foo/bar and detached DROP from /foo.
    This ping in cgroup /foo/bar should pass...
    ### override:PASS
    ### multi:PASS

    Signed-off-by: Roman Gushchin
    Acked-by: Song Liu
    Cc: Daniel Borkmann
    Cc: Alexei Starovoitov
    Signed-off-by: Daniel Borkmann

    Roman Gushchin
     

22 Sep, 2018

1 commit

  • following commit:
    commit d58e468b1112 ("flow_dissector: implements flow dissector BPF hook")
    added struct bpf_flow_keys which conflicts with the struct with
    same name in sockex2_kern.c and sockex3_kern.c

    similar to commit:
    commit 534e0e52bc23 ("samples/bpf: fix a compilation failure")
    we tried the rename it "flow_keys" but it also conflicted with struct
    having same name in include/net/flow_dissector.h. Hence renaming the
    struct to "flow_key_record". Also, this commit doesn't fix the
    compilation error completely because the similar struct is present in
    sockex3_kern.c. Hence renaming it in both files sockex3_user.c and
    sockex3_kern.c

    Signed-off-by: Prashant Bhole
    Acked-by: Song Liu
    Signed-off-by: Daniel Borkmann

    Prashant Bhole
     

18 Sep, 2018

2 commits

  • samples/bpf build failed with the following errors:

    $ make samples/bpf/
    ...
    HOSTCC samples/bpf/sockex3_user.o
    /data/users/yhs/work/net-next/samples/bpf/sockex3_user.c:16:8: error: redefinition of ‘struct bpf_flow_keys’
    struct bpf_flow_keys {
    ^
    In file included from /data/users/yhs/work/net-next/samples/bpf/sockex3_user.c:4:0:
    ./usr/include/linux/bpf.h:2338:9: note: originally defined here
    struct bpf_flow_keys *flow_keys;
    ^
    make[3]: *** [samples/bpf/sockex3_user.o] Error 1

    Commit d58e468b1112d ("flow_dissector: implements flow dissector BPF hook")
    introduced struct bpf_flow_keys in include/uapi/linux/bpf.h and hence
    caused the naming conflict with samples/bpf/sockex3_user.c.

    The fix is to rename struct bpf_flow_keys in samples/bpf/sockex3_user.c
    to flow_keys to avoid the conflict.

    Signed-off-by: Yonghong Song
    Signed-off-by: Daniel Borkmann

    Yonghong Song
     
  • Remove duplicated includes.

    Signed-off-by: YueHaibing
    Acked-by: Yonghong Song
    Signed-off-by: Daniel Borkmann

    YueHaibing
     

01 Sep, 2018

2 commits


30 Aug, 2018

1 commit


17 Aug, 2018

1 commit

  • It is common XDP practice to unload/deattach the XDP bpf program,
    when the XDP sample program is Ctrl-C interrupted (SIGINT) or
    killed (SIGTERM).

    The samples/bpf programs xdp_redirect_cpu and xdp_rxq_info,
    forgot to trap signal SIGTERM (which is the default signal used
    by the kill command).

    This was discovered by Red Hat QA, which automated scripts depend
    on killing the XDP sample program after a timeout period.

    Fixes: fad3917e361b ("samples/bpf: add cpumap sample program xdp_redirect_cpu")
    Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info")
    Reported-by: Jean-Tsung Hsiao
    Signed-off-by: Jesper Dangaard Brouer
    Acked-by: Yonghong Song
    Signed-off-by: Daniel Borkmann

    Jesper Dangaard Brouer
     

16 Aug, 2018

2 commits

  • Pull networking updates from David Miller:
    "Highlights:

    - Gustavo A. R. Silva keeps working on the implicit switch fallthru
    changes.

    - Support 802.11ax High-Efficiency wireless in cfg80211 et al, From
    Luca Coelho.

    - Re-enable ASPM in r8169, from Kai-Heng Feng.

    - Add virtual XFRM interfaces, which avoids all of the limitations of
    existing IPSEC tunnels. From Steffen Klassert.

    - Convert GRO over to use a hash table, so that when we have many
    flows active we don't traverse a long list during accumluation.

    - Many new self tests for routing, TC, tunnels, etc. Too many
    contributors to mention them all, but I'm really happy to keep
    seeing this stuff.

    - Hardware timestamping support for dpaa_eth/fsl-fman from Yangbo Lu.

    - Lots of cleanups and fixes in L2TP code from Guillaume Nault.

    - Add IPSEC offload support to netdevsim, from Shannon Nelson.

    - Add support for slotting with non-uniform distribution to netem
    packet scheduler, from Yousuk Seung.

    - Add UDP GSO support to mlx5e, from Boris Pismenny.

    - Support offloading of Team LAG in NFP, from John Hurley.

    - Allow to configure TX queue selection based upon RX queue, from
    Amritha Nambiar.

    - Support ethtool ring size configuration in aquantia, from Anton
    Mikaev.

    - Support DSCP and flowlabel per-transport in SCTP, from Xin Long.

    - Support list based batching and stack traversal of SKBs, this is
    very exciting work. From Edward Cree.

    - Busyloop optimizations in vhost_net, from Toshiaki Makita.

    - Introduce the ETF qdisc, which allows time based transmissions. IGB
    can offload this in hardware. From Vinicius Costa Gomes.

    - Add parameter support to devlink, from Moshe Shemesh.

    - Several multiplication and division optimizations for BPF JIT in
    nfp driver, from Jiong Wang.

    - Lots of prepatory work to make more of the packet scheduler layer
    lockless, when possible, from Vlad Buslov.

    - Add ACK filter and NAT awareness to sch_cake packet scheduler, from
    Toke Høiland-Jørgensen.

    - Support regions and region snapshots in devlink, from Alex Vesker.

    - Allow to attach XDP programs to both HW and SW at the same time on
    a given device, with initial support in nfp. From Jakub Kicinski.

    - Add TLS RX offload and support in mlx5, from Ilya Lesokhin.

    - Use PHYLIB in r8169 driver, from Heiner Kallweit.

    - All sorts of changes to support Spectrum 2 in mlxsw driver, from
    Ido Schimmel.

    - PTP support in mv88e6xxx DSA driver, from Andrew Lunn.

    - Make TCP_USER_TIMEOUT socket option more accurate, from Jon
    Maxwell.

    - Support for templates in packet scheduler classifier, from Jiri
    Pirko.

    - IPV6 support in RDS, from Ka-Cheong Poon.

    - Native tproxy support in nf_tables, from Máté Eckl.

    - Maintain IP fragment queue in an rbtree, but optimize properly for
    in-order frags. From Peter Oskolkov.

    - Improvde handling of ACKs on hole repairs, from Yuchung Cheng"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1996 commits)
    bpf: test: fix spelling mistake "REUSEEPORT" -> "REUSEPORT"
    hv/netvsc: Fix NULL dereference at single queue mode fallback
    net: filter: mark expected switch fall-through
    xen-netfront: fix warn message as irq device name has '/'
    cxgb4: Add new T5 PCI device ids 0x50af and 0x50b0
    net: dsa: mv88e6xxx: missing unlock on error path
    rds: fix building with IPV6=m
    inet/connection_sock: prefer _THIS_IP_ to current_text_addr
    net: dsa: mv88e6xxx: bitwise vs logical bug
    net: sock_diag: Fix spectre v1 gadget in __sock_diag_cmd()
    ieee802154: hwsim: using right kind of iteration
    net: hns3: Add vlan filter setting by ethtool command -K
    net: hns3: Set tx ring' tc info when netdev is up
    net: hns3: Remove tx ring BD len register in hns3_enet
    net: hns3: Fix desc num set to default when setting channel
    net: hns3: Fix for phy link issue when using marvell phy driver
    net: hns3: Fix for information of phydev lost problem when down/up
    net: hns3: Fix for command format parsing error in hclge_is_all_function_id_zero
    net: hns3: Add support for serdes loopback selftest
    bnxt_en: take coredump_record structure off stack
    ...

    Linus Torvalds
     
  • Pull Kbuild updates from Masahiro Yamada:

    - verify depmod is installed before modules_install

    - support build salt in case build ids must be unique between builds

    - allow users to specify additional host compiler flags via HOST*FLAGS,
    and rename internal variables to KBUILD_HOST*FLAGS

    - update buildtar script to drop vax support, add arm64 support

    - update builddeb script for better debarch support

    - document the pit-fall of if_changed usage

    - fix parallel build of UML with O= option

    - make 'samples' target depend on headers_install to fix build errors

    - remove deprecated host-progs variable

    - add a new coccinelle script for refcount_t vs atomic_t check

    - improve double-test coccinelle script

    - misc cleanups and fixes

    * tag 'kbuild-v4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (41 commits)
    coccicheck: return proper error code on fail
    Coccinelle: doubletest: reduce side effect false positives
    kbuild: remove deprecated host-progs variable
    kbuild: make samples really depend on headers_install
    um: clean up archheaders recipe
    kbuild: add %asm-generic to no-dot-config-targets
    um: fix parallel building with O= option
    scripts: Add Python 3 support to tracing/draw_functrace.py
    builddeb: Add automatic support for sh{3,4}{,eb} architectures
    builddeb: Add automatic support for riscv* architectures
    builddeb: Add automatic support for m68k architecture
    builddeb: Add automatic support for or1k architecture
    builddeb: Add automatic support for sparc64 architecture
    builddeb: Add automatic support for mips{,64}r6{,el} architectures
    builddeb: Add automatic support for mips64el architecture
    builddeb: Add automatic support for ppc64 and powerpcspe architectures
    builddeb: Introduce functions to simplify kconfig tests in set_debarch
    builddeb: Drop check for 32-bit s390
    builddeb: Change architecture detection fallback to use dpkg-architecture
    builddeb: Skip architecture detection when KBUILD_DEBARCH is set
    ...

    Linus Torvalds
     

14 Aug, 2018

1 commit

  • Daniel Borkmann says:

    ====================
    pull-request: bpf-next 2018-08-13

    The following pull-request contains BPF updates for your *net-next* tree.

    The main changes are:

    1) Add driver XDP support for veth. This can be used in conjunction with
    redirect of another XDP program e.g. sitting on NIC so the xdp_frame
    can be forwarded to the peer veth directly without modification,
    from Toshiaki.

    2) Add a new BPF map type REUSEPORT_SOCKARRAY and prog type SK_REUSEPORT
    in order to provide more control and visibility on where a SO_REUSEPORT
    sk should be located, and the latter enables to directly select a sk
    from the bpf map. This also enables map-in-map for application migration
    use cases, from Martin.

    3) Add a new BPF helper bpf_skb_ancestor_cgroup_id() that returns the id
    of cgroup v2 that is the ancestor of the cgroup associated with the
    skb at the ancestor_level, from Andrey.

    4) Implement BPF fs map pretty-print support based on BTF data for regular
    hash table and LRU map, from Yonghong.

    5) Decouple the ability to attach BTF for a map from the key and value
    pretty-printer in BPF fs, and enable further support of BTF for maps for
    percpu and LPM trie, from Daniel.

    6) Implement a better BPF sample of using XDP's CPU redirect feature for
    load balancing SKB processing to remote CPU. The sample implements the
    same XDP load balancing as Suricata does which is symmetric hash based
    on IP and L4 protocol, from Jesper.

    7) Revert adding NULL pointer check with WARN_ON_ONCE() in __xdp_return()'s
    critical path as it is ensured that the allocator is present, from Björn.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

12 Aug, 2018

1 commit


10 Aug, 2018

3 commits

  • This implement XDP CPU redirection load-balancing across available
    CPUs, based on the hashing IP-pairs + L4-protocol. This equivalent to
    xdp-cpu-redirect feature in Suricata, which is inspired by the
    Suricata 'ippair' hashing code.

    An important property is that the hashing is flow symmetric, meaning
    that if the source and destination gets swapped then the selected CPU
    will remain the same. This is helps locality by placing both directions
    of a flows on the same CPU, in a forwarding/routing scenario.

    The hashing INITVAL (15485863 the 10^6th prime number) was fairly
    arbitrary choosen, but experiments with kernel tree pktgen scripts
    (pktgen_sample04_many_flows.sh +pktgen_sample05_flow_per_thread.sh)
    showed this improved the distribution.

    This patch also change the default loaded XDP program to be this
    load-balancer. As based on different user feedback, this seems to be
    the expected behavior of the sample xdp_redirect_cpu.

    Link: https://github.com/OISF/suricata/commit/796ec08dd7a63
    Signed-off-by: Jesper Dangaard Brouer
    Signed-off-by: Daniel Borkmann

    Jesper Dangaard Brouer
     
  • Adjusted function call API to take an initval. This allow the API
    user to set the initial value, as a seed. This could also be used for
    inputting the previous hash.

    Signed-off-by: Jesper Dangaard Brouer
    Signed-off-by: Daniel Borkmann

    Jesper Dangaard Brouer
     
  • The teardown race in cpumap is really hard to reproduce. These changes
    makes it easier to reproduce, for QA.

    The --stress-mode now have a case of a very small queue size of 8, that helps
    to trigger teardown flush to encounter a full queue, which results in calling
    xdp_return_frame API, in a non-NAPI protect context.

    Also increase MAX_CPUS, as my QA department have larger machines than me.

    Tested-by: Jean-Tsung Hsiao
    Signed-off-by: Jesper Dangaard Brouer
    Signed-off-by: Daniel Borkmann

    Jesper Dangaard Brouer
     

03 Aug, 2018

1 commit

  • The test_cgrp2_attach test covers bpf cgroup attachment code well,
    so let's re-use it for testing allocation/releasing of cgroup storage.

    The extension is pretty straightforward: the bpf program will use
    the cgroup storage to save the number of transmitted bytes.

    Expected output:
    $ ./test_cgrp2_attach2
    Attached DROP prog. This ping in cgroup /foo should fail...
    ping: sendmsg: Operation not permitted
    Attached DROP prog. This ping in cgroup /foo/bar should fail...
    ping: sendmsg: Operation not permitted
    Attached PASS prog. This ping in cgroup /foo/bar should pass...
    Detached PASS from /foo/bar while DROP is attached to /foo.
    This ping in cgroup /foo/bar should fail...
    ping: sendmsg: Operation not permitted
    Attached PASS from /foo/bar and detached DROP from /foo.
    This ping in cgroup /foo/bar should pass...
    ### override:PASS
    ### multi:PASS

    Signed-off-by: Roman Gushchin
    Cc: Alexei Starovoitov
    Cc: Daniel Borkmann
    Acked-by: Martin KaFai Lau
    Signed-off-by: Daniel Borkmann

    Roman Gushchin
     

27 Jul, 2018

4 commits


21 Jul, 2018

2 commits

  • Daniel Borkmann says:

    ====================
    pull-request: bpf-next 2018-07-20

    The following pull-request contains BPF updates for your *net-next* tree.

    The main changes are:

    1) Add sharing of BPF objects within one ASIC: this allows for reuse of
    the same program on multiple ports of a device, and therefore gains
    better code store utilization. On top of that, this now also enables
    sharing of maps between programs attached to different ports of a
    device, from Jakub.

    2) Cleanup in libbpf and bpftool's Makefile to reduce unneeded feature
    detections and unused variable exports, also from Jakub.

    3) First batch of RCU annotation fixes in prog array handling, i.e.
    there are several __rcu markers which are not correct as well as
    some of the RCU handling, from Roman.

    4) Two fixes in BPF sample files related to checking of the prog_cnt
    upper limit from sample loader, from Dan.

    5) Minor cleanup in sockmap to remove a set but not used variable,
    from Colin.
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     
  • All conflicts were trivial overlapping changes, so reasonably
    easy to resolve.

    Signed-off-by: David S. Miller

    David S. Miller
     

18 Jul, 2018

2 commits


17 Jul, 2018

2 commits


14 Jul, 2018

1 commit

  • People noticed that the code match on IEEE 802.1ad (ETH_P_8021AD) ethertype,
    and this implies Q-in-Q or double tagged VLANs. Thus, we better parse
    the next VLAN header too. It is even marked as a TODO.

    This is relevant for real world use-cases, as XDP cpumap redirect can be
    used when the NIC RSS hashing is broken. E.g. the ixgbe driver HW cannot
    handle double tagged VLAN packets, and places everything into a single
    RX queue. Using cpumap redirect, users can redistribute traffic across
    CPUs to solve this, which is faster than the network stacks RPS solution.

    It is left as an exerise how to distribute the packets across CPUs. It
    would be convenient to use the RX hash, but that is not _yet_ exposed
    to XDP programs. For now, users can code their own hash, as I've demonstrated
    in the Suricata code (where Q-in-Q is handled correctly).

    Reported-by: Florian Maury
    Reported-by: Marek Majkowski
    Signed-off-by: Jesper Dangaard Brouer
    Signed-off-by: Daniel Borkmann

    Jesper Dangaard Brouer