Skip to content

Commit

Permalink
RDMA/hns: Correct the value of HNS_ROCE_HEM_CHUNK_LEN
Browse files Browse the repository at this point in the history
Size of pointer to buf field of struct hns_roce_hem_chunk should be
considered when calculating HNS_ROCE_HEM_CHUNK_LEN, or sg table size will
be larger than expected when allocating hem.

Fixes: 9a44353 ("IB/hns: Add driver files for hns RoCE driver")
Link: https://lore.kernel.org/r/1572575610-52530-2-git-send-email-liweihang@hisilicon.com
Signed-off-by: Sirong Wang <wangsirong@huawei.com>
Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Sirong Wang authored and Jason Gunthorpe committed Nov 6, 2019
1 parent ce8e808 commit 531eb45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/hns/hns_roce_hem.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ enum {

#define HNS_ROCE_HEM_CHUNK_LEN \
((256 - sizeof(struct list_head) - 2 * sizeof(int)) / \
(sizeof(struct scatterlist)))
(sizeof(struct scatterlist) + sizeof(void *)))

#define check_whether_bt_num_3(type, hop_num) \
(type < HEM_TYPE_MTT && hop_num == 2)
Expand Down

0 comments on commit 531eb45

Please sign in to comment.