OSDN Git Service

RDMA/hns: Add support for addressing when hopnum is 0
authorXi Wang <wangxi11@huawei.com>
Mon, 13 Apr 2020 11:58:06 +0000 (19:58 +0800)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 22 Apr 2020 18:59:53 +0000 (15:59 -0300)
commit3c873161a0d7d1e11f1ce9cc59f89a009fb65711
tree0d275c1b29104b6c0d4d9b2a0276e1fe5f82d32d
parent95a776e8a6282ac19051655c55124e711318ae6e
RDMA/hns: Add support for addressing when hopnum is 0

Currently, WQE and EQE table have already used the mtr interface to config
and access memory by multi-hop addressing when hopnum is from 1 to 3. But
if hopnum is 0, each table need write its own but repetitive logic, and
many duplicate code exists in the mtr interfaces invoke process.

So wraps the public logic as 3 functions: hns_roce_mtr_create(),
hns_roce_mtr_destroy() and hns_roce_mtr_map() to support hopnum ranges from
0 to 3. In addition, makes the mtr interfaces easier to use.

Link: https://lore.kernel.org/r/1586779091-51410-2-git-send-email-liweihang@huawei.com
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/hns/hns_roce_device.h
drivers/infiniband/hw/hns/hns_roce_hem.c
drivers/infiniband/hw/hns/hns_roce_hem.h
drivers/infiniband/hw/hns/hns_roce_mr.c