1. Aug 11, 2021
    • 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.com
      
      
      Signed-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.org
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      ebd0d30c
  2. Aug 10, 2021
  3. Aug 09, 2021