lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <vbflfvi8vyg.fsf@mellanox.com>
Date:   Sat, 24 Aug 2019 14:44:11 +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>
Subject: Re: [PATCH net-next v2 03/10] net: sched: refactor block offloads
 counter usage


On Sat 24 Aug 2019 at 03:26, Jakub Kicinski <jakub.kicinski@...ronome.com> wrote:
> On Fri, 23 Aug 2019 21:50:49 +0300, Vlad Buslov wrote:
>> @@ -1201,14 +1199,11 @@ static int u32_reoffload_knode(struct tcf_proto *tp, struct tc_u_knode *n,
>>  			cls_u32.knode.link_handle = ht->handle;
>>  	}
>>
>> -	err = cb(TC_SETUP_CLSU32, &cls_u32, cb_priv);
>> -	if (err) {
>> -		if (add && tc_skip_sw(n->flags))
>> -			return err;
>> -		return 0;
>> -	}
>> -
>> -	tc_cls_offload_cnt_update(block, &n->in_hw_count, &n->flags, add);
>> +	err = tc_setup_cb_reoffload(block, tp, add, cb, TC_SETUP_CLSU32,
>> +				    &cls_u32, cb_priv, &n->flags,
>> +				    &n->in_hw_count);
>> +	if (err && add && tc_skip_sw(n->flags))
>> +		return err;
>
> Could this be further simplified by adding something along the lines of:
>
> 	if (!add || !tc_skip_sw(*flags))
> 		err = 0;
>
> to tc_setup_cb_reoffload() ?

Indeed, all the users of tc_setup_cb_reoffload() have same error check
that can be moved into the function. I will refactor it in V3.

>
>>
>>  	return 0;
>>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ