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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 22 Aug 2019 15:58:05 -0700
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     Vlad Buslov <vladbu@...lanox.com>
Cc:     netdev@...r.kernel.org, jhs@...atatu.com, xiyou.wangcong@...il.com,
        jiri@...nulli.us, davem@...emloft.net, pablo@...filter.org,
        Jiri Pirko <jiri@...lanox.com>
Subject: Re: [PATCH net-next 04/10] net: sched: notify classifier on
 successful offload add/delete

On Thu, 22 Aug 2019 15:43:47 +0300, Vlad Buslov wrote:
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index 4215c849f4a3..d8ef7a9e6906 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -3099,9 +3099,13 @@ int tc_setup_cb_add(struct tcf_block *block, struct tcf_proto *tp,
>  	}
>  
>  	ok_count = __tc_setup_cb_call(block, type, type_data, err_stop);
> -	if (ok_count > 0)
> -		tc_cls_offload_cnt_update(block, tp, in_hw_count, flags,
> -					  ok_count, true);
> +	if (ok_count >= 0) {
> +		if (tp->ops->hw_add)
> +			tp->ops->hw_add(tp, type_data);
> +		if (ok_count > 0)
> +			tc_cls_offload_cnt_update(block, tp, in_hw_count, flags,
> +						  ok_count, true);
> +	}

nit:

	if (ok_count < 0)
		goto err_unlock;

	if (tp->ops->hw_add)
		tp->ops->hw_add(tp, type_data);
	if (ok_count > 0)
		tc_cls_offload_cnt_update(block, tp, in_hw_count, flags,
					  ok_count, true);

IOW try to keep the "success flow" unindented.

>  errout:
>  	up_read(&block->cb_lock);
>  	return ok_count;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ