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: <20160620133310.GB4526@leon.nu>
Date:	Mon, 20 Jun 2016 16:33:10 +0300
From:	Leon Romanovsky <leon@...nel.org>
To:	Lijun Ou <oulijun@...wei.com>
Cc:	dledford@...hat.com, sean.hefty@...el.com,
	hal.rosenstock@...il.com, davem@...emloft.net,
	jeffrey.t.kirsher@...el.com, jiri@...lanox.com,
	ogerlitz@...lanox.com, linux-rdma@...r.kernel.org,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	gongyangming@...wei.com, xiaokun@...wei.com,
	tangchaofei@...wei.com, haifeng.wei@...wei.com,
	yisen.zhuang@...wei.com, yankejian@...wei.com,
	charles.chenxin@...wei.com, linuxarm@...wei.com
Subject: Re: [PATCH v10 06/22] IB/hns: Add initial cmd operation

On Thu, Jun 16, 2016 at 10:35:14PM +0800, Lijun Ou wrote:
> This patch added the operation for cmd, and added some functions
> for initializing eq table and selecting cmd mode.
> 
> Signed-off-by: Wei Hu <xavier.huwei@...wei.com>
> Signed-off-by: Nenglong Zhao <zhaonenglong@...ilicon.com>
> Signed-off-by: Lijun Ou <oulijun@...wei.com>
> ---
> PATCH v9/v8/v7/v6:
> - No change over the PATCH v5
> 
> PATCH v5:
> - The initial patch which was redesigned based on the second patch
>   in PATCH v4
> ---

<...>

> +#define CMD_MAX_NUM		32
> +
> +int hns_roce_cmd_init(struct hns_roce_dev *hr_dev)
> +{
> +	struct device *dev = &hr_dev->pdev->dev;
> +
> +	mutex_init(&hr_dev->cmd.hcr_mutex);
> +	sema_init(&hr_dev->cmd.poll_sem, 1);
> +	hr_dev->cmd.use_events = 0;
> +	hr_dev->cmd.toggle = 1;
> +	hr_dev->cmd.max_cmds = CMD_MAX_NUM;

<...>

> +	for (hr_cmd->token_mask = 1; hr_cmd->token_mask < hr_cmd->max_cmds;
> +	     hr_cmd->token_mask <<= 1)
> +		;
> +	--hr_cmd->token_mask;

It doesn't look that you dynamically change max_cmds supported.
Why do you need to calculate token_mask dynamically?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ