1. 31 3月, 2020 9 次提交
  2. 30 3月, 2020 5 次提交
  3. 29 3月, 2020 1 次提交
  4. 28 3月, 2020 7 次提交
  5. 27 3月, 2020 9 次提交
  6. 26 3月, 2020 3 次提交
    • P
      devlink: Rely on driver eswitch thread safety instead of devlink · 98fed6eb
      Parav Pandit 提交于
      devlink_nl_cmd_eswitch_set_doit() doesn't hold devlink->lock mutex while
      invoking driver callback. This is likely due to eswitch mode setting
      involves adding/remove devlink ports, health reporters or
      other devlink objects for a devlink device.
      
      So it is driver responsiblity to ensure thread safe eswitch state
      transition happening via either sriov legacy enablement or via devlink
      eswitch set callback.
      
      Therefore, get() callback should also be invoked without holding
      devlink->lock mutex.
      Vendor driver can use same internal lock which it uses during eswitch
      mode set() callback.
      This makes get() and set() implimentation symmetric in devlink core and
      in vendor drivers.
      
      Hence, remove holding devlink->lock mutex during eswitch get() callback.
      
      Failing to do so results into below deadlock scenario when mlx5_core
      driver is improved to handle eswitch mode set critical section invoked
      by devlink and sriov sysfs interface in subsequent patch.
      
      devlink_nl_cmd_eswitch_set_doit()
         mlx5_eswitch_mode_set()
           mutex_lock(esw->mode_lock) <- Lock A
           [...]
           register_devlink_port()
             mutex_lock(&devlink->lock); <- lock B
      
      mutex_lock(&devlink->lock); <- lock B
      devlink_nl_cmd_eswitch_get_doit()
         mlx5_eswitch_mode_get()
         mutex_lock(esw->mode_lock) <- Lock A
      
      In subsequent patch, mlx5_core driver uses its internal lock during
      get() and set() eswitch callbacks.
      
      Other drivers have been inspected which returns either constant during
      get operations or reads the value from already allocated structure.
      Hence it is safe to remove the lock in get( ) callback and let vendor
      driver handle it.
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Reviewed-by: NMark Bloch <markb@mellanox.com>
      Signed-off-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      98fed6eb
    • P
      net: Fix CONFIG_NET_CLS_ACT=n and CONFIG_NFT_FWD_NETDEV={y, m} build · 2c64605b
      Pablo Neira Ayuso 提交于
      net/netfilter/nft_fwd_netdev.c: In function ‘nft_fwd_netdev_eval’:
          net/netfilter/nft_fwd_netdev.c:32:10: error: ‘struct sk_buff’ has no member named ‘tc_redirected’
            pkt->skb->tc_redirected = 1;
                    ^~
          net/netfilter/nft_fwd_netdev.c:33:10: error: ‘struct sk_buff’ has no member named ‘tc_from_ingress’
            pkt->skb->tc_from_ingress = 1;
                    ^~
      
      To avoid a direct dependency with tc actions from netfilter, wrap the
      redirect bits around CONFIG_NET_REDIRECT and move helpers to
      include/linux/skbuff.h. Turn on this toggle from the ifb driver, the
      only existing client of these bits in the tree.
      
      This patch adds skb_set_redirected() that sets on the redirected bit
      on the skbuff, it specifies if the packet was redirect from ingress
      and resets the timestamp (timestamp reset was originally missing in the
      netfilter bugfix).
      
      Fixes: bcfabee1 ("netfilter: nft_fwd_netdev: allow to redirect to ifb via ingress")
      Reported-by: noreply@ellerman.id.au
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2c64605b
    • E
      net: use indirect call wrappers for skb_copy_datagram_iter() · 29f3490b
      Eric Dumazet 提交于
      TCP recvmsg() calls skb_copy_datagram_iter(), which
      calls an indirect function (cb pointing to simple_copy_to_iter())
      for every MSS (fragment) present in the skb.
      
      CONFIG_RETPOLINE=y forces a very expensive operation
      that we can avoid thanks to indirect call wrappers.
      
      This patch gives a 13% increase of performance on
      a single flow, if the bottleneck is the thread reading
      the TCP socket.
      
      Fixes: 950fcaec ("datagram: consolidate datagram copy to iter helpers")
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NPaolo Abeni <pabeni@redhat.com>
      Acked-by: NWillem de Bruijn <willemb@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      29f3490b
  7. 24 3月, 2020 4 次提交
  8. 19 3月, 2020 1 次提交
  9. 18 3月, 2020 1 次提交