[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <vbfh86818n3.fsf@mellanox.com>
Date: Fri, 23 Aug 2019 10:25:08 +0000
From: Vlad Buslov <vladbu@...lanox.com>
To: Jakub Kicinski <jakub.kicinski@...ronome.com>
CC: Vlad Buslov <vladbu@...lanox.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"jhs@...atatu.com" <jhs@...atatu.com>,
"xiyou.wangcong@...il.com" <xiyou.wangcong@...il.com>,
"jiri@...nulli.us" <jiri@...nulli.us>,
"davem@...emloft.net" <davem@...emloft.net>,
"pablo@...filter.org" <pablo@...filter.org>,
Jiri Pirko <jiri@...lanox.com>
Subject: Re: [PATCH net-next 01/10] net: sched: protect block offload-related
fields with rw_semaphore
On Fri 23 Aug 2019 at 01:15, Jakub Kicinski <jakub.kicinski@...ronome.com> wrote:
> On Thu, 22 Aug 2019 15:43:44 +0300, Vlad Buslov wrote:
>> @@ -2987,19 +3007,26 @@ int tc_setup_cb_call(struct tcf_block *block, enum tc_setup_type type,
>> int ok_count = 0;
>> int err;
>>
>> + down_read(&block->cb_lock);
>> /* Make sure all netdevs sharing this block are offload-capable. */
>> - if (block->nooffloaddevcnt && err_stop)
>> - return -EOPNOTSUPP;
>> + if (block->nooffloaddevcnt && err_stop) {
>> + ok_count = -EOPNOTSUPP;
>> + goto errout;
>> + }
>>
>> list_for_each_entry(block_cb, &block->flow_block.cb_list, list) {
>> err = block_cb->cb(type, type_data, block_cb->cb_priv);
>> if (err) {
>> - if (err_stop)
>> - return err;
>> + if (err_stop) {
>> + ok_count = err;
>> + goto errout;
>> + }
>> } else {
>> ok_count++;
>> }
>> }
>> +errout:
>
> Please name the labels with the first action they perform. Here:
>
> err_unlock:
Thanks for reviewing. Will fix in V2.
>
>> + up_read(&block->cb_lock);
>> return ok_count;
Powered by blists - more mailing lists