Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966455AbcCPKgo (ORCPT ); Wed, 16 Mar 2016 06:36:44 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:37974 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752537AbcCPKgl (ORCPT ); Wed, 16 Mar 2016 06:36:41 -0400 Date: Wed, 16 Mar 2016 11:36:38 +0100 From: Jiri Pirko To: oulijun Cc: dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, davem@davemloft.net, jeffrey.t.kirsher@intel.com, jiri@mellanox.com, ogerlitz@mellanox.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, gongyangming@huawei.com, xiaokun@huawei.com, tangchaofei@huawei.com, haifeng.wei@huawei.com, yisen.zhuang@huawei.com, yankejian@huawei.com, lisheng011@huawei.com, charles.chenxin@huawei.com, linuxarm@huawei.com Subject: Re: [PATCH 1/3] infiniband: IB/hns: add Hisilicon RoCE support Message-ID: <20160316103638.GB2254@nanopsycho.orion> References: <1457692631-9290-1-git-send-email-oulijun@huawei.com> <1457692631-9290-2-git-send-email-oulijun@huawei.com> <20160311104239.GD3931@nanopsycho.orion> <56E9340E.3040207@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56E9340E.3040207@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3192 Lines: 117 Wed, Mar 16, 2016 at 11:23:10AM CET, oulijun@huawei.com wrote: >Hi Jiri Pirko, thanks your reviewing. >sorry, I will send a new patch according to your reviews. > >On 2016/3/11 18:42, Jiri Pirko wrote: >> Fri, Mar 11, 2016 at 11:37:09AM CET, oulijun@huawei.com wrote: >>> The driver for Hisilicon RoCE is a platform driver. >>> The driver will support mulitple versions of hardware. Currently only "v1" >>> for hip06 SOC is supported. >>> The driver includes two parts: common driver and hardware-specific >>> operations. hns_roce_v1_hw.c and hns_roce_v1_hw.h are files for >>> hardware-specific operations only for v1 engine, and other files(.c and .h) >>> for common algorithm and common hardware operations >>> >>> Signed-off-by: Lijun Ou >>> Signed-off-by: Wei Hu(Xavier) >>> Signed-off-by: Znlong >> >> >> >> I'm sorry to be nitpicking, but you still have style issues in your >> code. I believe that for newly submitted code, this should be avoided. I >> already pointed that out as a comment to your last version, but you >> ignored it. So again, couple of examples: >> >>> +struct ib_ah *hns_roce_create_ah(struct ib_pd *ibpd, >>> + struct ib_ah_attr *ah_attr) >> >> >> >>> + ret = ib_get_cached_gid(ibpd->device, ah_attr->port_num, >>> + ah_attr->grh.sgid_index, &sgid, &gid_attr); >> >> >> >>> +int hns_roce_bitmap_alloc_range( >>> + struct hns_roce_bitmap *bitmap, >>> + int cnt, int align, u32 *obj) >> >> >> >>> + pages = >>> + kmalloc(sizeof(*pages) * buf->nbufs, >>> + GFP_KERNEL); >> >In v2, I consider that it will violate checkpatch if write as follows > pages = kmalloc(sizeof(*pages) * buf->nbufs, > GFP_KERNEL); Why it would be problem for checkpatch? I bet it won't. >so, I continue to have it. I will continue to bash on your odd codingstyle. Please fix it! >Now, I have used kmalloc_array instead of it. I will send new patch at soon. >Again, i am sorry for my incorrect plan. > >> >> >>> + dev_err(dev, >>> + "CQ alloc.Failed to find cq buf addr.\n"); >> >> >> >>> + resp.qp_tab_size = hr_dev->caps.num_qps; >> >> >> >>> + buddy->bits[i] = >>> + kmalloc(s * sizeof(long), GFP_KERNEL); >> >> >> and many, many others similar to this. Please fix this. >> >> >> Also, I don't understand why you have "_" prefix for labels: >> >>> + >>> +_error_failed_register_device: >>> + hns_roce_engine_uninit(hr_dev); >>> + >>> +_error_failed_engine_init: >>> + hns_roce_cleanup_bitmap(hr_dev); >>> + >>> +_error_failed_setup_hca: >>> + hns_roce_cleanup_icm(hr_dev); >>> + >>> +_error_failed_init_icm: >>> + if (hr_dev->cmd_mod) >>> + hns_roce_cmd_use_polling(hr_dev); >>> + >>> +_error_failed_use_event: >>> + hns_roce_cleanup_eq_table(hr_dev); >>> + >>> +_error_failed_eq_tabel: >>> + hns_roce_cmd_cleanup(hr_dev); >>> + >>> +_error_failed_cmd_init: >>> + (void)hns_roce_engine_reset(hr_dev, 0); >>> + >>> +_error_failed_reset_engine: >>> + hns_roce_free_cfg(hr_dev); >>> + >>> +_error_failed_get_cfg: >>> + ib_dealloc_device(&hr_dev->ib_dev); >>> + >>> + return ret; >>> +} >> >> . >> > >