Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1431775

Re: [PATCH v10 03/22] IB/hns: Add initial main frame driver and get cfg info

From "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
Newsgroups linux.kernel
Subject Re: [PATCH v10 03/22] IB/hns: Add initial main frame driver and get cfg info
Date 2016-06-27 09:40 +0200
Message-ID <rOzjb-5CO-3@gated-at.bofh.it> (permalink)
References <rKGsW-11v-3@gated-at.bofh.it> <rKGsX-11v-49@gated-at.bofh.it> <rNxMu-7xb-23@gated-at.bofh.it> <rOyQa-5sS-27@gated-at.bofh.it> <rOyQa-5sS-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 2016/6/27 15:00, Leon Romanovsky wrote:
> On Sat, Jun 25, 2016 at 06:29:31PM +0800, Wei Hu (Xavier) wrote:
>>
>> On 2016/6/24 19:48, Leon Romanovsky wrote:
>>> On Thu, Jun 16, 2016 at 10:35:11PM +0800, Lijun Ou wrote:
>>>> This patch mainly added the initial bare main driver. It
>>>> could get the relative configure information of net node.
>>>>
>>>> Signed-off-by: Wei Hu <xavier.huwei@huawei.com>
>>>> Signed-off-by: Nenglong Zhao <zhaonenglong@hisilicon.com>
>>>> Signed-off-by: Lijun Ou <oulijun@huawei.com>
>>>> ---
> ...
>
>>>> +		return -ENOMEM;
>>>> +
>>>> +	for (i = 0; i < HNS_ROCE_MAX_PORTS; i++) {
>>>> +		net_node = of_parse_phandle(np, "eth-handle", i);
>>>> +		if (net_node) {
>>>> +			pdev = of_find_device_by_node(net_node);
>>>> +			netdev = platform_get_drvdata(pdev);
>>>> +			phy_port = (u8)i;
>>>> +			if (netdev) {
>>>> +				hr_dev->iboe.netdevs[port_cnt] = netdev;
>>>> +				hr_dev->iboe.phy_port[port_cnt] = phy_port;
>>>> +			} else {
>>>> +				return -ENODEV;
>>>> +			}
>>>> +			port_cnt++;
>>>> +		}
>>>> +	}
>>> Do you want to check port_cnt value, before continue?
>> Hi, Leon
>>      Maybe we need not to check port_cnt value.
>>      port_cnt can be ensured smaller than HNS_ROCE_MAX_PORTS.
> You can in theory to get port_cnt == 0, in such case it is wise to
> return error.
I see.

Thanks
Wei Hu

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: [PATCH v10 03/22] IB/hns: Add initial main frame driver and get  cfg info Leon Romanovsky <leon@kernel.org> - 2016-06-24 13:50 +0200
  Re: [PATCH v10 03/22] IB/hns: Add initial main frame driver and get  cfg info Leon Romanovsky <leon@kernel.org> - 2016-06-27 09:10 +0200
    Re: [PATCH v10 03/22] IB/hns: Add initial main frame driver and get  cfg info "Wei Hu (Xavier)" <xavier.huwei@huawei.com> - 2016-06-27 09:40 +0200

csiph-web