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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b5f66ba0-7d1c-4228-b0ec-f62aca289b23@nvidia.com>
Date: Thu, 3 Jul 2025 15:22:41 +0300
From: Gal Pressman <gal@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net
Cc: netdev@...r.kernel.org, edumazet@...gle.com, pabeni@...hat.com,
 andrew+netdev@...n.ch, horms@...nel.org, andrew@...n.ch,
 przemyslaw.kitszel@...el.com, anthony.l.nguyen@...el.com,
 sgoutham@...vell.com, gakula@...vell.com, sbhatta@...vell.com,
 bbhushan2@...vell.com, tariqt@...dia.com, mbloch@...dia.com,
 leon@...nel.org, ecree.xilinx@...il.com
Subject: Re: [PATCH net-next v2 3/5] eth: mlx5: migrate to the *_rxfh_context
 ops

On 02/07/2025 6:06, Jakub Kicinski wrote:
> Convert mlx5 to dedicated RXFH ops. This is a fairly shallow
> conversion, TBH, most of the driver code stays as is, but we
> let the core allocate the context ID for the driver.
> 
> mlx5e_rx_res_rss_get_rxfh() and friends are made void, since
> core only calls the driver for context 0. The second call
> is right after context creation so it must exist (tm).
> 
> Tested with drivers/net/hw/rss_ctx.py on MCX6.
> 
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
> ---
> v2:
>  - remove hfunc local var in mlx5e_rxfh_hfunc_check()
>  - make the get functions void and add WARN_ON_ONCE()
> v1: https://lore.kernel.org/20250630160953.1093267-4-kuba@kernel.org
> ---
> -int mlx5e_rss_get_rxfh(struct mlx5e_rss *rss, u32 *indir, u8 *key, u8 *hfunc, bool *symmetric)
> +void mlx5e_rss_get_rxfh(struct mlx5e_rss *rss, u32 *indir, u8 *key, u8 *hfunc,
> +			bool *symmetric)

I assume this doesn't compile, you didn't remove the return statement at
the end of the function.

>  {
>  	if (indir)
>  		memcpy(indir, rss->indir.table,

...

> -int mlx5e_rx_res_rss_get_rxfh(struct mlx5e_rx_res *res, u32 rss_idx,
> -			      u32 *indir, u8 *key, u8 *hfunc, bool *symmetric)
> +void mlx5e_rx_res_rss_get_rxfh(struct mlx5e_rx_res *res, u32 rss_idx,
> +			       u32 *indir, u8 *key, u8 *hfunc, bool *symmetric)
>  {
>  	struct mlx5e_rss *rss;
>  
> -	if (rss_idx >= MLX5E_MAX_NUM_RSS)
> -		return -EINVAL;
> +	rss = NULL;

Nit, would be nicer to initialize to NULL in the variable declaration.

> +	if (rss_idx < MLX5E_MAX_NUM_RSS)
> +		rss = res->rss[rss_idx];
> +	if (WARN_ON_ONCE(!rss))
> +		return;
>  
> -	rss = res->rss[rss_idx];
> -	if (!rss)
> -		return -ENOENT;
> -
> -	return mlx5e_rss_get_rxfh(rss, indir, key, hfunc, symmetric);
> +	mlx5e_rss_get_rxfh(rss, indir, key, hfunc, symmetric);
>  }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ