1. 11 Aug, 2021 34 commits
  2. 10 Aug, 2021 6 commits
    • Lahav Schlesinger's avatar
      net: Support filtering interfaces on no master · d3432bf1
      Lahav Schlesinger authored
      Currently there's support for filtering neighbours/links for interfaces
      which have a specific master device (using the IFLA_MASTER/NDA_MASTER
      attributes).
      
      This patch adds support for filtering interfaces/neighbours dump for
      interfaces that *don't* have a master.
      Signed-off-by: default avatarLahav Schlesinger <lschlesinger@drivenets.com>
      Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
      Link: https://lore.kernel.org/r/20210810090658.2778960-1-lschlesinger@drivenets.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d3432bf1
    • Mark Bloch's avatar
      net/sched: cls_api, reset flags on replay · a5397d68
      Mark Bloch authored
      tc_new_tfilter() can replay a request if it got EAGAIN. The cited commit
      didn't account for this when it converted TC action ->init() API
      to use flags instead of parameters. This can lead to passing stale flags
      down the call chain which results in trying to lock rtnl when it's
      already locked, deadlocking the entire system.
      
      Fix by making sure to reset flags on each replay.
      
      ============================================
      WARNING: possible recursive locking detected
      5.14.0-rc3-custom-49011-g3d2bbb4f104d #447 Not tainted
      --------------------------------------------
      tc/37605 is trying to acquire lock:
      ffffffff841df2f0 (rtnl_mutex){+.+.}-{3:3}, at: tc_setup_cb_add+0x14b/0x4d0
      
      but task is already holding lock:
      ffffffff841df2f0 (rtnl_mutex){+.+.}-{3:3}, at: tc_new_tfilter+0xb12/0x22e0
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
             CPU0
             ----
        lock(rtnl_mutex);
        lock(rtnl_mutex);
      
       *** DEADLOCK ***
       May be due to missing lock nesting notation
      1 lock held by tc/37605:
       #0: ffffffff841df2f0 (rtnl_mutex){+.+.}-{3:3}, at: tc_new_tfilter+0xb12/0x22e0
      
      stack backtrace:
      CPU: 0 PID: 37605 Comm: tc Not tainted 5.14.0-rc3-custom-49011-g3d2bbb4f104d #447
      Hardware name: Mellanox Technologies Ltd. MSN2010/SA002610, BIOS 5.6.5 08/24/2017
      Call Trace:
       dump_stack_lvl+0x8b/0xb3
       __lock_acquire.cold+0x175/0x3cb
       lock_acquire+0x1a4/0x4f0
       __mutex_lock+0x136/0x10d0
       fl_hw_replace_filter+0x458/0x630 [cls_flower]
       fl_change+0x25f2/0x4a64 [cls_flower]
       tc_new_tfilter+0xa65/0x22e0
       rtnetlink_rcv_msg+0x86c/0xc60
       netlink_rcv_skb+0x14d/0x430
       netlink_unicast+0x539/0x7e0
       netlink_sendmsg+0x84d/0xd80
       ____sys_sendmsg+0x7ff/0x970
       ___sys_sendmsg+0xf8/0x170
       __sys_sendmsg+0xea/0x1b0
       do_syscall_64+0x35/0x80
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      RIP: 0033:0x7f7b93b6c0a7
      Code: 0c 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05 <48>
      RSP: 002b:00007ffe365b3818 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
      RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7b93b6c0a7
      RDX: 0000000000000000 RSI: 00007ffe365b3880 RDI: 0000000000000003
      RBP: 00000000610a75f6 R08: 0000000000000001 R09: 0000000000000000
      R10: fffffffffffff3a9 R11: 0000000000000246 R12: 0000000000000001
      R13: 0000000000000000 R14: 00007ffe365b7b58 R15: 00000000004822c0
      
      Fixes: 695176bf ("net_sched: refactor TC action init API")
      Signed-off-by: default avatarMark Bloch <mbloch@nvidia.com>
      Reviewed-by: default avatarVlad Buslov <vladbu@nvidia.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Tested-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Link: https://lore.kernel.org/r/20210810034305.63997-1-mbloch@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a5397d68
    • Jakub Kicinski's avatar
      Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux · ebd0d30c
      Jakub Kicinski authored
      Saeed Mahameed says:
      
      ====================
      pull-request: mlx5-next 2020-08-9
      
      This pulls mlx5-next branch which includes patches already reviewed on
      net-next and rdma mailing lists.
      
      1) mlx5 single E-Switch FDB for lag
      
      2) IB/mlx5: Rename is_apu_thread_cq function to is_apu_cq
      
      3) Add DCS caps & fields support
      
      [1] https://patchwork.kernel.org/project/netdevbpf/cover/20210803231959.26513-1-saeed@kernel.org/
      
      [2] https://patchwork.kernel.org/project/netdevbpf/patch/0e3364dab7e0e4eea5423878b01aa42470be8d36.1626609184.git.leonro@nvidia.com/
      
      [3] https://patchwork.kernel.org/project/netdevbpf/patch/55e1d69bef1fbfa5cf195c0bfcbe35c8019de35e.1624258894.git.leonro@nvidia.com/
      
      * 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux:
        net/mlx5: Lag, Create shared FDB when in switchdev mode
        net/mlx5: E-Switch, add logic to enable shared FDB
        net/mlx5: Lag, move lag destruction to a workqueue
        net/mlx5: Lag, properly lock eswitch if needed
        net/mlx5: Add send to vport rules on paired device
        net/mlx5: E-Switch, Add event callback for representors
        net/mlx5e: Use shared mappings for restoring from metadata
        net/mlx5e: Add an option to create a shared mapping
        net/mlx5: E-Switch, set flow source for send to uplink rule
        RDMA/mlx5: Add shared FDB support
        {net, RDMA}/mlx5: Extend send to vport rules
        RDMA/mlx5: Fill port info based on the relevant eswitch
        net/mlx5: Lag, add initial logic for shared FDB
        net/mlx5: Return mdev from eswitch
        IB/mlx5: Rename is_apu_thread_cq function to is_apu_cq
        net/mlx5: Add DCS caps & fields support
      ====================
      
      Link: https://lore.kernel.org/r/20210809202522.316930-1-saeed@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ebd0d30c
    • Florian Westphal's avatar
      netfilter: nf_queue: move hookfn registration out of struct net · 87029970
      Florian Westphal authored
      This was done to detect when the pernet->init() function was not called
      yet, by checking if net->nf.queue_handler is NULL.
      
      Once the nfnetlink_queue module is active, all struct net pointers
      contain the same address.  So place this back in nf_queue.c.
      
      Handle the 'netns error unwind' test by checking nfnl_queue_net for a
      NULL pointer and add a comment for this.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      87029970
    • Jakub Kicinski's avatar
      Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next · d1a4e0a9
      Jakub Kicinski authored
      Daniel Borkmann says:
      
      ====================
      bpf-next 2021-08-10
      
      We've added 31 non-merge commits during the last 8 day(s) which contain
      a total of 28 files changed, 3644 insertions(+), 519 deletions(-).
      
      1) Native XDP support for bonding driver & related BPF selftests, from Jussi Maki.
      
      2) Large batch of new BPF JIT tests for test_bpf.ko that came out as a result from
         32-bit MIPS JIT development, from Johan Almbladh.
      
      3) Rewrite of netcnt BPF selftest and merge into test_progs, from Stanislav Fomichev.
      
      4) Fix XDP bpf_prog_test_run infra after net to net-next merge, from Andrii Nakryiko.
      
      5) Follow-up fix in unix_bpf_update_proto() to enforce socket type, from Cong Wang.
      
      6) Fix bpf-iter-tcp4 selftest to print the correct dest IP, from Jose Blanquicet.
      
      7) Various misc BPF XDP sample improvements, from Niklas Söderlund, Matthew Cover,
         and Muhammad Falak R Wani.
      
      * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (31 commits)
        bpf, tests: Add tail call test suite
        bpf, tests: Add tests for BPF_CMPXCHG
        bpf, tests: Add tests for atomic operations
        bpf, tests: Add test for 32-bit context pointer argument passing
        bpf, tests: Add branch conversion JIT test
        bpf, tests: Add word-order tests for load/store of double words
        bpf, tests: Add tests for ALU operations implemented with function calls
        bpf, tests: Add more ALU64 BPF_MUL tests
        bpf, tests: Add more BPF_LSH/RSH/ARSH tests for ALU64
        bpf, tests: Add more ALU32 tests for BPF_LSH/RSH/ARSH
        bpf, tests: Add more tests of ALU32 and ALU64 bitwise operations
        bpf, tests: Fix typos in test case descriptions
        bpf, tests: Add BPF_MOV tests for zero and sign extension
        bpf, tests: Add BPF_JMP32 test cases
        samples, bpf: Add an explict comment to handle nested vlan tagging.
        selftests/bpf: Add tests for XDP bonding
        selftests/bpf: Fix xdp_tx.c prog section name
        net, core: Allow netdev_lower_get_next_private_rcu in bh context
        bpf, devmap: Exclude XDP broadcast to master device
        net, bonding: Add XDP support to the bonding driver
        ...
      ====================
      
      Link: https://lore.kernel.org/r/20210810130038.16927-1-daniel@iogearbox.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      d1a4e0a9
    • Johan Almbladh's avatar
      bpf, tests: Add tail call test suite · 874be05f
      Johan Almbladh authored
      While BPF_CALL instructions were tested implicitly by the cBPF-to-eBPF
      translation, there has not been any tests for BPF_TAIL_CALL instructions.
      The new test suite includes tests for tail call chaining, tail call count
      tracking and error paths. It is mainly intended for JIT development and
      testing.
      Signed-off-by: default avatarJohan Almbladh <johan.almbladh@anyfinetworks.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: default avatarYonghong Song <yhs@fb.com>
      Link: https://lore.kernel.org/bpf/20210809091829.810076-15-johan.almbladh@anyfinetworks.com
      874be05f