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]
Message-ID: <20170315185638.GG2079@mtr-leonro.local>
Date:   Wed, 15 Mar 2017 20:56:38 +0200
From:   Leon Romanovsky <leonro@...lanox.com>
To:     Erez Shitrit <erezsh@...lanox.com>
CC:     <dledford@...hat.com>, <linux-rdma@...r.kernel.org>,
        <netdev@...r.kernel.org>, <valex@...lanox.com>,
        <saedm@...lanox.com>, <erezsh@....mellanox.co.il>
Subject: Re: [RFC v1 for accelerated IPoIB 14/25] net/mlx5: Enable
 flow-steering for IB link

On Mon, Mar 13, 2017 at 08:31:25PM +0200, Erez Shitrit wrote:
>
> Get the relevant capabilities if supports ipoib_enhanced_offloads and
> init the flow steering table accordingly.
>
> Signed-off-by: Erez Shitrit <erezsh@...lanox.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 10 +++++-----
>  drivers/net/ethernet/mellanox/mlx5/core/fw.c      |  3 ++-
>  2 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> index fa4edd88daf1..dd21fc557281 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
> @@ -1991,9 +1991,6 @@ int mlx5_init_fs(struct mlx5_core_dev *dev)
>  	struct mlx5_flow_steering *steering;
>  	int err = 0;
>
> -	if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH)
> -		return 0;
> -
>  	err = mlx5_init_fc_stats(dev);
>  	if (err)
>  		return err;
> @@ -2004,8 +2001,11 @@ int mlx5_init_fs(struct mlx5_core_dev *dev)
>  	steering->dev = dev;
>  	dev->priv.steering = steering;
>
> -	if (MLX5_CAP_GEN(dev, nic_flow_table) &&
> -	    MLX5_CAP_FLOWTABLE_NIC_RX(dev, ft_support)) {
> +	if ((((MLX5_CAP_GEN(dev, port_type) == MLX5_CAP_PORT_TYPE_ETH) &&
> +	      (MLX5_CAP_GEN(dev, nic_flow_table))) ||
> +	     ((MLX5_CAP_GEN(dev, port_type) == MLX5_CAP_PORT_TYPE_IB) &&
> +	      MLX5_CAP_GEN(dev, ipoib_enhanced_offloads)))
> +	    && MLX5_CAP_FLOWTABLE_NIC_RX(dev, ft_support)) {

Erez,

Please calculate the result outside of "if.." and do it in steps,
it is pretty hard to count all these brackets.

Thanks

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ