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:   Wed, 4 Jan 2023 09:03:06 -0400
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Leon Romanovsky <leon@...nel.org>
Cc:     Or Har-Toov <ohartoov@...dia.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>, linux-rdma@...r.kernel.org,
        Michael Guralnik <michaelgur@...dia.com>,
        netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>,
        Saeed Mahameed <saeedm@...dia.com>
Subject: Re: [PATCH rdma-next 4/4] RDMA/mlx5: Use query_special_contexts for
 mkeys

On Wed, Jan 04, 2023 at 10:11:25AM +0200, Leon Romanovsky wrote:
> -int mlx5_cmd_null_mkey(struct mlx5_core_dev *dev, u32 *null_mkey)
> -{
> -	u32 out[MLX5_ST_SZ_DW(query_special_contexts_out)] = {};
> -	u32 in[MLX5_ST_SZ_DW(query_special_contexts_in)] = {};
> -	int err;
> +	err = mlx5_cmd_exec_inout(dev->mdev, query_special_contexts, in, out);
> +	if (err)
> +		return err;
>  
> -	MLX5_SET(query_special_contexts_in, in, opcode,
> -		 MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS);
> -	err = mlx5_cmd_exec_inout(dev, query_special_contexts, in, out);
> -	if (!err)
> -		*null_mkey = MLX5_GET(query_special_contexts_out, out,
> -				      null_mkey);
> -	return err;
> +	if (MLX5_CAP_GEN(dev->mdev, dump_fill_mkey))
> +		dev->mkeys.dump_fill_mkey = MLX5_GET(query_special_contexts_out,
> +						     out, dump_fill_mkey);
> +
> +	if (MLX5_CAP_GEN(dev->mdev, null_mkey))
> +		dev->mkeys.null_mkey = cpu_to_be32(
> +			MLX5_GET(query_special_contexts_out, out, null_mkey));
> +
> +	if (MLX5_CAP_GEN(dev->mdev, terminate_scatter_list_mkey)) {
> +		dev->mkeys.terminate_scatter_list_mkey =
> +			cpu_to_be32(MLX5_GET(query_special_contexts_out, out,
> +					     terminate_scatter_list_mkey));
> +		return 0;
> +	}
> +	dev->mkeys.terminate_scatter_list_mkey =
> +		MLX5_TERMINATE_SCATTER_LIST_LKEY;

This is already stored in the core dev, why are you recalculating it
here?

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ