1. 25 4月, 2019 3 次提交
    • V
      net: sched: flower: refactor reoffload for concurrent access · c049d56e
      Vlad Buslov 提交于
      Recent changes that introduced unlocked flower did not properly account for
      case when reoffload is initiated concurrently with filter updates. To fix
      the issue, extend flower with 'hw_filters' list that is used to store
      filters that don't have 'skip_hw' flag set. Filter is added to the list
      when it is inserted to hardware and only removed from it after being
      unoffloaded from all drivers that parent block is attached to. This ensures
      that concurrent reoffload can still access filter that is being deleted and
      prevents race condition when driver callback can be removed when filter is
      no longer accessible trough idr, but is still present in hardware.
      
      Refactor fl_change() to respect new filter reference counter and to release
      filter reference with __fl_put() in case of error, instead of directly
      deallocating filter memory. This allows for concurrent access to filter
      from fl_reoffload() and protects it with reference counting. Refactor
      fl_reoffload() to iterate over hw_filters list instead of idr. Implement
      fl_get_next_hw_filter() helper function that is used to iterate over
      hw_filters list with reference counting and skips filters that are being
      concurrently deleted.
      
      Fixes: 92149190 ("net: sched: flower: set unlocked flag for flower proto ops")
      Signed-off-by: NVlad Buslov <vladbu@mellanox.com>
      Reviewed-by: NSaeed Mahameed <saeedm@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c049d56e
    • R
      net: mvneta: Switch to using devm_alloc_etherdev_mqs · a3ddd94f
      Rosen Penev 提交于
      It allows some of the code to be simplified.
      
      Tested on Turris Omnia.
      Signed-off-by: NRosen Penev <rosenp@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a3ddd94f
    • E
      tipc: tipc_udp_recv() cleanup vs rcu verbs · 4109a2c3
      Eric Dumazet 提交于
      First thing tipc_udp_recv() does is to use rcu_dereference_sk_user_data(),
      and this is really hinting we already own rcu_read_lock() from the caller
      (UDP stack).
      
      No need to add another rcu_read_lock()/rcu_read_unlock() pair.
      
      Also use rcu_dereference() instead of rcu_dereference_rtnl()
      in the data path.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Jon Maloy <jon.maloy@ericsson.com>
      Cc: Ying Xue <ying.xue@windriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4109a2c3
  2. 24 4月, 2019 37 次提交