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  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, 7 May 2020 17:36:23 +0200
From:   Pablo Neira Ayuso <pablo@...filter.org>
To:     Edward Cree <ecree@...arflare.com>
Cc:     netdev@...r.kernel.org, davem@...emloft.net,
        netfilter-devel@...r.kernel.org, jiri@...nulli.us, kuba@...nel.org
Subject: Re: [RFC PATCH net] net: flow_offload: simplify hw stats check
 handling

On Thu, May 07, 2020 at 03:59:09PM +0100, Edward Cree wrote:
[...]
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
> index 890b078851c9..1f0caeae24e1 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
> @@ -30,14 +30,14 @@ static int mlxsw_sp_flower_parse_actions(struct mlxsw_sp *mlxsw_sp,
>  		return -EOPNOTSUPP;
>  
>  	act = flow_action_first_entry_get(flow_action);
> -	if (act->hw_stats == FLOW_ACTION_HW_STATS_ANY ||
> -	    act->hw_stats == FLOW_ACTION_HW_STATS_IMMEDIATE) {
> +	if (act->hw_stats & FLOW_ACTION_HW_STATS_DISABLED) {
> +		/* Nothing to do */

What if the driver does not support to disable counters?

It will have to check for _DONT_CARE here.

And _DISABLED implies "bail out if you cannot disable".

You cannot assume _DISABLE != _DONT_CARE, it's the driver that decides
this.

Powered by blists - more mailing lists