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: <1cb13f80-c4f5-e172-c7a7-2d0433a215b7@intel.com>
Date:   Wed, 18 Jan 2023 13:42:18 -0800
From:   Jacob Keller <jacob.e.keller@...el.com>
To:     Saeed Mahameed <saeed@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>
CC:     Saeed Mahameed <saeedm@...dia.com>, <netdev@...r.kernel.org>,
        Tariq Toukan <tariqt@...dia.com>,
        Adham Faris <afaris@...dia.com>
Subject: Re: [net-next 07/15] net/mlx5e: Add warning when log WQE size is
 smaller than log stride size



On 1/18/2023 10:35 AM, Saeed Mahameed wrote:
> From: Adham Faris <afaris@...dia.com>
> 
> Add warning macro in the function mlx5e_mpwqe_get_log_num_strides()
> when log WQE size is smaller than log stride size. Theoretically this
> should not happen.
> 
> Signed-off-by: Adham Faris <afaris@...dia.com>
> Reviewed-by: Tariq Toukan <tariqt@...dia.com>
> Signed-off-by: Saeed Mahameed <saeedm@...dia.com>

Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>

> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/params.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
> index a17b768b81f1..53d2979e9457 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
> @@ -411,9 +411,14 @@ u8 mlx5e_mpwqe_get_log_num_strides(struct mlx5_core_dev *mdev,
>  {
>  	enum mlx5e_mpwrq_umr_mode umr_mode = mlx5e_mpwrq_umr_mode(mdev, xsk);
>  	u8 page_shift = mlx5e_mpwrq_page_shift(mdev, xsk);
> -
> -	return mlx5e_mpwrq_log_wqe_sz(mdev, page_shift, umr_mode) -
> -		mlx5e_mpwqe_get_log_stride_size(mdev, params, xsk);
> +	u8 log_wqe_size, log_stride_size;
> +
> +	log_wqe_size = mlx5e_mpwrq_log_wqe_sz(mdev, page_shift, umr_mode);
> +	log_stride_size = mlx5e_mpwqe_get_log_stride_size(mdev, params, xsk);
> +	WARN(log_wqe_size < log_stride_size,
> +	     "Log WQE size %u < log stride size %u (page shift %u, umr mode %d, xsk on? %d)\n",
> +	     log_wqe_size, log_stride_size, page_shift, umr_mode, !!xsk);
> +	return log_wqe_size - log_stride_size;
>  }
>  
>  u8 mlx5e_mpwqe_get_min_wqe_bulk(unsigned int wq_sz)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ