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: <DACA750462785649825D7529120E85A808A65AFC@dggemm521-mbs.china.huawei.com>
Date:   Tue, 20 Nov 2018 02:21:31 +0000
From:   xuechaojing <xuechaojing@...wei.com>
To:     David Miller <davem@...emloft.net>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "wulike (A)" <wulike1@...wei.com>, chiqijun <chiqijun@...wei.com>,
        Wangfengying <fy.wang@...wei.com>,
        "Quhuichun (Tony)" <tony.qu@...wei.com>,
        "Luoshaokai (luoshaokai)" <luoshaokai@...wei.com>,
        xuechaojing <xuechaojing@...wei.com>
Subject: 答复: [PATCH 1/4] net-next/hinic:replace multiply and division operators

Hi:

This wqebb size is 32 in rx and in tx is 64, so the value is a power of two.

Thank you

-----邮件原件-----
发件人: David Miller [mailto:davem@...emloft.net] 
发送时间: 2018年11月20日 7:02
收件人: xuechaojing <xuechaojing@...wei.com>
抄送: linux-kernel@...r.kernel.org; netdev@...r.kernel.org; wulike (A) <wulike1@...wei.com>; chiqijun <chiqijun@...wei.com>; Wangfengying <fy.wang@...wei.com>; Quhuichun (Tony) <tony.qu@...wei.com>; Luoshaokai (luoshaokai) <luoshaokai@...wei.com>
主题: Re: [PATCH 1/4] net-next/hinic:replace multiply and division operators

From: Xue Chaojing <xuechaojing@...wei.com>
Date: Mon, 19 Nov 2018 06:12:31 +0000

> @@ -530,7 +536,9 @@ int hinic_wq_allocate(struct hinic_wqs *wqs, struct hinic_wq *wq,
>  		return -EINVAL;
>  	}
>  
> -	num_wqebbs_per_page = ALIGN(wq_page_size, wqebb_size) / wqebb_size;
> +	wqebb_size_shift = ilog2(wqebb_size);

You now have introduced the assumption that these various sizes are a power of two.

You should check for this, either at compile time or at run time, in order to avoid surprises and hard to debug issues in the future.

Thank you.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ