On Fri, 16 Aug 2019 18:06:54 +0300, Vlad Buslov wrote:
> diff --git a/net/core/flow_offload.c b/net/core/flow_offload.c
> index 64c3d4d72b9c..cf52d9c422fa 100644
> --- a/net/core/flow_offload.c
> +++ b/net/core/flow_offload.c
> @@ -391,6 +391,8 @@ static void flow_indr_block_cb_del(struct 
> flow_indr_block_cb *indr_block_cb)
>       kfree(indr_block_cb);
>  }
>  
> +static DEFINE_MUTEX(flow_indr_block_ing_cb_lock);

I'd be tempted to place this definition next to:

static LIST_HEAD(block_ing_cb_list);

as it seems this is the list it protects. The reason for the name
discrepancy between the two is not immediately obvious to me :S 
but you're not changing that.

Otherwise makes sense, so FWIW:

Acked-by: Jakub Kicinski <jakub.kicin...@netronome.com>

>  static void flow_block_ing_cmd(struct net_device *dev,
>                              flow_indr_block_bind_cb_t *cb,
>                              void *cb_priv,
> @@ -398,11 +400,11 @@ static void flow_block_ing_cmd(struct net_device *dev,
>  {
>       struct flow_indr_block_ing_entry *entry;
>  
> -     rcu_read_lock();
> -     list_for_each_entry_rcu(entry, &block_ing_cb_list, list) {
> +     mutex_lock(&flow_indr_block_ing_cb_lock);
> +     list_for_each_entry(entry, &block_ing_cb_list, list) {
>               entry->cb(dev, cb, cb_priv, command);
>       }
> -     rcu_read_unlock();
> +     mutex_unlock(&flow_indr_block_ing_cb_lock);
>  }

Reply via email to