Re: [PATCH for-next 3/4] RDMA/hns: Update the IRRL table chunk size in hip08

Leon Romanovsky
2017-10-01T05:40:37Z

[-- Attachment #1: Type: text/plain, Size: 1912 bytes --]

On Sat, Sep 30, 2017 at 05:29:00PM +0800, Wei Hu (Xavier) wrote:
> As the increase of the IRRL specification in hip08, the IRRL table
> chunk size needs to be updated.
> This patch updates the IRRL table chunk size to 256k for hip08.
>
> Signed-off-by: Wei Hu (Xavier) <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Shaobo Xu <xushaobo2-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
> drivers/infiniband/hw/hns/hns_roce_device.h | 3 +++
> drivers/infiniband/hw/hns/hns_roce_hem.c | 31 ++++++++++++++---------------
> drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 1 +
> drivers/infiniband/hw/hns/hns_roce_hw_v1.h | 2 ++
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 1 +
> drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 2 ++
> 6 files changed, 24 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_device.h b/drivers/infiniband/hw/hns/hns_roce_device.h
> index 9353400..fc2a53d 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_device.h
> +++ b/drivers/infiniband/hw/hns/hns_roce_device.h
> @@ -236,6 +236,8 @@ struct hns_roce_hem_table {
> unsigned long num_obj;
> /*Single obj size */
> unsigned long obj_size;
> + unsigned long table_chunk_size;
> + unsigned long hem_alloc_size;
> int lowmem;
> struct mutex mutex;
> struct hns_roce_hem **hem;
> @@ -565,6 +567,7 @@ struct hns_roce_caps {
> u32 cqe_ba_pg_sz;
> u32 cqe_buf_pg_sz;
> u32 cqe_hop_num;
> + u32 chunk_sz; /* chunk size in non multihop mode*/
> };

Hi,

I have two comments:
1. In this code table_chunk_size is equal and similar to hem_alloc_size.
Please don't introduce unneeded complexity.
2. The size of table is num_obj * obj_size, there is no need to
table_chunk_size and hem_alloc_size at all. There are plenty of macros in
the kernel to deal with the tables.

Thanks

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]